simplify config

This commit is contained in:
λmolinae 2025-01-10 22:00:52 -06:00
parent b8a2083826
commit fd10d88fb4

View file

@ -145,32 +145,44 @@ static const enum libinput_config_tap_button_map button_map = LIBINPUT_CONFIG_TA
#define SHCMD(cmd) { .v = (const char*[]){ "/bin/sh", "-c", cmd, NULL } } #define SHCMD(cmd) { .v = (const char*[]){ "/bin/sh", "-c", cmd, NULL } }
/* commands */ /* commands */
static const char *termcmd[] = { "footclient", NULL }; static const char *termcmd[] = { "footclient", NULL }; // Terminal
static const char *menucmd[] = { "tofi-drun", NULL }; static const char *menucmd[] = { "tofi-drun", NULL }; // Application launcher
static const char *fmgrcmd[] = { "pcmanfm-qt", NULL}; static const char *fmgrcmd[] = { "pcmanfm-qt", NULL }; // File manager
static const char *lockcmd[] = { "swaylock", NULL }; // Launch swaylock
static const char *emojcmd[] = { "tofiunicode",NULL }; // Launch emoji menu
static const Key keys[] = { static const Key keys[] = {
/* Note that Shift changes certain key codes: c -> C, 2 -> at, etc. */ /* Note that Shift changes certain key codes: c -> C, 2 -> at, etc. */
/* modifier key function argument */ /* modifier key function argument */
{ MODKEY, XKB_KEY_p, spawn, {.v = menucmd} }, { MODKEY, XKB_KEY_r, spawn, {.v = menucmd} },
{ MODKEY|WLR_MODIFIER_SHIFT, XKB_KEY_Return, spawn, {.v = termcmd} }, { MODKEY|WLR_MODIFIER_SHIFT, XKB_KEY_Return, spawn, {.v = termcmd} },
{ MODKEY, XKB_KEY_e, spawn, {.v = fmgrcmd} }, { MODKEY, XKB_KEY_e, spawn, {.v = fmgrcmd} },
{ MODKEY|WLR_MODIFIER_SHIFT, XKB_KEY_S, spawn, SHCMD("grim -g \"$(slurp -d)\" - | wl-copy")}, { MODKEY, XKB_KEY_l, spawn, {.v = lockcmd} },
{ MODKEY|WLR_MODIFIER_SHIFT, XKB_KEY_E, spawn, {.v = emojcmd} },
{ 0, XKB_KEY_XF86AudioMicMute, spawn,SHCMD("wpctl set-mute @DEFAULT_AUDIO_SOURCE@ toggle") },
{ 0, XKB_KEY_XF86AudioMute, spawn,SHCMD("wpctl set-mute @DEFAULT_AUDIO_SINK@ toggle") },
{ 0, XKB_KEY_XF86AudioLowerVolume, spawn,SHCMD("wpctl set-volume @DEFAULT_AUDIO_SINK@ 5%-") },
{ 0, XKB_KEY_XF86AudioRaiseVolume, spawn,SHCMD("wpctl set-volume -l 1 @DEFAULT_AUDIO_SINK@ 5%+")},
{ 0, XKB_KEY_XF86MonBrightnessUp, spawn,SHCMD("brightnessctl s +5%")},
{ 0, XKB_KEY_XF86MonBrightnessDown,spawn,SHCMD("brightnessctl s 5%-")},
{ MODKEY, XKB_KEY_b, togglebar, {0} }, { MODKEY, XKB_KEY_b, togglebar, {0} },
{ MODKEY|WLR_MODIFIER_SHIFT, XKB_KEY_S, togglesticky, {0} },
{ MODKEY, XKB_KEY_j, focusstack, {.i = +1} }, { MODKEY, XKB_KEY_j, focusstack, {.i = +1} },
{ MODKEY, XKB_KEY_k, focusstack, {.i = -1} }, { MODKEY, XKB_KEY_k, focusstack, {.i = -1} },
{ MODKEY, XKB_KEY_i, incnmaster, {.i = +1} }, { MODKEY|WLR_MODIFIER_SHIFT, XKB_KEY_d, incnmaster, {.i = +1} },
{ MODKEY, XKB_KEY_d, incnmaster, {.i = -1} }, { MODKEY|WLR_MODIFIER_SHIFT, XKB_KEY_a, incnmaster, {.i = -1} },
{ MODKEY|WLR_MODIFIER_CTRL, XKB_KEY_s, togglesticky, {0} }, { MODKEY|WLR_MODIFIER_CTRL, XKB_KEY_a, setmfact, {.f = -0.05f} },
{ MODKEY, XKB_KEY_h, setmfact, {.f = -0.05f} }, { MODKEY|WLR_MODIFIER_CTRL, XKB_KEY_d, setmfact, {.f = +0.05f} },
{ MODKEY, XKB_KEY_l, setmfact, {.f = +0.05f} }, /*
{ MODKEY, XKB_KEY_h, incgaps, {.i = +1 } }, { MODKEY, XKB_KEY_h, incgaps, {.i = +1 } },
{ MODKEY, XKB_KEY_l, incgaps, {.i = -1 } }, { MODKEY, XKB_KEY_l, incgaps, {.i = -1 } },
{ MODKEY|WLR_MODIFIER_SHIFT, XKB_KEY_H, incogaps, {.i = +1 } }, { MODKEY|WLR_MODIFIER_SHIFT, XKB_KEY_H, incogaps, {.i = +1 } },
{ MODKEY|WLR_MODIFIER_SHIFT, XKB_KEY_L, incogaps, {.i = -1 } }, { MODKEY|WLR_MODIFIER_SHIFT, XKB_KEY_L, incogaps, {.i = -1 } },
{ MODKEY|WLR_MODIFIER_CTRL, XKB_KEY_h, incigaps, {.i = +1 } }, { MODKEY|WLR_MODIFIER_CTRL, XKB_KEY_h, incigaps, {.i = +1 } },
{ MODKEY|WLR_MODIFIER_CTRL, XKB_KEY_l, incigaps, {.i = -1 } }, { MODKEY|WLR_MODIFIER_CTRL, XKB_KEY_l, incigaps, {.i = -1 } },
*/
{ MODKEY, XKB_KEY_0, togglegaps, {0} }, { MODKEY, XKB_KEY_0, togglegaps, {0} },
/*
{ MODKEY|WLR_MODIFIER_SHIFT, XKB_KEY_parenright, defaultgaps, {0} }, { MODKEY|WLR_MODIFIER_SHIFT, XKB_KEY_parenright, defaultgaps, {0} },
{ MODKEY, XKB_KEY_y, incihgaps, {.i = +1 } }, { MODKEY, XKB_KEY_y, incihgaps, {.i = +1 } },
{ MODKEY, XKB_KEY_o, incihgaps, {.i = -1 } }, { MODKEY, XKB_KEY_o, incihgaps, {.i = -1 } },
@ -182,26 +194,24 @@ static const Key keys[] = {
{ MODKEY|WLR_MODIFIER_SHIFT, XKB_KEY_O, incovgaps, {.i = -1 } }, { MODKEY|WLR_MODIFIER_SHIFT, XKB_KEY_O, incovgaps, {.i = -1 } },
{ MODKEY, XKB_KEY_Return, zoom, {0} }, { MODKEY, XKB_KEY_Return, zoom, {0} },
{ MODKEY, XKB_KEY_Tab, view, {0} }, { MODKEY, XKB_KEY_Tab, view, {0} },
*/
{ MODKEY, XKB_KEY_q, killclient, {0} }, { MODKEY, XKB_KEY_q, killclient, {0} },
{ MODKEY, XKB_KEY_t, setlayout, {.v = &layouts[0]} }, { MODKEY, XKB_KEY_t, setlayout, {.v = &layouts[0]} },
{ MODKEY, XKB_KEY_f, setlayout, {.v = &layouts[1]} }, { MODKEY, XKB_KEY_f, setlayout, {.v = &layouts[1]} },
{ MODKEY, XKB_KEY_m, setlayout, {.v = &layouts[2]} }, { MODKEY, XKB_KEY_m, setlayout, {.v = &layouts[2]} },
/*
{ MODKEY, XKB_KEY_space, setlayout, {0} }, { MODKEY, XKB_KEY_space, setlayout, {0} },
*/
{ MODKEY|WLR_MODIFIER_SHIFT, XKB_KEY_space, togglefloating, {0} }, { MODKEY|WLR_MODIFIER_SHIFT, XKB_KEY_space, togglefloating, {0} },
{ MODKEY, XKB_KEY_e, togglefullscreen, {0} }, { MODKEY, XKB_KEY_e, togglefullscreen, {0} },
{ MODKEY|WLR_MODIFIER_SHIFT, XKB_KEY_E, spawn, { .v = (const char*[]){ "tofiunicode", NULL } }}, /*
{ 0, XKB_KEY_XF86AudioMicMute,spawn, SHCMD("wpctl set-mute @DEFAULT_AUDIO_SOURCE@ toggle")},
{ 0, XKB_KEY_XF86AudioMute, spawn, SHCMD("wpctl set-mute @DEFAULT_AUDIO_SINK@ toggle")},
{ 0, XKB_KEY_XF86AudioLowerVolume, spawn,SHCMD("wpctl set-volume @DEFAULT_AUDIO_SINK@ 5%-")},
{ 0, XKB_KEY_XF86AudioRaiseVolume, spawn,SHCMD("wpctl set-volume -l 1 @DEFAULT_AUDIO_SINK@ 5%+")},
{ 0, XKB_KEY_XF86MonBrightnessUp, spawn,SHCMD("brightnessctl s +5%")},
{ 0, XKB_KEY_XF86MonBrightnessDown,spawn,SHCMD("brightnessctl s 5%-")},
{ MODKEY, XKB_KEY_0, view, {.ui = ~0} }, { MODKEY, XKB_KEY_0, view, {.ui = ~0} },
{ MODKEY|WLR_MODIFIER_SHIFT, XKB_KEY_parenright, tag, {.ui = ~0} }, { MODKEY|WLR_MODIFIER_SHIFT, XKB_KEY_parenright, tag, {.ui = ~0} },
{ MODKEY, XKB_KEY_comma, focusmon, {.i = WLR_DIRECTION_LEFT} }, { MODKEY, XKB_KEY_comma, focusmon, {.i = WLR_DIRECTION_LEFT} },
{ MODKEY, XKB_KEY_period, focusmon, {.i = WLR_DIRECTION_RIGHT} }, { 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_less, tagmon, {.i = WLR_DIRECTION_LEFT} },
{ MODKEY|WLR_MODIFIER_SHIFT, XKB_KEY_greater, tagmon, {.i = WLR_DIRECTION_RIGHT} }, { MODKEY|WLR_MODIFIER_SHIFT, XKB_KEY_greater, tagmon, {.i = WLR_DIRECTION_RIGHT} },
*/
TAGKEYS( XKB_KEY_1, XKB_KEY_exclam, 0), TAGKEYS( XKB_KEY_1, XKB_KEY_exclam, 0),
TAGKEYS( XKB_KEY_2, XKB_KEY_at, 1), TAGKEYS( XKB_KEY_2, XKB_KEY_at, 1),
TAGKEYS( XKB_KEY_3, XKB_KEY_numbersign, 2), TAGKEYS( XKB_KEY_3, XKB_KEY_numbersign, 2),