5 Commits

Author SHA1 Message Date
Pijus Kamandulis 17a652ebec Update color scheme, font and gap 2021-06-14 23:53:49 +03:00
Pijus Kamandulis 93d5de8248 Added screenshot keybind 2021-04-09 01:27:02 +03:00
Pijus Kamandulis 926d23911c Implement toggle for fake fullscreen 2021-03-28 14:35:24 +03:00
Pijus Kamandulis db085c674b Apply selectivefakefullscreen patch 2021-03-28 14:02:08 +03:00
Pijus Kamandulis 54db675f10 Update config 2021-03-11 13:18:55 +02:00
3 changed files with 54 additions and 22 deletions
+4 -3
View File
@@ -31,9 +31,9 @@ static const Rule rules[] = {
* WM_CLASS(STRING) = instance, class
* WM_NAME(STRING) = title
*/
/* class instance title tags mask isfloating monitor */
{ "Gimp", NULL, NULL, 0, 1, -1 },
{ "Firefox", NULL, NULL, 1 << 8, 0, -1 },
/* class instance title tags mask isfloating isfakefullscreen monitor */
{ "Gimp", NULL, NULL, 0, 1, 0, -1 },
{ "Firefox", NULL, NULL, 1 << 8, 0, 0, -1 },
};
/* layout(s) */
@@ -104,6 +104,7 @@ static Key keys[] = {
TAGKEYS( XK_8, 7)
TAGKEYS( XK_9, 8)
{ MODKEY|ShiftMask, XK_q, quit, {0} },
{ MODKEY, XK_F11, togglefakefullscreen, {0} },
};
/* button definitions */
+22 -12
View File
@@ -2,7 +2,7 @@
/* appearance */
static const unsigned int borderpx = 2; /* border pixel of windows */
static const unsigned int gappx = 4; /* gaps between windows */
static const unsigned int gappx = 2; /* gaps between windows */
static const unsigned int snap = 32; /* snap pixel */
static const unsigned int systraypinning = 0; /* 0: sloppy systray follows selected monitor, >0: pin systray to monitor X */
static const unsigned int systrayspacing = 2; /* systray spacing */
@@ -10,13 +10,13 @@ static const int systraypinningfailfirst = 1; /* 1: if pinning fails, display
static const int showsystray = 1; /* 0 means no systray */
static const int showbar = 1; /* 0 means no bar */
static const int topbar = 1; /* 0 means bottom bar */
static const char *fonts[] = { "Noto Sans:size=9", "Noto Color Emoji:size=9", "fontawesome:size=9" };
static const char dmenufont[] = "Noto Sans:size=9";
static const char col_gray1[] = "#222222";
static const char *fonts[] = { "Consolas:size=12" };
static const char dmenufont[] = "Consolas:size=12";
static const char col_gray1[] = "#2C2C2C";
static const char col_gray2[] = "#444444";
static const char col_gray3[] = "#bbbbbb";
static const char col_gray4[] = "#eeeeee";
static const char col_cyan[] = "#005577";
static const char col_gray3[] = "#DCDCDC";
static const char col_gray4[] = "#DCDCDC";
static const char col_cyan[] = "#60B48A";
static const char *colors[][3] = {
/* fg bg border */
[SchemeNorm] = { col_gray3, col_gray1, col_gray2 },
@@ -24,16 +24,16 @@ static const char *colors[][3] = {
};
/* tagging */
static const char *tags[] = { "1", "2", "3", "4" };
static const char *tags[] = { "1", "2", "3", "4", "5", "6", "7", "8", "9" };
static const Rule rules[] = {
/* xprop(1):
* WM_CLASS(STRING) = instance, class
* WM_NAME(STRING) = title
*/
/* class instance title tags mask isfloating monitor */
{ "Gimp", NULL, NULL, 0, 1, -1 },
{ "Firefox", NULL, NULL, 1 << 8, 0, -1 },
/* class instance title tags mask isfloating isfakefullscreen monitor */
{ "Gimp", NULL, NULL, 0, 1, 0, -1 },
{ "Firefox", NULL, NULL, 1 << 8, 0, 0, -1 },
};
/* layout(s) */
@@ -53,6 +53,7 @@ static const Layout layouts[] = {
/* key definitions */
#define MODKEY Mod1Mask
#define SUPERKEY Mod4Mask
#define TAGKEYS(KEY,TAG) \
{ MODKEY, KEY, view, {.ui = 1 << TAG} }, \
{ MODKEY|ControlMask, KEY, toggleview, {.ui = 1 << TAG} }, \
@@ -65,12 +66,20 @@ static const Layout layouts[] = {
/* commands */
static char dmenumon[2] = "0"; /* component of dmenucmd, manipulated in spawn() */
static const char *dmenucmd[] = { "dmenu_run", "-m", dmenumon, "-fn", dmenufont, "-nb", col_gray1, "-nf", col_gray3, "-sb", col_cyan, "-sf", col_gray4, NULL };
static const char *termcmd[] = { "st", NULL };
static const char *termcmd[] = { "xfce4-terminal", NULL };
static const char *slockcmd[] = { "slock", NULL };
/* shell commands */
static const char maimselcmd[] = "maim -s ~/Pictures/screen-sel-$(date '+%y%m%d-%H%M-%S').png";
static const char maimfullcmd[] = "maim ~/Pictures/screen-full-$(date '+%y%m%d-%H%M-%S').png";
static Key keys[] = {
/* modifier key function argument */
{ MODKEY, XK_p, spawn, {.v = dmenucmd } },
{ MODKEY|ShiftMask, XK_Return, spawn, {.v = termcmd } },
{ SUPERKEY, XK_l, spawn, {.v = slockcmd } },
{ SUPERKEY|ShiftMask, XK_s, spawn, SHCMD(maimselcmd) },
{ 0, XK_Print, spawn, SHCMD(maimfullcmd) },
{ MODKEY, XK_b, togglebar, {0} },
{ MODKEY, XK_j, focusstack, {.i = +1 } },
{ MODKEY, XK_k, focusstack, {.i = -1 } },
@@ -104,6 +113,7 @@ static Key keys[] = {
TAGKEYS( XK_8, 7)
TAGKEYS( XK_9, 8)
{ MODKEY|ShiftMask, XK_q, quit, {0} },
{ MODKEY, XK_F11, togglefakefullscreen, {0} },
};
/* button definitions */
+28 -7
View File
@@ -110,7 +110,7 @@ struct Client {
int basew, baseh, incw, inch, maxw, maxh, minw, minh;
int bw, oldbw;
unsigned int tags;
int isfixed, isfloating, isurgent, neverfocus, oldstate, isfullscreen;
int isfixed, isfloating, isurgent, neverfocus, oldstate, isfullscreen, isfakefullscreen;
Client *next;
Client *snext;
Monitor *mon;
@@ -156,6 +156,7 @@ typedef struct {
const char *title;
unsigned int tags;
int isfloating;
int isfakefullscreen;
int monitor;
} Rule;
@@ -241,6 +242,7 @@ static void tag(const Arg *arg);
static void tagmon(const Arg *arg);
static void tile(Monitor *);
static void togglebar(const Arg *arg);
static void togglefakefullscreen(const Arg *arg);
static void togglefloating(const Arg *arg);
static void toggletag(const Arg *arg);
static void toggleview(const Arg *arg);
@@ -335,6 +337,7 @@ applyrules(Client *c)
&& (!r->instance || strstr(instance, r->instance)))
{
c->isfloating = r->isfloating;
c->isfakefullscreen = r->isfakefullscreen;
c->tags |= r->tags;
for (m = mons; m && m->num != r->monitor; m = m->next);
if (m)
@@ -611,7 +614,10 @@ clientmessage(XEvent *e)
if (cme->data.l[1] == netatom[NetWMFullscreen]
|| cme->data.l[2] == netatom[NetWMFullscreen])
setfullscreen(c, (cme->data.l[0] == 1 /* _NET_WM_STATE_ADD */
|| (cme->data.l[0] == 2 /* _NET_WM_STATE_TOGGLE */ && !c->isfullscreen)));
// || (cme->data.l[0] == 2 /* _NET_WM_STATE_TOGGLE */ && !c->isfullscreen)));
|| (cme->data.l[0] == 2 /* _NET_WM_STATE_TOGGLE */
&& (!c->isfullscreen || c->isfakefullscreen))));
} else if (cme->message_type == netatom[NetActiveWindow]) {
if (c != selmon->sel && !c->isurgent)
seturgent(c, 1);
@@ -655,7 +661,7 @@ configurenotify(XEvent *e)
updatebars();
for (m = mons; m; m = m->next) {
for (c = m->clients; c; c = c->next)
if (c->isfullscreen)
if (c->isfullscreen && !c->isfakefullscreen)
resizeclient(c, m->mx, m->my, m->mw, m->mh);
resizebarwin(m);
}
@@ -1268,7 +1274,7 @@ movemouse(const Arg *arg)
if (!(c = selmon->sel))
return;
if (c->isfullscreen) /* no support moving fullscreen windows by mouse */
if (c->isfullscreen && !c->isfakefullscreen) /* no support moving fullscreen windows by mouse */
return;
restack(selmon);
ocx = c->x;
@@ -1479,7 +1485,7 @@ resizemouse(const Arg *arg)
if (!(c = selmon->sel))
return;
if (c->isfullscreen) /* no support resizing fullscreen windows by mouse */
if (c->isfullscreen && !c->isfakefullscreen) /* no support resizing fullscreen windows by mouse */
return;
restack(selmon);
ocx = c->x;
@@ -1686,6 +1692,8 @@ setfullscreen(Client *c, int fullscreen)
XChangeProperty(dpy, c->win, netatom[NetWMState], XA_ATOM, 32,
PropModeReplace, (unsigned char*)&netatom[NetWMFullscreen], 1);
c->isfullscreen = 1;
if (c->isfakefullscreen)
return;
c->oldstate = c->isfloating;
c->oldbw = c->bw;
c->bw = 0;
@@ -1696,6 +1704,8 @@ setfullscreen(Client *c, int fullscreen)
XChangeProperty(dpy, c->win, netatom[NetWMState], XA_ATOM, 32,
PropModeReplace, (unsigned char*)0, 0);
c->isfullscreen = 0;
if (c->isfakefullscreen)
return;
c->isfloating = c->oldstate;
c->bw = c->oldbw;
c->x = c->oldx;
@@ -1837,7 +1847,8 @@ showhide(Client *c)
if (ISVISIBLE(c)) {
/* show clients top down */
XMoveWindow(dpy, c->win, c->x, c->y);
if ((!c->mon->lt[c->mon->sellt]->arrange || c->isfloating) && !c->isfullscreen)
if ((!c->mon->lt[c->mon->sellt]->arrange || c->isfloating)
&& (!c->isfullscreen || c->isfakefullscreen))
resize(c, c->x, c->y, c->w, c->h, 0);
showhide(c->snext);
} else {
@@ -1937,12 +1948,22 @@ togglebar(const Arg *arg)
arrange(selmon);
}
void
togglefakefullscreen(const Arg *arg)
{
if (!selmon->sel)
return;
selmon->sel->isfakefullscreen = !selmon->sel->isfakefullscreen;
selmon->sel->isfloating = False;
arrange(selmon);
}
void
togglefloating(const Arg *arg)
{
if (!selmon->sel)
return;
if (selmon->sel->isfullscreen) /* no support for fullscreen windows */
if (selmon->sel->isfullscreen && !selmon->sel->isfakefullscreen) /* no support for fullscreen windows */
return;
selmon->sel->isfloating = !selmon->sel->isfloating || selmon->sel->isfixed;
if (selmon->sel->isfloating)