Improved bottom statusbar

- Removed the useless placeholder
- Added more status buttons
- (During debugging) replaced Polybar with tint2, couldn't make it work
This commit is contained in:
Alexis Jhon Gaspar 2023-09-23 20:53:15 +08:00
parent a4593859c2
commit bb34217d59
10 changed files with 92 additions and 50 deletions

View file

@ -4,12 +4,7 @@ wal -R # could be changed
picom -b # launches compositor
/usr/local/bin/dwmblocks & # launches slstatus/dwmblocks
/usr/bin/dunst & # launches dunst daemon
while true; do
xsetroot -name ";$(date +'%A, %B %d, %Y') | Kernel $(uname -r) | suckless-utils 6.4" # set bottom bar status
sleep infinity # to stop it from interfering with dwmblocks/slstatus
done &
paplay /usr/share/sounds/Oxygen-Sys-Special.ogg # autoplay sound, optional
pkill -f "sleep infinity" & # set the bottom status as sleep infinity doesn't load it up
nm-applet & # optional, launch network-manager applet
nemo-desktop & # launch nemo in desktop mode, to provide desktop icons, optional
exec /usr/local/bin/dwm # launch dwm

View file

@ -38,7 +38,7 @@ static const char localshare[] = ".local/share";
#endif // AUTOSTART_PATCH
#if BAR_ANYBAR_PATCH
static const int usealtbar = 1; /* 1 means use non-dwm status bar */
static const char *altbarclass = "Polybar"; /* Alternate bar class name */
static const char *altbarclass = "Tint2"; /* Alternate bar class name */
static const char *altbarcmd = "$HOME/bar.sh"; /* Alternate bar launch command */
#endif // BAR_ANYBAR_PATCH
#if BAR_HOLDBAR_PATCH
@ -95,6 +95,8 @@ static const int vertpadbar = 0; /* vertical padding for statusba
#endif // BAR_STATUSPADDING_PATCH
#if BAR_STATUSBUTTON_PATCH
static const char buttonbar[] = "󰕰 Start";
static const char buttonbar2[] = " st";
static const char buttonbar3[] = " Firefox";
#endif // BAR_STATUSBUTTON_PATCH
#if BAR_SYSTRAY_PATCH
static const unsigned int systrayspacing = 2; /* systray spacing */
@ -549,6 +551,8 @@ static const BarRule barrules[] = {
/* monitor bar alignment widthfunc drawfunc clickfunc hoverfunc name */
#if BAR_STATUSBUTTON_PATCH
{ -1, 0, BAR_ALIGN_LEFT, width_stbutton, draw_stbutton, click_stbutton, NULL, "statusbutton" },
{ -1, 1, BAR_ALIGN_LEFT, width_stbutton2, draw_stbutton2, click_stbutton2, NULL, "statusbutton2" },
{ -1, 1, BAR_ALIGN_LEFT, width_stbutton3, draw_stbutton3, click_stbutton3, NULL, "statusbutton3" },
#endif // BAR_STATUSBUTTON_PATCH
#if BAR_POWERLINE_TAGS_PATCH
{ 0, 0, BAR_ALIGN_LEFT, width_pwrl_tags, draw_pwrl_tags, click_pwrl_tags, NULL, "powerline_tags" },
@ -579,19 +583,19 @@ static const BarRule barrules[] = {
#elif BAR_POWERLINE_STATUS_PATCH
{ statusmon, 0, BAR_ALIGN_RIGHT, width_pwrl_status, draw_pwrl_status, click_pwrl_status, NULL, "powerline_status" },
#elif BAR_STATUS_PATCH && BAR_STATUSCMD_PATCH
{ statusmon, 0, BAR_ALIGN_RIGHT, width_status, draw_status, click_statuscmd, NULL, "status" },
{ statusmon, 1, BAR_ALIGN_RIGHT, width_status, draw_status, click_statuscmd, NULL, "status" },
#elif BAR_STATUS_PATCH
{ statusmon, 0, BAR_ALIGN_RIGHT, width_status, draw_status, click_status, NULL, "status" },
{ statusmon, 1, BAR_ALIGN_RIGHT, width_status, draw_status, click_status, NULL, "status" },
#endif // BAR_STATUS2D_PATCH | BAR_STATUSCMD_PATCH
#if XKB_PATCH
{ 0, 0, BAR_ALIGN_RIGHT, width_xkb, draw_xkb, click_xkb, NULL, "xkb" },
#endif // XKB_PATCH
#if BAR_FLEXWINTITLE_PATCH
{ -1, 0, BAR_ALIGN_NONE, width_flexwintitle, draw_flexwintitle, click_flexwintitle, NULL, "flexwintitle" },
{ -1, 1, BAR_ALIGN_NONE, width_flexwintitle, draw_flexwintitle, click_flexwintitle, NULL, "flexwintitle" },
#elif BAR_TABGROUPS_PATCH
{ -1, 0, BAR_ALIGN_NONE, width_bartabgroups, draw_bartabgroups, click_bartabgroups, NULL, "bartabgroups" },
#elif BAR_AWESOMEBAR_PATCH
{ -1, 0, BAR_ALIGN_NONE, width_awesomebar, draw_awesomebar, click_awesomebar, NULL, "awesomebar" },
{ -1, 1, BAR_ALIGN_NONE, width_awesomebar, draw_awesomebar, click_awesomebar, NULL, "awesomebar" },
#elif BAR_FANCYBAR_PATCH
{ -1, 0, BAR_ALIGN_NONE, width_fancybar, draw_fancybar, click_fancybar, NULL, "fancybar" },
#elif BAR_WINTITLE_PATCH
@ -1362,6 +1366,8 @@ static const Button buttons[] = {
/* click event mask button function argument */
#if BAR_STATUSBUTTON_PATCH
{ ClkButton, 0, Button1, spawn, SHCMD("spmenu_run -d -a '-g 4 -l 10'") /* use spmenu instead of dmenu */ },
{ ClkButton2, 0, Button1, spawn, {.v = termcmd } },
{ ClkButton3, 0, Button1, spawn, SHCMD("firefox") },
#endif // BAR_STATUSBUTTON_PATCH
{ ClkLtSymbol, 0, Button1, setlayout, {0} },
#if BAR_LAYOUTMENU_PATCH

View file

@ -232,6 +232,8 @@ enum {
enum {
#if BAR_STATUSBUTTON_PATCH
ClkButton,
ClkButton2,
ClkButton3,
#endif // BAR_STATUSBUTTON_PATCH
#if TAB_PATCH
ClkTabBar,

View file

@ -15,4 +15,38 @@ click_stbutton(Bar *bar, Arg *arg, BarArg *a)
{
return ClkButton;
}
/* modification by Lucas-mother3 to add more buttons */
int
width_stbutton2(Bar *bar, BarArg *a)
{
return TEXTW(buttonbar2);
}
int
draw_stbutton2(Bar *bar, BarArg *a)
{
return drw_text(drw, a->x, a->y, a->w, a->h, lrpad / 2, buttonbar2, 0, False);
}
int
click_stbutton2(Bar *bar, Arg *arg, BarArg *a)
{
return ClkButton2;
}
int
width_stbutton3(Bar *bar, BarArg *a)
{
return TEXTW(buttonbar3);
}
int
draw_stbutton3(Bar *bar, BarArg *a)
{
return drw_text(drw, a->x, a->y, a->w, a->h, lrpad / 2, buttonbar3, 0, False);
}
int
click_stbutton3(Bar *bar, Arg *arg, BarArg *a)
{
return ClkButton3;
}

View file

@ -1,4 +1,9 @@
static int width_stbutton(Bar *bar, BarArg *a);
static int draw_stbutton(Bar *bar, BarArg *a);
static int click_stbutton(Bar *bar, Arg *arg, BarArg *a);
static int width_stbutton2(Bar *bar, BarArg *a);
static int draw_stbutton2(Bar *bar, BarArg *a);
static int click_stbutton2(Bar *bar, Arg *arg, BarArg *a);
static int width_stbutton3(Bar *bar, BarArg *a);
static int draw_stbutton3(Bar *bar, BarArg *a);
static int click_stbutton3(Bar *bar, Arg *arg, BarArg *a);

View file

@ -59,39 +59,39 @@ loadxrdb()
XRDB_LOAD_COLOR("dwm.color13", scratchnormfloatcolor);
#endif // RENAMED_SCRATCHPADS_PATCH
#if BAR_FLEXWINTITLE_PATCH
XRDB_LOAD_COLOR("dwm.normTTBbgcolor", normTTBbgcolor);
XRDB_LOAD_COLOR("dwm.normLTRbgcolor", normLTRbgcolor);
XRDB_LOAD_COLOR("dwm.normMONObgcolor", normMONObgcolor);
XRDB_LOAD_COLOR("dwm.normGRIDbgcolor", normGRIDbgcolor);
XRDB_LOAD_COLOR("dwm.normGRD1bgcolor", normGRD1bgcolor);
XRDB_LOAD_COLOR("dwm.normGRD2bgcolor", normGRD2bgcolor);
XRDB_LOAD_COLOR("dwm.normGRDMbgcolor", normGRDMbgcolor);
XRDB_LOAD_COLOR("dwm.normHGRDbgcolor", normHGRDbgcolor);
XRDB_LOAD_COLOR("dwm.normDWDLbgcolor", normDWDLbgcolor);
XRDB_LOAD_COLOR("dwm.normSPRLbgcolor", normSPRLbgcolor);
XRDB_LOAD_COLOR("dwm.normfloatbgcolor", normfloatbgcolor);
XRDB_LOAD_COLOR("dwm.actTTBbgcolor", actTTBbgcolor);
XRDB_LOAD_COLOR("dwm.actLTRbgcolor", actLTRbgcolor);
XRDB_LOAD_COLOR("dwm.actMONObgcolor", actMONObgcolor);
XRDB_LOAD_COLOR("dwm.actGRIDbgcolor", actGRIDbgcolor);
XRDB_LOAD_COLOR("dwm.actGRD1bgcolor", actGRD1bgcolor);
XRDB_LOAD_COLOR("dwm.actGRD2bgcolor", actGRD2bgcolor);
XRDB_LOAD_COLOR("dwm.actGRDMbgcolor", actGRDMbgcolor);
XRDB_LOAD_COLOR("dwm.actHGRDbgcolor", actHGRDbgcolor);
XRDB_LOAD_COLOR("dwm.actDWDLbgcolor", actDWDLbgcolor);
XRDB_LOAD_COLOR("dwm.actSPRLbgcolor", actSPRLbgcolor);
XRDB_LOAD_COLOR("dwm.actfloatbgcolor", actfloatbgcolor);
XRDB_LOAD_COLOR("dwm.selTTBbgcolor", selTTBbgcolor);
XRDB_LOAD_COLOR("dwm.selLTRbgcolor", selLTRbgcolor);
XRDB_LOAD_COLOR("dwm.selMONObgcolor", selMONObgcolor);
XRDB_LOAD_COLOR("dwm.selGRIDbgcolor", selGRIDbgcolor);
XRDB_LOAD_COLOR("dwm.selGRD1bgcolor", selGRD1bgcolor);
XRDB_LOAD_COLOR("dwm.selGRD2bgcolor", selGRD2bgcolor);
XRDB_LOAD_COLOR("dwm.selGRDMbgcolor", selGRDMbgcolor);
XRDB_LOAD_COLOR("dwm.selHGRDbgcolor", selHGRDbgcolor);
XRDB_LOAD_COLOR("dwm.selDWDLbgcolor", selDWDLbgcolor);
XRDB_LOAD_COLOR("dwm.selSPRLbgcolor", selSPRLbgcolor);
XRDB_LOAD_COLOR("dwm.selfloatbgcolor", selfloatbgcolor);
XRDB_LOAD_COLOR("dwm.color0", normTTBbgcolor);
XRDB_LOAD_COLOR("dwm.color0", normLTRbgcolor);
XRDB_LOAD_COLOR("dwm.color0", normMONObgcolor);
XRDB_LOAD_COLOR("dwm.color0", normGRIDbgcolor);
XRDB_LOAD_COLOR("dwm.color0", normGRD1bgcolor);
XRDB_LOAD_COLOR("dwm.color0", normGRD2bgcolor);
XRDB_LOAD_COLOR("dwm.color0", normGRDMbgcolor);
XRDB_LOAD_COLOR("dwm.color0", normHGRDbgcolor);
XRDB_LOAD_COLOR("dwm.color0", normDWDLbgcolor);
XRDB_LOAD_COLOR("dwm.color0", normSPRLbgcolor);
XRDB_LOAD_COLOR("dwm.color0", normfloatbgcolor);
XRDB_LOAD_COLOR("dwm.color1", actTTBbgcolor);
XRDB_LOAD_COLOR("dwm.color1", actLTRbgcolor);
XRDB_LOAD_COLOR("dwm.color1", actMONObgcolor);
XRDB_LOAD_COLOR("dwm.color1", actGRIDbgcolor);
XRDB_LOAD_COLOR("dwm.color1", actGRD1bgcolor);
XRDB_LOAD_COLOR("dwm.color1", actGRD2bgcolor);
XRDB_LOAD_COLOR("dwm.color1", actGRDMbgcolor);
XRDB_LOAD_COLOR("dwm.color1", actHGRDbgcolor);
XRDB_LOAD_COLOR("dwm.color1", actDWDLbgcolor);
XRDB_LOAD_COLOR("dwm.color1", actSPRLbgcolor);
XRDB_LOAD_COLOR("dwm.color1", actfloatbgcolor);
XRDB_LOAD_COLOR("dwm.color2", selTTBbgcolor);
XRDB_LOAD_COLOR("dwm.color2", selLTRbgcolor);
XRDB_LOAD_COLOR("dwm.color2", selMONObgcolor);
XRDB_LOAD_COLOR("dwm.color2", selGRIDbgcolor);
XRDB_LOAD_COLOR("dwm.color2", selGRD1bgcolor);
XRDB_LOAD_COLOR("dwm.color2", selGRD2bgcolor);
XRDB_LOAD_COLOR("dwm.color2", selGRDMbgcolor);
XRDB_LOAD_COLOR("dwm.color2", selHGRDbgcolor);
XRDB_LOAD_COLOR("dwm.color2", selDWDLbgcolor);
XRDB_LOAD_COLOR("dwm.color2", selSPRLbgcolor);
XRDB_LOAD_COLOR("dwm.color2", selfloatbgcolor);
#endif // BAR_FLEXWINTITLE_PATCH
#if BAR_STATUS2D_XRDB_TERMCOLORS_PATCH && BAR_STATUS2D_PATCH
XRDB_LOAD_COLOR("color0", termcol0);

View file

@ -65,7 +65,7 @@
* taps into the many layout options that flextile-deluxe offers to produce a window
* title section in the bar that is representative of what is shown on screen.
*/
#define BAR_FLEXWINTITLE_PATCH 0
#define BAR_FLEXWINTITLE_PATCH 0
/* This patch adds a context menu for layout switching.
* - xmenu needs to be installed.
@ -272,13 +272,13 @@
*
* https://dwm.suckless.org/patches/anybar/
*/
#define BAR_ANYBAR_PATCH 0
#define BAR_ANYBAR_PATCH 1
/* Anybar option to place the next bar depending on previous bar's position (top or bottom) */
#define BAR_ANYBAR_TOP_AND_BOTTOM_BARS_PATCH 0
#define BAR_ANYBAR_TOP_AND_BOTTOM_BARS_PATCH 1
/* Anybar option to let dwm manage the width of the bar */
#define BAR_ANYBAR_MANAGE_WIDTH_PATCH 0
#define BAR_ANYBAR_MANAGE_WIDTH_PATCH 1
/* This patch adds a border around the status bar(s) just like the border of client windows.
* https://codemadness.org/paste/dwm-border-bar.patch
@ -290,7 +290,7 @@
* modules.
* https://dwm.suckless.org/patches/centeredwindowname/
*/
#define BAR_CENTEREDWINDOWNAME_PATCH 0
#define BAR_CENTEREDWINDOWNAME_PATCH 0
/* Draws a dot indicator overlayed on each tag icon for each client. The selected client
* is drawn as a larger horizontal line.
@ -400,7 +400,7 @@
/* This patch draws and updates the statusbar on all monitors.
* https://dwm.suckless.org/patches/statusallmons/
*/
#define BAR_STATUSALLMONS_PATCH 0
#define BAR_STATUSALLMONS_PATCH 1
/* This patch enables colored text in the status bar. It changes the way colors are defined
* in config.h allowing multiple color combinations for use in the status script.

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.8 MiB

After

Width:  |  Height:  |  Size: 1.8 MiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.5 MiB

After

Width:  |  Height:  |  Size: 1.5 MiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.1 MiB

After

Width:  |  Height:  |  Size: 1.1 MiB