WelcomeWelcome | FAQFAQ | DownloadsDownloads | WikiWiki

Author Topic: xorg restart - setxkbmap dont work  (Read 4082 times)

Offline rado

  • Newbie
  • *
  • Posts: 7
xorg restart - setxkbmap dont work
« on: June 19, 2013, 11:45:40 AM »
Hi all, I didn't find this question through search, so sorry if I double post.

My question is - where does Xorg get settings for keyboard from? We are making kiosk-like system at our school and have an extension, which sets keyboard layout and srvrkeys:none using setxkbmap and then starts Firefox (no window manager) in infinite cycle. When FF is closed, the setxkbmap should set those keyboard settings again but I can switch VT (which should be disabled by srvrkeys:none) and if query setxkbmap I get some (perhaps default) settings like pc105 layout and no srvrkeys:none option.

I tried put setxkbmap before firefox after it, outside while cycle, but none works. It seems as there are some default settings which are applied after my setxkbmap, but I dont know where.

We now ended with killing and then starting Xorg (without while cycle so the script exits and is started again by Xorg). This works, but makes another problem - when FF is restarted, color of some pixels of windows text (on tabs, address bar, etc.) and images is (i think) inverted.

Thanks a lot for help, if you need more info just say.

Offline rado

  • Newbie
  • *
  • Posts: 7
Re: xorg restart - setxkbmap dont work
« Reply #1 on: June 21, 2013, 10:08:15 AM »
Hi, I found solution for my problem with inverted pixels, but not for the question. The problem was with killing Xorg not terming it, so new start of X created bad looking pixels in text and image, but I cant explain it more deeply. But then I needed add loop after terminating X (while it isn't completely terminated) otherwise it stoped at waitforX (which is executed in .xsession and, as I anderstood from source code I found, waits until Xorg can use display).

Maybe it helps somebody.

But still if somebody can explain me my original question I would be helpful. If I am not clear feel free to ask.

Offline theYinYeti

  • Full Member
  • ***
  • Posts: 177
    • YetI web site
Re: xorg restart - setxkbmap dont work
« Reply #2 on: June 21, 2013, 10:55:01 AM »
Hi rado. I don’t know if this will help, but I use setxkbmap too, and I don’t have any problem with it. I don’t know where you put your command. I wrote it in a file named “/home/tc/.X.d/X_kbd”, the contents of which follows:
Code: [Select]
#!/bin/sh

setxkbmap -layout "fr, fr(bepo), us" -option "grp:sclk_toggle, grp_led:scroll, keypad:oss, kpdl:comma, compose:paus, nbsp:level2, terminate:ctrl_alt_bksp"
As you see, I don’t use the same options as you do, but I use quite a lot, and they do work. And I checked in Xkb’s file /usr/local/share/X11/xkb/rules/base.lst: your option is known to this version of XOrg. So it should work, if you launch setxkbmap from inside “~/.X.d/” in an executable file.

Oh, and I remember something else. I once had this problem where X_kbd was not executed. That was because I made the mistake of writing “exec …something…” in one of the scripts inside “~/.X.d/” that gets executed before X_kbd. I removed the “exec” and all was fine.

Offline rado

  • Newbie
  • *
  • Posts: 7
Re: xorg restart - setxkbmap dont work
« Reply #3 on: June 25, 2013, 06:12:09 AM »
Hi tYY, thanks for reply. For now it works, but I save your suggestions for future use. My setup is an tcz extension which contains tce.installed directory with small script which adds name of other script (autofirefox) to /etc/sysconfig/desktop.  Autofirefox contains setxkbmap command. This was written by my colleague and I didn't made deeper investigation, but I think that when X starts this autofirefox script (or whatever is in /etc/sysconfig/desktop) is run.

I think I don't understand that thing with exec something, could you explain it a bit more?

Thanks in advance.

Offline theYinYeti

  • Full Member
  • ***
  • Posts: 177
    • YetI web site
Re: xorg restart - setxkbmap dont work
« Reply #4 on: June 25, 2013, 06:17:27 AM »
“exec” is a shell command that says (in this context) that the remainder of the line is a command that should be starting and replace the current process. If the current process runs a loop over the files in ~/.X.d, then as soon as an “exec” is run, this means the end of the loop ;-)

Offline rado

  • Newbie
  • *
  • Posts: 7
Re: xorg restart - setxkbmap dont work
« Reply #5 on: July 11, 2013, 05:27:09 AM »
Sorry, lot of work, thanks for clarification, now I understand.