Skip to content

Instantly share code, notes, and snippets.

@Surzhko
Last active November 4, 2017 15:51
Show Gist options
  • Save Surzhko/9113536 to your computer and use it in GitHub Desktop.
Save Surzhko/9113536 to your computer and use it in GitHub Desktop.
Touchpad Toggle, window tilling and lock session key bindings for Lubuntu
#!/bin/bash
synclient TouchpadOff=$(synclient -l | grep -c 'TouchpadOff.*=.*0')
...
<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>
...
@alanmimms
Copy link

Thanks! 👍

@thismatters
Copy link

thismatters commented Nov 4, 2017

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