Friday, April 19, 2024
 Popular · Latest · Hot · Upcoming
8
rated 0 times [  8] [ 0]  / answers: 1 / hits: 2695  / 1 Year ago, thu, april 20, 2023, 6:47:31

I would like to have two shortcuts each for "Put Left" and "Put Right" for positioning windows in the left and right position.



Specifically, I would like the default keys as well as some custom keys that are more accessible when typing:



i.e.:




  • Put Left: <Control><Alt>KP4 and <Shift><Alt>H

  • Put Right: <Control><Alt>KP6 and <Shift><Alt>L



The CompizConfig dialogue box appears to only allow one shortcut key to be assigned.



How can I have two shortcut keys enabled for a single grid compiz-config setting?


More From » compiz

 Answers
5

One way to do it is simply map the custom secondary keyboard shortcut to the primary (Compiz) shortcut using xdotool.




  1. xdotool is a small command-line utility which allows automation of keyboard and mouse clicks/movements; install it with sudo apt-get install xdotool

  2. We'll assume here that the default shortcuts for Grid Left/Right are as below: (Ctrl+Super+Left/Right):



    enter image description here


  3. Open Settings...Keyboard, and go to the Shortcuts tab. Click + to create a custom shortcut, naming it say Compiz GridRightAlt, and setting the "Command" field to:



    xdotool key --clearmodifiers Ctrl+Super+Right


    Click Apply. The right-column will say Disabled, click on it and you'll see "New Accelerator": press your shortcut key combo, e.g. Shift+Alt+L.



    enter image description here




    • Repeat the steps for the left Compiz GridLeftAlt, setting the command to:



    xdotool key --clearmodifiers Ctrl+Super+Left


    and the shortcut keycombo to Shift+Alt+H.




Close the Keyboard settings and that's it!


[#36593] Friday, April 21, 2023, 1 Year  [reply] [flag answer]
Only authorized users can answer the question. Please sign in first, or register a free account.
adedes

Total Points: 454
Total Questions: 114
Total Answers: 111

Location: Turks and Caicos Islands
Member since Fri, May 8, 2020
4 Years ago
;