Add diskusage indicator

This commit is contained in:
Yash Karandikar 2023-03-08 19:10:55 -06:00
parent 1345847603
commit b0e061eb95
3 changed files with 13 additions and 1 deletions

View file

@ -47,7 +47,7 @@ bottom-left = powermenu title bluetooth wireguard redshift
bottom-center = i3
bottom-right = alsa battery date
top-left = cpu memory backlight
top-left = cpu memory diskusage backlight
top-center = cava
top-right = spotify-prev spotify-play-pause spotify-next spotify network-detail

View file

@ -415,3 +415,11 @@ format-underline = ${colors.urgent}
exec = $HOME/.config/polybar/scripts/redshift.sh period
click-left = $HOME/.config/polybar/scripts/redshift.sh toggle
interval = 1
[module/diskusage]
type=custom/script
format-prefix = " "
format-prefix-foreground = ${colors.notify}
format-underline = ${colors.notify}
exec = $HOME/.config/polybar/scripts/diskusage.sh
interval = 30

View file

@ -0,0 +1,4 @@
#!/bin/bash
DISK=/dev/sda3
df -h $DISK | awk '/^\/dev\/sd[ab]/ { sum+=$5 } END { print sum }' | sed -e "s/$/%/"