You are not logged in.

#1 2016-09-02 16:07:35

YanDoroshenko
Member
Registered: 2016-09-02
Posts: 12

[SOLVED] Openbox + xmodmap

Hey,
I have a problem with keyboard settings. I am trying to make right Meta key (rwin) to act as a Hyper key (menu). It worked OK with xmodmap (xmodmap -e "keycode 134 = Menu"), but since I switched to Openbox, xmodmap is no option anymore - Openbox overwrites its configs.
So I want to try the same thing with setxkbmap, but after reading through manual, countless forum topics and searching through a bunch of config files I still have no idea how. Any help will be appreciated.
Thanks.

Last edited by YanDoroshenko (2016-09-03 15:36:00)

Offline

#2 2016-09-02 19:23:10

Markus00000
Member
Registered: 2011-03-27
Posts: 323

Re: [SOLVED] Openbox + xmodmap

Offline

#3 2016-09-02 20:44:32

YanDoroshenko
Member
Registered: 2016-09-02
Posts: 12

Re: [SOLVED] Openbox + xmodmap

Markus00000 wrote:

Have you tried this?

Yes, I have tried that. It does not work, unfortunately. For some reason Openbox seems to be overriding all the xmodmap settings some time during or shortly after the startup.

Last edited by YanDoroshenko (2016-09-02 21:10:24)

Offline

#4 2016-09-02 20:45:27

Head_on_a_Stick
Member
From: The Wirral
Registered: 2014-02-20
Posts: 8,288
Website

Re: [SOLVED] Openbox + xmodmap

YanDoroshenko wrote:

It worked OK with xmodmap (xmodmap -e "keycode 134 = Menu"), but since I switched to openbox, xmodmap is no option anymore - openbox overwrites its configs.

How are you starting Openbox?

The solution linked by @Markus00000 will only work if `exec openbox-session` is used rather than just `exec openbox` (if started via ~/.xinitrc).

EDIT: You should probably add "openbox" to the thread title.

Last edited by Head_on_a_Stick (2016-09-02 20:46:10)


Para todos todo, para nosotros nada

Offline

#5 2016-09-02 20:49:57

YanDoroshenko
Member
Registered: 2016-09-02
Posts: 12

Re: [SOLVED] Openbox + xmodmap

Head_on_a_Stick wrote:

How are you starting Openbox?

I'm starting it with SDDM.

Head_on_a_Stick wrote:

EDIT: You should probably add "openbox" to the thread title.

Yes, you're right, I should do that, but I don't know how (to edit the topic title). I'm a bit new here on the forum. Sorry for being a dumb ass.

Offline

#6 2016-09-02 20:58:17

Head_on_a_Stick
Member
From: The Wirral
Registered: 2014-02-20
Posts: 8,288
Website

Re: [SOLVED] Openbox + xmodmap

YanDoroshenko wrote:

I'm starting it with SDDM.

Try adding your xmodmap command to ~/.config/openbox/autostart -- copy the file from /etc/xdg/openbox/autostart if you don't already have it.

I don't know how (to edit the topic title)

Click on the "Edit" button on your first post in this thread to edit the title.


Para todos todo, para nosotros nada

Offline

#7 2016-09-02 21:04:46

YanDoroshenko
Member
Registered: 2016-09-02
Posts: 12

Re: [SOLVED] Openbox + xmodmap

Head_on_a_Stick wrote:

Try adding your xmodmap command

Not working. Tried xmodmap -e 'keycode 134 = Menu' and xmodmap ~/.Xmodmap. Neither works.

Head_on_a_Stick wrote:

Click on the "Edit" button on your first post in this thread to edit the title.

Done, thanks.

Offline

#8 2016-09-02 21:11:50

Head_on_a_Stick
Member
From: The Wirral
Registered: 2014-02-20
Posts: 8,288
Website

Re: [SOLVED] Openbox + xmodmap

YanDoroshenko wrote:

Not working. Tried xmodmap -e 'keycode 134 = Menu' and xmodmap ~/.Xmodmap. Neither works.

Does that first command work when run from a shell?

Please post the full content of ~/.config/openbox/autostart

We use that file in BunsenLabs under LightDM and `xmodmap` works just fine:
https://github.com/BunsenLabs/bunsen-co … ostart#L35

You should also check SDDM and make sure that "openbox-session" is selected rather than just "openbox".


Para todos todo, para nosotros nada

Offline

#9 2016-09-02 21:20:15

YanDoroshenko
Member
Registered: 2016-09-02
Posts: 12

Re: [SOLVED] Openbox + xmodmap

Head_on_a_Stick wrote:

Does that first command work when run from a shell?

Yes, it does work from a shell.

Head_on_a_Stick wrote:

Please post the full content of ~/.config/openbox/autostart

lxpanel &
xfce4-clipman &
plank &
xcompmgr &
nitrogen --restore &
xmodmap -e "keycode 134 = Menu"
Head_on_a_Stick wrote:

You should also check SDDM and make sure that "openbox-session" is selected rather than just "openbox".

SDDM looks for sessions in /usr/share/xsessions and the openbox.desktop file references the /usr/bin/openbox-session which seems fine to me.

Last edited by YanDoroshenko (2016-09-03 06:51:58)

Offline

#10 2016-09-02 21:23:40

Head_on_a_Stick
Member
From: The Wirral
Registered: 2014-02-20
Posts: 8,288
Website

Re: [SOLVED] Openbox + xmodmap

Is the menu or rwin key defined in ~/.config/openbox/rc.xml?

If so, try commenting out the relevant stanza.


Para todos todo, para nosotros nada

Offline

#11 2016-09-02 21:33:48

YanDoroshenko
Member
Registered: 2016-09-02
Posts: 12

Re: [SOLVED] Openbox + xmodmap

Head_on_a_Stick wrote:

Is the menu or rwin key defined

Neither of them was defined but I tried commenting out the whole <keyboard> block. Did not help.

Offline

#12 2016-09-02 21:37:48

Head_on_a_Stick
Member
From: The Wirral
Registered: 2014-02-20
Posts: 8,288
Website

Re: [SOLVED] Openbox + xmodmap

We could eliminate SDDM temporarily:

# systemctl isolate multi-user.target

Then start the desktop with:

startx /usr/bin/openbox-session

To restart SDDM, use:

# systemctl isolate graphical.target

Para todos todo, para nosotros nada

Offline

#13 2016-09-02 21:55:13

YanDoroshenko
Member
Registered: 2016-09-02
Posts: 12

Re: [SOLVED] Openbox + xmodmap

OK, progress.
I've made an xterm  with an xmodmap command pop up once Openbox starts. An xterm launches fine, does its stuff and closes. And AFTER that the keyboard config is being altered. Like Openbox runs something (which looks like parameterless setxkbmap that wipes all the xmodmap settings) after the autostart script is done.

Last edited by YanDoroshenko (2016-09-02 22:07:34)

Offline

#14 2016-09-03 06:51:07

YanDoroshenko
Member
Registered: 2016-09-02
Posts: 12

Re: [SOLVED] Openbox + xmodmap

So, the workaround has been found.

sleep 15 && xmodmap -e "keycode 134 = Menu" &

in the autostart file seems to work fine.

Offline

#15 2016-09-03 09:16:03

YanDoroshenko
Member
Registered: 2016-09-02
Posts: 12

Re: [SOLVED] Openbox + xmodmap

UPD: it does work fine. The problem is that damn Openbox resets it after some time. Try to get rid of everything keyboard related and then just install what I need.

Offline

#16 2016-09-03 15:35:45

YanDoroshenko
Member
Registered: 2016-09-02
Posts: 12

Re: [SOLVED] Openbox + xmodmap

Solved. Went to /usr/share/X11/xkb/keycodes/evdev and swapped 134 and 135. Yes, I know that it's a big no-no but I don't care.

Offline

#17 2016-09-05 18:11:48

Head_on_a_Stick
Member
From: The Wirral
Registered: 2014-02-20
Posts: 8,288
Website

Re: [SOLVED] Openbox + xmodmap

If you want to dig any further, I would recommend removing the layers of abstraction in your system.

First, try stopping the display manager using the technique outlined in https://bbs.archlinux.org/viewtopic.php … 2#p1651662

If the problem still occurs then you could try bypassing the openbox-session script by creating ~/.xinitrc and calling the window manager with:

exec openbox

If this fixes it then the problem may lie in your XDG autostarted programs, check /etc/xdg/autostart & ~/.config/autostart for any .desktop files.


Para todos todo, para nosotros nada

Offline

Board footer

Powered by FluxBB