Xfce – Set a keyboard shortcut for compositing toggle

I use Xfce as my primary desktop environment, and recently, I found the need to disable and enable compositing on a regular basis. This led to my search for a way to do this via keyboard shortcuts, as it was quite inconvenient to have to open the Window Manager Tweaks GUI each time to simply toggle a check box.

So, I discovered xfconf-query, and upon some further reading, came to this as the quickest possible way of doing it via the command line:

xfconf-query -Tc xfwm4 -p /general/use_compositing

Create file compositing.sh using the editor of your choice, with the following content:

#!/bin/sh
xfconf-query -Tc xfwm4 -p /general/use_compositing

Make the file executable:

chmod u+x compositing.sh

Now open Menu > Settings > Keyboard > Application shortcuts > Add

Voila! Enjoy switching compositing on and off as and when you need to.


Comments

One response to “Xfce – Set a keyboard shortcut for compositing toggle”

  1. Kymin KIM

    THX! This is exactly what I was looking for. Gotta try it, but cudos first.

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.