From 5e1da4d5eecb26a2673f7b7e1b6a80ffa518a52d Mon Sep 17 00:00:00 2001 From: Jesse Luehrs Date: Tue, 12 Dec 2017 09:43:26 -0500 Subject: more keyboard reconfiguring and refactoring including setting the function keys to work even without hardware level remapping --- Xmodmap | 31 ++++++++++++++++++++++++++++--- bin/setup-inputs | 22 ++++++++++++++++++++++ xbindkeysrc | 23 +++++++++++++---------- xinitrc | 13 ++----------- 4 files changed, 65 insertions(+), 24 deletions(-) create mode 100755 bin/setup-inputs diff --git a/Xmodmap b/Xmodmap index ac29037..3a3b6ad 100644 --- a/Xmodmap +++ b/Xmodmap @@ -1,14 +1,39 @@ +! reset state clear control clear mod1 clear mod4 + +! swap alt and control keycode 37 = Alt_L Meta_L keycode 64 = Control_L keycode 105 = Alt_R Meta_R keycode 108 = Control_R + +! map prtsc to super, because the thinkpad layout puts it in that location keycode 107 = Super_R -keycode 115 = Insert -keycode 118 = Insert -keycode 110 = Insert + +! set the values for control, mod1 (meta), and mod4 (super) now that they have +! been assigned to keycodes add control = Control_L Control_R add mod1 = Alt_L Alt_R Meta_L Meta_R add mod4 = Super_L Super_R + +! map home and end to insert, because the thinkpad layout puts them where +! insert should be +keycode 110 = Insert +keycode 115 = Insert + +! map function keys to their appropriate values (thinkpad does this in +! hardware, but other keyboards don't) +keycode 67 = XF86AudioMute F1 XF86AudioMute F1 F1 F1 XF86Switch_VT_1 +keycode 68 = XF86AudioLowerVolume F2 XF86AudioLowerVolume F2 F2 F2 XF86Switch_VT_2 +keycode 69 = XF86AudioRaiseVolume F3 XF86AudioRaiseVolume F3 F3 F3 XF86Switch_VT_3 +keycode 70 = XF86AudioMicMute F4 XF86AudioMicMute F4 F4 F4 XF86Switch_VT_4 +keycode 71 = XF86MonBrightnessDown F5 XF86MonBrightnessDown F5 F5 F5 XF86Switch_VT_5 +keycode 72 = XF86MonBrightnessUp F6 XF86MonBrightnessUp F6 F6 F6 XF86Switch_VT_6 +keycode 73 = XF86Display F7 XF86Display F7 F7 F7 XF86Switch_VT_7 +keycode 74 = XF86WLAN F8 XF86WLAN F8 F8 F8 XF86Switch_VT_8 +keycode 75 = XF86Tools F9 XF86Tools F9 F9 F9 XF86Switch_VT_9 +keycode 76 = XF86Search F10 XF86Search F10 F10 F10 XF86Switch_VT_10 +keycode 95 = XF86LaunchA F11 XF86LaunchA F11 F11 F11 XF86Switch_VT_11 +keycode 96 = XF86Explorer F12 XF86Explorer F12 F12 F12 XF86Switch_VT_12 diff --git a/bin/setup-inputs b/bin/setup-inputs new file mode 100755 index 0000000..aab71a6 --- /dev/null +++ b/bin/setup-inputs @@ -0,0 +1,22 @@ +#!/bin/sh + +# key bindings +setxkbmap -option ctrl:nocaps +setxkbmap -option compose:caps +xmodmap $HOME/.Xmodmap +$HOME/.bin/numkeys on + +# disable trackpoint +xinput set-prop "TPPS/2 IBM TrackPoint" "Device Enabled" 0 + +# tap to click on touchpad +synclient TapButton1=1 +synclient TapButton2=2 +synclient TapButton3=3 + +# restart services that depend on keyboard reconfigurations +if pgrep readproctitle > /dev/null; then + svre xcape + svre kuake + svre xbindkeys +fi diff --git a/xbindkeysrc b/xbindkeysrc index 47a42db..3b4c4bf 100644 --- a/xbindkeysrc +++ b/xbindkeysrc @@ -25,21 +25,30 @@ "numkeys toggle" Shift + Shift_L -"volume up" - XF86AudioRaiseVolume +"volume mute" + XF86AudioMute "volume down" XF86AudioLowerVolume -"volume mute" - XF86AudioMute +"volume up" + XF86AudioRaiseVolume "pactl set-source-mute 2 toggle" XF86AudioMicMute +"xbacklight -dec 10" + XF86MonBrightnessDown + +"xbacklight -inc 10" + XF86MonBrightnessUp + "xrandr --auto" XF86Display +"[ $(rfkill --output type,soft | grep wlan | awk '{print $2}') = 'unblocked' ] && sudo rfkill block wlan || sudo rfkill unblock wlan" + XF86WLAN + "xset dpms force off" XF86Search @@ -48,9 +57,3 @@ "kill_focused CONT" XF86Explorer - -"xbacklight -inc 10" - XF86MonBrightnessUp - -"xbacklight -dec 10" - XF86MonBrightnessDown diff --git a/xinitrc b/xinitrc index f558956..6957172 100644 --- a/xinitrc +++ b/xinitrc @@ -2,17 +2,8 @@ start-pulseaudio-x11 -# these have to all happen before xcape is started -setxkbmap -option ctrl:nocaps -setxkbmap -option compose:caps -xmodmap $HOME/.Xmodmap -$HOME/.bin/numkeys on - -xinput set-prop "TPPS/2 IBM TrackPoint" "Device Enabled" 0 -synclient TapButton1=1 -synclient TapButton2=2 -synclient TapButton3=3 - pidof svscan || (svscan $HOME/.services 2>&1 | readproctitle $USER ........................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................) & +setup-inputs + exec i3 -- cgit v1.2.3-54-g00ecf