sites

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

commit c298c58d02ee431e071632b24c444a6b3b1b3d10
parent 4f13bdcb82c9eadfbad9eaf255db78cfd181d353
Author: Christopher Witt <github@ch-witt.de>
Date:   Fri,  1 May 2020 20:07:59 +0200

add systray-toggle patch to the systray page

Diffstat:
Adwm.suckless.org/patches/systray/dwm-systray-toogle-6.2.diff | 63+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Mdwm.suckless.org/patches/systray/index.md | 5+++++
2 files changed, 68 insertions(+), 0 deletions(-)

diff --git a/dwm.suckless.org/patches/systray/dwm-systray-toogle-6.2.diff b/dwm.suckless.org/patches/systray/dwm-systray-toogle-6.2.diff @@ -0,0 +1,63 @@ +From 727d0569a7bb7920887cb5b34707201ba72d1e76 Mon Sep 17 00:00:00 2001 +From: Christopher Witt <github@ch-witt.de> +Date: Sat, 25 Apr 2020 21:37:15 +0200 +Subject: [PATCH] systray-toggle to show/hide the systray + +--- + config.def.h | 3 ++- + dwm.c | 14 ++++++++++++++ + 2 files changed, 16 insertions(+), 1 deletion(-) + +diff --git a/config.def.h b/config.def.h +index 2d824d1..fb7dc0c 100644 +--- a/config.def.h ++++ b/config.def.h +@@ -6,7 +6,7 @@ static const unsigned int snap = 32; /* snap pixel */ + static const unsigned int systraypinning = 0; /* 0: sloppy systray follows selected monitor, >0: pin systray to monitor X */ + static const unsigned int systrayspacing = 2; /* systray spacing */ + static const int systraypinningfailfirst = 1; /* 1: if pinning fails, display systray on the first monitor, False: display systray on the last monitor*/ +-static const int showsystray = 1; /* 0 means no systray */ ++static int showsystray = 1; /* 0 means no systray */ + static const int showbar = 1; /* 0 means no bar */ + static const int topbar = 1; /* 0 means bottom bar */ + static const char *fonts[] = { "monospace:size=10" }; +@@ -68,6 +68,7 @@ static Key keys[] = { + { MODKEY, XK_p, spawn, {.v = dmenucmd } }, + { MODKEY|ShiftMask, XK_Return, spawn, {.v = termcmd } }, + { MODKEY, XK_b, togglebar, {0} }, ++ { MODKEY|ShiftMask, XK_b, togglesystray, {0} }, + { MODKEY, XK_j, focusstack, {.i = +1 } }, + { MODKEY, XK_k, focusstack, {.i = -1 } }, + { MODKEY, XK_i, incnmaster, {.i = +1 } }, +diff --git a/dwm.c b/dwm.c +index 1b90b7b..530ef32 100644 +--- a/dwm.c ++++ b/dwm.c +@@ -240,6 +240,7 @@ static void tag(const Arg *arg); + static void tagmon(const Arg *arg); + static void tile(Monitor *); + static void togglebar(const Arg *arg); ++static void togglesystray(); + static void togglefloating(const Arg *arg); + static void toggletag(const Arg *arg); + static void toggleview(const Arg *arg); +@@ -1908,6 +1909,19 @@ togglebar(const Arg *arg) + arrange(selmon); + } + ++void ++togglesystray() ++{ ++ if (showsystray) ++ XUnmapWindow(dpy, systray->win); ++ showsystray = !showsystray; ++ updatesystray(); ++ drawbar(selmon); ++} ++ + void + togglefloating(const Arg *arg) + { +-- +2.26.2 + diff --git a/dwm.suckless.org/patches/systray/index.md b/dwm.suckless.org/patches/systray/index.md @@ -17,6 +17,10 @@ Download * [dwm-git-20130119-systray.diff](dwm-git-20130119-systray.diff) (19946b) * [dwm-systray-6.0.diff](dwm-systray-6.0.diff) (19788b) (20130119) +Apply the following patch on top of the systray patch to have a keybind for showing/hiding the systray. + +* [dwm-systray-toggle-6.2.diff](dwm-systray-6.2.diff) (2465b) + Author ------ * Jan Christoph Ebersbach <jceb@e-jc.de> @@ -24,3 +28,4 @@ Author * David Phillips (5ed9c48 (6.1), 20160103, 20180314) * Eric Pruitt (7af4d43 (20160626)) * Igor Gevka (cb3f58a (6.2), 20200216) +* Christopher Witt <git@ch-witt.de> (systray-toggle-6.2)