From 1a737bce584209a9bec383bb38fb076718e763f7 Mon Sep 17 00:00:00 2001 From: BossCode45 Date: Tue, 13 Sep 2022 10:21:40 +1200 Subject: Changed order of things in config file --- config.h | 47 +++++++++++++++++++++++++---------------------- makefile | 4 ++-- readme.org | 4 ++-- 3 files changed, 29 insertions(+), 26 deletions(-) diff --git a/config.h b/config.h index 2ccab4c..4d7c4f5 100644 --- a/config.h +++ b/config.h @@ -34,8 +34,8 @@ typedef union struct Key { - KeySym keysym; unsigned int modifiers; + KeySym keysym; void (*function)(const KeyArg arg); const KeyArg arg; }; @@ -59,35 +59,38 @@ const char* qutebrowser[] = {"qutebrowser", NULL}; const char* i3lock[] = {"i3lock", "-eti", "/usr/share/backgrounds/lockscreen.png", NULL}; const char* suspend[] = {"systemctl", "suspend", NULL}; -#define MOD Mod4Mask +//Super key mod +//#define MOD Mod4Mask +//Alt key mod +#define MOD Mod1Mask #define SHIFT ShiftMask #define WSKEY(K, X) \ - {K, MOD, changeWS, {.num = X}}, \ - {K, MOD|SHIFT, wToWS, {.num = X}} + {MOD, K, changeWS, {.num = X}}, \ + {MOD|SHIFT, K, wToWS, {.num = X}} static struct Key keyBinds[] = { - //Key //Modifiers //Func //Args + //Modifiers //Key //Func //Args //General - {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_c, MOD, spawn, {.str = qutebrowser}}, - {XK_x, MOD, spawn, {.str = i3lock}}, - {XK_x, MOD|SHIFT, spawn, {.str = i3lock}}, - {XK_x, MOD|SHIFT, spawn, {.str = suspend}}, + {MOD, XK_e, exit, {NULL}}, + {MOD, XK_Return, spawn, {.str = alacritty}}, + {MOD, XK_d, spawn, {.str = rofi}}, + {MOD, XK_t, toggle, {NULL}}, + {MOD, XK_q, kill, {NULL}}, + {MOD, XK_c, spawn, {.str = qutebrowser}}, + {MOD, XK_x, spawn, {.str = i3lock}}, + {MOD|SHIFT, XK_x, spawn, {.str = i3lock}}, + {MOD|SHIFT, XK_x, spawn, {.str = suspend}}, //Focus - {XK_h, MOD, focChange, {.dir = Left}}, - {XK_j, MOD, focChange, {.dir = Down}}, - {XK_k, MOD, focChange, {.dir = Up}}, - {XK_l, MOD, focChange, {.dir = Right}}, + {MOD, XK_h, focChange, {.dir = Left}}, + {MOD, XK_j, focChange, {.dir = Down}}, + {MOD, XK_k, focChange, {.dir = Up}}, + {MOD, XK_l, focChange, {.dir = Right}}, //Window moving - {XK_h, MOD|SHIFT, wMove, {.dir = Left}}, - {XK_j, MOD|SHIFT, wMove, {.dir = Down}}, - {XK_k, MOD|SHIFT, wMove, {.dir = Up}}, - {XK_l, MOD|SHIFT, wMove, {.dir = Right}}, + {MOD|SHIFT, XK_h, wMove, {.dir = Left}}, + {MOD|SHIFT, XK_j, wMove, {.dir = Down}}, + {MOD|SHIFT, XK_k, wMove, {.dir = Up}}, + {MOD|SHIFT, XK_l, wMove, {.dir = Right}}, //Workspaces WSKEY(XK_1, 1), WSKEY(XK_2, 2), diff --git a/makefile b/makefile index fc039da..45b40df 100644 --- a/makefile +++ b/makefile @@ -1,7 +1,7 @@ .PHONY: clean CXX := g++ -CXXFLAGS := -g `pkg-config --cflags x11` -LINKFLAGS := `pkg-config --libs x11` +CXXFLAGS := #-g -fsanitize=address -fno-omit-frame-pointer +LINKFLAGS := -lX11 OBJS_DIR := . OUT_DIR := . SOURCE_DIR := . diff --git a/readme.org b/readme.org index e6d33c4..1a9018d 100644 --- a/readme.org +++ b/readme.org @@ -43,11 +43,11 @@ Current keybinds (these can all be edited): To add new keybinds create a new entry in the keybind array: #+begin_src cpp -{key, modifiers, command, {commandArgs}}, +{modifiers, key, command, {commandArgs}}, #+end_src e.g. #+begin_src cpp -{XK_l, MOD|SHIFT, wMove, {.dir = Right}}, +{MOD|SHIFT, XK_l, wMove, {.dir = Right}}, #+end_src Commands are executed going down the list and multiple commands with the same keybind and modifiers will all be executed -- cgit v1.2.3