make scripts posix sh
This commit is contained in:
parent
6f0c0047d0
commit
5c82197471
@ -1,4 +1,4 @@
|
|||||||
#!/usr/bin/env bash
|
#!/bin/sh
|
||||||
|
|
||||||
# g# e f# b | b f# g# e | g# f# e b
|
# g# e f# b | b f# g# e | g# f# e b
|
||||||
|
|
||||||
|
|||||||
@ -1,4 +1,4 @@
|
|||||||
#!/usr/bin/env bash
|
#!/bin/sh
|
||||||
|
|
||||||
# usermod -aG input $USER
|
# usermod -aG input $USER
|
||||||
|
|
||||||
|
|||||||
@ -1,4 +1,4 @@
|
|||||||
#!/usr/bin/env bash
|
#!/bin/sh
|
||||||
|
|
||||||
beep \
|
beep \
|
||||||
-f 1198.64491 -l 200 \
|
-f 1198.64491 -l 200 \
|
||||||
|
|||||||
@ -5,7 +5,7 @@ bssid="$(bluetoothctl devices | rofi -dmenu -p "Devices: " -l 20 | cut -d' ' -f2
|
|||||||
exit_counter=0
|
exit_counter=0
|
||||||
until bluetoothctl connect "$bssid"
|
until bluetoothctl connect "$bssid"
|
||||||
do
|
do
|
||||||
((exit_counter+=1))
|
exit_counter=$((exit_counter+1))
|
||||||
|
|
||||||
if [ "$exit_counter" -gt 3 ]; then
|
if [ "$exit_counter" -gt 3 ]; then
|
||||||
break
|
break
|
||||||
@ -13,4 +13,4 @@ do
|
|||||||
echo ...
|
echo ...
|
||||||
sleep 1
|
sleep 1
|
||||||
fi
|
fi
|
||||||
done
|
done
|
||||||
@ -1,4 +1,4 @@
|
|||||||
#!/bin/bash
|
#!/bin/sh
|
||||||
|
|
||||||
gen_workspaces()
|
gen_workspaces()
|
||||||
{
|
{
|
||||||
|
|||||||
@ -1,10 +1,10 @@
|
|||||||
#!/usr/bin/env bash
|
#!/bin/sh
|
||||||
|
|
||||||
# The idea is to define "holder" modules in i3status config and then replace them
|
# The idea is to define "holder" modules in i3status config and then replace them
|
||||||
|
|
||||||
# In order to make this example work you need to add
|
# In order to make this example work you need to add
|
||||||
# order += "tztime holder__headphones"
|
# order += "tztime holder__headphones"
|
||||||
# and
|
# and
|
||||||
# tztime holder__headphones {
|
# tztime holder__headphones {
|
||||||
# format = "holder__headphones"
|
# format = "holder__headphones"
|
||||||
# }
|
# }
|
||||||
@ -12,15 +12,14 @@
|
|||||||
[ -x "/usr/bin/jq" ] || exec i3status
|
[ -x "/usr/bin/jq" ] || exec i3status
|
||||||
|
|
||||||
update_holder() {
|
update_holder() {
|
||||||
local instance="$1"
|
instance="$1"
|
||||||
local replacement="$2"
|
replacement="$2"
|
||||||
echo "$3" | jq --argjson arg_j "$replacement" "(.[] | (select(.instance==\"$instance\"))) |= \$arg_j"
|
echo "$3" | jq --argjson arg_j "$replacement" "(.[] | (select(.instance==\"$instance\"))) |= \$arg_j"
|
||||||
}
|
}
|
||||||
|
|
||||||
get_device_battery_status() {
|
get_device_battery_status() {
|
||||||
for uuid in $(timeout 1 bluetoothctl devices | cut -f2 -d' ' 2>/dev/null)
|
for uuid in $(timeout 1 bluetoothctl devices | cut -f2 -d' ' 2>/dev/null)
|
||||||
do
|
do
|
||||||
local device_info
|
|
||||||
device_info="$(timeout 1 bluetoothctl info "$uuid")"
|
device_info="$(timeout 1 bluetoothctl info "$uuid")"
|
||||||
|
|
||||||
if echo "$device_info" | grep -q 'Connected: yes\|Battery Percentage'; then
|
if echo "$device_info" | grep -q 'Connected: yes\|Battery Percentage'; then
|
||||||
@ -31,7 +30,7 @@ get_device_battery_status() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
update_json_with_text() {
|
update_json_with_text() {
|
||||||
local json="{ \"full_text\": \"$1\", \"color\": \"#FFFFFF\"}"
|
json="{ \"full_text\": \"$1\", \"color\": \"#FFFFFF\"}"
|
||||||
update_holder "holder__headphones" "$json" "$2"
|
update_holder "holder__headphones" "$json" "$2"
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -48,4 +47,4 @@ i3status | (
|
|||||||
json_array="$(echo "$line" | sed -e 's/^,//')"
|
json_array="$(echo "$line" | sed -e 's/^,//')"
|
||||||
echo "$(update_json_with_text "$(get_device_battery_status)" "$json_array"),"
|
echo "$(update_json_with_text "$(get_device_battery_status)" "$json_array"),"
|
||||||
done
|
done
|
||||||
)
|
)
|
||||||
@ -1,4 +1,4 @@
|
|||||||
#!/bin/sh
|
#!/bin/sh
|
||||||
|
|
||||||
pidd="$(ps -u $USER -o pid,%mem,%cpu,comm | sort -b -k2 -r | sed -n '1!p' | rofi -dmenu -i -l 15 | awk '{print $1}')"
|
pidd="$(ps -u "${USER}" -o pid,%mem,%cpu,comm | sort -b -k2 -r | sed -n '1!p' | rofi -dmenu -i -l 15 | awk '{print $1}')"
|
||||||
kill -15 "$pidd"
|
kill -15 "$pidd"
|
||||||
@ -1,4 +1,4 @@
|
|||||||
#!/bin/bash
|
#!/bin/sh
|
||||||
|
|
||||||
|
|
||||||
eval "$(echo "i3-msg exit
|
eval "$(echo "i3-msg exit
|
||||||
@ -6,4 +6,4 @@ reboot
|
|||||||
shutdown -h now
|
shutdown -h now
|
||||||
systemctl suspend
|
systemctl suspend
|
||||||
i3lock -enf -c 1e1e1e
|
i3lock -enf -c 1e1e1e
|
||||||
convert canvas:none PNG:- | feh -YF -" | rofi -dmenu -m -1 -i -p "Power")"
|
convert canvas:none PNG:- | feh -YF -" | rofi -dmenu -m -1 -i -p "Power")"
|
||||||
@ -63,4 +63,3 @@ case "$1" in
|
|||||||
*) shift; cmd_help "$@" ;;
|
*) shift; cmd_help "$@" ;;
|
||||||
esac
|
esac
|
||||||
exit 0
|
exit 0
|
||||||
|
|
||||||
|
|||||||
@ -1,4 +1,4 @@
|
|||||||
#!/bin/bash
|
#!/bin/sh
|
||||||
|
|
||||||
choosed_screen_layout="$(slm ls | rofi -dmenu -m -1 -i -p "Select screen layout")"
|
choosed_screen_layout="$(slm ls | rofi -dmenu -m -1 -i -p "Select screen layout")"
|
||||||
slm load "$choosed_screen_layout"
|
slm load "$choosed_screen_layout"
|
||||||
@ -1,7 +1,7 @@
|
|||||||
#!/usr/bin/env sh
|
#!/bin/sh
|
||||||
|
|
||||||
|
|
||||||
readonly tmux_list_sessions_script="$HOME/.local/bin/tmux_list_sessions.sh"
|
readonly tmux_list_sessions_script="${HOME}/.local/bin/tmux_list_sessions.sh"
|
||||||
|
|
||||||
export FZF_DEFAULT_OPTS="\
|
export FZF_DEFAULT_OPTS="\
|
||||||
${FZF_DEFAULT_OPTS}
|
${FZF_DEFAULT_OPTS}
|
||||||
|
|||||||
@ -1,7 +1,7 @@
|
|||||||
#!/usr/bin/env sh
|
#!/bin/sh
|
||||||
|
|
||||||
|
|
||||||
readonly tmux_list_sessions_script="$HOME/.local/bin/tmux_list_sessions.sh"
|
readonly tmux_list_sessions_script="${HOME}/.local/bin/tmux_list_sessions.sh"
|
||||||
|
|
||||||
export FZF_DEFAULT_OPTS="\
|
export FZF_DEFAULT_OPTS="\
|
||||||
${FZF_DEFAULT_OPTS}
|
${FZF_DEFAULT_OPTS}
|
||||||
|
|||||||
@ -1,15 +1,12 @@
|
|||||||
#!/usr/bin/env bash
|
#!/bin/sh
|
||||||
|
|
||||||
|
|
||||||
declare current_session
|
|
||||||
current_session="$(tmux display-message -p '#S')"
|
current_session="$(tmux display-message -p '#S')"
|
||||||
readonly current_session
|
readonly current_session
|
||||||
|
|
||||||
declare last_session
|
|
||||||
last_session="$(tmux display-message -p '#{client_last_session}')"
|
last_session="$(tmux display-message -p '#{client_last_session}')"
|
||||||
readonly last_session
|
readonly last_session
|
||||||
|
|
||||||
declare sessions
|
|
||||||
sessions="$(tmux list-session -F '#S#{?session_attached, (attached) , }')"
|
sessions="$(tmux list-session -F '#S#{?session_attached, (attached) , }')"
|
||||||
sessions="$(echo "${sessions}" | sed "s/^${current_session} /${current_session} (current) /")"
|
sessions="$(echo "${sessions}" | sed "s/^${current_session} /${current_session} (current) /")"
|
||||||
sessions="$(echo "${sessions}" | sed "s/^${last_session} /${last_session} (last) /")"
|
sessions="$(echo "${sessions}" | sed "s/^${last_session} /${last_session} (last) /")"
|
||||||
|
|||||||
@ -1,4 +1,4 @@
|
|||||||
#!/usr/bin/env sh
|
#!/bin/sh
|
||||||
|
|
||||||
|
|
||||||
export FZF_DEFAULT_OPTS="\
|
export FZF_DEFAULT_OPTS="\
|
||||||
|
|||||||
@ -1,7 +1,7 @@
|
|||||||
#!/bin/bash
|
#!/bin/sh
|
||||||
|
|
||||||
set -eo pipefail
|
set -ue
|
||||||
|
|
||||||
bssid="$(nmcli -f BSSID,SSID,SIGNAL,RATE,BARS,SECURITY dev wifi list | sed -n '1!p' | rofi -dmenu -p "WiFi: " -l 20 | cut -d' ' -f1)"
|
bssid="$(nmcli -f BSSID,SSID,SIGNAL,RATE,BARS,SECURITY dev wifi list | sed -n '1!p' | rofi -dmenu -p "WiFi: " -l 20 | cut -d' ' -f1)"
|
||||||
pass="$(echo "" | rofi -dmenu -p "Password: ")"
|
pass="$(echo "" | rofi -dmenu -p "Password: ")"
|
||||||
nmcli device wifi connect "$bssid" "password" "$pass"
|
nmcli device wifi connect "$bssid" "password" "$pass"
|
||||||
Loading…
x
Reference in New Issue
Block a user