-
-
Save dreua/2520359142a9cc4dd486321d84156422 to your computer and use it in GitHub Desktop.
| # Save this file as /usr/share/X11/xkb/symbols/asdfbrackets | |
| # Thanks to: BRPocock's answer at | |
| # https://ask.fedoraproject.org/en/question/73014/how-to-assign-ctrl-up-to-home-ctrl-down-to-end-ctrl-left-to-page-up-and-ctrl-right-to-page-down/?answer=73021#post-id-73021 | |
| partial alphanumeric_keys | |
| xkb_symbols "asdfbrackets" { | |
| name[Group1]="brackets on AltGr+asdf"; | |
| key <AC01> { [ a, A, braceleft, AE ] }; | |
| key <AC02> { [ s, S, bracketleft, U1E9E ] }; | |
| key <AC03> { [ d, D, bracketright, ETH ] }; | |
| key <AC04> { [ f, F, braceright, ordfeminine ] }; | |
| }; | |
| # Usage: | |
| # Run as user: | |
| # setxkbmap -v | |
| # Append +asdfbrackets to symbols, for example: | |
| # setxkbmap -v -symbols 'pc+de+us:2+inet(evdev)+asdfbrackets' | |
| # For simplicity and because I am starting bash by default, I just added this to my .bashrc: | |
| # setxkbmap -v -symbols 'pc+de+us:2+inet(evdev)+asdfbrackets' > /dev/null | |
| # However, there is a better solution given in the linke above. |
sudo git diff HEAD~1
diff --git a/de b/de
index b3c7ee6..e3ed004 100644
--- a/de
+++ b/de
@@ -65,6 +65,15 @@ xkb_symbols "nodeadkeys" {
key <AC10> { [ odiaeresis, Odiaeresis, doubleacute, doubleacute ] };
key <AC11> { [ adiaeresis, Adiaeresis, asciicircum, asciicircum ] };
key <BKSL> { [ numbersign, apostrophe, rightsinglequotemark, grave ] };
+
+ //// CUSTOMIZATION for my personal use - make AltGr+ASDF become {[]}
+
+ key <AC01> { [ a, A, braceleft, AE ] };
+ key <AC02> { [ s, S, bracketleft, U1E9E ] };
+ key <AC03> { [ d, D, bracketright, ETH ] };
+ key <AC04> { [ f, F, braceright, ordfeminine ] };
+
+ //// END CUSTOMIZATION
};
After changing the keymap there is no need to logout, just run setxkbmap without arguments should work 🎉
To get back to my layout after some other setxkbmap command messed it up: setxkbmap de -variant nodeadkeys
Put it in its own file "de_asdfbrackets":
// setxkbmap de_asdfbrackets
default
partial alphanumeric_keys
xkb_symbols "asdfbrackets" {
include "de(nodeadkeys)"
name[Group1]="German (Altgr+ASDF becomes {[]})";
key <AC01> { [ a, A, braceleft, AE ] };
key <AC02> { [ s, S, bracketleft, U1E9E ] };
key <AC03> { [ d, D, bracketright, ETH ] };
key <AC04> { [ f, F, braceright, ordfeminine ] };
};
Note the include here, that makes it easier to set it with setxkbmap.
Let's see how that goes.
Much better: put it in a file "custom" this is already pre configured to be selectable in gnome
For some reason, upgrading to F43 cleared that file :(
Recreate it with the contents from two posts above, path: sudo vim /usr/share/X11/xkb/symbols/custom
It was not deleted, I just didn't see it in the xkb.rpmmoved directory. Should be a one time issue, but placing the file in a user directory might be beneficial in general.
Details: https://bugzilla.redhat.com/show_bug.cgi?id=2407061
Update - Nowadays I use this as follows:
deat the end of sectionxkb_symbols "nodeadkeys". For programmers I'd recommend the nodeadkeys-layout combined with a compose key, if you need anything like á just type: Compose (e.g. Scroll Lock), ´, a. The ``` as commonly used in markdown becomes much quicker to type. And this enables you to type stuff like ë or ♯♪ as well.