Custom shortcut JWM not works without relaunch of JWM

Moderator: BarryK

Post Reply
Caramel
Posts: 483
Joined: Sun Oct 02, 2022 6:25 pm
Location: France
Has thanked: 101 times
Been thanked: 81 times

Custom shortcut JWM not works without relaunch of JWM

Post by Caramel »

(Easy 6.1 / same problem with Fossapup ( but briefly tested in Fossapup) )

I created a keyboard shorcut in JWM for showdesktop (Alt + z)

After relaunch of JWM, the shorcut works. But after a reboot (or a relaunch of X) the shorcut does not work until JWM is relaunched.

I tested with direct edit of /root/.jwmrc, direct edit of /root/.jwm/jwmrc-personal or with EasyJWM in Easy 6.1 (Tested with direct edit in Fossapup)

(EDIT : fix the name of the file .jwmrc)

Last edited by Caramel on Sat Aug 31, 2024 3:29 am, edited 1 time in total.
User avatar
rockedge
Site Admin
Posts: 6571
Joined: Mon Dec 02, 2019 1:38 am
Location: Connecticut,U.S.A.
Has thanked: 2779 times
Been thanked: 2650 times
Contact:

Re: Custom shortcut JWM not works without relaunch of JWM

Post by rockedge »

@Caramel I think you will need to modify /etc/xdg/templates/_root_.jwmrc for the key binding to stay available.

Andrew8342
Posts: 1
Joined: Tue Jul 23, 2024 1:15 pm

Re: Custom shortcut JWM not works without relaunch of JWM

Post by Andrew8342 »

I had a similar issue with JWM on Easy 6.1. Setting a keyboard shortcut for showdesktop (Alt + z) worked after relaunching JWM but failed after a reboot. It seems to require JWM to be relaunched each time.
I tried editing /root/.jwm, /root/.jwm/jwmrc-personal, and using EasyJWM, but the problem persists. It also happens in Fossapup. It might be a bug or a conflict in the session startup process. Maybe someone else has a workaround?

Greetings, Andrew :-)

Last edited by Andrew8342 on Tue Jul 23, 2024 1:58 pm, edited 1 time in total.
Caramel
Posts: 483
Joined: Sun Oct 02, 2022 6:25 pm
Location: France
Has thanked: 101 times
Been thanked: 81 times

Re: Custom shortcut JWM not works without relaunch of JWM

Post by Caramel »

rockedge wrote: Tue Jul 23, 2024 12:52 pm

@Caramel I think you will need to modify /etc/xdg/templates/_root_.jwmrc for the key binding to stay available.

Thanks for the answer.

I added

Code: Select all

 <Key mask="A" key="z">showdesktop</Key>

to this file (in Easy 6.1). After relaunch of X, Alt+z still doesn't work.

User avatar
BarryK
Posts: 2738
Joined: Tue Dec 24, 2019 1:04 pm
Has thanked: 135 times
Been thanked: 745 times

Re: Custom shortcut JWM not works without relaunch of JWM

Post by BarryK »

Have you tried putting it in /root/.jwm/jwmrc-personal?

That file gets loaded at the end of /root/.jwmrc, and that is where EasyJWM writes settings.

Radky's EasyJWM can also be used to create keyboard shortcuts.

Caramel
Posts: 483
Joined: Sun Oct 02, 2022 6:25 pm
Location: France
Has thanked: 101 times
Been thanked: 81 times

Re: Custom shortcut JWM not works without relaunch of JWM

Post by Caramel »

BarryK wrote: Tue Jul 23, 2024 1:45 pm

Have you tried putting it in /root/.jwm/jwmrc-personal?

That file gets loaded at the end of /root/.jwmrc, and that is where EasyJWM writes settings.

Radky's EasyJWM can also be used to create keyboard shortcuts.

I tested with jwmrc-personal and with EasyJWM.

Caramel
Posts: 483
Joined: Sun Oct 02, 2022 6:25 pm
Location: France
Has thanked: 101 times
Been thanked: 81 times

Re: Custom shortcut JWM not works without relaunch of JWM

Post by Caramel »

Experiment:
Start in command line.

I entered the command

/usr/bin/xinit /usr/bin/jwm

An incomplet desktop is displayed.
Alf+ z doesn't work. (but it works after relaunch of jwm)

So the source of the problem is probably in xinit or in jwm

Caramel
Posts: 483
Joined: Sun Oct 02, 2022 6:25 pm
Location: France
Has thanked: 101 times
Been thanked: 81 times

Custom shortcut JWM - new test

Post by Caramel »

I have 2 installations of Easy 6.1.

Froñ a previous test , I can switch between french (occitan variant) and spanish keyboard layouts on one of these installations. (Edit.; no change if the occitan variant is removed)
Si I decided to switch the keyboar to es and retry.
And this time the shortcut Alt+ z (in reality I type Alt+w on my physical french keyboard) works without problem.
Return to fr layout. The problem is still here.

Caramel
Posts: 483
Joined: Sun Oct 02, 2022 6:25 pm
Location: France
Has thanked: 101 times
Been thanked: 81 times

Custom shortcut JWM not works - assumption

Post by Caramel »

Probably, when jwm is launched at the end of the X starting, it doesn't know the chosen keyboard and uses the us layout.
The french layout is azerty, not qwerty like the us layout. z and w have swapped places.

New test : I typed Alt+w on my physical keyboard and the action "showdesktop" was executed (It's just after boot. If i relaunch JWM, the good command becomes Alt+z

Conclusion : if we doesn't have a us keyboard, not create a shortcut with keys that differ from the us layout

User avatar
BarryK
Posts: 2738
Joined: Tue Dec 24, 2019 1:04 pm
Has thanked: 135 times
Been thanked: 745 times

Re: Custom shortcut JWM not works without relaunch of JWM

Post by BarryK »

Caramel
Posts: 483
Joined: Sun Oct 02, 2022 6:25 pm
Location: France
Has thanked: 101 times
Been thanked: 81 times

Re: Custom shortcut JWM not works without relaunch of JWM

Post by Caramel »

BarryK wrote: Tue Jul 23, 2024 4:03 pm

maybe this is related:

https://github.com/joewing/jwm/issues/321

Thanks.

https://github.com/joewing/jwm/issues/3 ... -234436914 :

A workaround is adding a line to .jwmrc:
<StartupCommand>sleep 6.0s &amp;&amp; jwm -restart &amp;</StartupCommand>

The workaround works. (EDIT : finally not always works)

Caramel
Posts: 483
Joined: Sun Oct 02, 2022 6:25 pm
Location: France
Has thanked: 101 times
Been thanked: 81 times

Re: Custom shortcut JWM not works without relaunch of JWM

Post by Caramel »

Other method, seems better. (EDIT : not always work)
Use the command sleep before the launch of jwm in .xinitrc (line 390)

The difficulty is to choose the duration of the sleep.
Enough so that JWM can know the chosen keyboard layout and not too long so as not to unnecessarily prolong the start-up

Caramel
Posts: 483
Joined: Sun Oct 02, 2022 6:25 pm
Location: France
Has thanked: 101 times
Been thanked: 81 times

Re: Custom shortcut JWM not works without relaunch of JWM

Post by Caramel »

After new tests, it seems that not only JWN must be relaunched but more, we need to use the keyboard (type at least a character even if any application is open) before the relaunch.

Caramel
Posts: 483
Joined: Sun Oct 02, 2022 6:25 pm
Location: France
Has thanked: 101 times
Been thanked: 81 times

Re: Custom shortcut JWM not works without relaunch of JWM

Post by Caramel »

New method:
Add

Code: Select all

KEYMAP=$(cat /etc/keymap)
setxkbmap $KEYMAP

line 387 (before #exec $CURRENTWM) in /root/.xinitrc

EDIT : Problem with the method, The used keyboad layout after the boot is the layout from /etc/keymap but the layout chosen for X11 could be a variant.

EDIT2:
Just add

Code: Select all

setxkbmap

line387

Caramel
Posts: 483
Joined: Sun Oct 02, 2022 6:25 pm
Location: France
Has thanked: 101 times
Been thanked: 81 times

Custom shortcut JWM - solution

Post by Caramel »

Useless if you use a us keyboard layout or if you don't create custom shortcuts in JWM with problematic keys (keys that are placed differently from the us layout like a,z,q,w,m... in the azerty layout)

- Edit /root/.xinitrc and add the command setxkbmap before the launch of JWM (Line 387 in Easy 6.1/6.1.1)

or

- Add a wrapper to the jwm executable. This is a pet with the wrapper and the executable jwm renamed jwm-real :
(Edit: pet removed)

The solution needs to be reapply after an upgrade (or the installation of a SFS in the main filsystem)

Caramel
Posts: 483
Joined: Sun Oct 02, 2022 6:25 pm
Location: France
Has thanked: 101 times
Been thanked: 81 times

Custom shortcut JWM -problem with the pet

Post by Caramel »

I removed the pet.
There is a problem with wmpoweroff that wants to kill jwm but with the pet jwm became jwm-real.

EDIT: If you have installed the pet, uninstall it with PKGget.

EDIT: to stop EasyOS if you have installed the bad pet, you can enter in a terminal

Code: Select all

kill -9 `pidof jwm-real`

EDIT2:
or
after uninstallation of the pet, you can enter

Code: Select all

jwm -exit 

to restart the "normal" jwm

EDIT3
New pet.
This time jwm is not renamed but moved to /usr/local/bin

jwm-startlayout-1.1.pet
(107.77 KiB) Downloaded 28 times
User avatar
BarryK
Posts: 2738
Joined: Tue Dec 24, 2019 1:04 pm
Has thanked: 135 times
Been thanked: 745 times

Re: Custom shortcut JWM not works without relaunch of JWM

Post by BarryK »

Caramel,
What does running "setxkbmap" without any parameters actually do?

The man page doesn't say what happens without any parameters:
https://linux.die.net/man/1/setxkbmap

EDIT:
I have inserted this at line 387 in /root/.xinitrc:

Code: Select all

#20240726 Caramel: ref: https://forum.puppylinux.com/viewtopic.php?t=12241
XkbModel="$(grep '#xkbmodel0' /etc/X11/xorg.conf.d/10-evdev-puppy.conf | cut -f 4 -d '"')"
XkbLayout="$(grep '#xkeymap0' /etc/X11/xorg.conf.d/10-evdev-puppy.conf | cut -f 4 -d '"')"
XkbVariant="$(grep '#xkbvariant0' /etc/X11/xorg.conf.d/10-evdev-puppy.conf | grep -v '#Option' | cut -f 4 -d '"')"
setxkbmap -model "${XkbModel}" -layout "${XkbLayout}" -variant "${XkbVariant}"
Caramel
Posts: 483
Joined: Sun Oct 02, 2022 6:25 pm
Location: France
Has thanked: 101 times
Been thanked: 81 times

Re: Custom shortcut JWM not works without relaunch of JWM

Post by Caramel »

BarryK wrote: Fri Jul 26, 2024 10:16 am

Caramel,
What does running "setxkbmap" without any parameters actually do?

The man page doesn't say what happens without any parameters:
https://linux.die.net/man/1/setxkbmap

Type setxkbmap -v or setxbbmap -v 10 provides an answer.

The keymap is build by applying rules from evdev (/etc/X11/xorg.d/10-evdev-puppy.conf)

User avatar
BarryK
Posts: 2738
Joined: Tue Dec 24, 2019 1:04 pm
Has thanked: 135 times
Been thanked: 745 times

Re: Custom shortcut JWM not works without relaunch of JWM

Post by BarryK »

Caramel wrote: Fri Jul 26, 2024 12:17 pm
BarryK wrote: Fri Jul 26, 2024 10:16 am

Caramel,
What does running "setxkbmap" without any parameters actually do?

The man page doesn't say what happens without any parameters:
https://linux.die.net/man/1/setxkbmap

Type setxkbmap -v or setxbbmap -v 10 provides an answer.

The keymap is build by applying rules from evdev (/etc/X11/xorg.d/10-evdev-puppy.conf)

OK. I will change to not have any parameters in .xinitrc

Post Reply

Return to “EasyOS”