Xfce Forum

Sub domains
 

You are not logged in.

#1 2020-02-10 12:15:21

ours_code
Member
Registered: 2020-02-10
Posts: 3

[SOLVED] Creating shortcut programmatically

Hello guys,

Thanks for the work on that desktop environment.
I wish to make a script that adds my xfce4 shortcuts when running it. I tried make it edit the shortcut file located in ~/.config/xfce4/xfconf/xfce-perchannel-xml/xfce4-keyboard-shortcuts.xml then log out and log in but without success.
After doing that and trying to edit the shortcut manually I am prompted that it would replace a shortcut allocated to "(null)", which let me think that my changes are partially taken into account.

Can someone indicate me what I should consider changing beside the aforementioned file or point me to a relevant documentation.

Thank you,

Last edited by ours_code (2020-02-20 11:09:03)

Offline

#2 2020-02-10 14:50:55

alcornoqui
Member
Registered: 2014-07-28
Posts: 701

Re: [SOLVED] Creating shortcut programmatically

From a recent thread: Reloading keyboard shortcuts.

ToZ wrote:

You shouldn't update these files when Xfce is running. Xfconfd regularly writes these settings from memory to those files - especially when logging out. To edit these contents, use the tools provided or xfconf-query. If you want to edit the xml files directly, make sure you are logged out and that xfsettingsd and xfconf are not running.

In Script to change keyboard shortcuts, again ToZ demonstrates how to use xfconf-query to programatically change shortcuts for a particular situation, but I think the commands used will give you enough info to achieve your goal.

Good luck, and welcome to the forum!

Last edited by alcornoqui (2020-02-10 14:51:44)

Offline

#3 2020-02-11 08:08:41

ours_code
Member
Registered: 2020-02-10
Posts: 3

Re: [SOLVED] Creating shortcut programmatically

Big thanks for the quick response.

Offline

#4 2020-02-11 11:14:26

alcornoqui
Member
Registered: 2014-07-28
Posts: 701

Re: [SOLVED] Creating shortcut programmatically

So you got it working, great!

You can edit the title to add [SOLVED], it helps when searching.

Offline

#5 2020-02-20 11:10:05

ours_code
Member
Registered: 2020-02-10
Posts: 3

Re: [SOLVED] Creating shortcut programmatically

adding an example:
xfconf-query -c xfce4-keyboard-shortcuts -p '/xfwm4/custom/<Super>x' --create -v -t string -s resize_window_key

Offline

Board footer

Powered by FluxBB