add block button handles for status bar scripts

This commit is contained in:
frosty 2024-05-28 05:23:36 -04:00
parent e1766d7081
commit 31e692b48e
9 changed files with 50 additions and 1 deletions

View file

@ -2,6 +2,10 @@
BATTERY="BAT1" BATTERY="BAT1"
case "$BLOCK_BUTTON" in
6) setsid -f "$TERMINAL" -e "$EDITOR" "$0" ;;
esac
get_status_icon() { get_status_icon() {
case "$1" in case "$1" in
"Full" | "Charging") printf ' \n' ;; "Full" | "Charging") printf ' \n' ;;

View file

@ -1,5 +1,9 @@
#!/bin/sh #!/bin/sh
case "$BLOCK_BUTTON" in
6) setsid -f "$TERMINAL" -e "$EDITOR" "$0" ;;
esac
value=$(top -b -n 1 | awk '/%Cpu\(s\)/{print int($2)}') value=$(top -b -n 1 | awk '/%Cpu\(s\)/{print int($2)}')
icon=" " icon=" "

View file

@ -1,5 +1,10 @@
#!/bin/sh #!/bin/sh
case "$BLOCK_BUTTON" in
1) notify-send "$(cal)" ;;
6) setsid -f "$TERMINAL" -e "$EDITOR" "$0" ;;
esac
value=$(date '+%b %-d %Y %-I:%M %p') value=$(date '+%b %-d %Y %-I:%M %p')
icon=" " icon=" "

View file

@ -2,6 +2,10 @@
DEFAULT_LOCATION="/" DEFAULT_LOCATION="/"
case "$BLOCK_BUTTON" in
6) setsid -f "$TERMINAL" -e "$EDITOR" "$0" ;;
esac
get_location_icon() { get_location_icon() {
case "$1" in case "$1" in
"/home"*) printf ' \n' ;; "/home"*) printf ' \n' ;;

View file

@ -1,6 +1,10 @@
#!/bin/sh #!/bin/sh
value=$(free -h | awk '/Mem/ {gsub(/Gi/, "G", $3); gsub(/Mi/, "M", $3); print $3"/"$2}') case "$BLOCK_BUTTON" in
6) setsid -f "$TERMINAL" -e "$EDITOR" "$0" ;;
esac
value=$(free -h | awk '/Mem/ {print $3"/"$2}' | sed 's/Gi/G/g; s/Mi/M/g')
icon=" " icon=" "
printf ' %s %s\n' "$icon" "$value" printf ' %s %s\n' "$icon" "$value"

View file

@ -1,5 +1,9 @@
#!/bin/sh #!/bin/sh
case "$BLOCK_BUTTON" in
6) setsid -f "$TERMINAL" -e "$EDITOR" "$0" ;;
esac
get_local_ip() { get_local_ip() {
if ! local_ip=$(ip route get 1); then if ! local_ip=$(ip route get 1); then
printf 'Offline\n' printf 'Offline\n'

View file

@ -1,5 +1,9 @@
#!/bin/sh #!/bin/sh
case "$BLOCK_BUTTON" in
6) setsid -f "$TERMINAL" -e "$EDITOR" "$0" ;;
esac
value=$(uptime -p | sed 's/ day[s]*\b/d/g; s/ hour[s]*\b/h/g; s/ minute[s]*\b/m/g; s/up //; s/,//g') value=$(uptime -p | sed 's/ day[s]*\b/d/g; s/ hour[s]*\b/h/g; s/ minute[s]*\b/m/g; s/up //; s/,//g')
icon=" " icon=" "

View file

@ -1,5 +1,9 @@
#!/bin/sh #!/bin/sh
case "$BLOCK_BUTTON" in
6) setsid -f "$TERMINAL" -e "$EDITOR" "$0" ;;
esac
value=$(whoami) value=$(whoami)
icon=" " icon=" "

View file

@ -1,6 +1,22 @@
#!/bin/sh #!/bin/sh
AUDIO_SINK="@DEFAULT_AUDIO_SINK@" AUDIO_SINK="@DEFAULT_AUDIO_SINK@"
AUDIO_LIMIT=1
AUDIO_STEP=2
case "$BLOCK_BUTTON" in
1) wpctl set-mute "$AUDIO_SINK" toggle ;;
3) setsid -f "$TERMINAL" -e pulsemixer ;;
4)
wpctl set-mute "$AUDIO_SINK" 0
wpctl set-volume -l "$AUDIO_LIMIT" "$AUDIO_SINK" "$AUDIO_STEP"%+
;;
5)
wpctl set-mute "$AUDIO_SINK" 0
wpctl set-volume -l "$AUDIO_LIMIT" "$AUDIO_SINK" "$AUDIO_STEP"%-
;;
6) setsid -f "$TERMINAL" -e "$EDITOR" "$0" ;;
esac
get_volume_icon() { get_volume_icon() {
case "$1" in case "$1" in