mirror of
https://github.com/eRgo35/dwm.git
synced 2025-12-16 05:46:09 +01:00
fix: fixed button mapping and added documentation
This commit is contained in:
52
config.def.h
52
config.def.h
@@ -3,8 +3,14 @@
|
||||
#include <X11/XF86keysym.h>
|
||||
|
||||
/* Helper macros for spawning commands */
|
||||
#define SHCMD(cmd) { .v = (const char*[]){ "/bin/sh", "-c", cmd, NULL } }
|
||||
#define CMD(...) { .v = (const char*[]){ __VA_ARGS__, NULL } }
|
||||
#define SHCMD(cmd) \
|
||||
{ \
|
||||
.v = (const char *[]) { "/bin/sh", "-c", cmd, NULL } \
|
||||
}
|
||||
#define CMD(...) \
|
||||
{ \
|
||||
.v = (const char *[]) { __VA_ARGS__, NULL } \
|
||||
}
|
||||
|
||||
/* appearance */
|
||||
#if ROUNDED_CORNERS_PATCH
|
||||
@@ -57,7 +63,13 @@ static const int topbar = 1; /* 0 means bottom bar */
|
||||
/* Display modes of the tab bar: never shown, always shown, shown only in */
|
||||
/* monocle mode in the presence of several windows. */
|
||||
/* Modes after showtab_nmodes are disabled. */
|
||||
enum showtab_modes { showtab_never, showtab_auto, showtab_nmodes, showtab_always};
|
||||
enum showtab_modes
|
||||
{
|
||||
showtab_never,
|
||||
showtab_auto,
|
||||
showtab_nmodes,
|
||||
showtab_always
|
||||
};
|
||||
static const int showtab = showtab_auto; /* Default tab bar show mode */
|
||||
static const int toptab = False; /* False means bottom tab bar */
|
||||
#endif // TAB_PATCH
|
||||
@@ -900,8 +912,7 @@ static const char *dmenucmd[] = {
|
||||
#if BAR_DMENUMATCHTOP_PATCH
|
||||
topbar ? NULL : "-b",
|
||||
#endif // BAR_DMENUMATCHTOP_PATCH
|
||||
NULL
|
||||
};
|
||||
NULL};
|
||||
static const char *termcmd[] = {"kitty", NULL};
|
||||
static const char *prtscrcmd[] = {"flameshot", "gui", NULL};
|
||||
static const char *mutevol[] = {"pactl", "set-sink-mute", "0", "toggle", NULL};
|
||||
@@ -1393,8 +1404,7 @@ static const Key keys[] = {
|
||||
TAGKEYS(XK_6, 5)
|
||||
TAGKEYS(XK_7, 6)
|
||||
TAGKEYS(XK_8, 7)
|
||||
TAGKEYS( XK_9, 8)
|
||||
};
|
||||
TAGKEYS(XK_9, 8)};
|
||||
|
||||
#if KEYMODES_PATCH
|
||||
static const Key cmdkeys[] = {
|
||||
@@ -1422,11 +1432,22 @@ static const Command commands[] = {
|
||||
};
|
||||
#endif // KEYMODES_PATCH
|
||||
|
||||
|
||||
#define Button6 6
|
||||
#define Button7 7
|
||||
#define Button8 8
|
||||
#define Button9 9
|
||||
// Mouse: Logitech G502 Hero
|
||||
// Buttons 1-5 defined in library already
|
||||
// Button1 // left click
|
||||
// Button2 // middle click
|
||||
// Button3 // right click
|
||||
// Button4 // scroll wheel up
|
||||
// Button5 // scroll wheel down
|
||||
#define Button6 6 // scroll wheel left
|
||||
#define Button7 7 // scroll wheel right
|
||||
#define Button8 8 // back button
|
||||
#define Button9 9 // forward button
|
||||
#define Button10 10 // undefined
|
||||
#define Button11 11 // extra thumb button
|
||||
#define Button12 12 // top middle button
|
||||
#define Button13 13 // left bottom extra button
|
||||
#define Button14 14 // left top extra button
|
||||
|
||||
/* button definitions */
|
||||
#if STATUSBUTTON_PATCH
|
||||
@@ -1436,9 +1457,10 @@ static const Command commands[] = {
|
||||
#endif //
|
||||
static const Button buttons[] = {
|
||||
/* click event mask button function argument */
|
||||
{ ClkRootWin, 0, Button9, spawn, {.v = upvol } },
|
||||
{ ClkRootWin, 0, Button8, spawn, {.v = downvol } },
|
||||
{ ClkRootWin, 0, Button6, spawn, {.v = mutevol } },
|
||||
{ClkClientWin, 0, Button11, spawn, {.v = mutemic}},
|
||||
{ClkClientWin, 0, Button12, spawn, {.v = termcmd}},
|
||||
{ClkClientWin, 0, Button13, spawn, {.v = downvol}},
|
||||
{ClkClientWin, 0, Button14, spawn, {.v = upvol}},
|
||||
#if BAR_STATUSBUTTON_PATCH
|
||||
{ClkButton, 0, Button1, spawn, {.v = dmenucmd}},
|
||||
#endif // BAR_STATUSBUTTON_PATCH
|
||||
|
||||
Reference in New Issue
Block a user