added picom toggle/status modules to polybar

This commit is contained in:
2025-06-01 22:56:10 +10:00
parent 2a0633945d
commit d4a37b723f
3 changed files with 25 additions and 1 deletions

10
.config/picom/toggle.sh Executable file
View File

@@ -0,0 +1,10 @@
#!/bin/bash
if pgrep -x picom
then
pkill picom
else
picom &>/dev/null &
fi
polybar-msg action picom-status hook 0

View File

@@ -83,7 +83,7 @@ separator-foreground = ${colors.red}
font-0 = JetBrains Mono Nerd Font:size=12;4
modules-left = xworkspaces xwindow
modules-right = pulseaudio battery memory cpu wlan eth date
modules-right = picom-status pulseaudio battery memory cpu wlan eth date
cursor-click = pointer
cursor-scroll = ns-resize
@@ -217,4 +217,12 @@ label = %{F#F9e2af} %{F-} %{F#a6e3a1}%time% %date%%{F-}
screenchange-reload = true
pseudo-transparency = true
[module/picom-status]
type = custom/script
exec = ~/.config/polybar/picom_status.sh
hook-0 = ~/.config/polybar/picom_status.sh
interval = 0
click-left = $HOME/.config/picom/toggle.sh
; vim:ft=dosini

View File

@@ -0,0 +1,6 @@
#!/bin/bash
if pgrep -x "picom" > /dev/null; then
echo "Picom: ON"
else
echo "Picom: OFF"
fi