commit ec33f1b317a63dc7195551a7c697b1046c710971
parent a3bffe3022e88d7d085f962bad2a4586840ff4cb
Author: Mahdi Mirzade <[email protected]>
Date: Mon, 6 Jun 2022 14:34:16 +0430
Cleanup config file, remove xsession .desktop file
Diffstat:
M | Makefile | | | 8 | ++------ |
M | config.h | | | 137 | +++++++++++++++++++++++++++++++++++++++++++------------------------------------ |
M | dwm.c | | | 76 | +++++++++++++++++++++++++++++++++++++++------------------------------------- |
D | dwm.desktop | | | 5 | ----- |
4 files changed, 115 insertions(+), 111 deletions(-)
diff --git a/Makefile b/Makefile
@@ -31,7 +31,7 @@ clean:
dist: clean
mkdir -p dwm-${VERSION}
cp -R LICENSE Makefile README config.def.h config.h config.mk\
- dwm.1 drw.h util.h ${SRC} dwm.desktop dwm.png transient.c dwm-${VERSION}
+ dwm.1 drw.h util.h ${SRC} dwm.png transient.c dwm-${VERSION}
tar -cf dwm-${VERSION}.tar dwm-${VERSION}
gzip dwm-${VERSION}.tar
rm -rf dwm-${VERSION}
@@ -43,13 +43,9 @@ install: all
mkdir -p ${DESTDIR}${MANPREFIX}/man1
sed "s/VERSION/${VERSION}/g" < dwm.1 > ${DESTDIR}${MANPREFIX}/man1/dwm.1
chmod 644 ${DESTDIR}${MANPREFIX}/man1/dwm.1
- mkdir -p /usr/share/xsessions
- cp -f dwm.desktop /usr/share/xsessions
- chmod 644 /usr/share/xsessions/dwm.desktop
uninstall:
rm -f ${DESTDIR}${PREFIX}/bin/dwm\
- ${DESTDIR}${MANPREFIX}/man1/dwm.1\
- $(DESTDIR)$(PREFIX)/share/xsessions/dwm.desktop
+ ${DESTDIR}${MANPREFIX}/man1/dwm.1
.PHONY: all options clean dist install uninstall
diff --git a/config.h b/config.h
@@ -3,23 +3,27 @@
/* Load essentials */
#include <X11/XF86keysym.h> /* For XF86 multimedia binds */
+/* System Tray */
+static const int showsystray = 0; /* 0 means no systray */
+static const unsigned int systraypadding= 1; /* systray vertical padding */
+static const unsigned int systrayspacing= 2; /* systray spacing */
+static const unsigned int systrayonleft = 0; /* 0: systray in the right corner, 1: systray on left of status text */
+
+static const unsigned int systraypinning= 1; /* 0: sloppy systray follows selected monitor, 1: pin systray to monitor X */
+static const int systraypinningfailfirst= 1; /* 1: if pinning fails, display systray on the first monitor, 0: display systray on the last monitor*/
+
/* appearance */
static const char *fonts[] = { "monospace:size=9", "Vazir:size=9" };
static const unsigned int borderpx = 0; /* border pixel of windows */
static const unsigned int gappx = 10; /* gaps between windows */
static const unsigned int snap = 32; /* snap pixel */
-static const unsigned int systraypinning= 1; /* 0: sloppy systray follows selected monitor, 1: pin systray to monitor X */
-static const unsigned int systrayonleft = 0; /* 0: systray in the right corner, 1: systray on left of status text */
-static const unsigned int systraypadding= 0; /* systray vertical padding */
-static const unsigned int systrayspacing= 2; /* systray spacing */
-static const int systraypinningfailfirst= 1; /* 1: if pinning fails, display systray on the first monitor, 0: display systray on the last monitor*/
-static const int showsystray = 0; /* 0 means no systray */
static const int showbar = 1; /* 0 means no bar */
static const int topbar = 1; /* 0 means bottom bar */
static const int barheight = 3; /* Spacing around the bar's font */
static const int hidevacanttags = 1; /* 1 means hide empty tags / 0: show every tag */
static const int hidetagindicator = 1; /* 1 means hide default top-left square-shaped tag indicator */
-static const int truecenteredtitle = 0; /* 1 means center the WM_NAME of the currently selected window on the status bar */
+static const int showtitle = 0; /* 1 means show WM_NAME of the currently selected window */
+static const int truecenteredtitle = 0; /* 1 means center the WM_NAME on the status bar */
static const unsigned int colorfultag = 0; /* 0 means use SchemeSel for selected tag */
static char fgcolor[] = "#D8DEE9";
static char bgcolor[] = "#2E3440";
@@ -100,10 +104,12 @@ static const Rule rules[] = {
};
/* layout(s) */
-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 resizehints = 1; /* 1 means respect size hints in tiled resizals */
+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 resizehints = 1; /* 1 means respect size hints in tiled resizals */
static const int lockfullscreen = 1; /* 1 will force focus on the fullscreen window */
+static int layouts_default = 0; /* Default layout */
+static const int layouts_floating = 2;/* Layout number for floating mode */
//static const Layout layouts[] = {
// /* symbol arrange function */
@@ -129,8 +135,8 @@ static const Layout layouts[] = {
{ MODKEY|ControlMask, KEY, toggleview, {.ui = 1 << TAG} }, \
{ MODKEY|ShiftMask, KEY, tag, {.ui = 1 << TAG} }, \
{ MODKEY|ControlMask|ShiftMask, KEY, toggletag, {.ui = 1 << TAG} }, \
- { ALTMOD, KEY, focusnthmon, {.i = TAG } }, \
- { ALTMOD|ShiftMask, KEY, tagnthmon, {.i = TAG } },
+ { ALTMOD, KEY, focusnthmon, {.i = TAG } }, \
+ { ALTMOD|ShiftMask, KEY, tagnthmon, {.i = TAG } },
/* helper for spawning shell commands in the pre dwm-5.0 fashion */
#define SHCMD(cmd) { .v = (const char*[]){ "/bin/sh", "-c", cmd, NULL } }
@@ -149,7 +155,6 @@ static Key keys[] = {
{ MODKEY, XK_c, spawn, {.v = dmenucmd } },
{ MODKEY, XK_Return, spawn, {.v = termcmd } },
{ MODKEY|ShiftMask, XK_Return, spawn, {.v = termcmdfloat } },
- { MODKEY|ShiftMask, XK_b, spawn, SHCMD("dwm_bar -M") },
{ MODKEY, XK_b, togglebar, {0} },
{ MODKEY, XK_j, focusstack, {.i = +1 } },
{ MODKEY, XK_k, focusstack, {.i = -1 } },
@@ -157,17 +162,17 @@ static Key keys[] = {
{ MODKEY, XK_d, incnmaster, {.i = -1 } },
{ MODKEY, XK_h, setmfact, {.f = -0.05} },
{ MODKEY, XK_l, setmfact, {.f = +0.05} },
- { MODKEY|ShiftMask, XK_j, movestack, {.i = +1 } },
- { MODKEY|ShiftMask, XK_k, movestack, {.i = -1 } },
+ { MODKEY|ShiftMask, XK_j, movestack, {.i = +1 } },
+ { MODKEY|ShiftMask, XK_k, movestack, {.i = -1 } },
{ MODKEY, XK_space, zoom, {0} },
{ MODKEY, XK_Tab, view, {0} },
{ MODKEY, XK_t, setlayout, {.v = &layouts[0]} },
{ MODKEY, XK_m, setlayout, {.v = &layouts[1]} },
{ MODKEY, XK_f, setlayout, {.v = &layouts[2]} },
- { MODKEY|ControlMask, XK_comma, cyclelayout, {.i = -1 } },
- { MODKEY|ControlMask, XK_period, cyclelayout, {.i = +1 } },
+ { MODKEY|ControlMask, XK_comma, cyclelayout, {.i = -1 } },
+ { MODKEY|ControlMask, XK_period, cyclelayout, {.i = +1 } },
{ MODKEY|ShiftMask, XK_space, togglefloating, {0} },
- { MODKEY|ShiftMask, XK_f, togglefullscr, {0} },
+ { MODKEY|ShiftMask, XK_f, togglefullscr, {0} },
{ MODKEY, XK_s, togglesticky, {0} },
{ MODKEY, XK_0, view, {.ui = ~0 } },
{ MODKEY|ShiftMask, XK_0, tag, {.ui = ~0 } },
@@ -175,12 +180,12 @@ static Key keys[] = {
{ MODKEY, XK_period, focusmon, {.i = +1 } },
{ MODKEY|ShiftMask, XK_comma, tagmon, {.i = -1 } },
{ MODKEY|ShiftMask, XK_period, tagmon, {.i = +1 } },
- { MODKEY, XK_F5, xrdb, {.v = NULL } },
- { MODKEY, XK_minus, setgaps, {.i = -1 } },
- { MODKEY, XK_equal, setgaps, {.i = +1 } },
- { MODKEY|ShiftMask, XK_equal, setgaps, {.i = 0 } },
- { MODKEY|ControlMask, XK_minus, shiftview, {.i = -1 } },
- { MODKEY|ControlMask, XK_equal, shiftview, {.i = +1 } },
+ { MODKEY, XK_F5, xrdb, {.v = NULL } },
+ { MODKEY, XK_minus, setgaps, {.i = -1 } },
+ { MODKEY, XK_equal, setgaps, {.i = +1 } },
+ { MODKEY|ShiftMask, XK_equal, setgaps, {.i = 0 } },
+ { MODKEY|ControlMask, XK_minus, shiftview, {.i = -1 } },
+ { MODKEY|ControlMask, XK_equal, shiftview, {.i = +1 } },
TAGKEYS( XK_1, 0)
TAGKEYS( XK_2, 1)
TAGKEYS( XK_3, 2)
@@ -193,37 +198,43 @@ static Key keys[] = {
{ MODKEY|ShiftMask, XK_r, restart, {0} },
{ MODKEY, XK_q, killclient, {0} },
{ MODKEY|ControlMask, XK_q, quit, {0} },
- { MODKEY|ShiftMask, XK_q, spawn, SHCMD("powermenu") },
- { MODKEY, XK_r, spawn, SHCMD("dmenurecord") },
- { MODKEY, XK_w, spawn, SHCMD("surf-open") },
- { MODKEY|ControlMask, XK_w, spawn, SHCMD("surf") },
- { MODKEY|ShiftMask, XK_m, spawn, SHCMD("dmenu_man") },
- { MODKEY|ShiftMask, XK_w, spawn, SHCMD("st -c \"st-float\" -g \"100x20\" -e sh -c \"SET_BG_SELECT=1 set-bg\"") },
- { MODKEY|ShiftMask, XK_u, spawn, SHCMD("update") },
- { MODKEY|ShiftMask, XK_t, spawn, SHCMD("set-theme -s") },
- { MODKEY|ShiftMask, XK_g, spawn, SHCMD("gtt") },
- { MODKEY|ShiftMask, XK_y, spawn, SHCMD("myt -d") },
- { MODKEY|ControlMask, XK_l, spawn, SHCMD("lock") },
- { MODKEY, XK_grave, spawn, SHCMD("emoji insert") },
- { ControlMask, XK_grave, spawn, SHCMD("emoji clipboard") },
- { 0, XK_Print, spawn, SHCMD("screenshot") },
- { ShiftMask, XK_Print, spawn, SHCMD("screenshot -t 5") },
- { ControlMask, XK_Print, spawn, SHCMD("screenshot -s yes") },
- { ControlMask|ShiftMask, XK_Print, spawn, SHCMD("screenshot -s yes -t 5") },
- { 0, XF86XK_WebCam, spawn, SHCMD("webcam") },
- { 0, XF86XK_AudioPlay, spawn, SHCMD("media-controller toggle") },
- { 0, XF86XK_AudioPause, spawn, SHCMD("media-controller toggle") },
- { 0, XF86XK_AudioNext, spawn, SHCMD("media-controller next") },
- { 0, XF86XK_AudioPrev, spawn, SHCMD("media-controller prev") },
- { ShiftMask, XF86XK_AudioPlay, spawn, SHCMD("media-controller pause-all") },
- { ShiftMask, XF86XK_AudioPause, spawn, SHCMD("media-controller pause-all") },
- { ShiftMask, XF86XK_AudioNext, spawn, SHCMD("media-controller seek-fwd") },
- { ShiftMask, XF86XK_AudioPrev, spawn, SHCMD("media-controller seek-bwd") },
- { 0, XF86XK_MonBrightnessUp, spawn, SHCMD("bl -i") },
- { 0, XF86XK_MonBrightnessDown, spawn, SHCMD("bl -d") },
- { 0, XF86XK_AudioRaiseVolume, spawn, SHCMD("volume up") },
- { 0, XF86XK_AudioLowerVolume, spawn, SHCMD("volume down") },
- { 0, XF86XK_AudioMute, spawn, SHCMD("volume mute") },
+ { MODKEY|ShiftMask, XK_b, spawn, SHCMD("dwm-bar -M") },
+ { MODKEY|ShiftMask, XK_q, spawn, SHCMD("dmenu-power") },
+ { MODKEY, XK_r, spawn, SHCMD("dmenu-record") },
+ { MODKEY, XK_w, spawn, SHCMD("surf-open") },
+ { MODKEY|ControlMask, XK_w, spawn, SHCMD("surf") },
+ { MODKEY|ShiftMask, XK_e, spawn, SHCMD("st -e sh -c \"mutt\"") },
+ { MODKEY|ShiftMask, XK_m, spawn, SHCMD("dmenu-man") },
+ { MODKEY|ShiftMask, XK_w, spawn, SHCMD("st -c \"st-float\" -g \"100x20\" -e sh -c \"SET_BG_SELECT=1 bg-set\"") },
+ { MODKEY|ShiftMask, XK_u, spawn, SHCMD("st -c \"st-float\" -g \"100x28\" -e sh -c \"doas pacman -Syu --noconfirm && rm ~/.cache/pkg_updates\"") },
+ { MODKEY|ShiftMask, XK_t, spawn, SHCMD("theme-sel -s") },
+ { MODKEY|ShiftMask, XK_g, spawn, SHCMD("gtt") },
+ { MODKEY|ShiftMask, XK_y, spawn, SHCMD("myt -d") },
+ { MODKEY|ControlMask, XK_l, spawn, SHCMD("lock") },
+ { MODKEY, XK_grave, spawn, SHCMD("emoji insert") },
+ { ControlMask, XK_grave, spawn, SHCMD("emoji clipboard") },
+ { 0, XK_Print, spawn, SHCMD("screenshot -xc") },
+ { ShiftMask, XK_Print, spawn, SHCMD("screenshot -xc -t 5") },
+ { ControlMask, XK_Print, spawn, SHCMD("screenshot -xc -s yes") },
+ { ControlMask|ShiftMask, XK_Print, spawn, SHCMD("screenshot -xc -s yes -t 5") },
+ { 0, XF86XK_WebCam, spawn, SHCMD("webcam") },
+ { 0, XF86XK_TouchpadToggle, spawn, SHCMD("toggle-touch") },
+ { 0, XF86XK_TouchpadOn, spawn, SHCMD("toggle-touch") },
+ { 0, XF86XK_TouchpadOff, spawn, SHCMD("toggle-touch") },
+ { 0, XF86XK_AudioPlay, spawn, SHCMD("media-controller toggle") },
+ { 0, XF86XK_AudioPause, spawn, SHCMD("media-controller toggle") },
+ { 0, XF86XK_AudioNext, spawn, SHCMD("media-controller next") },
+ { 0, XF86XK_AudioPrev, spawn, SHCMD("media-controller prev") },
+ { ShiftMask, XF86XK_AudioPlay, spawn, SHCMD("media-controller pause-all") },
+ { ShiftMask, XF86XK_AudioPause, spawn, SHCMD("media-controller pause-all") },
+ { ShiftMask, XF86XK_AudioNext, spawn, SHCMD("media-controller seek-fwd") },
+ { ShiftMask, XF86XK_AudioPrev, spawn, SHCMD("media-controller seek-bwd") },
+ { 0, XF86XK_MonBrightnessUp, spawn, SHCMD("backlight -i") },
+ { 0, XF86XK_MonBrightnessDown, spawn, SHCMD("backlight -d") },
+ { 0, XF86XK_AudioRaiseVolume, spawn, SHCMD("volume -i") },
+ { 0, XF86XK_AudioLowerVolume, spawn, SHCMD("volume -d") },
+ { 0, XF86XK_AudioMute, spawn, SHCMD("volume -m") },
+ { 0, XF86XK_AudioMicMute, spawn, SHCMD("volume -M") },
};
@@ -248,14 +259,14 @@ static Button buttons[] = {
{ ClkTagBar, 0, Button3, toggleview, {0} },
{ ClkTagBar, MODKEY, Button1, tag, {0} },
{ ClkTagBar, MODKEY, Button3, toggletag, {0} },
- { ClkTagBar, 0, Button4, shiftview, {.i = -1} },
- { ClkTagBar, 0, Button5, shiftview, {.i = +1} },
- { ClkLtSymbol, 0, Button1, cyclelayout, {.i = +1} },
- { ClkLtSymbol, 0, Button3, cyclelayout, {.i = -1} },
- { ClkLtSymbol, 0, Button2, setlayout, {.v = &layouts[0]} },
- { ClkLtSymbol, 0, Button4, cyclelayout, {.i = -1} },
- { ClkLtSymbol, 0, Button5, cyclelayout, {.i = +1} },
+ { ClkTagBar, 0, Button4, shiftview, {.i = -1} },
+ { ClkTagBar, 0, Button5, shiftview, {.i = +1} },
+ { ClkLtSymbol, 0, Button1, cyclelayout, {.i = +1} },
+ { ClkLtSymbol, 0, Button3, cyclelayout, {.i = -1} },
+ { ClkLtSymbol, 0, Button2, setlayout, {.v = &layouts[0]} },
+ { ClkLtSymbol, 0, Button4, cyclelayout, {.i = -1} },
+ { ClkLtSymbol, 0, Button5, cyclelayout, {.i = +1} },
{ ClkWinTitle, 0, Button2, togglesticky, {0} },
- { ClkStatusText, 0, Button3, spawn, SHCMD("dwm_bar -M") },
+ { ClkStatusText, 0, Button3, spawn, SHCMD("dwm_bar -M") },
};
diff --git a/dwm.c b/dwm.c
@@ -556,7 +556,7 @@ buttonpress(XEvent *e)
arg.ui = 1 << i;
} else if (ev->x < x + blw)
click = ClkLtSymbol;
- else if (ev->x > selmon->ww - (int)TEXTW(stext) - getsystraywidth())
+ else if (showtitle != 1 || ev->x > selmon->ww - (int)TEXTW(stext) - getsystraywidth())
click = ClkStatusText;
else
click = ClkWinTitle;
@@ -814,9 +814,9 @@ createmon(void)
m->topbar = topbar;
m->gappx = gappx;
m->colorfultag = colorfultag ? colorfultag : 0;
- m->lt[0] = &layouts[0];
- m->lt[1] = &layouts[1 % LENGTH(layouts)];
- strncpy(m->ltsymbol, layouts[0].symbol, sizeof m->ltsymbol);
+ m->lt[0] = &layouts[layouts_default];
+ m->lt[1] = &layouts[(layouts_default + 1) % LENGTH(layouts)];
+ strncpy(m->ltsymbol, layouts[layouts_default].symbol, sizeof m->ltsymbol);
return m;
}
@@ -927,8 +927,9 @@ drawstatusbar(Monitor *m, int bh, char* stext) {
else
isCode = 0;
text = p;
-
- w += systraypadding * 2; /* Xpx padding on both sides */
+ if (showsystray)
+ /* Xpx padding on both sides */
+ w += systraypadding * 2;
ret = m->ww - w;
x = m->ww - w - getsystraywidth();
@@ -1023,16 +1024,16 @@ drawbar(Monitor *m)
if (!m->showbar)
return;
- if(showsystray && m == systraytomon(m) && !systrayonleft)
- stw = getsystraywidth();
+ if (showsystray && m == systraytomon(m) && !systrayonleft)
+ stw = getsystraywidth();
/* draw status first so it can be overdrawn by tags later */
if (m == selmon || 1) { /* status is drawn on all monitors */
//drw_setscheme(drw, scheme[SchemeNorm]);
//tw = TEXTW(stext) - lrpad + 2; /* 2px right padding */
//drw_text(drw, m->ww - tw, 0, tw, bh, 0, stext, 0);
- apply_fribidi(stext);
- tw = m->ww - drawstatusbar(m, bh, fribidi_text);
+ apply_fribidi(stext);
+ tw = m->ww - drawstatusbar(m, bh, fribidi_text);
}
resizebarwin(m);
@@ -1044,40 +1045,39 @@ drawbar(Monitor *m)
}
x = 0;
for (i = 0; i < LENGTH(tags); i++) {
- if (hidevacanttags) /* Do not draw vacant tags */
- if(!(occ & 1 << i || m->tagset[m->seltags] & 1 << i)) continue;
- if (colorfultag)
- //drw_setscheme(drw, (m->tagset[m->seltags] & 1 << i ? tagscheme[i] : scheme[SchemeNorm]));
- //drw_setscheme(drw, (m->tagset[m->seltags] & 1 << i ? tagscheme_sel[i] : tagscheme[i]));
- drw_setscheme(drw, (occ & 1 << i ? (m->tagset[m->seltags] & 1 << i ? tagscheme_sel[i] : tagscheme[i]) : scheme[SchemeNorm]));
- else
+ if (hidevacanttags) /* Do not draw vacant tags */
+ if (!(occ & 1 << i || m->tagset[m->seltags] & 1 << i)) continue;
+ if (colorfultag)
+ //drw_setscheme(drw, (m->tagset[m->seltags] & 1 << i ? tagscheme[i] : scheme[SchemeNorm]));
+ //drw_setscheme(drw, (m->tagset[m->seltags] & 1 << i ? tagscheme_sel[i] : tagscheme[i]));
+ drw_setscheme(drw, (occ & 1 << i ? (m->tagset[m->seltags] & 1 << i ? tagscheme_sel[i] : tagscheme[i]) : scheme[SchemeNorm]));
+ else
drw_setscheme(drw, scheme[m->tagset[m->seltags] & 1 << i ? SchemeSel : SchemeNorm]);
- apply_fribidi(tags[i]);
+ apply_fribidi(tags[i]);
w = TEXTW(fribidi_text);
drw_text(drw, x, 0, w, bh, lrpad / 2, fribidi_text, urg & 1 << i);
- if (!hidetagindicator) /* Do not draw top-left tag indicators */
- if (occ & 1 << i)
- drw_rect(drw, x + boxs, boxs, boxw, boxw,
- m == selmon && selmon->sel && selmon->sel->tags & 1 << i,
- urg & 1 << i);
+ if (!hidetagindicator) /* Do not draw top-left tag indicators */
+ if (occ & 1 << i)
+ drw_rect(drw, x + boxs, boxs, boxw, boxw,
+ m == selmon && selmon->sel && selmon->sel->tags & 1 << i,
+ urg & 1 << i);
x += w;
}
- apply_fribidi(m->ltsymbol);
+ apply_fribidi(m->ltsymbol);
w = blw = TEXTW(fribidi_text);
drw_setscheme(drw, scheme[SchemeLayout]);
x = drw_text(drw, x, 0, w, bh, lrpad / 2, fribidi_text, 0);
if ((w = m->ww - tw - stw - x) > bh) {
- if (m->sel) {
+ if (showtitle && m->sel) {
drw_setscheme(drw, scheme[m == selmon ? SchemeSel : SchemeNorm]);
- apply_fribidi(m->sel->name);
- int mid = lrpad / 2;
- if (truecenteredtitle)
- if (TEXTW(fribidi_text) <= w)
- mid = (w - TEXTW(fribidi_text)) / 2;
- //mid = lrpad / 2;
- drw_text(drw, x, 0, w, bh, mid, fribidi_text, 0);
- if (m->sel->isfloating && !hidetagindicator)
+ apply_fribidi(m->sel->name);
+ int mid = lrpad / 2;
+ if (truecenteredtitle && TEXTW(fribidi_text) <= w)
+ mid = (w - TEXTW(fribidi_text)) / 2;
+ //mid = lrpad / 2;
+ drw_text(drw, x, 0, w, bh, mid, fribidi_text, 0);
+ if (m->sel->isfloating && !hidetagindicator)
drw_rect(drw, x + boxs, boxs, boxw, boxw, m->sel->isfixed, 0);
} else {
drw_setscheme(drw, scheme[SchemeNorm]);
@@ -1884,7 +1884,7 @@ propertynotify(XEvent *e)
}
if (ev->atom == XA_WM_NAME || ev->atom == netatom[NetWMName]) {
updatetitle(c);
- if (c == c->mon->sel)
+ if (showtitle && c == c->mon->sel)
drawbar(c->mon);
}
if (ev->atom == netatom[NetWMWindowType])
@@ -3231,10 +3231,12 @@ zoom(const Arg *arg)
int
main(int argc, char *argv[])
{
- if (argc == 2 && !strcmp("-v", argv[1]))
- die("dwm-"VERSION);
+ if (argc == 2 && !strcmp("-v", argv[1]))
+ die("dwm-"VERSION);
+ else if (argc == 2 && !strcmp("-f", argv[1]))
+ layouts_default = layouts_floating;
else if (argc != 1 && strcmp("-s", argv[1]))
- die("usage: dwm [-v]");
+ die("usage: dwm [-fvh] [-s STATUS_TEXT]");
if (!setlocale(LC_CTYPE, "") || !XSupportsLocale())
fputs("warning: no locale support\n", stderr);
if (!(dpy = XOpenDisplay(NULL)))
diff --git a/dwm.desktop b/dwm.desktop
@@ -1,5 +0,0 @@
-[Desktop Entry]
-Name=Mahdi's dwm
-Comment=Mahdi's build of dwm
-Exec=~/.config/dwm/autostart.sh
-Type=Application