This commit is contained in:
Daniel Napora 2024-12-10 20:59:19 +01:00
parent b3ab627166
commit 580699c086
2 changed files with 20 additions and 26 deletions

View File

@ -10,7 +10,7 @@ CONFFILE="$HOME/.config/picom.conf"
mkdir -p "$CONFDIR"
menu() {
case $LANG in
pl*)
ENABLE="Włącz Kompozytora"
@ -18,8 +18,10 @@ case $LANG in
DISABLE="Wyłącz Kompozytora"
CHOOSE="Wybierz plik konfiguracyjny"
DEVNULL="/dev/null <i>(brak)</i>"
EDIT_TITLE="Edytuj..."
EDIT_TITLE="Edytuj ustawienia Picom"
EDIT="Edytuj plik ustawień Kompozytora"
CONFIG_GUI="Konfiguruj (picom-conf)"
INSTALL_GUI="Zainstaluj picom-conf"
OPENDIR="Otwórz katalog <i>~/.config/picom/configs</i>"
RENDERER="Rendering Backend"
GLX="<b>glx</b> <i>(zalecany)</i>"
@ -32,6 +34,8 @@ case $LANG in
CHOOSE="Elegir el archivo de configuración"
DEVNULL="/dev/null"
EDIT_TITLE="Editar..."
CONFIG_GUI="Configure with GUI (picom-conf)"
INSTALL_GUI="Install picom-conf (GUI)"
EDIT="Editar archivo de ajustes del Compositor"
OPENDIR="Abrir la carpeta <i>~/.config/picom/configs</i>"
RENDERER="Rendering Backend"
@ -44,8 +48,10 @@ case $LANG in
DISABLE="Stop Compositor"
CHOOSE="Choose config file"
DEVNULL="/dev/null <i>(none)</i>"
EDIT_TITLE="Edit..."
EDIT_TITLE="Edit Compositor settings"
EDIT="Edit Compositor settings file"
CONFIG_GUI="Configure with GUI (picom-conf)"
INSTALL_GUI="Install picom-conf (GUI)"
OPENDIR="Open <i>~/.config/picom/configs</i> directory"
RENDERER="Rendering Backend"
GLX="<b>glx</b> <i>(recommended)</i>"
@ -53,6 +59,7 @@ case $LANG in
;;
esac
menu() {
out+=("^sep(Picom)")
if ! pidof picom > /dev/null; then
out+=("$ENABLE,mabox-compositor --start")
@ -85,6 +92,12 @@ out+=("^sep($EDIT_TITLE)")
if [ -f "$CONFFILE" ];then
if [ ! "$(readlink $CONFFILE)" -ef "/dev/null" ];then
out+=("$EDIT,xdg-open $CONFFILE")
if hash picom-conf 2>&1 >/dev/null
then
out+=("$CONFIG_GUI,picom-conf")
else
out+=("$INSTALL_GUI,pamac-installer picom-conf-git")
fi
fi
fi
out+=("$OPENDIR,exo-open --launch FileManager $CONFDIR")
@ -98,7 +111,5 @@ printf '%s\n' "${out[@]}"
case "$1" in
start) start;;
stop) stop;;
restart) restart;;
menu) menu "$2";;
esac

View File

@ -11,7 +11,7 @@ CONFIGFILE="$HOME/.config/picom.conf"
if [ -f "$CONFIGFILE" ];then
picom --backend "$backend" --config "$CONFIGFILE" &
else
picom --backend "$backend" --config /usr/share/doc/picom/picom.conf.example &
picom --backend "$backend" --config /dev/null &
fi
}
stop() {
@ -24,27 +24,10 @@ restart(){
sleep 0.25
start
}
# OLD RESTART
#if [[ $1 = '--restart' ]]; then
# if pidof picom > /dev/null;then
# killall -q picom
# for (( i=0; i < RESTART_ATTEMPTS; i++ )); do
# pidof picom > /dev/null || # no process found! Safe to start again
# break
#
# (( i == RESTART_ATTEMPTS - 1 )) && # still didn't die? Probably hangs. Force it to die!
# killall -q -S KILL picom
#
# sleep 0.25
# done
# mabox-compositor --start
#fi
case "$1" in
--start) start;;
--stop) stop;;
--restart) restart;;
menu) menu "$2";;
--start|start) start;;
--stop|stop) stop;;
--restart|restart) restart;;
esac
exit 0