You are not logged in.
Pages: 1
In Gnome I configured the Windows key to be a Compose key. E.g., you hit the Compose key, then a punctuation key, then the letter you want and, depending on which punctuation key you use you get the letter with any of hundreds of possible diacritics (assuming your font contains the combination). This works on any plain US English keyboard, without having to switch to a keyboard for another language It's a real timesaver for typing in languages other than English.
Although I had it configured and working fine in Gnome, it does not work in xfce. I have searched the forums and found nothing. Can someone please point me to the secret way to configure a Compose key in xfce?
Linguistics on Linux!
Offline
There are two ways: setxkbmap and xmodmap. See here.
Offline
There are two ways: setxkbmap and xmodmap. See here.
Thanks. I think I got part of it. I used setxkbmap -option compose:lwin to set it to the left win button. That worked.
But the instructions in the link said:
Add this command to your X startup in ~/.xinitrc, ~/.xsession, etc.
But I don't have either of those files. I haven't tried logging out and back in again, but I suspect that the setting will go away unless I place the command in one of the X startup files mentioned above.
Linguistics on Linux!
Offline
How do you run Xfce (startxfce, xinit, startx, desktop manager)?
Yes, you can create a .xinitrc file in your home directory and place the command there.
Offline
Or just add this command to the list of autostarted applications in the Xfce session settings.
Offline
Or just add this command to the list of autostarted applications in the Xfce session settings.
How do I do this, exactly? I found an application called Session and Startup, and it has a place to specify which applications to run at startup, but I don't see a startup script where I can enter this command.
Meantime, I have made an .initrc file and put the command in it. Later today I will log out and back in to see if it is working.
Linguistics on Linux!
Offline
... I have made an .initrc file and put the command in it. Later today I will log out and back in to see if it is working.
It didn't work. The file is .xinitrc and it is located in ~/. The contents are:
#this command sets the compose button to the left
#Windows button on login
setxkbmap -option compose:lwin
The command does work from the command line once I am logged in to XFCE.
Linguistics on Linux!
Offline
~/.xinitrc is used when you run Xorg through xinit or startx. And you must follow any command with a command that runs your window manager.
In other words it should be something like:
setxkbmap -option compose:lwin
# any other command here
/usr/bin/startxfce4
# any additional program (e.g. terminal emulator) here
If you don't run xinit or startx, then the file is not used.
Hence why I asked you how you run Xfce.
Last edited by ManOfSteel (2011-11-15 07:27:35)
Offline
~/.xinitrc is used when you run Xorg through xinit or startx. And you must follow any command with a command that runs your window manager.
In other words it should be something like:setxkbmap -option compose:lwin # any other command here /usr/bin/startxfce4 # any additional program (e.g. terminal emulator) here
If you don't run xinit or startx, then the file is not used.
Hence why I asked you how you run Xfce.
I run XFCE from the login screen. The login screen calls the script /usr/bin/startxfce4. The contents of the script are:
#!/bin/sh
<comments snipped>
if test "x$XDG_CONFIG_HOME" = "x"
then
BASEDIR="$HOME/.config/xfce4/"
else
BASEDIR="$XDG_CONFIG_HOME/xfce4"
fi
if test "x$XDG_DATA_DIRS" = "x"
then
XDG_DATA_DIRS="/usr/local/share:/usr/share:/usr/share"
else
XDG_DATA_DIRS="$XDG_DATA_DIRS:/usr/share"
fi
export XDG_DATA_DIRS
if test "x$DISPLAY" = "x"
then
echo "$0: Starting X server"
prog=xinit
else
echo "$0: X server already running on display $DISPLAY"
prog=/bin/sh
fi
if test ! "x$*" = "x"
then
OPT=$*
if test "x${OPT#*--}" = "x${OPT}"
then
CLIENTRC=${OPT}
else
SERVERRC=${OPT#*-- }
CLIENTRC=${OPT% --*}
fi
fi
if [ -f "$HOME/.xserverrc" ]; then
SERVERRC="$HOME/.xserverrc $SERVERRC"
elif [ -f /etc/X11/xinit/xserverrc ]; then
SERVERRC="/etc/X11/xinit/xserverrc $SERVERRC"
fi
if test ! "x$SERVERRC" = "x"
then
SERVERRC="-- $SERVERRC"
fi
if [ -f $BASEDIR/xinitrc ]; then
exec $prog $BASEDIR/xinitrc $CLIENTRC $SERVERRC
elif [ -f $HOME/.xfce4/xinitrc ]; then
mkdir -p $BASEDIR
cp $HOME/.xfce4/xinitrc $BASEDIR/
exec $prog $BASEDIR/xinitrc $CLIENTRC $SERVERRC
else
exec $prog /etc/xdg/xfce4/xinitrc $CLIENTRC $SERVERRC
fi
I don't know much about scripts, so I don't know exactly how the script works or where to put the command.
Linguistics on Linux!
Offline
I run XFCE from the login screen. The login screen calls the script /usr/bin/startxfce4.
Different distributions use different login managers. Since you're talking about GNOME in your first post, I guess you're using GDM. You might want to check the documentation of GDM for how to run additional commands (if that's even possible).
If you insist on modifying the startup script, then you can add the command after the comments, before the first if statement.
Offline
If you insist on modifying the startup script, then you can add the command after the comments, before the first if statement.
Google turned up some documentation for GDM, but I couldn't find anything specific about how to do it. Apparently there are several scripts, and it appeared that the init script might be appropriate. But rather than do that I just followed your instructions above, putting it just before the first if statement. Then I logged out and back in again, and here I am with it working: á, ü, ñ, etc.
Thanks for your help and patience!
Linguistics on Linux!
Offline
Session and Startup -> Application Autostart then Add and just paste the command in the "Command" field, give a name and here you go.
Offline
Session and Startup -> Application Autostart then Add and just paste the command in the "Command" field, give a name and here you go.
Too bad I didn't see the Add button when you first suggested this. I just went to the Session and Startup > Application Autostart, didn't see anything that looked like a terminal, and decided it wouldn't work.
It might have been easier than adding the command to the startfxce4 script. Oh well. Noted here for archiving another way to solve the problem for the next user who needs a Compose key.
Linguistics on Linux!
Offline
Thank You!!!
I pasted
setxkbmap -option compose:lwin
into a new startup application entry [+Add ] in
Session and Startup -> Application Autostart
Thanks!! I am tall only because I stand on the backs of giants!
-Tom!!
Offline
Well, I had it working fine for a couple of years on my old laptop, but now I have a new one and it is broken. The new laptop is a System76 Bonobo Extreme, acquired December, 2013 and on which I immediately installed Xubuntu 13.10, currently up to date. The keyboard is US English.
I went into Settings Manager, Keyboard, selected the Layout tab, and set the compose key to Left Win (which pysically has an Ubuntu logo on it, since System76 is a Linux laptop seller). The compose key works, but erratically. Sometimes I have to try several times before it will give me the letter with the diacritic. The erratic behavior happens in all applications, and after logging out and back in and even restarting. I have spent over a month trying to figure out what is wrong, but I am stumped. I have also tried setting it to a key other than Left Win, but the problem remains. (At least this proves that it is not a physically defective key.)
I also tried "setxkbmap -option compose:lwin" from the command line but, although the command executed without error, it made no difference.
The maddening part is that it is erratic. Things should either work or not work. I need suggestions. Even if you don't have the right answer, your suggestion might prompt me or someone else to think of something.
Linguistics on Linux!
Offline
I discovered that the erratic behavior of the compose key was related to the key repeat function. The compose key worked perfectly after I disabled key repeat.
However, I recently had to do a fresh install of Xubuntu 14.04.1 and now the compose key is broken again. Even with the repeat key set to off and even after running setxkbmap -option compose:lwin from the command line as well as putting the command in the startup options. I mean that now it doesn't work at all, not even once in a while.
I need some clues.
Linguistics on Linux!
Offline
I have similar problem - I want to have level3 on both alt keys while typing in Polish, I found 2 solutions:
PolishChar.desktop
[Desktop Entry]
Version=1.0
Type=Application
Name=Polish fonts
Comment=
Exec=setxkbmap -option lv3:alt_switch
Icon=accessories-character-map
Path=
Terminal=false
StartupNotify=true
GenericName=
which can be placed in /home/myuser/.local/share/applications/
it will place an icon accessories-character-map in menu to activate an option on the keyboard
or
it is possible to activate it permanently adding
XKBOPTIONS="lv3:alt_switch"
in /etc/default/keyboard
you might edit it as root to change your option...
Be careful, make backup before...
I hope it will help.
Offline
Applications Menu -> Settings -> Keyboard
select "Layout" tab.
Un-tick "Use system defaults" to un-grey the options below it.
One of the options is "Compose key" which has a drop-down box to choose which key you want eg left win
Offline
Pages: 1
[ Generated in 0.013 seconds, 8 queries executed - Memory usage: 610.09 KiB (Peak: 626.94 KiB) ]