From 318436053af1a4d7ef01091f78f23634eb26049f Mon Sep 17 00:00:00 2001 From: thek4n Date: Wed, 13 Nov 2024 12:27:46 +0300 Subject: [PATCH] chore --- TARGETS.sh | 2 +- home/user/.local/bin/bluetooth | 16 ---------------- home/user/.local/bin/i3status_wrapper | 24 ++++++++++++------------ home/user/.local/bin/killer | 4 ---- home/user/.local/bin/slm | 2 +- home/user/.local/bin/slm_rofi.sh | 2 +- home/user/.local/bin/wifi | 7 ------- install | 4 ++-- 8 files changed, 17 insertions(+), 44 deletions(-) delete mode 100755 home/user/.local/bin/bluetooth delete mode 100755 home/user/.local/bin/killer delete mode 100755 home/user/.local/bin/wifi diff --git a/TARGETS.sh b/TARGETS.sh index eec4adf..42b2ea3 100644 --- a/TARGETS.sh +++ b/TARGETS.sh @@ -10,7 +10,7 @@ ssh: git:.config/git ranger:.config/ranger gpg: -i3:.xinitrc .xprofile .Xresources .config/i3 .config/i3status .local/bin/i3status_wrapper .config/rofi .config/picom .local/bin/slm .local/bin/slm_rofi.sh .local/bin/power_rofi.sh .local/bin/wifi .local/bin/bluetooth .local/bin/i3_switch_workspace.sh +i3:.xinitrc .xprofile .Xresources .config/i3 .config/i3status .local/bin/i3status_wrapper .config/rofi .config/picom .local/bin/slm .local/bin/slm_rofi.sh .local/bin/power_rofi.sh .local/bin/i3_switch_workspace.sh bat:.config/bat font: termux:.termux diff --git a/home/user/.local/bin/bluetooth b/home/user/.local/bin/bluetooth deleted file mode 100755 index d56adec..0000000 --- a/home/user/.local/bin/bluetooth +++ /dev/null @@ -1,16 +0,0 @@ -#!/bin/sh - -bssid="$(bluetoothctl devices | rofi -dmenu -p "Devices: " -l 20 | cut -d' ' -f2)" - -exit_counter=0 -until bluetoothctl connect "$bssid" -do - exit_counter=$((exit_counter+1)) - - if [ "$exit_counter" -gt 3 ]; then - break - else - echo ... - sleep 1 - fi -done \ No newline at end of file diff --git a/home/user/.local/bin/i3status_wrapper b/home/user/.local/bin/i3status_wrapper index bad77cb..826004e 100755 --- a/home/user/.local/bin/i3status_wrapper +++ b/home/user/.local/bin/i3status_wrapper @@ -12,39 +12,39 @@ [ -x "/usr/bin/jq" ] || exec i3status update_holder() { - instance="$1" - replacement="$2" - echo "$3" | jq --argjson arg_j "$replacement" "(.[] | (select(.instance==\"$instance\"))) |= \$arg_j" + instance="${1}" + replacement="${2}" + echo "${3}" | jq --argjson arg_j "${replacement}" "(.[] | (select(.instance==\"${instance}\"))) |= \$arg_j" } get_device_battery_status() { for uuid in $(timeout 1 bluetoothctl devices | cut -f2 -d' ' 2>/dev/null) do - 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 - echo "$device_info" | grep 'Battery Percentage' | awk -F '[()]' '{ print "🎧🔋"$2"%" }' + if echo "${device_info}" | grep -q 'Connected: yes\|Battery Percentage'; then + echo "${device_info}" | grep 'Battery Percentage' | awk -F '[()]' '{ print "🎧🔋"$2"%" }' break fi done } update_json_with_text() { - json="{ \"full_text\": \"$1\", \"color\": \"#FFFFFF\"}" - update_holder "holder__headphones" "$json" "$2" + json="{ \"full_text\": \"${1}\", \"color\": \"#FFFFFF\"}" + update_holder "holder__headphones" "${json}" "${2}" } i3status | ( # read first 2 lines without formatting read -r line - echo "$line" + echo "${line}" read -r line - echo "$line" + echo "${line}" while true do read -r line - json_array="$(echo "$line" | sed -e 's/^,//')" - echo "$(update_json_with_text "$(get_device_battery_status)" "$json_array")," + json_array="$(echo "${line}" | sed -e 's/^,//')" + echo "$(update_json_with_text "$(get_device_battery_status)" "${json_array}")," done ) \ No newline at end of file diff --git a/home/user/.local/bin/killer b/home/user/.local/bin/killer deleted file mode 100755 index d186993..0000000 --- a/home/user/.local/bin/killer +++ /dev/null @@ -1,4 +0,0 @@ -#!/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}')" -kill -15 "$pidd" \ No newline at end of file diff --git a/home/user/.local/bin/slm b/home/user/.local/bin/slm index 633dd2d..21e4d9d 100755 --- a/home/user/.local/bin/slm +++ b/home/user/.local/bin/slm @@ -33,7 +33,7 @@ cmd_help () { } -case "$1" in +case "${1}" in ls) shift; cmd_list "$@" ;; load) shift; cmd_load "$@" ;; wallpaper) shift; cmd_wallpaper "$@" ;; diff --git a/home/user/.local/bin/slm_rofi.sh b/home/user/.local/bin/slm_rofi.sh index 2c2fdaa..b69fda4 100755 --- a/home/user/.local/bin/slm_rofi.sh +++ b/home/user/.local/bin/slm_rofi.sh @@ -1,4 +1,4 @@ #!/bin/sh choosed_screen_layout="$(slm ls | rofi -dmenu -m -1 -i -p "Select screen layout")" -slm load "$choosed_screen_layout" \ No newline at end of file +slm load "${choosed_screen_layout}" \ No newline at end of file diff --git a/home/user/.local/bin/wifi b/home/user/.local/bin/wifi deleted file mode 100755 index 2c82126..0000000 --- a/home/user/.local/bin/wifi +++ /dev/null @@ -1,7 +0,0 @@ -#!/bin/sh - -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)" -pass="$(echo "" | rofi -dmenu -p "Password: ")" -nmcli device wifi connect "$bssid" "password" "$pass" \ No newline at end of file diff --git a/install b/install index 1fafad5..b85a2a1 100755 --- a/install +++ b/install @@ -59,8 +59,8 @@ _link_files_in_sandbox() ( files="$(map_get_value "${TARGETS}" "$(string_exclude_first_char "${targetfile}")")" _link_files_in_sandbox ${files} else - if [ ! "$(dirname "$targetfile")" = "." ]; then - mkdir -p "${SANDBOX_PATH}/$(dirname "$targetfile")" + if [ ! "$(dirname "${targetfile}")" = "." ]; then + mkdir -p "${SANDBOX_PATH}/$(dirname "${targetfile}")" fi ln -sT "${SUB}/${targetfile}" "${SANDBOX_PATH}/${targetfile}" fi