Page 1 of 1

Custom shortcut JWM not works without relaunch of JWM

Posted: Tue Jul 23, 2024 8:44 am
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)


Re: Custom shortcut JWM not works without relaunch of JWM

Posted: Tue Jul 23, 2024 12:52 pm
by rockedge

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


Re: Custom shortcut JWM not works without relaunch of JWM

Posted: Tue Jul 23, 2024 1:29 pm
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 :-)


Re: Custom shortcut JWM not works without relaunch of JWM

Posted: Tue Jul 23, 2024 1:32 pm
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.


Re: Custom shortcut JWM not works without relaunch of JWM

Posted: Tue Jul 23, 2024 1:45 pm
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.


Re: Custom shortcut JWM not works without relaunch of JWM

Posted: Tue Jul 23, 2024 2:23 pm
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.


Re: Custom shortcut JWM not works without relaunch of JWM

Posted: Tue Jul 23, 2024 2:30 pm
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


Custom shortcut JWM - new test

Posted: Tue Jul 23, 2024 3:04 pm
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.


Custom shortcut JWM not works - assumption

Posted: Tue Jul 23, 2024 3:20 pm
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


Re: Custom shortcut JWM not works without relaunch of JWM

Posted: Tue Jul 23, 2024 4:03 pm
by BarryK

Re: Custom shortcut JWM not works without relaunch of JWM

Posted: Tue Jul 23, 2024 6:00 pm
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)


Re: Custom shortcut JWM not works without relaunch of JWM

Posted: Tue Jul 23, 2024 6:24 pm
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


Re: Custom shortcut JWM not works without relaunch of JWM

Posted: Tue Jul 23, 2024 6:51 pm
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.


Re: Custom shortcut JWM not works without relaunch of JWM

Posted: Tue Jul 23, 2024 7:31 pm
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


Custom shortcut JWM - solution

Posted: Wed Jul 24, 2024 6:08 am
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)


Custom shortcut JWM -problem with the pet

Posted: Wed Jul 24, 2024 9:40 am
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

Re: Custom shortcut JWM not works without relaunch of JWM

Posted: Fri Jul 26, 2024 10:16 am
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}"

Re: Custom shortcut JWM not works without relaunch of JWM

Posted: Fri Jul 26, 2024 12:17 pm
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)


Re: Custom shortcut JWM not works without relaunch of JWM

Posted: Fri Jul 26, 2024 2:38 pm
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