tconfig.h: add option to control mouse movement and clicks via keyboard - dwm - [fork] customized build of dwm, the dynamic window manager
(HTM) git clone git://src.adamsgaard.dk/dwm
(DIR) Log
(DIR) Files
(DIR) Refs
(DIR) README
(DIR) LICENSE
---
(DIR) commit 7632ed9c1ae12ed5f7371082546f94e32bcc1e99
(DIR) parent d5889c7d704241c2832d17ab6c09bf54b83719c3
(HTM) Author: Anders Damsgaard <anders@adamsgaard.dk>
Date: Tue, 3 Nov 2020 15:25:53 +0100
config.h: add option to control mouse movement and clicks via keyboard
Diffstat:
M config.h | 26 ++++++++++++++++++++++++++
1 file changed, 26 insertions(+), 0 deletions(-)
---
(DIR) diff --git a/config.h b/config.h
t@@ -145,6 +145,19 @@ static const char *audioextvolupcmd[] = {"sndioctl", "output.level=+0.05",
static const char *audioextvoldncmd[] = {"sndioctl", "output.level=-0.05", NULL};
static const char *audioextmutecmd[] = {"sndioctl", "output.mute=!", NULL};
+static const char *mouseleftcmd[] = {"xdotool", "mousemove_relative", "--", "-100", "0", NULL};
+static const char *mouserightcmd[] = {"xdotool", "mousemove_relative", "--", "+100", "0", NULL};
+static const char *mouseupcmd[] = {"xdotool", "mousemove_relative", "--", "0", "-100", NULL};
+static const char *mousedowncmd[] = {"xdotool", "mousemove_relative", "--", "0", "+100", NULL};
+
+static const char *mousefineleftcmd[] = {"xdotool", "mousemove_relative", "--", "-10", "0", NULL};
+static const char *mousefinerightcmd[] = {"xdotool", "mousemove_relative", "--", "+10", "0", NULL};
+static const char *mousefineupcmd[] = {"xdotool", "mousemove_relative", "--", "0", "-10", NULL};
+static const char *mousefinedowncmd[] = {"xdotool", "mousemove_relative", "--", "0", "+10", NULL};
+
+static const char *mouseleftclickcmd[] = {"xdotool", "click", "1", NULL};
+static const char *mouserightclickcmd[]= {"xdotool", "click", "3", NULL};
+
/* see key names in /usr/include/X11/keysymdef.h */
static Key keys[] = {
/* modifier key function argument */
t@@ -164,6 +177,19 @@ static Key keys[] = {
{ MODKEY|ShiftMask, XK_comma, tagmon, {.i = -1 } },
{ MODKEY, XK_Tab, view, {0} },
+ { MODKEY, XK_Left, spawn, {.v = mouseleftcmd } },
+ { MODKEY, XK_Right, spawn, {.v = mouserightcmd } },
+ { MODKEY, XK_Up, spawn, {.v = mouseupcmd } },
+ { MODKEY, XK_Down, spawn, {.v = mousedowncmd } },
+
+ { MODKEY|ShiftMask, XK_Left, spawn, {.v = mousefineleftcmd } },
+ { MODKEY|ShiftMask, XK_Right, spawn, {.v = mousefinerightcmd } },
+ { MODKEY|ShiftMask, XK_Up, spawn, {.v = mousefineupcmd } },
+ { MODKEY|ShiftMask, XK_Down, spawn, {.v = mousefinedowncmd } },
+
+ { MODKEY|ShiftMask|ControlMask, XK_Left, spawn, {.v = mouseleftclickcmd } },
+ { MODKEY|ShiftMask|ControlMask, XK_Right, spawn, {.v = mouserightclickcmd } },
+
{ ShiftMask, XF86XK_AudioRaiseVolume, spawn, {.v = audioextvolupcmd } },
{ ShiftMask, XF86XK_AudioLowerVolume, spawn, {.v = audioextvoldncmd } },
{ ShiftMask, XF86XK_AudioMute, spawn, {.v = audioextmutecmd } },