Xfce Forum

Sub domains
 

You are not logged in.

#1 2016-09-03 22:35:47

Pheeble
Member
Registered: 2015-06-22
Posts: 20

Keyboard shortcut to switch mouse-wheel from zoom to transparency

After ToZ kindly pointed out the existence of 'xfconf-query' to me, I messed about (aka 'a little knowledge is a dangerous thing') and realised I could use it to solve an issue I've had with XFCE for a while.

Sometimes I want to use the mousewheel for desktop zooming, and sometimes I want to use it to quickly adjust the transparency of a window, but under the current XFCE window manager configuration it seems those options are mutually exclusive, ie. enabling mousewheel zoom in XFCE's Settings Editor disables mousewheel transparency, whereas to enable transparency the zoom must be disabled.

So I tried creating keyboard shortcuts to use xfconf-query to change the 'zoom-desktop' setting on the fly, and it worked. I've created two keyboard shortcuts:
1. <Super>+z = 'xfconf-query -c xfwm4 -p /general/zoom_desktop -s true' (enable zoom/disable transparency)
2. <Shift>+<Super>+z = 'xfconf-query -c xfwm4 -p /general/zoom_desktop -s false' (disable zoom/enable transparency)

The current zoom/transparency is retained when the mode is switched.

It seems to be working well, but I just thought I'd check to see if anyone can see any gotchas in this.

Offline

#2 2016-09-04 01:26:57

ToZ
Administrator
From: Canada
Registered: 2011-06-02
Posts: 10,949

Re: Keyboard shortcut to switch mouse-wheel from zoom to transparency

Seems like a good way of handling it. Thanks for sharing the tip.


Please remember to mark your thread [SOLVED] to make it easier for others to find
--- How To Ask For Help | FAQ | Developer Wiki  |  Community | Contribute ---

Offline

#3 2018-11-14 03:41:00

dooglus
Member
Registered: 2018-11-14
Posts: 1

Re: Keyboard shortcut to switch mouse-wheel from zoom to transparency

Pheeble wrote:

I've created two keyboard shortcuts:
1. <Super>+z = 'xfconf-query -c xfwm4 -p /general/zoom_desktop -s true' (enable zoom/disable transparency)
2. <Shift>+<Super>+z = 'xfconf-query -c xfwm4 -p /general/zoom_desktop -s false' (disable zoom/enable transparency)

I created a single shortcut which toggles between the two states:

bash -c "if [[ $(xfconf-query -c xfwm4 -p /general/zoom_desktop) == true ]]; then xfconf-query -c xfwm4 -p /general/zoom_desktop -s false; else xfconf-query -c xfwm4 -p /general/zoom_desktop -s true; fi"

Offline

Board footer

Powered by FluxBB