diff options
| author | tslil clingman <tslil@posteo.de> | 2022-10-09 17:12:37 +0200 |
|---|---|---|
| committer | tslil clingman <tslil@posteo.de> | 2022-10-09 17:43:58 +0200 |
| commit | c565c09250f3b1cec255bc1f36a0b373a92467cd (patch) | |
| tree | 4515907178f762eaaf3e91dc512cc969541ba974 /config.h | |
| parent | be7782eb232d3703831ae86ade3699aace3661d0 (diff) | |
write status for lemonbar periodically, remove unused functions, add ignore to AppRule, use titles, rectangle
Diffstat (limited to 'config.h')
| -rw-r--r-- | config.h | 108 |
1 files changed, 108 insertions, 0 deletions
diff --git a/config.h b/config.h new file mode 100644 index 0000000..aca1e5d --- /dev/null +++ b/config.h @@ -0,0 +1,108 @@ +/* see LICENSE for copyright and license */ + +#ifndef CONFIG_H +#define CONFIG_H + +/** modifiers **/ +#define MOD1 Mod1Mask /* ALT key */ +#define MOD4 Mod4Mask /* Super/Windows key */ +#define CONTROL ControlMask /* Control key */ +#define SHIFT ShiftMask /* Shift key */ + +/** generic settings **/ +#define MASTER_SIZE 0.6 +#define SHOW_PANEL True /* show panel by default on exec */ +#define TOP_PANEL False /* False means panel is on bottom */ +#define PANEL_HEIGHT 18 /* 0 for no space for panel, thus no panel */ +#define DEFAULT_MODE TILE /* initial layout/mode: TILE MONOCLE BSTACK GRID FLOAT */ +#define ATTACH_ASIDE True /* False means new window is master */ +#define FOLLOW_WINDOW False /* follow the window when moved to a different desktop */ +#define FOLLOW_MOUSE True /* focus the window the mouse just entered */ +#define CLICK_TO_FOCUS True /* focus an unfocused window when clicked */ +#define FOCUS_BUTTON Button3 /* mouse button to be used along with CLICK_TO_FOCUS */ +#define BORDER_WIDTH 2 /* window border width */ +#define FOCUS "#ff950e" /* focused window border color */ +#define UNFOCUS "#444444" /* unfocused window border color */ +#define MINWSZ 50 /* minimum window size in pixels */ +#define DEFAULT_DESKTOP 0 /* the desktop to focus initially */ +#define DESKTOPS 8 /* number of desktops - edit DESKTOPCHANGE keys to suit */ + +/** + * open applications to specified desktop with specified mode. + * if desktop is negative, then current is assumed + */ +static const AppRule rules[] = { \ + /* class desktop follow float ignore*/ + { "stalonetray", -1, True, True, True }, +}; + +/* helper for spawning shell commands */ +#define SHCMD(cmd) {.com = (const char*[]){"/bin/sh", "-c", cmd, NULL}} + +/** + * custom commands + * must always end with ', NULL };' + */ +static const char *termcmd[] = { "alacritty", NULL }; +static const char *menucmd[] = { "run", NULL }; + +#define DESKTOPCHANGE(K,N) \ + { MOD4, K, change_desktop, {.i = N} }, \ + { MOD4|ShiftMask, K, client_to_desktop, {.i = N} }, + +/** + * keyboard shortcuts + */ +static Key keys[] = { + /* modifier key function argument */ + + // Commands + { MOD4, XK_t, spawn, {.com = termcmd} }, + { MOD4, XK_d, spawn, {.com = menucmd} }, + { MOD4, XK_space, spawn, SHCMD("mpc toggle") }, + { MOD4|SHIFT, XK_space, spawn, SHCMD("albumbler.py") }, + { MOD4, XK_h, spawn, SHCMD("lock") }, + { MOD4|SHIFT|CONTROL, XK_space, spawn, SHCMD("notify-send --app-name=Playing $(mpc current)")}, + { MOD4|SHIFT|CONTROL, XK_q, quit, {.i = 0} }, /* quit with exit value 0 */ + + // Windows + { MOD4, XK_n, next_win, {NULL} }, + { MOD4, XK_o, prev_win, {NULL} }, + { MOD4|SHIFT, XK_n, move_down, {NULL} }, + { MOD4|SHIFT, XK_o, move_up, {NULL} }, + { MOD4|SHIFT, XK_k, killclient, {NULL} }, + { MOD4, XK_Return, swap_master, {NULL} }, + { MOD4, XK_BackSpace, focusurgent, {NULL} }, + { MOD4, XK_e, resize_master, {.i = +10} }, /* increase size in px */ + { MOD4, XK_i, resize_master, {.i = -10} }, /* decrease size in px */ + + // Desktops + { MOD4, XK_Tab, last_desktop, {NULL} }, + DESKTOPCHANGE( XK_l, 0) + DESKTOPCHANGE( XK_u, 1) + DESKTOPCHANGE( XK_y, 2) + DESKTOPCHANGE( XK_semicolon, 3) + DESKTOPCHANGE( XK_q, 4) + DESKTOPCHANGE( XK_w, 5) + DESKTOPCHANGE( XK_f, 6) + DESKTOPCHANGE( XK_p, 7) + + // Layouts + { MOD4, XK_a, switch_mode, {.i = TILE} }, + { MOD4, XK_r, switch_mode, {.i = MONOCLE} }, + { MOD4, XK_s, switch_mode, {.i = BSTACK} }, + { MOD4|SHIFT, XK_a, switch_mode, {.i = GRID} }, + { MOD4|SHIFT, XK_r, switch_mode, {.i = FLOAT} }, + { MOD4, XK_b, togglepanel, {NULL} }, +}; + +/** + * mouse shortcuts + */ +static Button buttons[] = { + { MOD4, Button1, mousemotion, {.i = MOVE} }, + { MOD4, Button3, mousemotion, {.i = RESIZE} }, +}; +#endif + +/* vim: set expandtab ts=4 sts=4 sw=4 : */ |
