diff options
Diffstat (limited to 'ar/.local/bin/statusbar')
| -rwxr-xr-x | ar/.local/bin/statusbar/sb-brightness | 28 | ||||
| -rwxr-xr-x | ar/.local/bin/statusbar/sb-forecast | 4 | ||||
| -rwxr-xr-x | ar/.local/bin/statusbar/sb-internet | 4 | ||||
| -rwxr-xr-x | ar/.local/bin/statusbar/sb-keyboard | 4 | ||||
| -rwxr-xr-x | ar/.local/bin/statusbar/sb-mailbox | 2 | ||||
| -rwxr-xr-x | ar/.local/bin/statusbar/sb-memory | 4 | ||||
| -rwxr-xr-x | ar/.local/bin/statusbar/sb-mpdup | 2 | ||||
| -rwxr-xr-x | ar/.local/bin/statusbar/sb-packages | 2 | ||||
| -rwxr-xr-x | ar/.local/bin/statusbar/sb-popupgrade | 2 | ||||
| -rwxr-xr-x | ar/.local/bin/statusbar/sb-queues | 2 | ||||
| -rwxr-xr-x | ar/.local/bin/statusbar/sb-volume | 2 |
11 files changed, 38 insertions, 18 deletions
diff --git a/ar/.local/bin/statusbar/sb-brightness b/ar/.local/bin/statusbar/sb-brightness index 909e676..625e69e 100755 --- a/ar/.local/bin/statusbar/sb-brightness +++ b/ar/.local/bin/statusbar/sb-brightness @@ -1,11 +1,31 @@ #!/bin/sh +monitor=$(xrandr --query | grep -i '\sconnected' | grep '[0-9]x[0-9]' | grep -i 'primary' | cut -d ' ' -f1) +[ -z "$monitor" ] && monitor=$(xrandr --query | grep -i '\sconnected' | grep '[0-9]x[0-9]' | cut -d ' ' -f1) +case "$monitor" in +*DP* | *HDMI*) + current_brightness=$(xrandr --verbose | grep -i "^$monitor connected" -A5 | grep -i "Brightness:" | cut -d ' ' -f2) + current_brightness=$(echo "$current_brightness * 100" | bc -l) + ;; +esac + case $BLOCK_BUTTON in 3) notify-send "š Backlight module -- Scroll up & down changes backlight" ;; -4) monbright -inc 5 ;; -5) monbright -dec 5 ;; +- Scroll up & down changes screen brightness +- Shift + Scroll up & down changes monitor backlight" ;; +4) pkexec brillo -A 5 -q ;; +5) pkexec brillo -U 5 -q ;; 6) setsid -f "$TERMINAL" -e "$EDITOR" "$0" ;; +7) monbright -inc 5 ;; +8) monbright -dec 5 ;; +9) setsid -f "$TERMINAL" -e "$EDITOR" "$0" ;; esac -monitorbright +if [ -r /sys/class/backlight/*/brightness ]; then + curr_brightness=$(cat /sys/class/backlight/*/brightness) + max_brightness=$(cat /sys/class/backlight/*/max_brightness) + brightness_per=$((100 * curr_brightness / max_brightness)) + printf "%s %s\n" "š”${brightness_per}%" "šŖ$current_brightness" +else + printf "%s\n" "šŖ$current_brightness" +fi diff --git a/ar/.local/bin/statusbar/sb-forecast b/ar/.local/bin/statusbar/sb-forecast index 4f78303..063c8e5 100755 --- a/ar/.local/bin/statusbar/sb-forecast +++ b/ar/.local/bin/statusbar/sb-forecast @@ -360,6 +360,6 @@ After $secs seconds, new clicks will also automatically update the doppler RADAR 8) setsid -f "$TERMINAL" -e "$EDITOR" "$0" ;; esac -checkforecast "$weatherreport" "3600" || { getweatherreport && pkill -RTMIN+15 "${STATUSBAR:-dwmblocks}" && sleep 3; } -checkforecast "$weatherreportjson" "86400" || { getweatherreportjson && pkill -RTMIN+15 "${STATUSBAR:-dwmblocks}" && sleep 3; } +checkforecast "$weatherreport" "3600" || { getweatherreport && pkill -RTMIN+13 "${STATUSBAR:-dwmblocks}" && sleep 3; } +checkforecast "$weatherreportjson" "86400" || { getweatherreportjson && pkill -RTMIN+13 "${STATUSBAR:-dwmblocks}" && sleep 3; } showweather diff --git a/ar/.local/bin/statusbar/sb-internet b/ar/.local/bin/statusbar/sb-internet index 1484f33..163b7b3 100755 --- a/ar/.local/bin/statusbar/sb-internet +++ b/ar/.local/bin/statusbar/sb-internet @@ -26,7 +26,7 @@ fi case $BLOCK_BUTTON in 1) "$TERMINAL" -e nmtui - pkill -RTMIN+7 dwmblocks + pkill -RTMIN+6 dwmblocks ;; 2) wifi_dev="$(nmcli -t -f DEVICE,TYPE device | @@ -43,7 +43,7 @@ case $BLOCK_BUTTON in notify-send "Wi-Fi" "Wi-Fi connected" fi - pkill -RTMIN+7 dwmblocks + pkill -RTMIN+6 dwmblocks ;; 3) notify-send "š Internet module" "\- Left click to connect ā: wifi disabled diff --git a/ar/.local/bin/statusbar/sb-keyboard b/ar/.local/bin/statusbar/sb-keyboard index 67b5f6d..2257b1b 100755 --- a/ar/.local/bin/statusbar/sb-keyboard +++ b/ar/.local/bin/statusbar/sb-keyboard @@ -3,7 +3,7 @@ # works on any init system # requirements: dmenu, xorg-setxkbmap case $BLOCK_BUTTON in -1) fcitx5-remote -t && kill -44 "$(pidof "${STATUSBAR:-dwmblocks}")" ;; +1) fcitx5-remote -t && kill -43 "$(pidof "${STATUSBAR:-dwmblocks}")" ;; 2) remaps ;; 3) notify-send "⨠Input Method module" "\- Shows current input method (defalt US) - Left click to switch language (EN/KO) @@ -14,7 +14,7 @@ case $BLOCK_BUTTON in [ -z "$kb_choice" ] && exit 0 kb="$(echo "$kb_choice" | awk '{print $3}')" setxkbmap "$kb" - pkill -RTMIN+10 "${STATUSBAR:-dwmblocks}" + pkill -RTMIN+9 "${STATUSBAR:-dwmblocks}" ;; esac diff --git a/ar/.local/bin/statusbar/sb-mailbox b/ar/.local/bin/statusbar/sb-mailbox index c772a0d..6926b6e 100755 --- a/ar/.local/bin/statusbar/sb-mailbox +++ b/ar/.local/bin/statusbar/sb-mailbox @@ -6,7 +6,7 @@ case $BLOCK_BUTTON in 1) setsid -w -f "$TERMINAL" -e neomutt - pkill -RTMIN+20 "${STATUSBAR:-dwmblocks}" + pkill -RTMIN+18 "${STATUSBAR:-dwmblocks}" ;; 2) setsid -f mw -Y >/dev/null ;; 3) notify-send "š¬ Mail module" "\- Shows unread mail diff --git a/ar/.local/bin/statusbar/sb-memory b/ar/.local/bin/statusbar/sb-memory index 01eb0e6..3c9dd03 100755 --- a/ar/.local/bin/statusbar/sb-memory +++ b/ar/.local/bin/statusbar/sb-memory @@ -16,9 +16,9 @@ nvme_temp=$(sensors 2>/dev/null | if [ -n "$width" ] && [ "$width" -eq "$width" ] 2>/dev/null; then if [ "$width" -lt 1920 ]; then free --mebi | sed -n '2{p;q}' | - awk -v t="$nvme_temp" '{printf "š¾%s° š%d%%\n", t, ($3/$2)*100+0.5}' + awk -v t="$nvme_temp" '{printf "š”%s° š%d%%\n", t, ($3/$2)*100+0.5}' else free --mebi | sed -n '2{p;q}' | - awk -v t="$nvme_temp" '{printf "š¾%s° š%dGB/%dGB", t, $3/1000+0.5, $2/1000+0.5}' + awk -v t="$nvme_temp" '{printf "š”%s° š%dGB/%dGB", t, $3/1000+0.5, $2/1000+0.5}' fi fi diff --git a/ar/.local/bin/statusbar/sb-mpdup b/ar/.local/bin/statusbar/sb-mpdup index 90e9c7e..fa9b61b 100755 --- a/ar/.local/bin/statusbar/sb-mpdup +++ b/ar/.local/bin/statusbar/sb-mpdup @@ -4,5 +4,5 @@ # music player's status. mpd must be running on X's start for this to work. while :; do - mpc idle >/dev/null && kill -57 "$(pidof "${STATUSBAR:-dwmblocks}")" || break + mpc idle >/dev/null && kill -55 "$(pidof "${STATUSBAR:-dwmblocks}")" || break done diff --git a/ar/.local/bin/statusbar/sb-packages b/ar/.local/bin/statusbar/sb-packages index 5955c75..467bfb3 100755 --- a/ar/.local/bin/statusbar/sb-packages +++ b/ar/.local/bin/statusbar/sb-packages @@ -15,7 +15,7 @@ # [Action] # Description = Updating statusbar... # When = PostTransaction -# Exec = /usr/bin/pkill -RTMIN+16 dwmblocks # Or i3blocks if using i3. +# Exec = /usr/bin/pkill -RTMIN+14 dwmblocks # Or i3blocks if using i3. case $BLOCK_BUTTON in 1) setsid -f "$TERMINAL" -e sb-popupgrade && remaps ;; diff --git a/ar/.local/bin/statusbar/sb-popupgrade b/ar/.local/bin/statusbar/sb-popupgrade index 14036eb..221c7db 100755 --- a/ar/.local/bin/statusbar/sb-popupgrade +++ b/ar/.local/bin/statusbar/sb-popupgrade @@ -3,7 +3,7 @@ printf "Beginning upgrade\\n" yay -Syu -pkill -RTMIN+16 "${STATUSBAR:-dwmblocks}" +pkill -RTMIN+14 "${STATUSBAR:-dwmblocks}" printf "\\nUpgrade complete.\\nPress <Enter> to exit window.\\n\\n" read -r _ diff --git a/ar/.local/bin/statusbar/sb-queues b/ar/.local/bin/statusbar/sb-queues index 40445f8..477fa7f 100755 --- a/ar/.local/bin/statusbar/sb-queues +++ b/ar/.local/bin/statusbar/sb-queues @@ -18,7 +18,7 @@ EOF if [ -z "$url" ]; then notify-send "š¤ No active yt-dlp downloads" fi - pkill -RTMIN+21 "${STATUSBAR:-dwmblocks}" + pkill -RTMIN+19 "${STATUSBAR:-dwmblocks}" } # This block displays the number of running and queued background tasks. Requires tsp. diff --git a/ar/.local/bin/statusbar/sb-volume b/ar/.local/bin/statusbar/sb-volume index 7881bfd..291e78d 100755 --- a/ar/.local/bin/statusbar/sb-volume +++ b/ar/.local/bin/statusbar/sb-volume @@ -5,7 +5,7 @@ case $BLOCK_BUTTON in 1) setsid -w -f "$TERMINAL" -e pulsemixer - pkill -RTMIN+5 "${STATUSBAR:-dwmblocks}" + pkill -RTMIN+4 "${STATUSBAR:-dwmblocks}" ;; 2) wpctl set-mute @DEFAULT_SINK@ toggle ;; 3) notify-send "š¢ Volume module" "\- Shows volume š, š if muted |
