Linux - DesktopThis forum is for the discussion of all Linux Software used in a desktop context.
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
I am running Arch Gnome with a US keyboard. I am trying to modify keys. The goal is to ideally have the ‘sterling’ sign on CTL+4 and the degrees sign “°” on another key so I can write 20°C etc.
I have looked at xmodmap but this does not seem to be flexible enough. That has brought me to
Code:
/usr/share/X11/xkb/symbols/us
. My keyboard layout is US Basic. I have tried modifying the line
Code:
key <AE03> { [ 3, numbersign ] };
by adding key
Code:
<AE03> { [ 3, numbersign, sterling ] }
That doesn't work. I have tried switching to US Intl but the dead key R-Alt does not work I take it my keyboard is not generating the AltGR scan code.
That is as far as I have got can anyone help?
Good ... morning (it appears to be 2 minutes past midnight in central Europe, oops.)
Quote:
Originally Posted by Bob Fletcher
I have looked at xmodmap but this does not seem to be flexible enough.
PSE elaborate.
So far you talk about adding two symbols, but I do not understand where xmodmap does not allow you to do it.
Here is my own xmodmap file in use and it is commented to be self-documenting:
Code:
! Ω and @
keycode 24 = q Q q Q at Greek_OMEGA at
! ś and Ś
keycode 32 = o O o O oe OE oe
! λ and Λ (greek_lambda)
keycode 46 = l L l L U03BB U039B U03BB
! δ and Δ (greek_delta)
keycode 40 = d D d D U03B4 U0394 U03B4
! ω (greek_omega)
keycode 25 = w W w W U03C9
! ✅ and ✔
keycode 44 = j J j J U2705 U2714
I found these changes swift and easy. Works like a charm...
Thank you so much Michael. I copied you code to .Xmodmap and it was loaded using xmodmap -pke. Still not working. Silly me. I had loaded the US Basic keymap that lacks the dead keys and AltGr. Loaded the US International with dead keys and all is working well now. I only used xmodmap a few years ago to swap the caps lock to shift on a UK keyboard. Spend most of my life in Australia but in the UK now and I just hate that UK keyboard layout.
Thanks again and have a good day.
1. AltGr may need to be added to the basic US layout, by either using the desktop's keyboard configuration tool or by adding
Code:
include "level3(ralt_switch)"
to the driver.
2. If the Compose key is enabled, using the desktop's tool (the Windows MENU key is a convenient location), you have
degree from Compose o o
sterling from Compose - L
1. AltGr may need to be added to the basic US layout, by either using the desktop's keyboard configuration tool or by adding
Code:
include "level3(ralt_switch)"
to the driver.
2. If the Compose key is enabled, using the desktop's tool (the Windows MENU key is a convenient location), you have
degree from Compose o o
sterling from Compose - L
Thank you. Choosing the US International layout made it all work I just did some modification to the Xmodmap to suit my requirements.
Thanks...
I’m back again. I cannot get ~/.Xmodmap to auto load at startup, well not quite true I have added xmodmap ~/.Xmodmap to a script I run at startup to load a network drive, but that is not the way, even if it does work. Going back to the days when I was running LM I just put the file in my home directory.
From all the reading and playing around it seems to be dependant on the DE and the DM as well as the distro. Most people seem to say that it should be added to ~/.xinitrc but that will only work when using startx.
My DM is GDM and that loads Gnome 3.24.2. So how to make it load the xmodmap file either for user or globally?
Thanks for your reply. I have spent some time with the Arch Wiki but that does not address this issue. Looking at the second link I did try a ~/.xsession but that does not work.
What I am hoping is for someone who is currently loading the ~/Xmodmap in a similar setup to mine.
As I am running Fluxbox, I put the call to xmodmap in the startup script to the Window-Manager. This does not seem too illogical. Other Window-Managers and desktop-environments should provide similar mechanisms. But I know nothing about that.
As I am running Fluxbox, I put the call to xmodmap in the startup script to the Window-Manager. This does not seem too illogical. Other Window-Managers and desktop-environments should provide similar mechanisms. But I know nothing about that.
It seems some changes have been made over the years. in my case it may also be GDM. I have trouble with LightDM. There seems to be so many answers to this looking around. Perhaps doing as I am doing now and putting it in a network drive startup script it does work but it seems all wrong to me. What I would like is to put .Xmodmap in my home directory and it be automatically detected. Apparently it will do this in OpenSUSE. A good tutorial is needed I think.
It seems some changes have been made over the years. in my case it may also be GDM. I have trouble with LightDM. There seems to be so many answers to this looking around. Perhaps doing as I am doing now and putting it in a network drive startup script it does work but it seems all wrong to me. What I would like is to put .Xmodmap in my home directory and it be automatically detected. Apparently it will do this in OpenSUSE. A good tutorial is needed I think.
This reads all more complicated than my experience wants me to believe.
Many things are fortunately not standardized and will hopefully never be. On the other hand, there may be Linux-distributions which always seem to divert from the customs which evolve over the time. But all the same, calling xmodmap on a file of keycode expressions is simple and unspectacular.
Find a location that suits your Desktop-environment, wherever that may be. Do not try to identify a “Best Ever” or a convention. If the bible and the Qur'an do not talk about it, I bet the Talmud won't either.
You're the boss.
Last edited by Michael Uplawski; 09-01-2017 at 11:21 PM.
Reason: Tie Poo
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.