mirror of
https://github.com/vincentbernat/i3wm-configuration.git
synced 2025-07-03 14:54:21 +02:00
dock: don't try to detect undocking, that doesn't work
Unplugging the dock while running seems harmful currently. Just use a special command for that before undocking. On the other hand, docking should just work.
This commit is contained in:
parent
62c3f6a7f4
commit
d84574ebc3
1 changed files with 12 additions and 30 deletions
|
@ -7,14 +7,7 @@ device="$2"
|
||||||
use="$3"
|
use="$3"
|
||||||
name="$4"
|
name="$4"
|
||||||
|
|
||||||
case "$event" in
|
[ x"$event" = x"XIDeviceEnabled" ] || exit 0
|
||||||
XIDevice*)
|
|
||||||
;;
|
|
||||||
*)
|
|
||||||
exit 0
|
|
||||||
;;
|
|
||||||
esac
|
|
||||||
event=${event#XIDevice}
|
|
||||||
|
|
||||||
# Load the given keymap
|
# Load the given keymap
|
||||||
xkb() {
|
xkb() {
|
||||||
|
@ -24,19 +17,8 @@ xkb() {
|
||||||
|
|
||||||
printf "$use: [%3d] $name\n" $device
|
printf "$use: [%3d] $name\n" $device
|
||||||
|
|
||||||
case "$event,$use,$(uname -n),$name" in
|
case "$use,$(uname -n),$name" in
|
||||||
# We try to use this keyboard to detect the dock
|
XISlaveKeyboard,zoro,"Topre Corporation Realforce 87")
|
||||||
Disabled,XISlaveKeyboard,zoro,"Topre Corporation Realforce 87")
|
|
||||||
# We are being undocked?
|
|
||||||
sleep 2
|
|
||||||
if xrandr | grep '^DP. connected'; then
|
|
||||||
# No, still docked?
|
|
||||||
:
|
|
||||||
else
|
|
||||||
xrandr --output DP3 --off --output DP4 --off --output eDP1 --auto --dpi 144
|
|
||||||
fi
|
|
||||||
;;
|
|
||||||
Enabled,XISlaveKeyboard,zoro,"Topre Corporation Realforce 87")
|
|
||||||
# Are we getting docked?
|
# Are we getting docked?
|
||||||
sleep 2
|
sleep 2
|
||||||
if xrandr | grep '^DP. connected'; then
|
if xrandr | grep '^DP. connected'; then
|
||||||
|
@ -46,28 +28,28 @@ case "$event,$use,$(uname -n),$name" in
|
||||||
fi
|
fi
|
||||||
xkb default
|
xkb default
|
||||||
;;
|
;;
|
||||||
Enabled,XISlaveKeyboard,zoro,"AT Translated Set 2 keyboard")
|
XISlaveKeyboard,zoro,"AT Translated Set 2 keyboard")
|
||||||
xkb x1
|
xkb x1
|
||||||
;;
|
;;
|
||||||
Enabled,XISlaveKeyboard,guybrush,"AT Translated Set 2 keyboard")
|
XISlaveKeyboard,guybrush,"AT Translated Set 2 keyboard")
|
||||||
xkb norwin
|
xkb norwin
|
||||||
;;
|
;;
|
||||||
Enabled,XISlaveKeyboard,*,"ThinkPad Extra Buttons")
|
XISlaveKeyboard,*,"ThinkPad Extra Buttons")
|
||||||
xkb thinkpad-extra
|
xkb thinkpad-extra
|
||||||
;;
|
;;
|
||||||
Enabled,XISlaveKeyboard,*)
|
XISlaveKeyboard,*)
|
||||||
xkb default
|
xkb default
|
||||||
;;
|
;;
|
||||||
Enabled,XISlavePointer,*,"Microsoft Microsoft 3-Button Mouse with IntelliEye(TM)")
|
XISlavePointer,*,"Microsoft Microsoft 3-Button Mouse with IntelliEye(TM)")
|
||||||
xinput set-ptr-feedback $device 3 3 1
|
xinput set-ptr-feedback $device 3 3 1
|
||||||
;;
|
;;
|
||||||
Enabled,XISlavePointer,*,"TPPS/2 IBM TrackPoint")
|
XISlavePointer,*,"TPPS/2 IBM TrackPoint")
|
||||||
xinput set-prop $device 'Evdev Wheel Emulation' 1
|
xinput set-prop $device 'Evdev Wheel Emulation' 1
|
||||||
xinput set-prop $device 'Evdev Wheel Emulation Button' 2
|
xinput set-prop $device 'Evdev Wheel Emulation Button' 2
|
||||||
xinput set-prop $device 'Evdev Wheel Emulation Axes' 6 7 4 5
|
xinput set-prop $device 'Evdev Wheel Emulation Axes' 6 7 4 5
|
||||||
xinput set-ptr-feedback $device 2 5 1
|
xinput set-ptr-feedback $device 2 5 1
|
||||||
;;
|
;;
|
||||||
Enabled,XISlavePointer,zoro,"SynPS/2 Synaptics TouchPad")
|
XISlavePointer,zoro,"SynPS/2 Synaptics TouchPad")
|
||||||
# [ 12.756] (--) synaptics: SynPS/2 Synaptics TouchPad: x-axis range 1472 - 5112 (res 42)
|
# [ 12.756] (--) synaptics: SynPS/2 Synaptics TouchPad: x-axis range 1472 - 5112 (res 42)
|
||||||
# [ 12.756] (--) synaptics: SynPS/2 Synaptics TouchPad: y-axis range 1408 - 3834 (res 42)
|
# [ 12.756] (--) synaptics: SynPS/2 Synaptics TouchPad: y-axis range 1408 - 3834 (res 42)
|
||||||
# The following is 60% 0 0 0 40% 60% 0 0
|
# The following is 60% 0 0 0 40% 60% 0 0
|
||||||
|
@ -77,10 +59,10 @@ case "$event,$use,$(uname -n),$name" in
|
||||||
xinput set-prop $device 'Synaptics Off' 3 # Needs a patch: http://lists.x.org/archives/xorg/2014-June/056689.html
|
xinput set-prop $device 'Synaptics Off' 3 # Needs a patch: http://lists.x.org/archives/xorg/2014-June/056689.html
|
||||||
xinput set-prop $device 'Synaptics Two-Finger Scrolling' 1 1
|
xinput set-prop $device 'Synaptics Two-Finger Scrolling' 1 1
|
||||||
;;
|
;;
|
||||||
Enabled,XISlavePointer,zoro,"ELAN Touchscreen")
|
XISlavePointer,zoro,"ELAN Touchscreen")
|
||||||
xinput disable $device
|
xinput disable $device
|
||||||
;;
|
;;
|
||||||
Enabled,XISlavePointer,guybrush,"SynPS/2 Synaptics TouchPad")
|
XISlavePointer,guybrush,"SynPS/2 Synaptics TouchPad")
|
||||||
xinput set-prop $device 'Synaptics Off' 1
|
xinput set-prop $device 'Synaptics Off' 1
|
||||||
;;
|
;;
|
||||||
esac
|
esac
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue