Added custom script to show me when I have upgrades available

This commit is contained in:
Vlad Doster 2020-01-02 20:48:05 -05:00
parent 4be34b0c91
commit 58b2e7030f
3 changed files with 24 additions and 11 deletions

View File

@ -55,11 +55,18 @@ wm-restack = i3
modules-left = i3 modules-left = i3
modules-center = xwindow modules-center = xwindow
modules-right = cpu memory volume wifi ethernet battery date modules-right = arch-updates cpu memory volume wifi ethernet battery date
tray-position = right tray-position = right
tray-padding = 0 tray-padding = 0
[module/arch-updates]
type = custom/script
exec = ~/.local/bin/polybar_scripts/aur_updates
format = <label>
label = %{A1:$TERMINAL -e yay >/dev/null 2>&1 &:}%output%%{A}
interval = 600
[module/battery] [module/battery]
type = internal/battery type = internal/battery
battery = BAT0 battery = BAT0
@ -151,7 +158,7 @@ label-urgent-padding = 1
[module/memory] [module/memory]
type = internal/memory type = internal/memory
interval = 2 interval = 1
format-prefix-foreground = ${colors.gray} format-prefix-foreground = ${colors.gray}
label = RAM: %gb_used%/%gb_free% label = RAM: %gb_used%/%gb_free%
@ -161,8 +168,8 @@ screenchange-reload = true
[module/volume] [module/volume]
type = internal/alsa type = internal/alsa
format-volume = <label-volume> <bar-volume> format-volume = [<label-volume> <bar-volume>]
label-volume = %{A3:$TERMINAL -e alsamixer >/dev/null 2>&1 &:}%percentage% %{A} label-volume = %{A3:$TERMINAL -e alsamixer >/dev/null 2>&1 &:}%percentage%%%{A}
label-volume-foreground = ${colors.foreground} label-volume-foreground = ${colors.foreground}
format-muted-foreground = ${colors.gray} format-muted-foreground = ${colors.gray}

View File

@ -145,13 +145,8 @@ super + F3
# Hibernate # Hibernate
super + F4 super + F4
prompt 'Hibernate computer?' 'sudo -A zzz -Z' prompt 'Hibernate computer?' 'sudo -A zzz -Z'
super + F5 is unbound. super + F5
# Start torrent daemon/open interface killall screenkey || screenkey
super + F6
torwrap
# toggle torrent daemon
super + F7
td-toggle
# sync email # sync email
super + F8 super + F8
mailsync mailsync

View File

@ -0,0 +1,11 @@
#!/usr/bin/env sh
if ! updates=$(yay -Qum 2> /dev/null | wc -l); then
updates=0
fi
if [ "$updates" -gt 0 ]; then
echo "[$updates updates]"
else
echo ""
fi