diff options
-rwxr-xr-x | pw-battery (renamed from sb-battery) | 4 | ||||
-rwxr-xr-x | pw-date | 34 | ||||
-rwxr-xr-x | pw-systemstats (renamed from sb-systemstats) | 8 | ||||
-rwxr-xr-x | sb-date | 23 | ||||
-rwxr-xr-x | sb-theme | 28 |
5 files changed, 35 insertions, 62 deletions
@@ -14,8 +14,6 @@ case "$BLOCK_BUTTON" in 3) ghostty -e "$EDITOR" "$0" ;; esac -. sb-theme - # Loop through all attached batteries. for battery in /sys/class/power_supply/BAT?*; do # If non-first battery, print a space separator. @@ -48,5 +46,5 @@ for battery in /sys/class/power_supply/BAT?*; do *) exit 1 ;; esac - display "$status$capacity%" "$color" + echo "| $status$capacity% |" done @@ -0,0 +1,34 @@ +#!/usr/bin/env bash + +# X220 screen is 1366x768 +width=300 +height=180 +X=$((1366-width)) +Y=24 # bar height + +case $BLOCK_BUTTON in + 1) + pid=$(wmctrl -lp | awk '/Orage/{print $3}') + if (( pid > 0 )) ; then + kill -9 "$pid" + else + { orage > /dev/null 2>&1; } & + wmctrl -r "orage" -e "0,$X,$Y,$width,$height" + fi + ;; + + 3) + TODAY=$(date '+%-d') + HEAD=$(cal | head -n1) + BODY=$(cal | tail -n7 | sed -z "s|$TODAY|<u><b>$TODAY</b></u>|1") + + dunstify "$HEAD" "$BODY" \ + -i office-calendar-symbolic \ + -h string:x-canonical-private-synchronous:calendar \ + -u normal + ;; + + +esac + +echo "$(date '+%a %d %b %T')" diff --git a/sb-systemstats b/pw-systemstats index 0f69661..67ee45c 100755 --- a/sb-systemstats +++ b/pw-systemstats @@ -26,14 +26,6 @@ FAN_SPEED=$(sensors | awk '/^fan|^cpu_fan/ {print $2}') [ -z "$FAN_SPEED" ] && FAN_SPEED="N/A" -# Show warning icon if CPU temp is high -case $CPU_TEMP in - "N/A") COLOR="#d8dee9" && CPU_ICON=" ?" ;; - [7-9][6-9]|[8-9][0-9]|100) COLOR="#bf616a" && CPU_ICON="" ;; # Greater than 75 - [6][6-9]|7[0-5]) COLOR="#ebcb8b" && CPU_ICON="" ;; # Between 66 and 75 - *) COLOR="#a3be8c" && CPU_ICON="" ;; # 65 or below -esac - # Send to bar echo " $FAN_SPEED $CPU_TEMP°C" diff --git a/sb-date b/sb-date deleted file mode 100755 index db08327..0000000 --- a/sb-date +++ /dev/null @@ -1,23 +0,0 @@ -#!/bin/sh -# Display the current time in HH:MM:SS. - -notify() { - notify-send --icon=office-calendar-symbolic \ - --hint=string:x-canonical-private-synchronous:"$1" "$@" -} - -case $BLOCK_BUTTON in - 3) - notify "This Month" "$(cal --color=always | - sed "s|..7m|<span color='$(xrdb -get color1)'>|;s|..0m|</span>|")" - appointments="$(calcurse -d1 \ - --format-apt "• <i>%S - %E</i>\n <span foreground='$(xrdb -get color7)'>%m</span>\n" \ - --format-event "• <span foreground='$(xrdb -get color15)'>%m</span>\n")" - [ -n "$appointments" ] && notify "Appointments" "$appointments" - ;; - 2) setsid --fork terminal -e calcurse ;; - 1) dunstify "This Month" "$(cal --color=always)";; -esac - -. sb-theme -display " $(date '+%a %d %b %T')" diff --git a/sb-theme b/sb-theme deleted file mode 100755 index f04c205..0000000 --- a/sb-theme +++ /dev/null @@ -1,28 +0,0 @@ -#!/bin/sh -# Utility functions for theming statusbar scripts. - -display() { - if [ -n "$2" ]; then - color="$2" - else - case "$(basename "$0")" in - sb-mail) color=13 ;; - sb-music) color=14 ;; - sb-disk) color=10 ;; - sb-memory) color=15 ;; - sb-loadavg) color=11 ;; - sb-mic) color=9 ;; - sb-record) color=9 ;; - sb-volume) color=15 ;; - sb-battery) color=14 ;; - sb-date) color=12 ;; - sb-network) color=9 ;; - *) color=15 ;; - esac - fi - - case "$STATUSBAR" in - dwmblocks) echo "^C$color^$1" ;; - *) echo "$1" ;; - esac -} |