WelcomeWelcome | FAQFAQ | DownloadsDownloads | WikiWiki

Author Topic: [Solved] How to modify keyboard shortcuts to use windows/super key in JWM?  (Read 8231 times)

Offline puppybyte!

  • Jr. Member
  • **
  • Posts: 91
Hi puppybyte!
If this works for you and you want to make it permanent, this should work:
Code: [Select]
echo 'xmodmap -e "keycode 133 = Super_L NoSymbol Super_L"' > .X.d/LeftWinKeyPay close attention to the punctuation right after  Super_L.

Run a backup and reboot. Your key should still have the correct keysym.

thanks, I confirmed the key has the correct keysym now.  I tried
<Key mask="4" key="t">exec:aterm</Key>  and <Key mask="133" key="t">exec:aterm</Key> in the ~/.jwmrc-keys file  but still windowskey+t does not launch aterm.  I appreciate your careful reply.
« Last Edit: March 07, 2022, 07:42:08 PM by Rich »

Offline Rich

  • Administrator
  • Hero Member
  • *****
  • Posts: 11624
Hi puppybyte!
...  and <Key mask="133" key="t">exec:aterm</Key>  ...
That's not a valid value for mask:
Quote
Here mask specifies the modifier keys that must be held to enable this action and key specifies the key that is to be
pressed. keycode may be specified instead of key if the key code is known but the key is not (or there is no symbol for
the key code). action is the action performed when this combination is pressed. The mask section is optional. It can
contain any number of the following values:

    A - Alt (mod1)
    C - Control
    S - Shift
    1 - mod1
    2 - mod2
    3 - mod3
    4 - mod4
    5 - mod5
Found here:
https://joewing.net/projects/jwm/config-2.3.html#keys

If you want to verify which  mod  your  Super_L  is assigned to, just run:
Code: [Select]
xmodmap
Do you have a  /home/tc/.jwmrc  configuration file? Does it have an  Include  directive for  ./.jwmrc-keys  at the end?

Offline puppybyte!

  • Jr. Member
  • **
  • Posts: 91
Hi puppybyte!

If you want to verify which  mod  your  Super_L  is assigned to, just run:
Code: [Select]
xmodmap
Do you have a  /home/tc/.jwmrc  configuration file? Does it have an  Include  directive for  ./.jwmrc-keys  at the end?

my xmodmap gives
Code: [Select]
xmodmap:  up to 2 keys per modifier, (keycodes in parentheses):

shift       Shift_L (0x32),  Shift_R (0x3e)
lock        Caps_Lock (0x42)
control     Control_L (0x25),  Control_R (0x69)
mod1        Alt_L (0x40)
mod2        Num_Lock (0x4d)
mod3     
mod4        Mode_switch (0x6c)
mod5   

I don't see any mention of windows key on mod4.

I do have .jwmrc file and it does include the directive for ./.jwmrc-keys.

thanks

Offline Rich

  • Administrator
  • Hero Member
  • *****
  • Posts: 11624
Hi puppybyte!
Try this:
Code: [Select]
xmodmap -e add Mod4 = Super_L
xmodmap

Offline puppybyte!

  • Jr. Member
  • **
  • Posts: 91
Here Rich
Code: [Select]
tc@box:~$ xmodmap -e add Mod4 = Super_L
xmodmap:  commandline:1:  bad add modifier input line
xmodmap:  unable to open file 'Mod4' for reading
xmodmap:  unable to open file '=' for reading
xmodmap:  unable to open file 'Super_L' for reading
xmodmap:  4 errors encountered, aborting.

Offline Rich

  • Administrator
  • Hero Member
  • *****
  • Posts: 11624
Hi puppybyte!
I'm sorry, there should have been quotes in that command:
Code: [Select]
xmodmap -e "add Mod4 = Super_L"
xmodmap

Offline puppybyte!

  • Jr. Member
  • **
  • Posts: 91
Rich: thanks it did take the command.
Code: [Select]
tc@box:~$ xmodmap
xmodmap:  up to 2 keys per modifier, (keycodes in parentheses):

shift       Shift_L (0x32),  Shift_R (0x3e)
lock        Caps_Lock (0x42)
control     Control_L (0x25),  Control_R (0x69)
mod1        Alt_L (0x40)
mod2        Num_Lock (0x4d)
mod3     
mod4        Mode_switch (0x6c),  Super_L (0x85)
mod5     

after confirming the key works, I gave it the command echo 'xmodmap -e "keycode 133 = Super_L NoSymbol Super_L"' > .X.d/LeftWinKey
to autostart and now I can launch my applications using windowskey rather than alt!!

please mark it solved.  thanks again. ;D ;D
« Last Edit: March 03, 2022, 04:29:48 PM by Rich »

Offline Rich

  • Administrator
  • Hero Member
  • *****
  • Posts: 11624
Hi puppybyte!
You are welcome. Marked as solved.

If you reboot, is the Mod4 setting remembered?

Offline puppybyte!

  • Jr. Member
  • **
  • Posts: 91
As you suspected Mod4 setting is not retained. I have to type in  xmodmap -e "add Mod4 = Super_L"
again.  The same command is in the ~/.X.d/LeftWinKey.
« Last Edit: March 03, 2022, 05:20:55 PM by puppybyte! »

Offline Rich

  • Administrator
  • Hero Member
  • *****
  • Posts: 11624
Hi puppybyte!
This should do it:
Code: [Select]
echo 'xmodmap -e "keycode 133 = Super_L NoSymbol Super_L"' > .X.d/LeftWinKey
Code: [Select]
echo 'xmodmap -e "add Mod4 = Super_L"' >> .X.d/LeftWinKeyReboot and see if it worked.

Offline puppybyte!

  • Jr. Member
  • **
  • Posts: 91
RIch: works perfectly after a reboot.  thanks! :) :)


Offline Rich

  • Administrator
  • Hero Member
  • *****
  • Posts: 11624
Hi puppybyte!
You are welcome. Thank you for confirming it worked.

Offline puppybyte!

  • Jr. Member
  • **
  • Posts: 91
I am using TC13 with JWM windowmanager, works well except I am used to windows key rather than alt key to launch a program.  Normally in JWM in other distros Alt (A) key can be substituted for windows key by (4).  Modifying the line   <Key mask="A" key="t">exec:aterm</Key>,  to  <Key mask="4" key="t">exec:aterm</Key> and rebooting does not work.  Anyone know a solution for this?

Offline Rich

  • Administrator
  • Hero Member
  • *****
  • Posts: 11624
Hi puppybyte!
I don't understand your last post. Are you saying it no longer works?

Offline puppybyte!

  • Jr. Member
  • **
  • Posts: 91
Hi Rich:

sorry about that post, it works very well.  All solved.