diff options
author | uint23 <[email protected]> | 2025-04-18 16:27:30 +0100 |
---|---|---|
committer | uint23 <[email protected]> | 2025-04-18 16:27:30 +0100 |
commit | 75d7cd191653558f015a71ab33e3b68c889138f4 (patch) | |
tree | f0d3358d5016f661cd76e87fe445c36b9fdd2bb8 | |
parent | 8566e50ca7758382553db0931fd3ccc214c87324 (diff) |
doc update
-rw-r--r-- | src/usercfg.h | 132 |
1 files changed, 115 insertions, 17 deletions
diff --git a/src/usercfg.h b/src/usercfg.h index 8155fc0..8bf6b3a 100644 --- a/src/usercfg.h +++ b/src/usercfg.h @@ -1,32 +1,130 @@ -#ifndef USER_CONFIG -#define USER_CONFIG - +/*< You can ignore this >*/ #include <X11/keysym.h> #include "defs.h" +/* + * ——————————————< Appearance >—————————————— * + * + * In this section you can configure the + * settings for sxwm. You can ignore the + * #define as it is C specific syntax + * + * GAPS (px): + * How many pixels between windows and + * screen edges (including bar) + * BORDER_WIDTH (px): + * How thick your border is + * + * BORDER_FOC_COL (hex): + * The colour of your border when the + * window is focused + * + * BORDER_UFOC_COL (hex): + * The colour of your border when the + * window is unfocused + * + * MASTER_WIDTH (float): + * % of the screen the master window + * should take as a decimal value 0-1 + * + * MOTION_THROTTLE (int): + * Usually you should set this to your + * screen refreshrate. This is set so + * there is no exessive number of + * requests being sent to the X server + * + * SNAP_DISTANCE (px): + * How many pixels away from the screen + * until the window *snaps* to the edge + * + * ———————————————————————————————————————————* +*/ + +#define GAPS 10 #define BORDER_WIDTH 5 -#define BORDER_FOC_COL "#AAFFFA" // the border color when focused -#define BORDER_UFOC_COL "#FF4439" // the border color when unfocused -#define GAPS 10 // how many pixels wide the border is -#define MASTER_WIDTH 0.6 // how much of the screen the master window takes up (0.0-1.0) -#define MOTION_THROTTLE 144 // set this to your screen refreshrate -#define SNAP_DISTANCE 10 // snap distance +#define BORDER_FOC_COL "#AAFFFA" +#define BORDER_UFOC_COL "#FF4439" +#define MASTER_WIDTH 0.6 +#define MOTION_THROTTLE 144 +#define SNAP_DISTANCE 10 -static const char *termcmd[] = {"st", NULL}; +/* + * ———————————< Keys & Bindins >————————————— * + * + * This is where you set your keybinds to + * open apps, kill apps, perform in-built + * functions. + * + * How to make a command to run an app: + * + * 1) Just write this: + * 'static const char *' + * you don't have to understand this, + * this is just how you make a string + * in C + * + * 2) Call it what the app is called or + * anything you want really, eg. the + * command to open a terminal is + * termcmd. Also append a '[]' at the + * end to show its an array. This is + * for use of arguments eg 'ls -lah'. + * + * 3) Construct the command by putting '=' + * then after that open '{' then put + * the first arg in "arg0",. Repeat for + * all your args and end it with NULL. + * Strings in C are ended with a NULL + * 'terminator' which tells the program + * that that is the end of the string. + * + * 4) Finally, close the '}', then add + * a semi-colon at the end. + * + * After doing all that, you should have + * something like this: + * + * static const char *app = { "app", NULL }; + * + * ——————————— —————————————————————————————— * + * +*/ -#define MOD ALT -static const Binding binds[] = { - BIND(MOD, Return, termcmd), +static const char *termcmd[] = { "st", NULL }; +static const char *browsercmd[] = { "firefox", NULL }; + +/*< This is your modifier key (MOD/SUPER) >*/ +#define MOD ALT + +/* + * ———————————————< Bindings >————————————————* + * + * This is where you assign keybinds to + * perform some actions. + * + * + * ——————————— —————————————————————————————— * +*/ + +static const Binding binds[] = +{ +/* Modifier(s) Key Function */ CALL(MOD|SHIFT, e, quit), + CALL(MOD|SHIFT, q, close_focused), + CALL(MOD, j, focus_next), CALL(MOD, k, focus_prev), + CALL(MOD|SHIFT, j, move_master_next), CALL(MOD|SHIFT, k, move_master_prev), - CALL(MOD|SHIFT, q, close_focused), - CALL(MOD, f, toggle_floating), + CALL(MOD, equal, inc_gaps), CALL(MOD, minus, dec_gaps), + + CALL(MOD, f, toggle_floating), CALL(MOD, space, toggle_floating_global), -}; -#endif +/* Here are your executable functions */ + BIND(MOD, Return, termcmd), + BIND(MOD, b, browsercmd), +}; |