compton-picom

master
Daniel Napora 2020-01-10 13:29:29 +01:00
parent 902d43cbde
commit 602fbec7e7
1 changed files with 11 additions and 11 deletions

View File

@ -1,6 +1,6 @@
#!/bin/bash #!/bin/bash
# mabox-compton # mabox-picom
# Openbox Pipe Menu for use with compton compositor # Openbox Pipe Menu for use with picom compositor
# Written for CrunchBang Linux <http://crunchbang.org/> # Written for CrunchBang Linux <http://crunchbang.org/>
# by Philip Newborough <corenominal@corenominal.org> # by Philip Newborough <corenominal@corenominal.org>
# Ported to #!++ <https://crunchbangplusplus.org> # Ported to #!++ <https://crunchbangplusplus.org>
@ -33,7 +33,7 @@ case $LANG in
esac esac
# ------------- Set xcompmgr command options ----------------------------------- # ------------- Set xcompmgr command options -----------------------------------
EXECXCOMP='compton' EXECXCOMP='picom'
if glxinfo | egrep -iq 'direct rendering: yes'; then if glxinfo | egrep -iq 'direct rendering: yes'; then
EXECXCOMP+=' --vsync opengl' EXECXCOMP+=' --vsync opengl'
fi fi
@ -48,22 +48,22 @@ if [[ $1 = '--edit' ]]; then
else else
terminator --command='nano "$HOME/.config/compton.conf"' terminator --command='nano "$HOME/.config/compton.conf"'
fi fi
elif [[ $1 = '--toggle' || $1 = '--start' ]]; then # Toggle compositing with compton. elif [[ $1 = '--toggle' || $1 = '--start' ]]; then # Toggle compositing with picom.
# TODO why --toggle and --start act exactly the same? # TODO why --toggle and --start act exactly the same?
if ! pidof compton > /dev/null; then if ! pidof picom > /dev/null; then
$EXECXCOMP & $EXECXCOMP &
else else
killall compton killall picom
fi fi
elif [[ $1 = '--restart' ]]; then elif [[ $1 = '--restart' ]]; then
if pidof compton > /dev/null;then if pidof picom > /dev/null;then
killall -q compton killall -q picom
for (( i=0; i < RESTART_ATTEMPTS; i++ )); do for (( i=0; i < RESTART_ATTEMPTS; i++ )); do
pidof compton > /dev/null || # no process found! Safe to start again pidof picom > /dev/null || # no process found! Safe to start again
break break
(( i == RESTART_ATTEMPTS - 1 )) && # still didn't die? Probably hangs. Force it to die! (( i == RESTART_ATTEMPTS - 1 )) && # still didn't die? Probably hangs. Force it to die!
killall -q -S KILL compton killall -q -S KILL picom
sleep 0.25 sleep 0.25
done done
@ -76,7 +76,7 @@ elif [[ $1 = '--watch' ]]; then
else else
# Output Openbox menu # Output Openbox menu
menuStart menuStart
if ! pidof compton > /dev/null; then if ! pidof picom > /dev/null; then
menuItem "$ENABLE" 'mabox-compositor --start' menuItem "$ENABLE" 'mabox-compositor --start'
else else
menuItem "$RESTART" 'mabox-compositor --restart' menuItem "$RESTART" 'mabox-compositor --restart'