Add Redshift and suspend option
This commit is contained in:
@@ -25,9 +25,9 @@ background = ${colors.background}
|
||||
foreground = ${colors.foreground}
|
||||
module-margin = 2
|
||||
font-0 = NotoSans\-Regular:pixelsize=10;2
|
||||
font-1 = FontAwesome:pixelsize=10;2
|
||||
font-1 = Icons:pixelsize=10;2
|
||||
|
||||
modules-left = topmenu pavolume
|
||||
modules-left = topmenu redshift pavolume
|
||||
modules-center = xwindow
|
||||
modules-right = vpn ping date
|
||||
|
||||
@@ -248,10 +248,12 @@ menu-1-3-exec = ~/.dotfiles/bin/vpn nl &
|
||||
|
||||
menu-2-0 = lock
|
||||
menu-2-0-exec = ~/.dotfiles/bin/i3exit lock &
|
||||
menu-2-1 = reboot
|
||||
menu-2-1-exec = ~/.dotfiles/bin/i3exit reboot &
|
||||
menu-2-2 = shutdown
|
||||
menu-2-2-exec = ~/.dotfiles/bin/i3exit shutdown &
|
||||
menu-2-1 = suspend
|
||||
menu-2-1-exec = ~/.dotfiles/bin/i3exit suspend &
|
||||
menu-2-2 = reboot
|
||||
menu-2-2-exec = ~/.dotfiles/bin/i3exit reboot &
|
||||
menu-2-3 = shutdown
|
||||
menu-2-3-exec = ~/.dotfiles/bin/i3exit shutdown &
|
||||
|
||||
[module/filesystem]
|
||||
type = internal/fs
|
||||
@@ -341,3 +343,8 @@ format = <label>
|
||||
label = "🌑%output%%"
|
||||
exec = ~/.dotfiles/bin/brightness listen
|
||||
|
||||
[module/redshift]
|
||||
type = custom/script
|
||||
interval = 5
|
||||
exec = ~/.dotfiles/polybar/scripts/redshift.sh
|
||||
|
||||
|
||||
22
polybar/scripts/redshift.sh
Executable file
22
polybar/scripts/redshift.sh
Executable file
@@ -0,0 +1,22 @@
|
||||
#!/bin/bash
|
||||
|
||||
# Specifying the icon(s) in the script
|
||||
# This allows us to change its appearance conditionally
|
||||
icon=""
|
||||
|
||||
pgrep -x redshift &> /dev/null
|
||||
if [[ $? -eq 0 ]]; then
|
||||
temp=$(redshift -p 2>/dev/null | grep temp | cut -d' ' -f3)
|
||||
temp=${temp//K/}
|
||||
fi
|
||||
|
||||
# OPTIONAL: Append ' ${temp}K' after $icon
|
||||
if [[ -z $temp ]]; then
|
||||
echo "%{F#65737E}$icon" # Greyed out (not running)
|
||||
elif [[ $temp -ge 5000 ]]; then
|
||||
echo "%{F#8FA1B3}$icon ${temp}K" # Blue
|
||||
elif [[ $temp -ge 4000 ]]; then
|
||||
echo "%{F#EBCB8B}$icon ${temp}K" # Yellow
|
||||
else
|
||||
echo "%{F#D08770}$icon ${temp}K" # Orange
|
||||
fi
|
||||
Reference in New Issue
Block a user