Xfce Forum

Sub domains
 

You are not logged in.

#1 2023-06-01 09:43:56

bradwiggo
Member
Registered: 2021-06-29
Posts: 15

Having issues assigning XFWM shortcuts using xfconf-query

I'm trying to make a script that will initalise xfce to my settings, using xfconf-query. It seems to be working fine for most things, but I'm having an issue with the XFWM keyboard shortcuts.

Basically I want tile up, down, left right to be mapped to up down left right arrow keys, and then top left etc mapped to page up/down and home/end, as on my laptop those are mapped to fn + arrow keys.

The issue I'm having is using the following set of xfconf commands:

xfconf-query -c xfce4-keyboard-shortcuts -p "/xfwm4/custom" -r -R # To reset any other changes 
xfconf-query -c xfce4-keyboard-shortcuts -np '/xfwm4/custom/<Super>Up' -t 'string' -s 'tile_up_key'
xfconf-query -c xfce4-keyboard-shortcuts -np '/xfwm4/custom/<Super>Down' -t 'string' -s 'tile_down_key'
xfconf-query -c xfce4-keyboard-shortcuts -np '/xfwm4/custom/<Super>Right' -t 'string' -s 'tile_right_key'
xfconf-query -c xfce4-keyboard-shortcuts -np '/xfwm4/custom/<Super>Left' -t 'string' -s 'tile_left_key'
xfconf-query -c xfce4-keyboard-shortcuts -np '/xfwm4/custom/<Super>End' -t 'string' -s 'tile_up_right_key'
xfconf-query -c xfce4-keyboard-shortcuts -np '/xfwm4/custom/<Super>Page_Down' -t 'string' -s 'tile_down_right_key'
xfconf-query -c xfce4-keyboard-shortcuts -np '/xfwm4/custom/<Super>Page_Up' -t 'string' -s 'tile_up_left_key'
xfconf-query -c xfce4-keyboard-shortcuts -np '/xfwm4/custom/<Super>Home' -t 'string' -s 'tile_down_left_key'

If I run these commands, none of the keys will work. If I run

xfconf-query -c xfce4-keyboard-shortcuts -lv | grep "xfwm4/custom/<Super>"

then this is the output:

/xfwm4/custom/<Super>Down                  tile_down_key
/xfwm4/custom/<Super>End                   tile_up_right_key
/xfwm4/custom/<Super>Home                  tile_down_left_key
/xfwm4/custom/<Super>Left                  tile_left_key
/xfwm4/custom/<Super>Page_Down             tile_down_right_key
/xfwm4/custom/<Super>Page_Up               tile_up_left_key
/xfwm4/custom/<Super>Right                 tile_right_key
/xfwm4/custom/<Super>Up                    tile_up_key

Which looks right, but if you look the the xfwm4-settings UI, it looks like this:

Picture 1

Which doesn't look right.

What am I doing wrong?

Offline

#2 2023-06-01 10:09:26

ToZ
Administrator
From: Canada
Registered: 2011-06-02
Posts: 11,202

Re: Having issues assigning XFWM shortcuts using xfconf-query

If you run each of those commands manually in a terminal window, does it then work?

If so, maybe place a sleep statement after the first command to give it time to complete properly.


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 2023-06-01 10:52:07

bradwiggo
Member
Registered: 2021-06-29
Posts: 15

Re: Having issues assigning XFWM shortcuts using xfconf-query

ToZ wrote:

If you run each of those commands manually in a terminal window, does it then work?

If so, maybe place a sleep statement after the first command to give it time to complete properly.


They sometimes work, but inconsistently. About 5 minutes after I made this post I ran the script again, and then every single one worked. However, 30 minutes later, some of the shortcuts have stopped working (I didn't rerun the script or make any other changes to XFWM4 bindings)

For example now I tried running

 xfconf-query -c xfce4-keyboard-shortcuts -np '/xfwm4/custom/<Super>Down' -t 'string' -s 'tile_down_key' 

and it didn't work. If I go into the settings UI and set it then it will work. However if I reboot, it stops working.

Offline

#4 2023-06-01 12:20:34

ToZ
Administrator
From: Canada
Registered: 2011-06-02
Posts: 11,202

Re: Having issues assigning XFWM shortcuts using xfconf-query

Which distro and versions of Xfce and xfwm4 are you running?


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

#5 2023-06-01 12:24:56

bradwiggo
Member
Registered: 2021-06-29
Posts: 15

Re: Having issues assigning XFWM shortcuts using xfconf-query

ToZ wrote:

Which distro and versions of Xfce and xfwm4 are you running?

Distro is Arch, Xfce version is 4.18, Xfwm4 version 4.18.0 (revision 7e7473c5b)

Offline

#6 2023-06-01 17:06:02

ToZ
Administrator
From: Canada
Registered: 2011-06-02
Posts: 11,202

Re: Having issues assigning XFWM shortcuts using xfconf-query

This might be of interest.

I can replicate the problem on my system as well. Have a read through that bug report and if you feel it is relevant, post to it. If not, feel free to create a new bug report.


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

#7 2023-06-02 13:32:38

bradwiggo
Member
Registered: 2021-06-29
Posts: 15

Re: Having issues assigning XFWM shortcuts using xfconf-query

ToZ wrote:

This might be of interest.

I can replicate the problem on my system as well. Have a read through that bug report and if you feel it is relevant, post to it. If not, feel free to create a new bug report.

Thanks, I'll have a look at the bug report.

As a workaround, xdotool could be used to automatically add shortcuts:

xfwm4-settings & disown
sleep 0.1
xdotool key Right Down Down 	
xdotool type "Add workspace"
xdotool key Enter
xdotool keydown Super Shift
xdotool key t
xdotool keyup Super Shift

Where "Add workspace" is the exact name of the action, and "Super+Shift+t" is the keyboard shortcut.

Offline

Board footer

Powered by FluxBB