diff --git a/config.h b/config.h index 103a7af..7a5bd2b 100644 --- a/config.h +++ b/config.h @@ -70,16 +70,16 @@ static const char *screenlock[] = { "betterlockscreen", "-l", NULL }; static const Key keys[] = { /* modifier key function argument */ { MODKEY, XK_d, spawn, {.v = dmenucmd } }, - { MODKEY, XK_less, spawn, {.v = termcmd } }, + { MODKEY, XK_Return, spawn, {.v = termcmd } }, { MODKEY, XK_i, spawn, {.v = chromium } }, { MODKEY, XK_twosuperior, spawn, {.v = screenlock } }, - { MODKEY, XK_t, setlayout, {.v = &layouts[0]} }, - { MODKEY, XK_m, setlayout, {.v = &layouts[1]} }, + { MODKEY, XK_space, setlayout, {0} }, { MODKEY, XK_f, togglefullscreen, {0} }, { MODKEY, XK_Up, focusstack, {.i = +1 } }, { MODKEY, XK_Down, focusstack, {.i = -1 } }, { MODKEY, XK_F12, incnmaster, {.i = +1 } }, { MODKEY, XK_F11, incnmaster, {.i = -1 } }, + { MODKEY, XK_exclam, zoom, {0} }, { MODKEY, XK_Left, setmfact, {.f = -0.05} }, { MODKEY, XK_Right, setmfact, {.f = +0.05} }, { MODKEY|ShiftMask, XK_a, killclient, {0} }, @@ -90,9 +90,9 @@ static const Key keys[] = { { MODKEY|ShiftMask, XK_comma, tagmon, {.i = -1 } }, { MODKEY|ShiftMask, XK_semicolon, tagmon, {.i = +1 } }, { MODKEY|ShiftMask, XK_q, quit, {0} }, - { MODKEY, XK_F1, spawn, SHCMD("pamixer -t && notify-send -u normal \"volume\" \"$(pamixer --get-volume-human)\"") }, - { MODKEY, XK_F2, spawn, SHCMD("pamixer -d 5 -u && notify-send -u normal \"volume\" \"$(pamixer --get-volume-human)\"") }, - { MODKEY, XK_F3, spawn, SHCMD("pamixer -i 5 -u && notify-send -u normal \"volume\" \"$(pamixer --get-volume-human)\"") }, + { MODKEY, XK_F1, spawn, SHCMD("pamixer -t && notify-send -u normal -a \"volume\" \"$(pamixer --get-volume-human)\"") }, + { MODKEY, XK_F2, spawn, SHCMD("pamixer -d 5 -u && notify-send -u normal -a \"volume\" \"$(pamixer --get-volume-human)\"") }, + { MODKEY, XK_F3, spawn, SHCMD("pamixer -i 5 -u && notify-send -u normal -a \"volume\" \"$(pamixer --get-volume-human)\"") }, { MODKEY, XK_F4, spawn, SHCMD("brightnessctl -d \"amdgpu_bl1\" set 10%- && notify-send -u normal -a \"brightness\" \"$(brightnessctl -d 'amdgpu_bl1' get)\"") }, { MODKEY, XK_F5, spawn, SHCMD("brightnessctl -d \"amdgpu_bl1\" set +10% && notify-send -u normal -a \"brightness\" \"$(brightnessctl -d 'amdgpu_bl1' get)\"") }, { MODKEY, XK_F6, spawn, SHCMD("~/nixos/scripts/usb_guest.sh") }, diff --git a/dwm.c b/dwm.c index 363e554..805b4d9 100644 --- a/dwm.c +++ b/dwm.c @@ -190,7 +190,7 @@ static void monocle(Monitor *m); static void motionnotify(XEvent *e); //static void movemouse(const Arg *arg); static Client *nexttiled(Client *c); -//static void pop(Client *c); +static void pop(Client *c); static void propertynotify(XEvent *e); static void quit(const Arg *arg); static Monitor *recttomon(int x, int y, int w, int h); @@ -241,7 +241,7 @@ static int xerror(Display *dpy, XErrorEvent *ee); static int xerrordummy(Display *dpy, XErrorEvent *ee); static int xerrorstart(Display *dpy, XErrorEvent *ee); static void xinitvisual(); -//static void zoom(const Arg *arg); +static void zoom(const Arg *arg); /* variables */ static const char broken[] = "broken"; @@ -1228,14 +1228,14 @@ nexttiled(Client *c) return c; } -// void -// pop(Client *c) -// { -// detach(c); -// attach(c); -// focus(c); -// arrange(c->mon); -// } +void +pop(Client *c) +{ + detach(c); + attach(c); + focus(c); + arrange(c->mon); +} void propertynotify(XEvent *e) @@ -2208,17 +2208,17 @@ xinitvisual() } } -// void -// zoom(const Arg *arg) -// { -// Client *c = selmon->sel; -// -// if (!selmon->lt[selmon->sellt]->arrange || !c || c->isfloating) -// return; -// if (c == nexttiled(selmon->clients) && !(c = nexttiled(c->next))) -// return; -// pop(c); -// } +void +zoom(const Arg *arg) +{ + Client *c = selmon->sel; + + if (!selmon->lt[selmon->sellt]->arrange || !c || c->isfloating) + return; + if (c == nexttiled(selmon->clients) && !(c = nexttiled(c->next))) + return; + pop(c); +} int main(int argc, char *argv[]) diff --git a/dwm.o b/dwm.o index 9dd1dac..ebc64e0 100644 Binary files a/dwm.o and b/dwm.o differ