Xfce Forum

Sub domains
 

You are not logged in.

#1 2022-06-05 11:31:19

ace_hunter
Member
Registered: 2022-06-05
Posts: 4

window tiling additional shortcuts

So I know there exists a way to create shortcuts to tile my window to the left, right, corners by going to

window-manager->keyboard..

What I need (if possible) is a way to create 2 or more shortcuts for the same action

So for example, I can tile my window to the bottom left with Super and then the NumPad 1 ..

But, what if I want to add one more keyboard shortcut for the same action.

I know I can try to write some 'complex' script using wmctrl .. but it's not easy when I am using multiple monitors..

Somehow, xfce4 / xfmwm4's shortcuts work beautifully.. I am trying to find out the 'underlying' command that gets called so I can then 'run' that command and add my own shortcuts in the 'keyboard shortcuts' .. or if there is any other way..

I am an xubuntu / xfce user since many years and this would be amazing if it's possible.

Thanks for the help in advance. My first time posting, don't know about etiquette and rules.. hope I didn't break any.

Offline

#2 2022-06-05 13:12:30

KBar
Member
Registered: 2021-11-05
Posts: 689

Re: window tiling additional shortcuts

First and foremost, welcome to our wonderful forum!

The "underlying" configuration is stored in Xfconf.

xfconf-query --channel xfce4-keyboard-shortcuts --list --verbose

Should list all of the shortcuts.

The back-end itself is stored in ~/.config/xfce/xfconf/xfce-perchannel-xml/xfce4-keyboard-shortcuts.xml

Remember to edit the subject of your topic to include the [SOLVED] tag once you're satisfied with the answers or have found a solution (in which case, don't forget to share it as well), so that other members of the community can quickly refer to it and save their time. Pretty please! tongue

Offline

#3 2022-06-07 11:40:39

ace_hunter
Member
Registered: 2022-06-05
Posts: 4

Re: window tiling additional shortcuts

Hey Kbar, thanks for the welcome smile .. Alright let me check out the back-end stuff and see if I can find what I am looking for..
But either way thank you for responding!

I knew about the xfconf and was dabling with it .. but couldn't get anywhere..

Offline

#4 2022-06-07 11:47:24

ace_hunter
Member
Registered: 2022-06-05
Posts: 4

Re: window tiling additional shortcuts

Okay, so I had also found this backend file too .. didn't realize it was the same file you were referring to.. The parts I am interested in are

<property name="&lt;Primary&gt;&lt;Super&gt;KP_Up" type="string" value="tile_up_key"/>
<property name="&lt;Primary&gt;&lt;Super&gt;KP_Down" type="string" value="tile_down_key"/>
<property name="&lt;Primary&gt;&lt;Super&gt;KP_Left" type="string" value="tile_left_key"/>
<property name="&lt;Primary&gt;&lt;Super&gt;KP_Right" type="string" value="tile_right_key"/>
<property name="&lt;Primary&gt;&lt;Super&gt;KP_Home" type="string" value="tile_up_left_key"/>

Usually,

the same file would have something like this:

      <property name="&lt;Alt&gt;&lt;Super&gt;1" type="string" value="bash /home/ace/Documents/scripts/ws.sh 0"/>
      <property name="&lt;Alt&gt;&lt;Super&gt;2" type="string" value="bash /home/ace/Documents/scripts/ws.sh 1"/

Where an actual command is tied to a keyboard shortcut.. whereas, in the above (the thing I'm interested in)
You would notice these are xfce4 internal 'functions' .. that are being called to conduct the tiling effect.

I have also found the source-code that implements it.

Wondering if there is a terminal command that is exposed that can trigger the same tiling effect (tile top, tile bottom right etc)

Which are being indicated by the values "tile_down_key" .. etc


So here's why I'm saying this to make this clear so you are able to help me (if a solution exists)

I can choose my shortcut keys by going to settings->windows-manager->keyboard shortcuts .. and then add keyboard shortcuts to the tiling..
The only problem with that is.. I want to be able to add an additional set of keyboard shortcuts for the same function.

And this UI (the window->manager->keyboard-shortcuts UI), doesn't allow me to duplicate the function and add an additional shortcut..

Unlike say the regular keyboard-shortcuts UI (settings->keyboard->application shortcuts) where I can add the same command multiple times and have multiple short-cut keys..

You may wonder why I'd want multiple shortcut keys.. well cuz my go to shortcut keys involve the numpad (but when I'm on my laptop and not attached to my full sized keyboard), I'd like an alternative shortcut keys for the tiling .. that doesn't include the numpad (and unfortunately the laptop i have doesn't have an exclusive numpad or even a 'soft numpad' using the Fn key)

Hope I have clarified my needs (wants rather) smile

Offline

#5 2022-06-07 11:58:39

KBar
Member
Registered: 2021-11-05
Posts: 689

Re: window tiling additional shortcuts

Perhaps you can try adding additional properties with the same value?

xfconf-query --channel xfce4-keyboard-shortcuts --create --property '<Super>Down' --type string --set tile_down_key

I didn't test it but worth a try I guess?


Remember to edit the subject of your topic to include the [SOLVED] tag once you're satisfied with the answers or have found a solution (in which case, don't forget to share it as well), so that other members of the community can quickly refer to it and save their time. Pretty please! tongue

Offline

#6 2022-06-07 12:07:16

KBar
Member
Registered: 2021-11-05
Posts: 689

Re: window tiling additional shortcuts

I just tested it and it just overwrote on top of the old shortcut.

I think what you can do is write a script that monitors the USB connection to your keyboard and then adjusts these settings on the fly. Kind of like a toggle.


Remember to edit the subject of your topic to include the [SOLVED] tag once you're satisfied with the answers or have found a solution (in which case, don't forget to share it as well), so that other members of the community can quickly refer to it and save their time. Pretty please! tongue

Offline

#7 2022-06-07 13:13:51

ace_hunter
Member
Registered: 2022-06-05
Posts: 4

Re: window tiling additional shortcuts

Sorry was in a meeting ... I had tried that.. adding multiple rows in that file, but didn't work... Yep, I guess I will have to write a script using wmctrl or something..

Anyway, thanks a lot for the help!

Offline

#8 2022-06-07 22:08:19

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

Re: window tiling additional shortcuts

You could just use xdotool to echo the shortcut keys of the main shortcut and assign it to another shortcut.

xdotool key Super+Right

...assuming that Super+Right is the shortcut set in Window Manager Settings, and assign this command to, for example, Ctrl+Right.


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

Registered users online in this topic: 0, guests: 1
[Bot] ClaudeBot

Board footer

Powered by FluxBB
Modified by Visman

[ Generated in 0.014 seconds, 8 queries executed - Memory usage: 553.91 KiB (Peak: 571.2 KiB) ]