Fedora 13 Lxde (pcman 0.9.7)
My system language is set to English, and the keyboard layout is set to Japanese (the notebook is Japanese).
1. I need to have a Swiss-French keyboard layout (to write in French).
2. I have installed the panel applet keyboard switcher.
3. I looked at this link http://www.xfree86.org/current/XKB-Config2.html, but I don't know exactly how and what to edit. to keep Japanese keyboard layout as default and add Swiss-French layout.
Can you help? Thank you.
Need help setting new keyboard layout Swiss-French
Re: Need help setting new keyboard layout Swiss-French
just execute the command
setxkbmap -layout "jp,ch(fr)" -option "grp:alt_shift_toggle"
In older versions (the one presented in Lubuntu 10.04) this used to crash the keyboard layout indicator applet, so you would need to execute it before starting the applet. In the version presented in Lubuntu 10.10 it is fixed.
If you need this permanently just add it to a file which is being sourced during login (e.g. ~/.profile).
Hope this helps
setxkbmap -layout "jp,ch(fr)" -option "grp:alt_shift_toggle"
In older versions (the one presented in Lubuntu 10.04) this used to crash the keyboard layout indicator applet, so you would need to execute it before starting the applet. In the version presented in Lubuntu 10.10 it is fixed.
If you need this permanently just add it to a file which is being sourced during login (e.g. ~/.profile).
Hope this helps
Re: Need help setting new keyboard layout Swiss-French
lyovushka, thank you very much. Fortunately, the command does not crash the panel applet (Fedora 13 LXDE Spin, here). Forgive me for answering late. I haven't been notified by email, or I did not see it (I will check my board settings, anyway).
Kind regards,
nomnex
I don't have a ~/.profile file in my /home dir. Do I create a text file named ~/.profile and past the single line 'command' you gave me, or do I past it into ~.bash_profile?If you need this permanently just add it to a file which is being sourced during login (e.g. ~/.profile).
Kind regards,
nomnex
-
- Posts: 381
- Joined: Mon Mar 23, 2009 5:14 am
Re: Need help setting new keyboard layout Swiss-French
If you are on Linux and run bash as your shell, you would normally put initialization in .bashrc and have .bash_profile source .bashrc
"man bash" and read the section INVOCATION for how the profile files work
The easiest way to get something to run once when you log in is to add it to /etc/xdg/lxsession/LXDE/autostart
"man bash" and read the section INVOCATION for how the profile files work
The easiest way to get something to run once when you log in is to add it to /etc/xdg/lxsession/LXDE/autostart
Re: Need help setting new keyboard layout Swiss-French
hi, Marty, I have read the man page and this link http://freeunix.dyndns.org:8088/site2/howto/Bash.shtml
I copied the command in the 'bash_profile' file. I works when I log-in. I use bash as default shell. I am not clear with the definitions 'sub-shell', 'log-in shell', 'non-interactive shell', 'initialization' and 'source'. If you can explain in easy to understand terms, I am all ears.
EDIT: I think I understood, re-reading the article, and your answer (see below).
> If you are on Linux and run bash as your shell, you would normally put initialization in .bashrc and have .bash_profile source .bashrc
initialization = (means) to type my command in the .barshrc file.
.bash_profile source .bashrc = (means) to type '.bashrc' in the '.bash_profile' file.
doing so will run my command, no matter the shell I log-in. Currently my command (in .barsh_profile) will run when I log-in, but not if I enter a sub-shell (TTY 1 to 6 console)
I am I correct?
> The easiest way to get something to run once when you log in is to add it to /etc/xdg/lxsession/LXDE/autostart
This confuses me a bit. Do you explain a different option of running the command (e.g. create a text file 'commands' and copy it in /etc/xdg/lxsession/LXDE/autostart). Or is it about copying my barshrc or/and bashrc_profile to this location?
I copied the command in the 'bash_profile' file. I works when I log-in. I use bash as default shell. I am not clear with the definitions 'sub-shell', 'log-in shell', 'non-interactive shell', 'initialization' and 'source'. If you can explain in easy to understand terms, I am all ears.
EDIT: I think I understood, re-reading the article, and your answer (see below).
> If you are on Linux and run bash as your shell, you would normally put initialization in .bashrc and have .bash_profile source .bashrc
initialization = (means) to type my command in the .barshrc file.
.bash_profile source .bashrc = (means) to type '.bashrc' in the '.bash_profile' file.
doing so will run my command, no matter the shell I log-in. Currently my command (in .barsh_profile) will run when I log-in, but not if I enter a sub-shell (TTY 1 to 6 console)
I am I correct?
> The easiest way to get something to run once when you log in is to add it to /etc/xdg/lxsession/LXDE/autostart
This confuses me a bit. Do you explain a different option of running the command (e.g. create a text file 'commands' and copy it in /etc/xdg/lxsession/LXDE/autostart). Or is it about copying my barshrc or/and bashrc_profile to this location?
-
- Posts: 381
- Joined: Mon Mar 23, 2009 5:14 am
Re: Need help setting new keyboard layout Swiss-French
It's a second method. You would append just the extra command lines you want to run to the existing contents. If you aren't completely sure what you are doing with the autostart file, and you have it working, we have a saying in English "leave well enough alone."
Re: Need help setting new keyboard layout Swiss-French
I am always glad to learn something newMarty Jack wrote:It's a second method. You would append just the extra command lines you want to run to the existing contents.

a. setxkbmap -layout "jp,ch(fr)" -option "grp:alt_shift_toggle"
or
b. @setxkbmap -layout "jp,ch(fr)" -option "grp:alt_shift_toggle"
-
- Posts: 381
- Joined: Mon Mar 23, 2009 5:14 am
Re: Need help setting new keyboard layout Swiss-French
The '@' indicates that lxsession should restart the command if it crashes. In this case you do not need the '@'.
Re: Need help setting new keyboard layout Swiss-French
Boot sequence is a bit messy in Linux and varies among distributions. If you have find some way of getting commands executed just stick with it 

Re: Need help setting new keyboard layout Swiss-French
I have a new annoyance with this command:
some applications use 'Alt+Shift' as shortcut for some their functions (e.g. gnumeric for a line break, or Anki to change the model template).
how can I modify the alt_shift_toggle part? I have tried ctrl_shift_toggle without success. Thank you.
Code: Select all
setxkbmap -layout "jp,ch(fr)" -option "grp:alt_shift_toggle"
how can I modify the alt_shift_toggle part? I have tried ctrl_shift_toggle without success. Thank you.