use function keys

This commit is contained in:
Maddie H 2023-07-18 17:21:45 +01:00
parent dca69fedae
commit 46afebd65b
Signed by: maddie
GPG Key ID: C296DE8C9053683F

View File

@ -5,7 +5,7 @@ static const unsigned int borderpx = 2; /* border pixel of windows */
static const unsigned int gappx = 10; /* gaps between windows */ static const unsigned int gappx = 10; /* gaps between windows */
static const unsigned int snap = 0; /* snap pixel */ static const unsigned int snap = 0; /* snap pixel */
static const int showbar = 1; /* 0 means no bar */ static const int showbar = 1; /* 0 means no bar */
static const int topbar = 0; /* 0 means bottom bar */ static const int topbar = 1; /* 0 means bottom bar */
/* fonts */ /* fonts */
static const char *fonts[] = { "Iosevka:pixelsize=14:antialias=true:autohint=true", static const char *fonts[] = { "Iosevka:pixelsize=14:antialias=true:autohint=true",
@ -82,11 +82,12 @@ static const char *dmenucmd[] = { "dmenu_run", "-p", "Run:", "-m", dmenumon, NUL
static const Key keys[] = { static const Key keys[] = {
/* modifier key function argument */ /* modifier key function argument */
/* launcher keys */
{ MODKEY, XK_w, spawn, SHCMD("librewolf https://www.wolframalpha.com/") }, { MODKEY, XK_w, spawn, SHCMD("librewolf https://www.wolframalpha.com/") },
{ MODKEY, XK_z, spawn, SHCMD("boomer") }, { MODKEY, XK_z, spawn, SHCMD("boomer") },
{ MODKEY, XK_c, spawn, SHCMD("gcolor2") }, { MODKEY, XK_c, spawn, SHCMD("gcolor2") },
{ MODKEY, XK_n, spawn, SHCMD("st nvim") }, { MODKEY, XK_n, spawn, SHCMD("st nvim") },
{ 0, XK_F4, spawn, SHCMD("st pulsemixer") },
{ MODKEY, XK_x, spawn, SHCMD("xkill") }, { MODKEY, XK_x, spawn, SHCMD("xkill") },
{ MODKEY|ShiftMask, XK_s, spawn, SHCMD("sss -c") }, { MODKEY|ShiftMask, XK_s, spawn, SHCMD("sss -c") },
{ MODKEY|ShiftMask, XK_bar, spawn, SHCMD("plumb $(xclip -o)") }, { MODKEY|ShiftMask, XK_bar, spawn, SHCMD("plumb $(xclip -o)") },
@ -97,14 +98,33 @@ static const Key keys[] = {
{ MODKEY|ShiftMask, XK_m, spawn, SHCMD("dmenu-mount") }, { MODKEY|ShiftMask, XK_m, spawn, SHCMD("dmenu-mount") },
{ MODKEY|ShiftMask, XK_b, spawn, SHCMD("dmenu-bluetooth") }, { MODKEY|ShiftMask, XK_b, spawn, SHCMD("dmenu-bluetooth") },
{ MODKEY|ShiftMask, XK_c, spawn, SHCMD("dmenu-kdeconnect") }, { MODKEY|ShiftMask, XK_c, spawn, SHCMD("dmenu-kdeconnect") },
{ 0, XK_F8, spawn, SHCMD("dmenu-mpc") },
/* function keys */
{ MODKEY, XK_F1, spawn, SHCMD("st -e sh -c 'cd ~/Documents/Code/NixFiles'")},
{ MODKEY, XK_F2, spawn, SHCMD("librewolf https://search.nixos.org")},
{ MODKEY, XK_F3, spawn, SHCMD("st -e sh -c 'search; exit'")},
{ MODKEY, XK_F4, spawn, SHCMD("st pulsemixer") },
/* media keys using function row */
{ MODKEY|ShiftMask, XK_F1, spawn, SHCMD("volume mute")},
{ MODKEY|ShiftMask, XK_F2, spawn, SHCMD("volume down") },
{ MODKEY|ShiftMask, XK_F3, spawn, SHCMD("volume up") },
{ MODKEY|ShiftMask, XK_F4, spawn, SHCMD("st pulsemixer") },
{ MODKEY|ShiftMask, XK_F5, spawn, SHCMD("playerctl previous") },
{ MODKEY|ShiftMask, XK_F6, spawn, SHCMD("playerctl play-pause") },
{ MODKEY|ShiftMask, XK_F7, spawn, SHCMD("playerctl next") },
{ MODKEY|ShiftMask, XK_F8, spawn, SHCMD("dmenu-mpc") },
/* media keys */
{ 0, XF86XK_AudioLowerVolume, spawn, SHCMD("volume down") }, { 0, XF86XK_AudioLowerVolume, spawn, SHCMD("volume down") },
{ 0, XF86XK_AudioMute, spawn, SHCMD("volume mute")}, { 0, XF86XK_AudioMute, spawn, SHCMD("volume mute")},
{ 0, XF86XK_AudioRaiseVolume, spawn, SHCMD("volume up") }, { 0, XF86XK_AudioRaiseVolume, spawn, SHCMD("volume up") },
{ 0, XF86XK_AudioPlay, spawn, SHCMD("playerctl play-pause") }, { MODKEY, XF86XK_AudioPlay, spawn, SHCMD("playerctl play-pause") },
{ 0, XF86XK_AudioNext, spawn, SHCMD("playerctl next") }, { MODKEY, XF86XK_AudioNext, spawn, SHCMD("playerctl next") },
{ 0, XF86XK_AudioPrev, spawn, SHCMD("playerctl previous") }, { MODKEY, XF86XK_AudioPrev, spawn, SHCMD("playerctl previous") },
{ 0, XK_Insert, spawn, {.v = lockcmd} },
/* dwm keys */
{ MODKEY, XK_Insert, spawn, {.v = lockcmd} },
{ MODKEY, XK_d, spawn, {.v = dmenucmd} }, { MODKEY, XK_d, spawn, {.v = dmenucmd} },
{ MODKEY, XK_space, spawn, {.v = dmenucmd} }, { MODKEY, XK_space, spawn, {.v = dmenucmd} },
{ MODKEY, XK_Return, spawn, {.v = termcmd} }, { MODKEY, XK_Return, spawn, {.v = termcmd} },