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
# mabox-compton
# Openbox Pipe Menu for use with compton compositor
# mabox-picom
# Openbox Pipe Menu for use with picom compositor
# Written for CrunchBang Linux <http://crunchbang.org/>
# by Philip Newborough <corenominal@corenominal.org>
# Ported to #!++ <https://crunchbangplusplus.org>
@ -33,7 +33,7 @@ case $LANG in
esac
# ------------- Set xcompmgr command options -----------------------------------
EXECXCOMP='compton'
EXECXCOMP='picom'
if glxinfo | egrep -iq 'direct rendering: yes'; then
EXECXCOMP+=' --vsync opengl'
fi
@ -48,22 +48,22 @@ if [[ $1 = '--edit' ]]; then
else
terminator --command='nano "$HOME/.config/compton.conf"'
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?
if ! pidof compton > /dev/null; then
if ! pidof picom > /dev/null; then
$EXECXCOMP &
else
killall compton
killall picom
fi
elif [[ $1 = '--restart' ]]; then
if pidof compton > /dev/null;then
killall -q compton
if pidof picom > /dev/null;then
killall -q picom
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
(( 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
done
@ -76,7 +76,7 @@ elif [[ $1 = '--watch' ]]; then
else
# Output Openbox menu
menuStart
if ! pidof compton > /dev/null; then
if ! pidof picom > /dev/null; then
menuItem "$ENABLE" 'mabox-compositor --start'
else
menuItem "$RESTART" 'mabox-compositor --restart'