diff --git a/.config/picom/toggle.sh b/.config/picom/toggle.sh new file mode 100755 index 0000000..c0bb984 --- /dev/null +++ b/.config/picom/toggle.sh @@ -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 diff --git a/.config/polybar/config.ini b/.config/polybar/config.ini index a78917f..b0fc4cf 100644 --- a/.config/polybar/config.ini +++ b/.config/polybar/config.ini @@ -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 + diff --git a/.config/polybar/picom_status.sh b/.config/polybar/picom_status.sh new file mode 100755 index 0000000..a1c8d61 --- /dev/null +++ b/.config/polybar/picom_status.sh @@ -0,0 +1,6 @@ +#!/bin/bash +if pgrep -x "picom" > /dev/null; then + echo "Picom: ON" +else + echo "Picom: OFF" +fi