2015-06-22 22:18:31 +03:00
|
|
|
#!/usr/bin/zsh
|
|
|
|
nvidia_dev='/dev/nvidia0'
|
2015-06-24 23:01:46 +03:00
|
|
|
pidfile='/tmp/compton.pid'
|
|
|
|
|
|
|
|
if [[ -r $pidfile ]]; then
|
|
|
|
read pid < $pidfile
|
|
|
|
rm $pidfile
|
|
|
|
if kill $pid; then
|
|
|
|
exit 0
|
2015-06-22 22:18:31 +03:00
|
|
|
fi
|
|
|
|
fi
|
2015-06-24 23:01:46 +03:00
|
|
|
|
|
|
|
if [[ -e $nvidia_dev ]]; then
|
2017-08-15 12:40:00 +03:00
|
|
|
gpu_opts=
|
2015-06-24 23:01:46 +03:00
|
|
|
else
|
2017-08-15 12:40:00 +03:00
|
|
|
gpu_opts=(--dbe --vsync opengl --backend xrender)
|
2015-06-24 23:01:46 +03:00
|
|
|
fi
|
2019-04-08 18:36:00 +03:00
|
|
|
compton $gpu_opts[@] -cGC -t-5 -l-5 -r4 -o.55 --no-fading-openclose &
|
2015-06-24 23:01:46 +03:00
|
|
|
pid=$!
|
|
|
|
if [[ -n $pid ]]; then
|
|
|
|
printf '%s' $pid > $pidfile
|
|
|
|
else
|
|
|
|
exit 1
|
|
|
|
fi
|
|
|
|
disown
|
2015-06-22 22:18:31 +03:00
|
|
|
exit 0
|