From 87bbd98e5be13728f5c945c877bd751bf7ed3a98 Mon Sep 17 00:00:00 2001 From: Daniel Napora Date: Tue, 17 Dec 2024 00:30:47 +0100 Subject: [PATCH] picom cd --- bin/compton_toggle | 32 +++++++++++++++++++++----------- 1 file changed, 21 insertions(+), 11 deletions(-) diff --git a/bin/compton_toggle b/bin/compton_toggle index 6fb59d0..3122fd6 100755 --- a/bin/compton_toggle +++ b/bin/compton_toggle @@ -5,30 +5,40 @@ backend=${picom_renderer:-glx} case "$LANG" in pl*) - DISABLED="Kompozytor Picom zastał WYŁĄCZONY" - ENABLED="Kompozytor Picom został URUCHOMIONY" - RENDERER="Sposób renderowania:" - WITHOUT="Bez pliku konfiguracyjnego (/dev/null)" + _DISABLED="Kompozytor Picom zastał WYŁĄCZONY" + _ENABLED="Kompozytor Picom został URUCHOMIONY" + _RENDERER="Sposób renderowania" + _WITHOUT="Bez pliku konfiguracyjnego (/dev/null)" + _MENU="Menu Konfiguracji..." ;; *) - DISABLED="Picom compositor DISABLED" - ENABLED="Picom compositor ENABLED" - RENDERER="Renderer backend:" - WITHOUT="Running without config file (/dev/null)" + _DISABLED="Picom compositor DISABLED" + _ENABLED="Picom compositor ENABLED" + _RENDERER="Renderer backend" + _WITHOUT="Running without config file (/dev/null)" + _ERROR="Something went wrong" + _NOT_STARTED="Picom not started\nCheck your configuration" + _MENU="Configure Picom" ;; esac if [ $(pgrep -u $USER picom) ]; then killall -u $USER picom - notify-send.sh -i compton -t 5000 "Compositor" "$DISABLED" + notify-send.sh --replace-file=/tmp/comptontgl -i compton -t 5000 "Compositor" "$_DISABLED" -o "$_MENU:jgpicom-pipe -s" else CONFIGFILE="$HOME/.config/picom.conf" if [ -f "$CONFIGFILE" ];then picom --backend "$backend" --config "$CONFIGFILE" & - notify-send.sh -i compton -t 8000 "$ENABLED" "\n$RENDERER: $backend" + sleep .25 + if [ $(pgrep -u $USER picom) ]; then + notify-send.sh --replace-file=/tmp/comptontgl -i compton -t 8000 "$_ENABLED" "\n$_RENDERER: $backend" -o "$_MENU:jgpicom-pipe -s" + else + notify-send.sh --replace-file=/tmp/comptontgl -i error -t 8000 "$_ERROR" "\n$_NOT_STARTED\n$_RENDERER: $backend" -o "$_MENU:jgpicom-pipe -s" + fi else picom --backend "$backend" --config /dev/null & - notify-send.sh -i compton -t 8000 "$ENABLED" "\n$WITHOUT\n$RENDERER $backend" + sleep .25 + notify-send.sh --replace-file=/tmp/comptontgl -i compton -t 8000 "$_ENABLED" "\n$_WITHOUT\n$_RENDERER $backend" -o "$_MENU:jgpicom-pipe -s" fi fi exit