Merge branch 'belenos' into 'belenos'
make-compton: Added grafical way of enabling and disabling compton. I've made a script that allows the activation and deactivation of Compton's effects through systems settings. Some modifications have been made like the fact that some scripts have been moved to separate files to avoid writing "\" before some special characters and to "clean" the helper up. Zenity is being used to ask the user what to do so "zenity" have been added in the "dependencies" section of the package. I hope everything is correct now. See merge request !60
This commit is contained in:
commit
457582712a
3 changed files with 96 additions and 11 deletions
9
helpers/DATA/compton/compton-launcher
Normal file
9
helpers/DATA/compton/compton-launcher
Normal file
|
|
@ -0,0 +1,9 @@
|
|||
#!/bin/sh
|
||||
|
||||
[ $DESKTOP_SESSION = "trisquel-session" ] || exit 0
|
||||
[ -f $HOME/.config/disable-compton ] && exit 0
|
||||
|
||||
FILE=/etc/compton.conf
|
||||
[ -f $HOME/.config/compton.conf ] && FILE="$HOME/.config/compton.conf"
|
||||
|
||||
[ 0 != $(glxinfo |grep "renderer string:" |grep -v llvmpipe | wc -c) ] && exec compton --config $FILE &
|
||||
63
helpers/DATA/compton/trisquel-compton-switcher
Normal file
63
helpers/DATA/compton/trisquel-compton-switcher
Normal file
|
|
@ -0,0 +1,63 @@
|
|||
#!/bin/bash
|
||||
|
||||
#Check if compton is currently running.
|
||||
case "$(pgrep -u $USER compton | wc -w)" in
|
||||
|
||||
0) COMPTON_RUNNING=false
|
||||
;;
|
||||
1) COMPTON_RUNNING=true
|
||||
;;
|
||||
esac
|
||||
|
||||
|
||||
if $COMPTON_RUNNING; then
|
||||
COMPTON=true
|
||||
DISCOMPTON=false
|
||||
|
||||
elif ! $COMPTON_RUNNING; then
|
||||
COMPTON=false
|
||||
DISCOMPTON=true
|
||||
|
||||
fi
|
||||
|
||||
#The text that will be showed to the user.
|
||||
TEXT="Use Compton compositor if 3d acceleration available"
|
||||
TITLE="Choose between enabling or disabling Compton"
|
||||
COMPTON_ENABLED="Compton enabled"
|
||||
COMPTON_DISABLED="Compton disabled"
|
||||
INFO="Compton is already running"
|
||||
|
||||
|
||||
#Checks the languange of the system (more can be added in the future) and displays the text corresponding to the language selected.
|
||||
if [ $LANG = es_ES.UTF-8 ]; then
|
||||
TEXT="Usar el compositor Compton si el equipo soporta aceleración 3D"
|
||||
TITLE="Seleccionar entre habilitar o deshabilitar los efectos de Compton"
|
||||
COMPTON_ENABLED="Compton habilitado"
|
||||
COMPTON_DISABLED="Compton deshabilitado"
|
||||
INFO="Compton ya se encuentra en ejecución"
|
||||
fi
|
||||
|
||||
#Zenity is summoned to interact with the user.
|
||||
ans=$(zenity --list --hide-header\
|
||||
--title "$TITLE"\
|
||||
--text "$TEXT"\
|
||||
--radiolist\
|
||||
--column "" --column ""\
|
||||
$COMPTON "$COMPTON_ENABLED"\
|
||||
$DISCOMPTON "$COMPTON_DISABLED")
|
||||
|
||||
#The program reacts to the user's decision.
|
||||
if [[ $ans = "$COMPTON_ENABLED" ]] && ! $COMPTON_RUNNING; then
|
||||
rm $HOME/.config/disable-compton
|
||||
compton-launcher
|
||||
|
||||
#A message is displayed if the user decides to run a program that is already running
|
||||
elif [[ $ans = "$COMPTON_ENABLED" ]] && $COMPTON_RUNNING; then
|
||||
zenity --info \
|
||||
--text="$INFO"
|
||||
|
||||
else
|
||||
killall compton
|
||||
touch $HOME/.config/disable-compton
|
||||
|
||||
fi
|
||||
|
|
@ -1,7 +1,7 @@
|
|||
#!/bin/sh
|
||||
#
|
||||
# Copyright (C) 2011 Rubén Rodríguez <ruben@trisquel.info>
|
||||
# Copyright (C) 2015 Francisco Parra <franparpe@openmailbox.org>
|
||||
# Copyright (C) 2015 Francisco Javier Parra <franparpe@openmailbox.org>
|
||||
#
|
||||
# This program is free software; you can redistribute it and/or modify
|
||||
# it under the terms of the GNU General Public License as published by
|
||||
|
|
@ -18,7 +18,7 @@
|
|||
# Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
|
||||
#
|
||||
|
||||
VERSION=5
|
||||
VERSION=6
|
||||
|
||||
. ./config
|
||||
|
||||
|
|
@ -28,9 +28,14 @@ cat << EOF >> debian/install
|
|||
compton.conf /etc
|
||||
compton-autostart.desktop /etc/xdg/autostart
|
||||
compton-launcher /usr/bin
|
||||
trisquel-compton-switcher /usr/bin
|
||||
trisquel-compton-switcher.desktop /usr/share/applications
|
||||
EOF
|
||||
|
||||
|
||||
cp $DATA/compton.conf .
|
||||
cp $DATA/compton-launcher .
|
||||
cp $DATA/trisquel-compton-switcher .
|
||||
|
||||
cat << EOF > compton-autostart.desktop
|
||||
[Desktop Entry]
|
||||
|
|
@ -43,21 +48,29 @@ X-GNOME-Autostart-Phase=Initialization
|
|||
OnlyShowIn=GNOME;
|
||||
EOF
|
||||
|
||||
cat << EOF > compton-launcher
|
||||
#!/bin/sh
|
||||
cat << EOF > trisquel-compton-switcher.desktop
|
||||
[Desktop Entry]
|
||||
Name=Compton compositor switcher
|
||||
Comment=Allows to enable or disable Compton
|
||||
Exec=trisquel-compton-switcher
|
||||
Icon=checkbox
|
||||
Terminal=false
|
||||
Type=Application
|
||||
StartupNotify=true
|
||||
Categories=GNOME;Settings;DesktopSettings;
|
||||
OnlyShowIn=GNOME;
|
||||
Keywords=Compton;Compositing;Window manager;
|
||||
X-Ubuntu-Gettext-Domain=trisquel-compton-switcher
|
||||
|
||||
[ \$DESKTOP_SESSION = "trisquel-session" ] || exit 0
|
||||
[ -f \$HOME/.config/disable-compton ] && exit 0
|
||||
|
||||
FILE=/etc/compton.conf
|
||||
[ -f \$HOME/.config/compton.conf ] && FILE="\$HOME/.config/compton.conf"
|
||||
|
||||
[ 0 != \$(glxinfo |grep "renderer string:" |grep -v llvmpipe | wc -c) ] && exec compton --config \$FILE &
|
||||
Name[es]=Gestor del compositor Compton
|
||||
Comment[es]=Permite activar o desactivar Compton
|
||||
EOF
|
||||
|
||||
sed 's/^Depends:/Depends: mesa-utils, /' debian/control* -i
|
||||
sed 's/^Depends:/Depends: zenity, /' debian/control* -i
|
||||
|
||||
chmod 755 compton-launcher
|
||||
chmod 755 trisquel-compton-switcher
|
||||
|
||||
changelog "Backported into Toutatis"
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue