From 8503e750d1e4627365b070db1ba44704ccddba0c Mon Sep 17 00:00:00 2001 From: mihirlad55 Date: Mon, 10 Aug 2020 01:39:28 +0000 Subject: [PATCH] Update from v1.0.3 to v1.1.0 - The altbarcmd variable is added to config.def.h where the launch command for the bar can be specified. This method of launching the bar ensures that the bar does not launch too early before dwm is ready. --- config.def.h | 1 + dwm.c | 9 +++++++++ 2 files changed, 10 insertions(+) diff --git a/config.def.h b/config.def.h index cb32018..d0d60aa 100644 --- a/config.def.h +++ b/config.def.h @@ -7,6 +7,7 @@ static const int showbar = 1; /* 0 means no bar */ static const int topbar = 1; /* 0 means bottom bar */ static const int usealtbar = 1; /* 1 means use non-dwm status bar */ static const char *altbarclass = "Polybar"; /* Alternate bar class name */ +static const char *altbarcmd = "$HOME/bar.sh"; /* Alternate bar launch command */ static const char *fonts[] = { "monospace:size=10" }; static const char dmenufont[] = "monospace:size=10"; static const char col_gray1[] = "#222222"; diff --git a/dwm.c b/dwm.c index 74ec400..f149ab4 100644 --- a/dwm.c +++ b/dwm.c @@ -208,6 +208,7 @@ static void seturgent(Client *c, int urg); static void showhide(Client *c); static void sigchld(int unused); static void spawn(const Arg *arg); +static void spawnbar(); static void tag(const Arg *arg); static void tagmon(const Arg *arg); static void tile(Monitor *); @@ -1630,6 +1631,7 @@ setup(void) XSelectInput(dpy, root, wa.event_mask); grabkeys(); focus(NULL); + spawnbar(); } @@ -1688,6 +1690,13 @@ spawn(const Arg *arg) } } +void +spawnbar() +{ + if (*altbarcmd) + system(altbarcmd); +} + void tag(const Arg *arg) { -- 2.28.0