Last active
November 4, 2017 15:51
-
-
Save Surzhko/9113536 to your computer and use it in GitHub Desktop.
Touchpad Toggle, window tilling and lock session key bindings for Lubuntu
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
synclient TouchpadOff=$(synclient -l | grep -c 'TouchpadOff.*=.*0') |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
... | |
<keyboard> | |
... | |
<!-- toggle tuchpad --> | |
<keybind key="XF86TouchpadToggle"> | |
<action name="Execute"> | |
<command>toggletp</command> | |
</action> | |
</keybind> | |
... | |
<!-- Keybindings for window tiling --> | |
<keybind key="C-A-KP_5"> # HalfLeftScreen | |
<action name="ToggleMaximize"/> | |
</keybind> | |
<keybind key="C-A-KP_4"> # HalfLeftScreen | |
<action name="UnmaximizeFull"/> | |
<action name="MoveResizeTo"><x>0</x><y>0</y><height>100%</height><width>50%</width></action> | |
</keybind> | |
<keybind key="C-A-KP_7"> # HalfLeftScreen | |
<action name="UnmaximizeFull"/> | |
<action name="MoveResizeTo"><x>0</x><y>0</y><height>50%</height><width>50%</width></action> | |
</keybind> | |
<keybind key="C-A-KP_6"> # HalfRightScreen | |
<action name="UnmaximizeFull"/> | |
<action name="MoveResizeTo"><x>-0</x><y>0</y><height>100%</height><width>50%</width></action> | |
</keybind> | |
<keybind key="C-A-KP_9"> # HalfRightScreen | |
<action name="UnmaximizeFull"/> | |
<action name="MoveResizeTo"><x>-0</x><y>0</y><height>50%</height><width>50%</width></action> | |
</keybind> | |
<keybind key="C-A-KP_8"> # HalfUpperScreen | |
<action name="UnmaximizeFull"/> | |
<action name="MoveResizeTo"><x>0</x><y>0</y><width>100%</width><height>50%</height></action> | |
</keybind> | |
<keybind key="C-A-KP_2"> # HalfLowerScreen | |
<action name="UnmaximizeFull"/> | |
<action name="MoveResizeTo"><x>0</x><y>-0</y><width>100%</width><height>50%</height></action> | |
</keybind> | |
<keybind key="C-A-KP_1"> # HalfLowerScreen | |
<action name="UnmaximizeFull"/> | |
<action name="MoveResizeTo"><x>0</x><y>-0</y><width>50%</width><height>50%</height></action> | |
</keybind> | |
<keybind key="C-A-KP_3"> # HalfLowerScreen | |
<action name="UnmaximizeFull"/> | |
<action name="MoveResizeTo"><x>-0</x><y>-0</y><width>50%</width><height>50%</height></action> | |
</keybind> | |
... | |
<!-- Lock the screen on Ctrl + Alt + l--> | |
<keybind key="C-A-l"> | |
<action name="Execute"> | |
<command>lxlock</command> | |
</action> | |
</keybind> | |
... | |
</keyboard> | |
... |
Thanks! ๐
omg that grep -c
as a flip-flop is genius. ๐
I'm using AwesomeWM, so to enable the hotkey I had to put the following into my rc.lua
(in my globalkeys
).
awful.key({}, "XF86TouchpadToggle", function () awful.util.spawn("toggletp") end),
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
This piece of code was so helpful to me