sites

public wiki contents of suckless.org
git clone git://git.suckless.org/sites
Log | Files | Refs

dwm-dash_above_activeWindow-20240604-061e9fe.diff (1672B)


      1 From 89303c44ed3c65e106f7e2e7711c112867226695 Mon Sep 17 00:00:00 2001
      2 From: DonRehan <30264386+donRehan@users.noreply.github.com>
      3 Date: Tue, 4 Jun 2024 04:33:48 +0300
      4 Subject: [PATCH] Add a dash above current active window in dwm bar
      5 
      6 Give user ability to modify its position , width and text position.
      7 ---
      8  config.def.h | 3 +++
      9  dwm.c        | 4 +++-
     10  2 files changed, 6 insertions(+), 1 deletion(-)
     11 
     12 diff --git a/config.def.h b/config.def.h
     13 index 9efa774..2ec5f52 100644
     14 --- a/config.def.h
     15 +++ b/config.def.h
     16 @@ -2,6 +2,9 @@
     17  
     18  /* appearance */
     19  static const unsigned int borderpx  = 1;        /* border pixel of windows */
     20 +static const unsigned int brdsh_w  = 2;        /* width of the app bar dash */
     21 +static const unsigned int brdsh_ypos  = 18;        /* y-position of the dash */
     22 +static const unsigned int text_ypos  = 1;        /* y-position of text */
     23  static const unsigned int snap      = 32;       /* snap pixel */
     24  static const int showbar            = 1;        /* 0 means no bar */
     25  static const int topbar             = 1;        /* 0 means bottom bar */
     26 diff --git a/dwm.c b/dwm.c
     27 index f1d86b2..3c9b293 100644
     28 --- a/dwm.c
     29 +++ b/dwm.c
     30 @@ -736,8 +736,10 @@ drawbar(Monitor *m)
     31  
     32  	if ((w = m->ww - tw - x) > bh) {
     33  		if (m->sel) {
     34 +			drw_setscheme(drw, scheme[SchemeNorm]);
     35 +			drw_text(drw, x, text_ypos, w, bh, lrpad / 2, m->sel->name, 0);
     36  			drw_setscheme(drw, scheme[m == selmon ? SchemeSel : SchemeNorm]);
     37 -			drw_text(drw, x, 0, w, bh, lrpad / 2, m->sel->name, 0);
     38 +			drw_rect(drw, x , bh - brdsh_ypos , w , brdsh_w , 1, 1);
     39  			if (m->sel->isfloating)
     40  				drw_rect(drw, x + boxs, boxs, boxw, boxw, m->sel->isfixed, 0);
     41  		} else {
     42 -- 
     43 2.34.1
     44