diff options
| author | BossCode45 <human.cyborg42@gmail.com> | 2022-08-28 18:22:59 +1200 |
|---|---|---|
| committer | BossCode45 <human.cyborg42@gmail.com> | 2022-08-28 18:22:59 +1200 |
| commit | 01a34fabc8cd6b5a7cb5ab1dd0e58f27094ec4d5 (patch) | |
| tree | 2fa857402e8e4e95d4e71aa8831f6d61433c4a4b /#config.h# | |
| parent | 1566509dc6c3a7b6b579c0088f627786b73ee6a6 (diff) | |
| download | YATwm-01a34fabc8cd6b5a7cb5ab1dd0e58f27094ec4d5.tar.gz YATwm-01a34fabc8cd6b5a7cb5ab1dd0e58f27094ec4d5.zip | |
Very basic window and focus moving
Diffstat (limited to '#config.h#')
| -rw-r--r-- | #config.h# | 57 |
1 files changed, 36 insertions, 21 deletions
@@ -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) }; |
