[wiki] [sites] [dwm][patch][dash_above_activeWindow] Add new patch || DonRehan

From: <git_AT_suckless.org>
Date: Tue, 04 Jun 2024 04:08:37 +0200

commit 7575ad5de71d2c945524af940c206001c2807747
Author: DonRehan <30264386+donRehan_AT_users.noreply.github.com>
Date: Tue Jun 4 05:03:46 2024 +0300

    [dwm][patch][dash_above_activeWindow] Add new patch
    
    Add patch that adds a dash above active window colored with schemeSel
    while leaving the regular text area with SchemeNorm scheme to have a
    colored dash above it.
    Add option to customize the dash properties through config.def.h.

diff --git a/dwm.suckless.org/patches/dash_above_activeWindow/dwm-dash_above_activeWindow-20240604-061e9fe.diff b/dwm.suckless.org/patches/dash_above_activeWindow/dwm-dash_above_activeWindow-20240604-061e9fe.diff
new file mode 100644
index 00000000..4d66f6c2
--- /dev/null
+++ b/dwm.suckless.org/patches/dash_above_activeWindow/dwm-dash_above_activeWindow-20240604-061e9fe.diff
_AT_@ -0,0 +1,44 @@
+From 89303c44ed3c65e106f7e2e7711c112867226695 Mon Sep 17 00:00:00 2001
+From: DonRehan <30264386+donRehan_AT_users.noreply.github.com>
+Date: Tue, 4 Jun 2024 04:33:48 +0300
+Subject: [PATCH] Add a dash above current active window in dwm bar
+
+Give user ability to modify its position , width and text position.
+---
+ config.def.h | 3 +++
+ dwm.c | 4 +++-
+ 2 files changed, 6 insertions(+), 1 deletion(-)
+
+diff --git a/config.def.h b/config.def.h
+index 9efa774..2ec5f52 100644
+--- a/config.def.h
++++ b/config.def.h
+_AT_@ -2,6 +2,9 @@
+
+ /* appearance */
+ static const unsigned int borderpx = 1; /* border pixel of windows */
++static const unsigned int brdsh_w = 2; /* width of the app bar dash */
++static const unsigned int brdsh_ypos = 18; /* y-position of the dash */
++static const unsigned int text_ypos = 1; /* y-position of text */
+ static const unsigned int snap = 32; /* snap pixel */
+ static const int showbar = 1; /* 0 means no bar */
+ static const int topbar = 1; /* 0 means bottom bar */
+diff --git a/dwm.c b/dwm.c
+index f1d86b2..3c9b293 100644
+--- a/dwm.c
++++ b/dwm.c
+_AT_@ -736,8 +736,10 @@ drawbar(Monitor *m)
+
+ if ((w = m->ww - tw - x) > bh) {
+ if (m->sel) {
++ drw_setscheme(drw, scheme[SchemeNorm]);
++ drw_text(drw, x, text_ypos, w, bh, lrpad / 2, m->sel->name, 0);
+ drw_setscheme(drw, scheme[m == selmon ? SchemeSel : SchemeNorm]);
+- drw_text(drw, x, 0, w, bh, lrpad / 2, m->sel->name, 0);
++ drw_rect(drw, x , bh - brdsh_ypos , w , brdsh_w , 1, 1);
+ if (m->sel->isfloating)
+ drw_rect(drw, x + boxs, boxs, boxw, boxw, m->sel->isfixed, 0);
+ } else {
+--
+2.34.1
+
diff --git a/dwm.suckless.org/patches/dash_above_activeWindow/index.md b/dwm.suckless.org/patches/dash_above_activeWindow/index.md
new file mode 100644
index 00000000..74536ac6
--- /dev/null
+++ b/dwm.suckless.org/patches/dash_above_activeWindow/index.md
_AT_@ -0,0 +1,20 @@
+dash_above_activeWindow
+=============
+
+Description
+-----------
+Create a line above active window with schemeSel color , while setting
+the background of text to the schemeNorm
+
+![screenshot of the activewindow in the bar after patch](preview.png)
+
+Config variables are avaliable to edit the width of bar dash , its y-position
+as well as text y-position in the bar.
+
+Download
+--------
+* [dwm-dash_above_activeWindow-20240604-061e9fe.diff](dwm-dash_above_activeWindow-20240604-061e9fe.diff)
+
+Author
+------
+* [Alhussien Ahmed](https://github.com/donRehan)
diff --git a/dwm.suckless.org/patches/dash_above_activeWindow/preview.png b/dwm.suckless.org/patches/dash_above_activeWindow/preview.png
new file mode 100644
index 00000000..92a430e4
Binary files /dev/null and b/dwm.suckless.org/patches/dash_above_activeWindow/preview.png differ
Received on Tue Jun 04 2024 - 04:08:37 CEST

This archive was generated by hypermail 2.3.0 : Tue Jun 04 2024 - 04:12:50 CEST