Compare commits

..

3 Commits

Author SHA1 Message Date
26303b95e9 fix: fixed button mapping and added documentation 2025-02-21 13:57:35 +01:00
cc72b2eff6 fix: button maps and flake fixes 2025-02-21 12:14:04 +01:00
dfc7fb0e2e feat: added mouse binds 2025-02-21 10:39:36 +01:00
2 changed files with 1468 additions and 1434 deletions

View File

@@ -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};
@@ -970,6 +981,7 @@ static const Key keys[] = {
// { 0, XF86XK_Search, spawn, {.v = search}},
/*{ 0, XF86XK_LaunchA, alttabstart, {0}},*/
{0, XF86XK_Explorer, spawn, {.v = explorer}},
{MODKEY | Mod1Mask, XK_F1, spawn, {.v = upvol}},
{MODKEY | Mod1Mask, XK_F3, spawn, {.v = downvol}},
{MODKEY, XK_n, spawn, {.v = nemo}},
@@ -1392,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[] = {
@@ -1421,6 +1432,23 @@ static const Command commands[] = {
};
#endif // KEYMODES_PATCH
// 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
/* click can be ClkButton, ClkTagBar, ClkLtSymbol, ClkStatusText, ClkWinTitle, ClkClientWin, or ClkRootWin */
@@ -1429,6 +1457,10 @@ static const Command commands[] = {
#endif //
static const Button buttons[] = {
/* click event mask button function argument */
{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

View File

@@ -28,6 +28,8 @@
};
};
defaultPackage.${system} = self.packages.${system}.dwm;
devShells.${system}.default = pkgs.mkShell {
buildInputs = with pkgs; [
gnumake