From 27ce2cea129d95926cfc7676e37f48e2cf388aa2 Mon Sep 17 00:00:00 2001 From: Mitchell Riedstra Date: Fri, 10 Sep 2021 20:30:29 -0400 Subject: Add in a fullscreen toggle hotkey to super+alt+f --- config.h | 2 ++ dwm.c | 8 ++++++++ 2 files changed, 10 insertions(+) diff --git a/config.h b/config.h index 04cb63f..12cb037 100644 --- a/config.h +++ b/config.h @@ -119,6 +119,8 @@ static Key keys[] = { { MODKEY|ShiftMask, XK_f, zoom, {0} }, { MODKEY, XK_Tab, view, {0} }, { MODKEY|ShiftMask, XK_q, killclient, {0} }, + /* This makes it impossible to switch to alt globally, oh well */ + { MODKEY|Mod1Mask, XK_f, togglefullscr, {0} }, { MODKEY, XK_t, setlayout, {.v = &layouts[0]} }, { MODKEY, XK_f, setlayout, {.v = &layouts[1]} }, { MODKEY, XK_m, setlayout, {.v = &layouts[2]} }, diff --git a/dwm.c b/dwm.c index 2e75b3a..cb4113f 100644 --- a/dwm.c +++ b/dwm.c @@ -212,6 +212,7 @@ static void tagmon(const Arg *arg); static void tile(Monitor *); static void togglebar(const Arg *arg); static void togglefloating(const Arg *arg); +static void togglefullscr(const Arg *arg); static void toggletag(const Arg *arg); static void toggleview(const Arg *arg); static void unfocus(Client *c, int setfocus); @@ -2255,3 +2256,10 @@ centeredfloatingmaster(Monitor *m) tx += WIDTH(c); } } + +void +togglefullscr(const Arg *arg) +{ + if(selmon->sel) + setfullscreen(selmon->sel, !selmon->sel->isfullscreen); +} -- cgit v1.2.3