diff options
-rw-r--r-- | .config/i3blocks/config | 8 | ||||
-rwxr-xr-x | .local/bin/statusbar/sb-clock | 2 | ||||
-rwxr-xr-x | .local/bin/statusbar/sb-disk | 17 | ||||
-rwxr-xr-x | .local/bin/statusbar/sb-doppler | 2 | ||||
-rwxr-xr-x | .local/bin/statusbar/sb-forecast | 8 | ||||
-rwxr-xr-x | .local/bin/statusbar/sb-internet | 28 | ||||
-rwxr-xr-x | .local/bin/statusbar/sb-memory | 4 | ||||
-rwxr-xr-x | .local/bin/statusbar/sb-microphone | 2 | ||||
-rwxr-xr-x | .local/bin/statusbar/sb-nettraf | 4 | ||||
-rwxr-xr-x | .local/bin/statusbar/sb-volume | 4 |
10 files changed, 50 insertions, 29 deletions
diff --git a/.config/i3blocks/config b/.config/i3blocks/config index 0ccbb8b..000b092 100644 --- a/.config/i3blocks/config +++ b/.config/i3blocks/config @@ -8,6 +8,10 @@ command=sb-news interval=once signal=6 +[disk] +command=sb-disk +interval=10 + [memory] command=sb-memory interval=10 @@ -35,12 +39,12 @@ signal=16 [microphone] command=sb-microphone -interval=once +interval=5 signal=23 [volume] command=sb-volume -interval=once +interval=5 signal=10 [clock] diff --git a/.local/bin/statusbar/sb-clock b/.local/bin/statusbar/sb-clock index 2229164..fb62665 100755 --- a/.local/bin/statusbar/sb-clock +++ b/.local/bin/statusbar/sb-clock @@ -21,7 +21,7 @@ esac case $BLOCK_BUTTON in 1) notify-send "This Month" "$(cal | sed "s/\<$(date +'%e'|tr -d ' ')\>/<b><span color='red'>&<\/span><\/b>/")" && notify-send "Appointments" "$(calcurse -d3)" ;; 2) setsid -f "$TERMINAL" -e calcurse ;; - 3) notify-send " Time/date module" "\- Left click to show upcoming appointments for the next three days via \`calcurse -d3\` and show the month via \`cal\` + 3) notify-send " Time/date module" "\- Left click to show upcoming appointments for the next three days via \`calcurse -d3\` and show the month via \`cal\` - Middle click opens calcurse if installed" ;; 8) setsid -f "$TERMINAL" -e "$EDITOR" "$0" ;; esac diff --git a/.local/bin/statusbar/sb-disk b/.local/bin/statusbar/sb-disk new file mode 100755 index 0000000..efc1f5e --- /dev/null +++ b/.local/bin/statusbar/sb-disk @@ -0,0 +1,17 @@ +#!/bin/sh + +# Status bar module for disk space +# $1 should be drive mountpoint, otherwise assumed /. + +location=${1:-/} + +[ -d "$location" ] || exit + +case $BLOCK_BUTTON in + 1) notify-send " Disk space" "$(df -h --output=target,used,size)" ;; + 3) notify-send " Disk module" "\- Shows used hard drive space. +- Click to show all disk info." ;; + 8) setsid -f "$TERMINAL" -e "$EDITOR" "$0" ;; +esac + +printf "%s: %s\n" "root" "$(df -h "$location" | awk ' /[0-9]/ {print $3 "/" $2}')" diff --git a/.local/bin/statusbar/sb-doppler b/.local/bin/statusbar/sb-doppler index 75092f3..b3967ce 100755 --- a/.local/bin/statusbar/sb-doppler +++ b/.local/bin/statusbar/sb-doppler @@ -19,4 +19,4 @@ After $secs seconds, new clicks will also automatically update the doppler RADAR 8) setsid -f "$TERMINAL" -e "$EDITOR" "$0" ;; esac -echo 🌅 +echo diff --git a/.local/bin/statusbar/sb-forecast b/.local/bin/statusbar/sb-forecast index f7df265..350f2c9 100755 --- a/.local/bin/statusbar/sb-forecast +++ b/.local/bin/statusbar/sb-forecast @@ -40,11 +40,11 @@ showweather() { case $BLOCK_BUTTON in 1) setsid -f "$TERMINAL" -e less -Sfr "$weatherreport" ;; 2) getforecast && showweather ;; - 3) notify-send " Weather module" "\- Left click for full forecast. + 3) notify-send " Weather module" "\- Left click for full forecast. - Middle click to update forecast. - : Chance of rain/snow - : Daily low - : Daily high" ;; + : Chance of rain/snow + : Daily low + : Daily high" ;; 8) setsid -f "$TERMINAL" -e "$EDITOR" "$0" ;; esac diff --git a/.local/bin/statusbar/sb-internet b/.local/bin/statusbar/sb-internet index 07774e0..e138115 100755 --- a/.local/bin/statusbar/sb-internet +++ b/.local/bin/statusbar/sb-internet @@ -1,8 +1,8 @@ #!/bin/sh -# Show wifi 📶 and percent strength or 📡 if none. -# Show 🌐 if connected to ethernet or ❎ if none. -# Show 🔒 if a vpn connection is active +# Show wifi and percent strength or if none. +# Show if connected to ethernet or if none. +# Show if a vpn connection is active togglevpn() { if [ ! -n "$(cat /sys/class/net/libre/operstate 2>/dev/null)" ];then @@ -16,28 +16,28 @@ togglevpn() { case $BLOCK_BUTTON in 1) togglevpn 2>/dev/null ;; - 3) notify-send "🌐 Internet module" "\- Click to enable/disable VPN - ❌: wifi disabled - 📡: no wifi connection - 📶: wifi connection with quality - ❎: no ethernet - 🌐: ethernet working - 🔒: vpn is active + 3) notify-send " Internet module" "\- Click to enable/disable VPN + : wifi disabled + : no wifi connection + : wifi connection with quality + : no ethernet + : ethernet working + : vpn is active " ;; 8) setsid -f "$TERMINAL" -e "$EDITOR" "$0" ;; esac # Wifi if [ "$(cat /sys/class/net/w*/operstate 2>/dev/null)" = 'up' ] ; then - wifiicon="$(awk '/^\s*w/ { print "📶", int($3 * 100 / 70) "% " }' /proc/net/wireless)" + wifiicon="$(awk '/^\s*w/ { print " ", int($3 * 100 / 70) "% " }' /proc/net/wireless)" elif [ "$(cat /sys/class/net/w*/operstate 2>/dev/null)" = 'down' ] ; then - [ "$(cat /sys/class/net/w*/flags 2>/dev/null)" = '0x1003' ] && wifiicon="📡 " || wifiicon="❌ " + [ "$(cat /sys/class/net/w*/flags 2>/dev/null)" = '0x1003' ] && wifiicon=" " || wifiicon=" " fi # Ethernet -[ "$(cat /sys/class/net/e*/operstate 2>/dev/null)" = 'up' ] && ethericon=" " || ethericon="❎" +[ "$(cat /sys/class/net/e*/operstate 2>/dev/null)" = 'up' ] && ethericon=" " || ethericon=" " -# Wireguard +# VPN (change libre to your tun interface name) [ -n "$(cat /sys/class/net/libre/operstate 2>/dev/null)" ] && tunicon=" " printf "%s%s%s\n" "$wifiicon" "$ethericon" "$tunicon" diff --git a/.local/bin/statusbar/sb-memory b/.local/bin/statusbar/sb-memory index fffee63..98c3da9 100755 --- a/.local/bin/statusbar/sb-memory +++ b/.local/bin/statusbar/sb-memory @@ -1,9 +1,9 @@ #!/bin/sh case $BLOCK_BUTTON in - 1) notify-send " Memory hogs" "$(ps axch -o cmd:15,%mem --sort=-%mem | head)" ;; + 1) notify-send " Memory hogs" "$(ps axch -o cmd:15,%mem --sort=-%mem | head)" ;; 2) setsid -f "$TERMINAL" -e btop ;; - 3) notify-send " Memory module" "\- Shows Memory Used/Total. + 3) notify-send " Memory module" "\- Shows Memory Used/Total. - Click to show memory hogs. - Middle click to open htop." ;; 8) setsid -f "$TERMINAL" -e "$EDITOR" "$0" ;; diff --git a/.local/bin/statusbar/sb-microphone b/.local/bin/statusbar/sb-microphone index 397d04b..45754c2 100755 --- a/.local/bin/statusbar/sb-microphone +++ b/.local/bin/statusbar/sb-microphone @@ -7,7 +7,7 @@ case $BLOCK_BUTTON in 2) wpctl set-mute @DEFAULT_SOURCE@ toggle ;; 4) wpctl set-volume @DEFAULT_SOURCE@ 1%+ ;; 5) wpctl set-volume @DEFAULT_SOURCE@ 1%- ;; - 3) notify-send " Microphone volume module" "\- Shows volume , if muted. + 3) notify-send " Microphone volume module" "\- Shows volume , if muted. - Middle click to mute. - Scroll to change." ;; 8) setsid -f "$TERMINAL" -e "$EDITOR" "$0" ;; diff --git a/.local/bin/statusbar/sb-nettraf b/.local/bin/statusbar/sb-nettraf index ce001b0..7644468 100755 --- a/.local/bin/statusbar/sb-nettraf +++ b/.local/bin/statusbar/sb-nettraf @@ -6,8 +6,8 @@ case $BLOCK_BUTTON in 1) setsid -f "$TERMINAL" -e bmon ;; - 3) notify-send " Network traffic module" " : Traffic received - : Traffic transmitted" ;; + 3) notify-send " Network traffic module" " : Traffic received + : Traffic transmitted" ;; 8) setsid -f "$TERMINAL" -e "$EDITOR" "$0" ;; esac diff --git a/.local/bin/statusbar/sb-volume b/.local/bin/statusbar/sb-volume index a7253f1..1aeceba 100755 --- a/.local/bin/statusbar/sb-volume +++ b/.local/bin/statusbar/sb-volume @@ -1,6 +1,6 @@ #!/bin/sh -# Prints the current volume or 🔇 if muted. +# Prints the current volume or if muted. case $BLOCK_BUTTON in 1) setsid -w -f "$TERMINAL" -e pulsemixer; pkill -RTMIN+10 "${STATUSBAR:-i3blocks}" ;; @@ -15,7 +15,7 @@ esac vol="$(wpctl get-volume @DEFAULT_AUDIO_SINK@)" -# If muted, print 🔇 and exit. +# If muted, print and exit. [ "$vol" != "${vol%\[MUTED\]}" ] && echo && exit vol="${vol#Volume: }" |