This commit is contained in:
thek4n 2024-11-13 12:27:46 +03:00
parent 0ae714129f
commit 318436053a
8 changed files with 17 additions and 44 deletions

View File

@ -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

View File

@ -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

View File

@ -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
)

View File

@ -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"

View File

@ -33,7 +33,7 @@ cmd_help () {
}
case "$1" in
case "${1}" in
ls) shift; cmd_list "$@" ;;
load) shift; cmd_load "$@" ;;
wallpaper) shift; cmd_wallpaper "$@" ;;

View File

@ -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"
slm load "${choosed_screen_layout}"

View File

@ -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"

View File

@ -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