summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
author0scar <qgt268@alumni.ku.dk>2024-09-24 07:09:18 +0000
committer0scar <qgt268@alumni.ku.dk>2024-10-01 11:53:30 +0000
commit5a61337342915ff0697546d0b88852f559bf84a5 (patch)
treeaed81bbf89e88ee8d201eec1a1f9dca4845b2705
parent8c62ba88848c8dc4b0d0471382e9ec4ca139fb60 (diff)
Customization
-rw-r--r--config.def.h83
1 files changed, 66 insertions, 17 deletions
diff --git a/config.def.h b/config.def.h
index ee03616..57e28e9 100644
--- a/config.def.h
+++ b/config.def.h
@@ -3,15 +3,18 @@
((hex >> 16) & 0xFF) / 255.0f, \
((hex >> 8) & 0xFF) / 255.0f, \
(hex & 0xFF) / 255.0f }
+
+#define TERMINAL "foot"
+
/* appearance */
static const int sloppyfocus = 1; /* focus follows mouse */
static const int mousefollowsfocus = 1; /* mouse follows focus */
static const int bypass_surface_visibility = 0; /* 1 means idle inhibitors will disable idle tracking even if it's surface isn't visible */
static const int smartborders = 1;
-static const unsigned int borderpx = 1; /* border pixel of windows */
+static const unsigned int borderpx = 2; /* border pixel of windows */
static const float rootcolor[] = COLOR(0x222222ff);
static const float bordercolor[] = COLOR(0x444444ff);
-static const float focuscolor[] = COLOR(0x005577ff);
+static const float focuscolor[] = COLOR(0xae81ffff);
static const float urgentcolor[] = COLOR(0xff0000ff);
/* This conforms to the xdg-protocol. Set the alpha to zero to restore the old behavior */
static const float fullscreen_bg[] = {0.1f, 0.1f, 0.1f, 1.0f}; /* You can also use glsl colors */
@@ -23,12 +26,14 @@ static const float fullscreen_bg[] = {0.1f, 0.1f, 0.1f, 1.0f}; /* You ca
static int log_level = WLR_ERROR;
/* NOTE: ALWAYS keep a rule declared even if you don't use rules (e.g leave at least one example) */
+#define TAG(t) (1 << (t - 1))
static const Rule rules[] = {
/* app_id title tags mask isfloating monitor */
/* examples: */
- { "Gimp_EXAMPLE", NULL, 0, 1, -1 }, /* Start on currently visible tags floating, not tiled */
- { "firefox_EXAMPLE", NULL, 1 << 8, 0, -1 }, /* Start on ONLY tag "9" */
+ { "Gimp", NULL, TAG(9), 1, -1 }, /* Start on currently visible tags floating, not tiled */
+ { "firefox", NULL, TAG(2), 0, -1 }, /* Start on ONLY tag "9" */
};
+#undef TAG
/* layout(s) */
static const Layout layouts[] = {
@@ -59,15 +64,15 @@ static const struct xkb_rule_names xkb_rules = {
/* example:
.options = "ctrl:nocaps",
*/
- .options = NULL,
+ .options = "compose:ralt,caps:escape",
};
-static const int repeat_rate = 25;
-static const int repeat_delay = 600;
+static const int repeat_rate = 50;
+static const int repeat_delay = 190;
/* Trackpad */
-static const int tap_to_click = 1;
-static const int tap_and_drag = 1;
+static const int tap_to_click = 0;
+static const int tap_and_drag = 0;
static const int drag_lock = 1;
static const int natural_scrolling = 0;
static const int disable_while_typing = 1;
@@ -99,7 +104,7 @@ static const uint32_t send_events_mode = LIBINPUT_CONFIG_SEND_EVENTS_ENABLED;
LIBINPUT_CONFIG_ACCEL_PROFILE_FLAT
LIBINPUT_CONFIG_ACCEL_PROFILE_ADAPTIVE
*/
-static const enum libinput_config_accel_profile accel_profile = LIBINPUT_CONFIG_ACCEL_PROFILE_ADAPTIVE;
+static const enum libinput_config_accel_profile accel_profile = LIBINPUT_CONFIG_ACCEL_PROFILE_FLAT;
static const double accel_speed = 0.0;
/* You can choose between:
@@ -109,7 +114,7 @@ LIBINPUT_CONFIG_TAP_MAP_LMR -- 1/2/3 finger tap maps to left/middle/right
static const enum libinput_config_tap_button_map button_map = LIBINPUT_CONFIG_TAP_MAP_LRM;
/* If you want to use the windows key for MODKEY, use WLR_MODIFIER_LOGO */
-#define MODKEY WLR_MODIFIER_ALT
+#define MODKEY WLR_MODIFIER_LOGO
#define TAGKEYS(KEY,SKEY,TAG) \
{ MODKEY, KEY, view, {.ui = 1 << TAG} }, \
@@ -121,14 +126,22 @@ static const enum libinput_config_tap_button_map button_map = LIBINPUT_CONFIG_TA
#define SHCMD(cmd) { .v = (const char*[]){ "/bin/sh", "-c", cmd, NULL } }
/* commands */
-static const char *termcmd[] = { "foot", NULL };
-static const char *menucmd[] = { "wmenu-run", NULL };
+static const char *browsercmd[] = {"firefox-developer-edition"};
+static const char *browsercmd_p[] = {"firefox-developer-edition", "-P"};
+static const char *menucmd[] = { "bemenu_run_history", "-p", "$", NULL };
+static const char *termcmd[] = { TERMINAL, "-d", "none", NULL };
+
+/* named scratchpads - First arg only serves to match against key in rules*/
+static const char *scratchpadcmd[] = { "s", TERMINAL, "-d", "none", "-T", "scratchpad", "-a", "scratchpad", NULL };
+static const char *scratchpadcalc[] = { "c", TERMINAL, "-d", "none", "-T", "spcalc", "-a", "spcalc", "-e", "bc", "-lq", NULL};
static const Key keys[] = {
/* Note that Shift changes certain key codes: c -> C, 2 -> at, etc. */
/* modifier key function argument */
- { MODKEY, XKB_KEY_p, spawn, {.v = menucmd} },
- { MODKEY|WLR_MODIFIER_SHIFT, XKB_KEY_Return, spawn, {.v = termcmd} },
+ { MODKEY, XKB_KEY_d, spawn, {.v = menucmd} },
+ { MODKEY, XKB_KEY_Return, spawn, {.v = termcmd} },
+ { MODKEY|WLR_MODIFIER_SHIFT, XKB_KEY_Return, spawn, {.v = scratchpadcmd} },
+ { MODKEY, XKB_KEY_apostrophe, spawn, {.v = scratchpadcalc} },
{ MODKEY, XKB_KEY_j, focusstack, {.i = +1} },
{ MODKEY, XKB_KEY_k, focusstack, {.i = -1} },
{ MODKEY, XKB_KEY_i, incnmaster, {.i = +1} },
@@ -137,7 +150,7 @@ static const Key keys[] = {
{ MODKEY, XKB_KEY_l, setmfact, {.f = +0.05f} },
{ MODKEY, XKB_KEY_Return, zoom, {0} },
{ MODKEY, XKB_KEY_Tab, view, {0} },
- { MODKEY|WLR_MODIFIER_SHIFT, XKB_KEY_C, killclient, {0} },
+ { MODKEY|WLR_MODIFIER_SHIFT, XKB_KEY_Q, killclient, {0} },
{ MODKEY, XKB_KEY_t, setlayout, {.v = &layouts[0]} },
{ MODKEY, XKB_KEY_f, setlayout, {.v = &layouts[1]} },
{ MODKEY, XKB_KEY_m, setlayout, {.v = &layouts[2]} },
@@ -150,6 +163,41 @@ static const Key keys[] = {
{ MODKEY, XKB_KEY_period, focusmon, {.i = WLR_DIRECTION_RIGHT} },
{ MODKEY|WLR_MODIFIER_SHIFT, XKB_KEY_less, tagmon, {.i = WLR_DIRECTION_LEFT} },
{ MODKEY|WLR_MODIFIER_SHIFT, XKB_KEY_greater, tagmon, {.i = WLR_DIRECTION_RIGHT} },
+
+
+ /* Programs */
+ { MODKEY, XKB_KEY_x, spawn, SHCMD("swaylock") },
+ { 0, XKB_KEY_Print, spawn, SHCMD("grim -g \"$(slurp)\" - | tee screenshot.png | wl-copy -t image/png") },
+ { MODKEY, XKB_KEY_Insert, spawn, SHCMD("notify-send \"Clipboard contents\" \"$(wl-paste -n)\"") },
+ { MODKEY, XKB_KEY_g, spawn, SHCMD("emoji") },
+
+ { MODKEY|WLR_MODIFIER_SHIFT, XKB_KEY_E, spawn, SHCMD(TERMINAL " -d none nmtui") },
+ { MODKEY, XKB_KEY_e, spawn, SHCMD(TERMINAL " -d none btop") },
+
+ { MODKEY, XKB_KEY_w, spawn, {.v = browsercmd} },
+ { MODKEY|WLR_MODIFIER_SHIFT, XKB_KEY_W, spawn, {.v = browsercmd_p} },
+
+ { MODKEY, XKB_KEY_z, spawn, SHCMD("zathura") },
+ { MODKEY|WLR_MODIFIER_SHIFT, XKB_KEY_Z, spawn, SHCMD(TERMINAL " -d none open_book") },
+ { MODKEY, XKB_KEY_m, spawn, SHCMD("open_man") },
+
+ /* Audio controls */
+ { MODKEY|WLR_MODIFIER_SHIFT, XKB_KEY_M, spawn, SHCMD("pamixer -t && sigblock -b vol") },
+ { 0, XKB_KEY_XF86AudioMute, spawn, SHCMD("pamixer -t && sigblock -b vol") },
+ { 0, XKB_KEY_XF86AudioRaiseVolume, spawn,SHCMD("pamixer --allow-boost -i 5 && sigblock -b vol") },
+ { 0, XKB_KEY_XF86AudioLowerVolume, spawn,SHCMD("pamixer --allow-boost -d 5 && sigblock -b vol") },
+ { MODKEY, XKB_KEY_bracketright, spawn, SHCMD("pamixer --allow-boost -i 5 && sigblock -b vol") },
+ { MODKEY, XKB_KEY_bracketleft, spawn, SHCMD("pamixer --allow-boost -d 5 && sigblock -b vol") },
+
+ /* Monitor brightness controls */
+ { 0, XKB_KEY_XF86MonBrightnessUp, spawn,SHCMD("brightnessctl s 10%+") },
+ { 0, XKB_KEY_XF86MonBrightnessDown,spawn,SHCMD("brightnessctl s 10%-") },
+
+ /* Notification controls */
+ { WLR_MODIFIER_CTRL, XKB_KEY_space, spawn, SHCMD("makoctl dismiss")},
+ { WLR_MODIFIER_CTRL|WLR_MODIFIER_SHIFT, XKB_KEY_space, spawn, SHCMD("makoctl dismiss --all")},
+ { WLR_MODIFIER_CTRL|MODKEY, XKB_KEY_space, spawn, SHCMD("makoctl restore")},
+
TAGKEYS( XKB_KEY_1, XKB_KEY_exclam, 0),
TAGKEYS( XKB_KEY_2, XKB_KEY_at, 1),
TAGKEYS( XKB_KEY_3, XKB_KEY_numbersign, 2),
@@ -159,7 +207,7 @@ static const Key keys[] = {
TAGKEYS( XKB_KEY_7, XKB_KEY_ampersand, 6),
TAGKEYS( XKB_KEY_8, XKB_KEY_asterisk, 7),
TAGKEYS( XKB_KEY_9, XKB_KEY_parenleft, 8),
- { MODKEY|WLR_MODIFIER_SHIFT, XKB_KEY_Q, quit, {0} },
+ { MODKEY|WLR_MODIFIER_SHIFT, XKB_KEY_BackSpace, quit, {0} },
/* Ctrl-Alt-Backspace and Ctrl-Alt-Fx used to be handled by X server */
{ WLR_MODIFIER_CTRL|WLR_MODIFIER_ALT,XKB_KEY_Terminate_Server, quit, {0} },
@@ -169,6 +217,7 @@ static const Key keys[] = {
#define CHVT(n) { WLR_MODIFIER_CTRL|WLR_MODIFIER_ALT,XKB_KEY_XF86Switch_VT_##n, chvt, {.ui = (n)} }
CHVT(1), CHVT(2), CHVT(3), CHVT(4), CHVT(5), CHVT(6),
CHVT(7), CHVT(8), CHVT(9), CHVT(10), CHVT(11), CHVT(12),
+#undef CHVT
};
static const Button buttons[] = {