Toggle fullscreen. Fixed gaps due to resizehints enabled
This commit is contained in:
parent
7c451d3c75
commit
45dddfa436
|
@ -2,7 +2,7 @@
|
||||||
|
|
||||||
/* appearance */
|
/* appearance */
|
||||||
static const unsigned int borderpx = 1; /* border pixel of windows */
|
static const unsigned int borderpx = 1; /* border pixel of windows */
|
||||||
static const unsigned int snap = 32; /* 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 = 1; /* 0 means bottom bar */
|
static const int topbar = 1; /* 0 means bottom bar */
|
||||||
//static const char *fonts[] = { "monospace:size=10" };
|
//static const char *fonts[] = { "monospace:size=10" };
|
||||||
|
@ -39,16 +39,16 @@ static const Rule rules[] = {
|
||||||
};
|
};
|
||||||
|
|
||||||
/* layout(s) */
|
/* layout(s) */
|
||||||
static const float mfact = 0.55; /* factor of master area size [0.05..0.95] */
|
static const float mfact = 0.5; /* factor of master area size [0.05..0.95] */
|
||||||
static const int nmaster = 1; /* number of clients in master area */
|
static const int nmaster = 1; /* number of clients in master area */
|
||||||
static const int resizehints = 1; /* 1 means respect size hints in tiled resizals */
|
static const int resizehints = 0; /* 1 means respect size hints in tiled resizals */
|
||||||
static const int lockfullscreen = 1; /* 1 will force focus on the fullscreen window */
|
static const int lockfullscreen = 1; /* 1 will force focus on the fullscreen window */
|
||||||
|
|
||||||
static const Layout layouts[] = {
|
static const Layout layouts[] = {
|
||||||
/* symbol arrange function */
|
/* symbol arrange function */
|
||||||
{ "[]=", tile }, /* first entry is default */
|
{ "[T]", tile }, /* first entry is default */
|
||||||
{ "><>", NULL }, /* no layout function means floating behavior */
|
{ "[O]", NULL }, /* no layout function means floating behavior */
|
||||||
{ "[M]", monocle },
|
{ "[F]", monocle },
|
||||||
};
|
};
|
||||||
|
|
||||||
/* key definitions */
|
/* key definitions */
|
||||||
|
@ -89,7 +89,7 @@ static Key keys[] = {
|
||||||
// win+shift+b sets floating on selected program
|
// win+shift+b sets floating on selected program
|
||||||
{ MODKEY|ShiftMask, XK_f, setlayout, {.v = &layouts[1]} },
|
{ MODKEY|ShiftMask, XK_f, setlayout, {.v = &layouts[1]} },
|
||||||
// win+f sets monocle (fullscreen) on selected program
|
// win+f sets monocle (fullscreen) on selected program
|
||||||
{ MODKEY, XK_f, setlayout, {.v = &layouts[2]} },
|
{ MODKEY, XK_f, togglefullscreen, {0} },
|
||||||
{ MODKEY, XK_p, setlayout, {0} },
|
{ MODKEY, XK_p, setlayout, {0} },
|
||||||
{ MODKEY|ShiftMask, XK_space, togglefloating, {0} },
|
{ MODKEY|ShiftMask, XK_space, togglefloating, {0} },
|
||||||
{ MODKEY, XK_0, view, {.ui = ~0 } },
|
{ MODKEY, XK_0, view, {.ui = ~0 } },
|
||||||
|
@ -123,4 +123,3 @@ static const Button buttons[] = {
|
||||||
{ ClkTagBar, MODKEY, Button1, tag, {0} },
|
{ ClkTagBar, MODKEY, Button1, tag, {0} },
|
||||||
{ ClkTagBar, MODKEY, Button3, toggletag, {0} },
|
{ ClkTagBar, MODKEY, Button3, toggletag, {0} },
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
15
dwm/config.h
15
dwm/config.h
|
@ -2,7 +2,7 @@
|
||||||
|
|
||||||
/* appearance */
|
/* appearance */
|
||||||
static const unsigned int borderpx = 1; /* border pixel of windows */
|
static const unsigned int borderpx = 1; /* border pixel of windows */
|
||||||
static const unsigned int snap = 32; /* 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 = 1; /* 0 means bottom bar */
|
static const int topbar = 1; /* 0 means bottom bar */
|
||||||
//static const char *fonts[] = { "monospace:size=10" };
|
//static const char *fonts[] = { "monospace:size=10" };
|
||||||
|
@ -39,16 +39,16 @@ static const Rule rules[] = {
|
||||||
};
|
};
|
||||||
|
|
||||||
/* layout(s) */
|
/* layout(s) */
|
||||||
static const float mfact = 0.55; /* factor of master area size [0.05..0.95] */
|
static const float mfact = 0.5; /* factor of master area size [0.05..0.95] */
|
||||||
static const int nmaster = 1; /* number of clients in master area */
|
static const int nmaster = 1; /* number of clients in master area */
|
||||||
static const int resizehints = 1; /* 1 means respect size hints in tiled resizals */
|
static const int resizehints = 0; /* 1 means respect size hints in tiled resizals */
|
||||||
static const int lockfullscreen = 1; /* 1 will force focus on the fullscreen window */
|
static const int lockfullscreen = 1; /* 1 will force focus on the fullscreen window */
|
||||||
|
|
||||||
static const Layout layouts[] = {
|
static const Layout layouts[] = {
|
||||||
/* symbol arrange function */
|
/* symbol arrange function */
|
||||||
{ "[]=", tile }, /* first entry is default */
|
{ "[T]", tile }, /* first entry is default */
|
||||||
{ "><>", NULL }, /* no layout function means floating behavior */
|
{ "[O]", NULL }, /* no layout function means floating behavior */
|
||||||
{ "[M]", monocle },
|
{ "[F]", monocle },
|
||||||
};
|
};
|
||||||
|
|
||||||
/* key definitions */
|
/* key definitions */
|
||||||
|
@ -89,7 +89,7 @@ static Key keys[] = {
|
||||||
// win+shift+b sets floating on selected program
|
// win+shift+b sets floating on selected program
|
||||||
{ MODKEY|ShiftMask, XK_f, setlayout, {.v = &layouts[1]} },
|
{ MODKEY|ShiftMask, XK_f, setlayout, {.v = &layouts[1]} },
|
||||||
// win+f sets monocle (fullscreen) on selected program
|
// win+f sets monocle (fullscreen) on selected program
|
||||||
{ MODKEY, XK_f, setlayout, {.v = &layouts[2]} },
|
{ MODKEY, XK_f, togglefullscreen, {0} },
|
||||||
{ MODKEY, XK_p, setlayout, {0} },
|
{ MODKEY, XK_p, setlayout, {0} },
|
||||||
{ MODKEY|ShiftMask, XK_space, togglefloating, {0} },
|
{ MODKEY|ShiftMask, XK_space, togglefloating, {0} },
|
||||||
{ MODKEY, XK_0, view, {.ui = ~0 } },
|
{ MODKEY, XK_0, view, {.ui = ~0 } },
|
||||||
|
@ -123,4 +123,3 @@ static const Button buttons[] = {
|
||||||
{ ClkTagBar, MODKEY, Button1, tag, {0} },
|
{ ClkTagBar, MODKEY, Button1, tag, {0} },
|
||||||
{ ClkTagBar, MODKEY, Button3, toggletag, {0} },
|
{ ClkTagBar, MODKEY, Button3, toggletag, {0} },
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
14
dwm/dwm.c
14
dwm/dwm.c
|
@ -212,6 +212,7 @@ static void tagmon(const Arg *arg);
|
||||||
static void tile(Monitor *m);
|
static void tile(Monitor *m);
|
||||||
static void togglebar(const Arg *arg);
|
static void togglebar(const Arg *arg);
|
||||||
static void togglefloating(const Arg *arg);
|
static void togglefloating(const Arg *arg);
|
||||||
|
static void togglefullscreen(const Arg *arg);
|
||||||
static void toggletag(const Arg *arg);
|
static void toggletag(const Arg *arg);
|
||||||
static void toggleview(const Arg *arg);
|
static void toggleview(const Arg *arg);
|
||||||
static void unfocus(Client *c, int setfocus);
|
static void unfocus(Client *c, int setfocus);
|
||||||
|
@ -712,7 +713,7 @@ drawbar(Monitor *m)
|
||||||
|
|
||||||
/* draw status first so it can be overdrawn by tags later */
|
/* draw status first so it can be overdrawn by tags later */
|
||||||
//if (m == selmon || 1) { /* status is only drawn on selected monitor */
|
//if (m == selmon || 1) { /* status is only drawn on selected monitor */
|
||||||
if (m->num == 1) {
|
if (m->num == 0) {
|
||||||
drw_setscheme(drw, scheme[SchemeNorm]);
|
drw_setscheme(drw, scheme[SchemeNorm]);
|
||||||
tw = TEXTW(stext) - lrpad + 2; /* 2px right padding */
|
tw = TEXTW(stext) - lrpad + 2; /* 2px right padding */
|
||||||
drw_text(drw, m->ww - tw, 0, tw, bh, 0, stext, 0);
|
drw_text(drw, m->ww - tw, 0, tw, bh, 0, stext, 0);
|
||||||
|
@ -1720,6 +1721,17 @@ togglefloating(const Arg *arg)
|
||||||
arrange(selmon);
|
arrange(selmon);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void
|
||||||
|
togglefullscreen(const Arg *arg)
|
||||||
|
{
|
||||||
|
if (&layouts[0] == selmon->lt[selmon->sellt]) {
|
||||||
|
setlayout(&((Arg) { .v = &layouts[2]}));
|
||||||
|
}
|
||||||
|
else if (&layouts[2] == selmon->lt[selmon->sellt]) {
|
||||||
|
setlayout(&((Arg) { .v = &layouts[0]}));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
toggletag(const Arg *arg)
|
toggletag(const Arg *arg)
|
||||||
{
|
{
|
||||||
|
|
Loading…
Reference in New Issue