]> git.madduck.net Git - etc/xsession.git/commitdiff

madduck's git repository

Every one of the projects in this repository is available at the canonical URL git://git.madduck.net/madduck/pub/<projectpath> — see each project's metadata for the exact URL.

All patches and comments are welcome. Please squash your changes to logical commits before using git-format-patch and git-send-email to patches@git.madduck.net. If you'd read over the Git project's submission guidelines and adhered to them, I'd be especially grateful.

SSH access, as well as push access can be individually arranged.

If you use my repositories frequently, consider adding the following snippet to ~/.gitconfig and using the third clone URL listed for each project:

[url "git://git.madduck.net/madduck/"]
  insteadOf = madduck:

Merge branch 'master' of ssh://git.madduck.net/~/git/pub/etc/xsession into xkb
authormartin f. krafft <madduck@madduck.net>
Sat, 5 Sep 2009 10:31:59 +0000 (12:31 +0200)
committermartin f. krafft <madduck@madduck.net>
Sat, 5 Sep 2009 10:31:59 +0000 (12:31 +0200)
Conflicts:
.xmodmap

.xkb/keymap/default [new file with mode: 0644]
.xkb/keymap/lapse.rw.madduck.net [new file with mode: 0644]
.xkb/symbols/madduck [new file with mode: 0644]
.xmodmap [deleted file]
.xsession.d/01-xkb
.xsession.d/01-xmodmap [deleted file]

diff --git a/.xkb/keymap/default b/.xkb/keymap/default
new file mode 100644 (file)
index 0000000..caa564c
--- /dev/null
@@ -0,0 +1,7 @@
+default xkb_keymap "default" {
+  xkb_keycodes  { include "evdev+aliases(qwerty)"       };
+  xkb_types     { include "complete"    };
+  xkb_compat    { include "complete"    };
+  xkb_symbols   { include "pc+us+inet(evdev)+madduck(mode_switch)+madduck(caps_mod4)+madduck(group2_intl)"  };
+  xkb_geometry  { include "pc(pc104)"        };
+};
diff --git a/.xkb/keymap/lapse.rw.madduck.net b/.xkb/keymap/lapse.rw.madduck.net
new file mode 100644 (file)
index 0000000..0dd9aab
--- /dev/null
@@ -0,0 +1,7 @@
+default xkb_keymap "thinkpad" {
+  xkb_keycodes  { include "evdev+aliases(qwerty)"       };
+  xkb_types     { include "complete"    };
+  xkb_compat    { include "complete"    };
+  xkb_symbols   { include "pc+us+inet(evdev)+madduck(thinkpad_switch)+madduck(caps_mod4)+madduck(group2_intl)"  };
+  xkb_geometry  { include "thinkpad(us)"        };
+};
diff --git a/.xkb/symbols/madduck b/.xkb/symbols/madduck
new file mode 100644 (file)
index 0000000..ddfef83
--- /dev/null
@@ -0,0 +1,185 @@
+// mode_switch: set up windows keys for mode switching and the menu keys
+// to generate mod3
+partial modifier_keys
+xkb_symbols "mode_switch" {
+  include "group(win_switch)"
+  replace key <MENU> {
+    [ VoidSymbol, VoidSymbol ]
+  };
+  modifier_map Mod3 { <MENU> };
+};
+
+// thinkpad_switch: on thinkpads, use the right control and alt keys as
+// substitute for the missing menu and windows keys
+partial modifier_keys
+xkb_symbols "thinkpad_switch" {
+  include "group(switch)"
+  replace key <RCTL> {
+    [ VoidSymbol, VoidSymbol ]
+  };
+  modifier_map Mod3 { <RCTL> };
+};
+
+// caps_mod4: make capslock generate the mod4 modifier
+partial modifier_keys
+xkb_symbols "caps_mod4" {
+  replace key <CAPS> {
+    [ VoidSymbol, VoidSymbol ]
+  };
+  modifier_map Mod4 { <CAPS> };
+};
+
+// group2_intl: my group2 map of international and other symbols
+partial modifier_keys alphanumeric_keys
+xkb_symbols "group2_intl" {
+  key <TLDE> {
+    symbols[Group2] = [ degree, infinity ]
+  };
+  key <AE01> {
+    symbols[Group2] = [ onequarter, oneeighth ]
+  };
+  key <AE02> {
+    symbols[Group2] = [ twosuperior, onehalf ]
+  };
+  key <AE03> {
+    symbols[Group2] = [ threesuperior, threequarters ]
+  };
+  key <AE04> {
+    symbols[Group2] = [ eacute, Eacute ]
+  };
+  key <AE05> {
+    symbols[Group2] = [ EuroSign, cent ]
+  };
+  key <AE06> {
+    symbols[Group2] = [ copyright, trademark ]
+  };
+  key <AE07> {
+    symbols[Group2] = [ yacute, Yacute ]
+  };
+  key <AE08> {
+    symbols[Group2] = [ uacute, Uacute ]
+  };
+  key <AE09> {
+    symbols[Group2] = [ iacute, Iacute ]
+  };
+  key <AE10> {
+    symbols[Group2] = [ oacute, Oacute ]
+  };
+  key <AE11> {
+    symbols[Group2] = [ endash, emdash ]
+  };
+  key <AE12> {
+    symbols[Group2] = [ approximate, plusminus ]
+  };
+  key <BKSP> {
+    symbols[Group2] = [ BackSpace, BackSpace ]
+  };
+  key <TAB> {
+    symbols[Group2] = [ Tab, Tab ]
+  };
+  key <AD01> {
+    symbols[Group2] = [ acircumflex, Acircumflex ]
+  };
+  key <AD02> {
+    symbols[Group2] = [ aacute, Aacute ]
+  };
+  key <AD03> {
+    symbols[Group2] = [ ediaeresis, Ediaeresis ]
+  };
+  key <AD04> {
+    symbols[Group2] = [ ecircumflex, Ecircumflex ]
+  };
+  key <AD05> {
+    symbols[Group2] = [ icircumflex, Icircumflex ]
+  };
+  key <AD06> {
+    symbols[Group2] = [ ydiaeresis, Ydiaeresis ]
+  };
+  key <AD07> {
+    symbols[Group2] = [ udiaeresis, Udiaeresis ]
+  };
+  key <AD08> {
+    symbols[Group2] = [ idiaeresis, Idiaeresis ]
+  };
+  key <AD09> {
+    symbols[Group2] = [ odiaeresis, Odiaeresis ]
+  };
+  key <AD10> {
+    symbols[Group2] = [ ocircumflex, Ocircumflex ]
+  };
+  key <AD11> {
+    symbols[Group2] = [ ae, AE ]
+  };
+  key <AD12> {
+    symbols[Group2] = [ oslash, Oslash ]
+  };
+  key <BKSL> {
+    symbols[Group2] = [ aring, Aring ]
+  };
+  key <AC01> {
+    symbols[Group2] = [ adiaeresis, Adiaeresis ]
+  };
+  key <AC02> {
+    symbols[Group2] = [ ssharp, section ]
+  };
+  key <AC03> {
+    symbols[Group2] = [ egrave, Egrave ]
+  };
+  key <AC04> {
+    symbols[Group2] = [ eth, Eth ]
+  };
+  key <AC05> {
+    symbols[Group2] = [ thorn, Thorn ]
+  };
+  key <AC06> {
+    symbols[Group2] = [ ucircumflex, Ucircumflex ]
+  };
+  key <AC07> {
+    symbols[Group2] = [ ugrave, Ugrave ]
+  };
+  key <AC08> {
+    symbols[Group2] = [ igrave, Igrave ]
+  };
+  key <AC09> {
+    symbols[Group2] = [ ograve, Ograve ]
+  };
+  key <AC10> {
+    symbols[Group2] = [ leftdoublequotemark, leftarrow ]
+  };
+  key <AC11> {
+    symbols[Group2] = [ rightdoublequotemark, rightarrow ]
+  };
+  key <RTRN> {
+    symbols[Group2] = [ Return, Return ]
+  };
+  key <AB01> {
+    symbols[Group2] = [ agrave, Agrave ]
+  };
+  key <AB02> {
+    symbols[Group2] = [ multiply, division ]
+  };
+  key <AB03> {
+    symbols[Group2] = [ ccedilla, Ccedilla ]
+  };
+  key <AB04> {
+    symbols[Group2] = [ atilde, Atilde ]
+  };
+  key <AB05> {
+    symbols[Group2] = [ otilde, Otilde ]
+  };
+  key <AB06> {
+    symbols[Group2] = [ ntilde, Ntilde ]
+  };
+  key <AB07> {
+    symbols[Group2] = [ mu, heart ]
+  };
+  key <AB08> {
+    symbols[Group2] = [ notsign, guillemotleft ]
+  };
+  key <AB09> {
+    symbols[Group2] = [ ellipsis, guillemotright ]
+  };
+  key <AB10> {
+    symbols[Group2] = [ exclamdown, questiondown ]
+  };
+};
diff --git a/.xmodmap b/.xmodmap
deleted file mode 100644 (file)
index 951e6ef..0000000
--- a/.xmodmap
+++ /dev/null
@@ -1,110 +0,0 @@
-!
-! don't make anything but Control_[LR] generate control
-clear Control
-add Control  = Control_L
-!use for Mod3 on lapse
-!add Control  = Control_R
-
-clear Mod1
-add Mod1     = Alt_L
-add Mod1     = Meta_L
-
-!
-! we kill caps lock once and for all and make it generate mod5
-!
-clear Lock
-keycode 0x42 = Caps_Lock
-clear Mod4
-add Mod4     = Caps_Lock
-
-!
-! now for what had me so long baffled. any keycode can generate eight keysyms,
-! but only the first four are used. and the way to index into them is by using
-! Shift and Mode_switch. my keyboard had no Mode_switch, so I am using that
-! bloody Windoze key:
-!
-
-! now we assign the Mode_switch keysym to both Windoze keys
-keycode 0x73 = Mode_switch
-!keycode 0x74 = Mode_switch
-!right alt on lapse
-keycode 0x71 = Mode_switch
-
-! ... and tell the Mode_switch keysym to generate the mod4 modifier.
-clear Mod5
-add Mod5     = Mode_switch
-
-! assign Super_R to the Menu key
-keycode 0x75 = Super_R
-!right control on lapse
-keycode 0x6d = Super_R
-
-! ... and make it generate the mod3 modifier
-clear Mod3
-add Mod3     = Super_R
-
-!
-! and now all we need to do is add what we would like to the keys.
-! if this approach doesn't work, you'll need to go via keycodes, e.g.:
-!
-!   keycode 0x26 = a A adiaeresis Adiaeresis
-!
-! however, you'll have to check which keycode is generated by which keypress.
-! use xev(1) for that.
-!
-keysym backslash = backslash bar aring Aring
-keysym bracketleft = bracketleft braceleft ae AE
-keysym bracketright = bracketright braceright oslash Ooblique
-keysym comma = comma less notsign guillemotleft
-keysym equal = equal plus approximate plusminus
-keysym grave = grave asciitilde degree infinity
-keysym minus = minus underscore endash emdash
-keysym period = period greater ellipsis guillemotright
-keysym slash = slash question exclamdown questiondown
-keysym apostrophe = apostrophe quotedbl rightdoublequotemark rightarrow
-keysym semicolon = semicolon colon leftdoublequotemark leftarrow
-keysym 0 = 0 parenright oacute Oacute
-keysym 1 = 1 exclam onequarter oneeighth
-keysym 2 = 2 at twosuperior onehalf
-keysym 3 = 3 numbersign threesuperior threequarters
-keysym 4 = 4 dollar eacute Eacute
-keysym 5 = 5 percent EuroSign cent
-keysym 6 = 6 asciicircum copyright trademark
-keysym 7 = 7 ampersand yacute Yacute
-keysym 8 = 8 asterisk uacute Uacute
-keysym 9 = 9 parenleft iacute Iacute
-keysym a = a A adiaeresis Adiaeresis
-keysym b = b B otilde Otilde
-keysym c = c C ccedilla Ccedilla
-keysym d = d D egrave Egrave
-keysym e = e E ediaeresis Ediaeresis
-keysym f = f F eth Eth
-keysym g = g G thorn Thorn
-keysym h = h H ucircumflex Ucircumflex
-keysym i = i I idiaeresis Idiaeresis
-keysym j = j J ugrave Ugrave
-keysym k = k K igrave Igrave
-keysym l = l L ograve Ograve
-keysym m = m M mu heart
-keysym n = n N ntilde Ntilde
-keysym o = o O odiaeresis Odiaeresis
-keysym p = p P ocircumflex Ocircumflex
-keysym q = q Q acircumflex Acircumflex
-keysym r = r R ecircumflex Ecircumflex
-keysym s = s S ssharp section
-keysym t = t T icircumflex Icircumflex
-keysym u = u U udiaeresis Udiaeresis
-keysym v = v V atilde Atilde
-keysym w = w W aacute Aacute
-keysym x = x X multiply division
-keysym y = y Y ydiaeresis ydiaeresis
-keysym z = z Z agrave Agrave
-
-! Thinkpad stuff
-! http://www.thinkwiki.org/wiki/Installing_OpenSUSE_10.0_on_a_ThinkPad_X41#Numlock_and_Browse_keys
-keycode  77 = Num_Lock
-keycode 233 = XF86Forward
-keycode 234 = XF86Back
-
-! the AccessIBM key
-keycode 159 = XF86Excel
index 7ff8667f36badaa84e016b66138a520f208270f3..6d19628ee7764172377cb30fbcbac731b3bad4d6 100644 (file)
@@ -1,5 +1,14 @@
 # load the keyboard definitions
-# DISABLED in favour of 01-xmodmap for now, until
-# http://lists.freedesktop.org/archives/xorg/2008-June/036340.html
-# is answered
-#xkbcomp $HOME/.xkb ${DISPLAY%%.*}
+
+XKBDIR="$HOME/.xkb"
+#XKBMAPFILE="$XKBDIR/keymap/${(%):-%M}"
+XKBMAPFILE="$XKBDIR/keymap/$(hostname --fqdn)"
+[[ -r "$XKBMAPFILE" ]] || XKBMAPFILE="${XKBMAPFILE%/*}/defaul"
+
+info "loading keymap from $XKBMAPFILE"
+
+xkbcomp -I"$XKBDIR" "$XKBMAPFILE" "${DISPLAY%%.*}"
+
+unset XKBDIR XKBMAPFILE
+
+# vim:ft=zsh
diff --git a/.xsession.d/01-xmodmap b/.xsession.d/01-xmodmap
deleted file mode 100644 (file)
index a68e964..0000000
+++ /dev/null
@@ -1,4 +0,0 @@
-# load the xmodmap, need to run twice sometimes to remove the Caps_lock sym
-# from the control key
-xmodmap $HOME/.xmodmap
-xmodmap $HOME/.xmodmap