From 01a34fabc8cd6b5a7cb5ab1dd0e58f27094ec4d5 Mon Sep 17 00:00:00 2001 From: BossCode45 Date: Sun, 28 Aug 2022 18:22:59 +1200 Subject: Very basic window and focus moving --- #config.h# | 57 ++++++++++++++++++++++++++++++++++++--------------------- 1 file changed, 36 insertions(+), 21 deletions(-) (limited to '#config.h#') diff --git a/#config.h# b/#config.h# index 26e8004..2876dfc 100644 --- a/#config.h# +++ b/#config.h# @@ -11,12 +11,23 @@ std::string startup[] = {"picom -fD 3", "feh --bg-scale /usr/share/backgrounds/v int gaps = 10; int outerGaps = 30; +int numWS = 5; + //Keys //The types and perhaps functions likely to be moved to seperate header file later +enum MoveDir +{ + Up, + Right, + Down, + Left +}; + typedef union { - const int num; const char** str; + const int num; + const MoveDir dir; } KeyArg; struct Key @@ -33,30 +44,34 @@ void spawn(const KeyArg arg); void toggle(const KeyArg arg); void kill(const KeyArg arg); void changeWS(const KeyArg arg); +void wToWS(const KeyArg arg); +void focChange(const KeyArg arg); + +const char* alacritty[] = ; +const char* rofi[] = {"rofi", "-i", "-show", "drun", NULL}; -const char* alacritty[] = {"alacritty", NULL}; -const char* rofi[] = {"rofi", "-i", "-show" "drun", NULL}; +#define MOD Mod1Mask +#define SHIFT ShiftMask -#define WSKEY(K, X) \ - {K, mod, changeWS, {.num = X - 1}}, +#define WSKEY(K, X) \ + {K, MOD, changeWS, {.num = X}}, \ + {K, MOD|SHIFT, wToWS, {.num = X}}, -unsigned int mod = Mod1Mask; static struct Key keyBinds[] = { //Key //Modifiers //Func //Args - {XK_E, mod, exit, {NULL}}, - {XK_Return, mod, spawn, {.str = alacritty}}, - {XK_D, mod, spawn, {.str = rofi}}, - {XK_T, mod, toggle, {NULL}}, - {XK_Q, mod, kill, {NULL}}, - {XK_1, mod, changeWS, {NULL}, - {XK_2, mod, changeWS, {NULL}}, - {XK_3, mod, changeWS, {.num = 2}}, - {XK_4, mod, changeWS, {.num = 3}}, - {XK_5, mod, changeWS, {.num = 4}}, - //WSKEY(XK_1, 1) - //WSKEY(XK_2, 2) - //WSKEY(XK_3, 3) - //WSKEY(XK_4, 4) - //WSKEY(XK_5, 5) + {XK_e, MOD, exit, {NULL}}, + {XK_Return, MOD, spawn, {.str = {"alacritty", NULL}}}, + {XK_d, MOD, spawn, {.str = rofi}}, + {XK_t, MOD, toggle, {NULL}}, + {XK_q, MOD, kill, {NULL}}, + {XK_h, MOD, focChange, {.dir = Left}}, + {XK_j, MOD, focChange, {.dir = Down}}, + {XK_k, MOD, focChange, {.dir = Up}}, + {XK_l, MOD, focChange, {.dir = Right}}, + WSKEY(XK_1, 1) + WSKEY(XK_2, 2) + WSKEY(XK_3, 3) + WSKEY(XK_4, 4) + WSKEY(XK_5, 5) }; -- cgit v1.2.3