Skip to content

Instantly share code, notes, and snippets.

@debxp
Created August 26, 2019 04:43
Show Gist options
  • Save debxp/8530d52e841927665b3c11f614d43d86 to your computer and use it in GitHub Desktop.
Save debxp/8530d52e841927665b3c11f614d43d86 to your computer and use it in GitHub Desktop.
Script to toggle xfce composite and launcher icon
[Desktop Entry]
Version=1.0
Type=Application
Name=Compositor...
Comment=
Exec=/home/gda/.local/bin/xfce4-composite-toggle
Icon=/home/gda/docs/pics/icons/composite-true.svg
Path=
Terminal=false
StartupNotify=false
#!/usr/bin/env bash
launcher="/home/gda/.config/xfce4/panel/launcher-11/composite-toggle.desktop"
status="$(xfconf-query -c xfwm4 -p /general/use_compositing)"
[[ $status = "true" ]] && valor="false" || valor="true"
icon_path="Icon=/home/gda/docs/pics/icons"
icon="composite-$valor.svg"
sed -i "s|^Icon.*$|$icon_path/$icon|g" $launcher
eval "xfconf-query -c xfwm4 -p /general/use_compositing -s $valor"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment