From 1d2c4066975dd9fe141935d072ae42f742cb22ff Mon Sep 17 00:00:00 2001 From: ziro Date: Mon, 18 May 2020 13:02:43 +0700 Subject: [PATCH] + Reducing script word count --- .config/polybar/config | 4 ++-- .config/polybar/scripts/disk.sh | 3 ++- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/.config/polybar/config b/.config/polybar/config index d711fe0..c70eefd 100755 --- a/.config/polybar/config +++ b/.config/polybar/config @@ -401,11 +401,11 @@ exec = ~/.config/polybar/scripts/player-mpris-tail.py -f '{:artist:t10:{artist}: tail = true label-font = 3 label-foreground = ${colors.foreground} -format-prefix = " " +format-prefix = "  " format-prefix-font = "5" format-foreground = ${colors.spotgreen} format-background = ${colors.background} -format-padding = 2 +format-padding = 1 click-left = ~/.config/polybar/scripts/player-mpris-tail.py play-pause & scroll-up = ~/.config/polybar/scripts/player-mpris-tail.py next & scroll-down = ~/.config/polybar/scripts/player-mpris-tail.py previous & diff --git a/.config/polybar/scripts/disk.sh b/.config/polybar/scripts/disk.sh index 6698d4c..bdb6d6b 100755 --- a/.config/polybar/scripts/disk.sh +++ b/.config/polybar/scripts/disk.sh @@ -2,7 +2,8 @@ capacity=$(df -h --output=source,avail /home | grep -A1 '/' | sed "s/^.* //;s/[[:alpha:]]//") warn="" -if [ $capacity -lt 71 ]; then warn='!'; fi + +[ $capacity -lt 21 ] && warn='!' printf "%s%s" "$warn " "$(echo $capacity | sed "s/$/G free/")"