From a59cd9cf0f9e9fc963a9e4c85399cb2407930c37 Mon Sep 17 00:00:00 2001 From: Alex Kotov Date: Fri, 19 Nov 2021 13:48:02 +0500 Subject: [PATCH] Remove status text --- README.md | 10 ---------- polytreewm.1 | 8 +------- src/config.def.h | 2 +- src/dwm.c | 19 +------------------ src/dwm/bar.c | 7 ------- src/dwm/handlers.c | 6 +----- src/settings.c | 12 ------------ src/settings.h | 3 --- 8 files changed, 4 insertions(+), 63 deletions(-) diff --git a/README.md b/README.md index bac2c7b..3be2e74 100644 --- a/README.md +++ b/README.md @@ -29,15 +29,6 @@ environment variable is set correctly, e.g.: (This will start PolytreeWM on display :1 of the host foo.bar.) -In order to display status info in the bar, you can do something -like this in your .xinitrc: - - while xsetroot -name "`date` `uptime | sed 's/.*,//'`" - do - sleep 1 - done & - exec polytreewm - Credits ------- @@ -56,7 +47,6 @@ Applied patches * pertag * resetnmaster * smartborders -* statusallmons * swallow Interesting patches (not applied) diff --git a/polytreewm.1 b/polytreewm.1 index fcc4c29..56f978f 100644 --- a/polytreewm.1 +++ b/polytreewm.1 @@ -21,8 +21,7 @@ Windows are grouped by tags. Each window can be tagged with one or multiple tags. Selecting certain tags displays all windows with these tags. .P Each screen contains a small status bar which displays all available tags, the -layout, the title of the focused window, and the text read from the root window -name property, if the screen is focused. A floating window is indicated with an +layout, the title of the focused window. A floating window is indicated with an empty square and a maximised floating window is indicated with a filled square before the windows title. The selected tags are indicated with a different color. The tags of the focused window are indicated with a filled square in the @@ -37,11 +36,6 @@ prints version information to stderr, then exits. .SH USAGE .SS Status bar .TP -.B X root window name -is read and displayed in the status text area. It can be set with the -.BR xsetroot (1) -command. -.TP .B Button1 click on a tag label to display all windows with that tag, click on the layout label toggles between tiled and floating layout. diff --git a/src/config.def.h b/src/config.def.h index 76534e8..98eb2e0 100644 --- a/src/config.def.h +++ b/src/config.def.h @@ -107,7 +107,7 @@ static Key keys[] = { }; /* button definitions */ -/* click can be ClkTagBar, ClkLtSymbol, ClkStatusText, ClkWinTitle, ClkClientWin, or ClkRootWin */ +/* click can be ClkTagBar, ClkLtSymbol, ClkWinTitle, ClkClientWin, or ClkRootWin */ static Button buttons[] = { /* click event mask button function argument */ diff --git a/src/dwm.c b/src/dwm.c index 9e5a88d..6d3a13c 100644 --- a/src/dwm.c +++ b/src/dwm.c @@ -74,7 +74,7 @@ enum { CurNormal, CurResize, CurMove, CurLast }; /* cursor */ enum { SchemeNorm, SchemeSel }; /* color schemes */ -enum { ClkTagBar, ClkLtSymbol, ClkStatusText, ClkWinTitle, +enum { ClkTagBar, ClkLtSymbol, ClkWinTitle, ClkClientWin, ClkRootWin, ClkLast }; /* clicks */ typedef struct Monitor Monitor; @@ -238,7 +238,6 @@ static void updateclientlist(void); static int updategeom(void); static void updatenumlockmask(void); static void updatesizehints(Client *c); -static void updatestatus(void); static void updatetitle(Client *c); static void updatewindowtype(Client *c); static void updatewmhints(Client *c); @@ -260,7 +259,6 @@ static void zoom(const Arg *arg); static Unit global_unit = NULL; static const char broken[] = "broken"; -static char stext[256]; static int screen; static int sw, sh; /* X display screen geometry width, height */ static int bh, blw = 0; /* bar geometry */ @@ -1614,7 +1612,6 @@ setup(void) scheme[i] = drw_scm_create(drw, colors[i], 3); /* init bars */ createbars(); - updatestatus(); /* supporting window for NetWMCheck */ wmcheckwin = XCreateSimpleWindow(dpy, root, 0, 0, 1, 1, 0, 0, 0); @@ -2033,20 +2030,6 @@ updatesizehints(Client *c) c->isfixed = (c->maxw && c->maxh && c->maxw == c->minw && c->maxh == c->minh); } -void -updatestatus(void) -{ - if (!gettextprop(root, XA_WM_NAME, stext, sizeof(stext))) { - strcpy(stext, "polytreewm-"VERSION); - } - - if (settings_get_status_on_all_monitors()) { - drawbars(); - } else { - drawbar(selmon); - } -} - void updatetitle(Client *c) { diff --git a/src/dwm/bar.c b/src/dwm/bar.c index 6ebf3a5..8db6674 100644 --- a/src/dwm/bar.c +++ b/src/dwm/bar.c @@ -44,13 +44,6 @@ drawbar(Monitor *m) unsigned int i, occ = 0, urg = 0; Client *c; - /* draw status first so it can be overdrawn by tags later */ - if (m == selmon || settings_get_status_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); - } - for (c = m->clients; c; c = c->next) { occ |= c->tags == 255 ? 0 : c->tags; if (c->isurgent) diff --git a/src/dwm/handlers.c b/src/dwm/handlers.c index 14c1340..96a9d21 100644 --- a/src/dwm/handlers.c +++ b/src/dwm/handlers.c @@ -33,8 +33,6 @@ on_button_press(XEvent *e) arg.ui = 1 << i; } else if (ev->x < x + blw) click = ClkLtSymbol; - else if (ev->x > selmon->ww - (int)TEXTW(stext)) - click = ClkStatusText; else click = ClkWinTitle; } else if ((c = wintoclient(ev->window))) { @@ -237,9 +235,7 @@ on_property_notify(XEvent *e) Window trans; XPropertyEvent *ev = &e->xproperty; - if ((ev->window == root) && (ev->atom == XA_WM_NAME)) - updatestatus(); - else if (ev->state == PropertyDelete) + if (ev->state == PropertyDelete) return; /* ignore */ else if ((c = wintoclient(ev->window))) { switch(ev->atom) { diff --git a/src/settings.c b/src/settings.c index 96b72ef..ebd040d 100644 --- a/src/settings.c +++ b/src/settings.c @@ -16,7 +16,6 @@ static bool respect_resize_hints_in_floating_layout = false; static bool show_bar_by_default = true; static UnitKind show_bar_per_unit = UNIT_MONITOR; static unsigned int snap_distance = 32; -static bool status_on_all_monitors = false; static bool swallow_floating = false; SettingsForSingleWindow settings_get_border_for_single_window() @@ -168,17 +167,6 @@ void settings_set_snap_distance(unsigned int new_snap_distance) snap_distance = constraints_snap_distance(new_snap_distance); } -bool settings_get_status_on_all_monitors() -{ - return status_on_all_monitors; -} - -void settings_set_status_on_all_monitors(const bool new_status_on_all_monitors) -{ - status_on_all_monitors = new_status_on_all_monitors; - // TODO: notify WM to rearrange clients -} - bool settings_get_swallow_floating() { return swallow_floating; diff --git a/src/settings.h b/src/settings.h index 2f098fa..113766c 100644 --- a/src/settings.h +++ b/src/settings.h @@ -54,9 +54,6 @@ void settings_set_show_bar_per_unit(UnitKind new_show_bar_per_unit); unsigned int settings_get_snap_distance(); void settings_set_snap_distance(unsigned int new_snap_distance); -bool settings_get_status_on_all_monitors(); -void settings_set_status_on_all_monitors(bool new_status_on_all_monitors); - bool settings_get_swallow_floating(); void settings_set_swallow_floating(bool new_swallow_floating);