diff options
Diffstat (limited to 'desktop/dwm')
-rw-r--r-- | desktop/dwm/README | 70 | ||||
-rw-r--r-- | desktop/dwm/README.CONFIG | 2 | ||||
-rw-r--r-- | desktop/dwm/dwm.SlackBuild | 79 | ||||
-rw-r--r-- | desktop/dwm/dwm.info | 10 | ||||
-rw-r--r-- | desktop/dwm/dwm.rasi.new | 4 | ||||
-rw-r--r-- | desktop/dwm/patches/use_uxterm_instead_of_st.diff | 6 | ||||
-rw-r--r-- | desktop/dwm/patches/use_uxterm_instead_of_st.patch | 11 | ||||
-rw-r--r-- | desktop/dwm/sbo-patches/0001-Prepare-6.2-release.patch | 45 | ||||
-rw-r--r-- | desktop/dwm/sbo-patches/dwm-systray-6.4.diff (renamed from desktop/dwm/sbo-patches/dwm-systray-20190208-cb3f58a.diff) | 171 | ||||
-rw-r--r-- | desktop/dwm/sbo-patches/enable-keypad.diff (renamed from desktop/dwm/sbo-patches/enable-keypad.patch) | 5 | ||||
-rw-r--r-- | desktop/dwm/sbo-patches/replace-dmenu-rofi.diff | 39 | ||||
-rw-r--r-- | desktop/dwm/sbo-patches/replace-dmenu-rofi.patch | 60 | ||||
-rw-r--r-- | desktop/dwm/sbo-patches/use-mod4.diff (renamed from desktop/dwm/sbo-patches/use-mod4.patch) | 0 | ||||
-rw-r--r-- | desktop/dwm/xinitrc.dwm | 7 | ||||
-rw-r--r-- | desktop/dwm/xinitrc.dwm.ck | 34 |
15 files changed, 251 insertions, 292 deletions
diff --git a/desktop/dwm/README b/desktop/dwm/README index f02b1fec01..2cd91ab2b3 100644 --- a/desktop/dwm/README +++ b/desktop/dwm/README @@ -1,68 +1,50 @@ -dwm is a dynamic window manager for X. It manages windows in -tiled and floating layouts. Either layout can be applied -dynamically, optimizing the environment for the application -in use and the task performed. It is the little brother of -wmii. +dwm is a dynamic window manager for X. It manages windows in tiled and +floating layouts. Either layout can be applied dynamically, optimizing +the environment for the application in use and the task performed. It is +the little brother of wmii. -As of 6.1, `st` is the default terminal. This does not -require installing `st`, only symlinking your favorite -terminal to: +As of 6.1, `st' is the default terminal. This does not require +installing `st', only symlinking your favourite terminal to: /usr/local/bin/st -If a config.h is found in the SlackBuild directory it will -be copied to the source directory and used in the build, -allowing easy customisation. +If a config.h is found in the SlackBuild directory it will be copied to +the source directory and used in the build, allowing easy customisation. See README.CONFIG for more information. - OPTIONS -Use the system tray patch: - - SYSTRAY=yes sh dwm.SlackBuild - -Use Mod4 (Windows key) instead of Mod1 (alt): - - MOD4=yes sh dwm.SlackBuild - -Use rofi instead of dmenu: +The following options all default to `no', but can be enabled by E.G.: - ROFI=yes sh dwm.SlackBuild + CK=yes ./dwm.SlackBuild -Enable keypad for tags as well as top row digits: +An xinitrc with ConsoleKit and dbus support: CK=yes +A system tray patch: SYSTRAY=yes +Use Mod4 (Windows key) instead of Mod1 (alt): MOD4=yes +Use rofi instead of dmenu: ROFI=yes +Enable keypad for tags as well as top row digits: KEYPAD=yes +Enable extra patches (in patches directory): PATCHES=yes +Change default bar font size: FONTSIZE=N - KEYPAD=yes sh dwm.SlackBuild +Multiple options can be used together. The ROFI option also installs dwm.rasi rofi theme to -/usr/share/rofi/themes. This is set to use the same -font as dwm, so if you have patched the dwm font then you -may also want to adjust it to match. - +/usr/share/rofi/themes. This uses the same font as dwm, so if you have +patched the dwm font then you may also want to adjust it to match. OPTIIONAL -st - -A good minimal terminal with fontconfig support. Think -"urxvt", but without perl support and the need to specify -fallback fonts manually. - -rofi - -A good replacement for dmenu, which caches commands hit rate -so that the most used ones are listed first and saves a lot -of extra typing. Cache can be cleared by deleting -~/.cache/rofi-*.runcache +st: A very minimal terminal with fontconfig support. Think `urxvt', but +with automatic font fallback. +rofi: A replacement for dmenu with more features, themes etc. NOTE -Some java applications seem to have problems displaying in -dwm. If you find any problems try: +The following may fix problems displaying java applications: export _JAVA_AWT_WM_NONREPARENTING=1 -in your shell before starting the application. This is -known to fix pycharm. +This should be run in the shell before starting the application. This +is known to fix pycharm. diff --git a/desktop/dwm/README.CONFIG b/desktop/dwm/README.CONFIG index 6c96c7c999..653c67eeec 100644 --- a/desktop/dwm/README.CONFIG +++ b/desktop/dwm/README.CONFIG @@ -60,7 +60,7 @@ https://asciinema.org/a/7886 Example: -$ cd dwm-6.2 +$ cd dwm-$VERSION $ cp config.def.h config.h $ vi config.h [make customizations] diff --git a/desktop/dwm/dwm.SlackBuild b/desktop/dwm/dwm.SlackBuild index 06a0579171..6a85242566 100644 --- a/desktop/dwm/dwm.SlackBuild +++ b/desktop/dwm/dwm.SlackBuild @@ -1,7 +1,7 @@ -#!/bin/sh +#!/bin/bash # Slackware build script for dwm # -# Now maintained by Dave Woodfall <dave@tty1.uk> +# Now maintained by Dave Woodfall <dave@slackbuilds.org> # Ryan P.C. McQuen | Everett, WA | ryanpcmcquen@member.fsf.org # Erik Falor <ewfalor@gmail.com> @@ -35,10 +35,13 @@ # NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, # EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +cd $(dirname $0) ; CWD=$(pwd) + PRGNAM=dwm -VERSION=${VERSION:-6.2} -BUILD=${BUILD:-5} +VERSION=${VERSION:-6.4} +BUILD=${BUILD:-1} TAG=${TAG:-_SBo} +PKGTYPE=${PKGTYPE:-tgz} if [ -z "$ARCH" ]; then case "$( uname -m )" in @@ -48,7 +51,14 @@ if [ -z "$ARCH" ]; then esac fi -CWD=$(pwd) +# If the variable PRINT_PACKAGE_NAME is set, then this script will report what +# the name of the created package would be, and then exit. This information +# could be useful to other scripts. +if [ ! -z "${PRINT_PACKAGE_NAME}" ]; then + echo "$PRGNAM-$VERSION-$ARCH-$BUILD$TAG.$PKGTYPE" + exit 0 +fi + TMP=${TMP:-/tmp/SBo} PKG=$TMP/package-$PRGNAM OUTPUT=${OUTPUT:-/tmp} @@ -80,17 +90,25 @@ if [ -e "$CWD/config.h" ]; then cp -v $CWD/config.h config.def.h fi -SYSTRAY=${SYSTRAY:-no} -[ "$SYSTRAY" = "yes" ] && patch -p1 <$CWD/sbo-patches/dwm-systray-20190208-cb3f58a.diff +[ "${CK:-no}" = "yes" ] && RCEXT=".ck" +[ "${SYSTRAY:-no}" = "yes" ] && patch -p1 <$CWD/sbo-patches/dwm-systray-6.4.diff +[ "${MOD4:-no}" = "yes" ] && patch -p1 <$CWD/sbo-patches/use-mod4.diff +[ "${ROFI:-no}" = "yes" ] && patch -p1 <$CWD/sbo-patches/replace-dmenu-rofi.diff +[ "${KEYPAD:-no}" = "yes" ] && patch -p1 <$CWD/sbo-patches/enable-keypad.diff -MOD4=${MOD4:-no} -[ "$MOD4" = "yes" ] && patch -p1 <$CWD/sbo-patches/use-mod4.patch +sed "s,monospace:size=10,monospace:size=${FONTSIZE:-10},g" -i config.def.h -ROFI=${ROFI:-no} -[ "$ROFI" = "yes" ] && patch -p1 <$CWD/sbo-patches/replace-dmenu-rofi.patch +### Per community request, this section has been restored +### for those that wish to include custom patches. +### A sample patch is included in the patches/ directory +### that will change the default terminal from 'st' +### to 'uxterm'. -Ryan -KEYPAD=${KEYPAD:-no} -[ "$KEYPAD" = "yes" ] && patch -p0 <$CWD/sbo-patches/enable-keypad.patch +if [ "${PATCHES:-no}" = "yes" ]; then + for p in $CWD/patches/*; do + patch --verbose -p1 < $p + done +fi mv config.def.h config.h @@ -101,19 +119,6 @@ find -L . \ \( -perm 666 -o -perm 664 -o -perm 640 -o -perm 600 -o -perm 444 \ -o -perm 440 -o -perm 400 \) -exec chmod 644 {} \; -### Per community request, this section has been restored -### for those that wish to include custom patches. -### A sample patch is included in the patches/ directory -### that will change the default terminal from 'st' -### to 'uxterm'. -Ryan -# -#for i in $(ls $CWD/patches); do -# patch -p0 < $CWD/patches/$i -#done - -# Reverse commit to continue support for fontconfig 2.11.1 -patch -R -p1 <$CWD/sbo-patches/0001-Prepare-6.2-release.patch - ## Fix options for our compilers, ## thanks to Brenton Earl. sed -i \ @@ -136,17 +141,9 @@ make install \ X11LIB=/usr/lib${LIBDIRSUFFIX}/X11 \ DESTDIR=$PKG -mkdir -p $PKG/etc/X11/xinit -install -m 0755 $CWD/xinitrc.dwm $PKG/etc/X11/xinit/xinitrc.dwm - -if [ "$ROFI" = "yes" ]; then - install -m 0644 -D $CWD/dwm.rasi.new $PKG/usr/share/rofi/themes/dwm.rasi.new -fi - -find $PKG -print0 | xargs -0 file | grep -e "executable" -e "shared object" | grep ELF \ - | cut -f 1 -d : | xargs strip --strip-unneeded 2> /dev/null || true - -find $PKG/usr/man -type f -exec gzip -9 {} \; +install -vDm 0755 $CWD/xinitrc.dwm$RCEXT $PKG/etc/X11/xinit/xinitrc.dwm +strip --strip-unneeded $PKG/usr/bin/$PRGNAM +gzip -9 $PKG/usr/man/man?/*.? mkdir -p $PKG/usr/doc/$PRGNAM-$VERSION cp -a LICENSE README $CWD/README.CONFIG \ @@ -155,7 +152,11 @@ cat $CWD/$PRGNAM.SlackBuild > $PKG/usr/doc/$PRGNAM-$VERSION/$PRGNAM.SlackBuild mkdir -p $PKG/install cat $CWD/slack-desc > $PKG/install/slack-desc -cat $CWD/doinst.sh > $PKG/install/doinst.sh + +if [ "${ROFI:-no}" = "yes" ]; then + install -vD -m 0644 $CWD/dwm.rasi.new -t $PKG/usr/share/rofi/themes + cat $CWD/doinst.sh > $PKG/install/doinst.sh +fi cd $PKG -/sbin/makepkg -l y -c n $OUTPUT/$PRGNAM-$VERSION-$ARCH-$BUILD$TAG.${PKGTYPE:-tgz} +/sbin/makepkg -l y -c n $OUTPUT/$PRGNAM-$VERSION-$ARCH-$BUILD$TAG.$PKGTYPE diff --git a/desktop/dwm/dwm.info b/desktop/dwm/dwm.info index c2abc48c64..8503306887 100644 --- a/desktop/dwm/dwm.info +++ b/desktop/dwm/dwm.info @@ -1,10 +1,10 @@ PRGNAM="dwm" -VERSION="6.2" +VERSION="6.4" HOMEPAGE="https://dwm.suckless.org" -DOWNLOAD="https://dl.suckless.org/dwm/dwm-6.2.tar.gz" -MD5SUM="9929845ccdec4d2cc191f16210dd7f3d" +DOWNLOAD="https://dl.suckless.org/dwm/dwm-6.4.tar.gz" +MD5SUM="008da068c3884ae675f65b9458b43c02" DOWNLOAD_x86_64="" MD5SUM_x86_64="" REQUIRES="" -MAINTAINER="Dave Woodfall" -EMAIL="dave@tty1.uk" +MAINTAINER="D Woodfall" +EMAIL="dave@slackbuilds.org" diff --git a/desktop/dwm/dwm.rasi.new b/desktop/dwm/dwm.rasi.new index b5eeb75f87..ba59ad3c29 100644 --- a/desktop/dwm/dwm.rasi.new +++ b/desktop/dwm/dwm.rasi.new @@ -12,10 +12,6 @@ font: "monospace 13"; } -configuration { - display-run: ""; -} - #window { anchor: north; location: north; diff --git a/desktop/dwm/patches/use_uxterm_instead_of_st.diff b/desktop/dwm/patches/use_uxterm_instead_of_st.diff new file mode 100644 index 0000000000..ecb34dc712 --- /dev/null +++ b/desktop/dwm/patches/use_uxterm_instead_of_st.diff @@ -0,0 +1,6 @@ +diff -Naru0 a/config.def.h b/config.def.h +--- a/config.def.h 2022-10-04 17:38:18.000000000 +0000 ++++ b/config.def.h 2023-04-29 00:53:30.080963780 +0000 +@@ -60 +60 @@ +-static const char *termcmd[] = { "st", NULL }; ++static const char *termcmd[] = { "uxterm", NULL }; diff --git a/desktop/dwm/patches/use_uxterm_instead_of_st.patch b/desktop/dwm/patches/use_uxterm_instead_of_st.patch deleted file mode 100644 index c45aa6b981..0000000000 --- a/desktop/dwm/patches/use_uxterm_instead_of_st.patch +++ /dev/null @@ -1,11 +0,0 @@ ---- config.def.h 2015-11-08 14:39:37.000000000 -0800 -+++ config.h 2015-11-27 09:35:45.456371304 -0800 -@@ -55,7 +55,7 @@ - /* commands */ - static char dmenumon[2] = "0"; /* component of dmenucmd, manipulated in spawn() */ - static const char *dmenucmd[] = { "dmenu_run", "-m", dmenumon, "-fn", dmenufont, "-nb", normbgcolor, "-nf", normfgcolor, "-sb", selbgcolor, "-sf", selfgcolor, NULL }; --static const char *termcmd[] = { "st", NULL }; -+static const char *termcmd[] = { "uxterm", NULL }; - - static Key keys[] = { - /* modifier key function argument */ diff --git a/desktop/dwm/sbo-patches/0001-Prepare-6.2-release.patch b/desktop/dwm/sbo-patches/0001-Prepare-6.2-release.patch deleted file mode 100644 index 22da3facea..0000000000 --- a/desktop/dwm/sbo-patches/0001-Prepare-6.2-release.patch +++ /dev/null @@ -1,45 +0,0 @@ -diff --git a/drw.c b/drw.c -index c638323..8fd1ca4 100644 ---- a/drw.c -+++ b/drw.c -@@ -132,6 +132,19 @@ xfont_create(Drw *drw, const char *fontname, FcPattern *fontpattern) - die("no font specified."); - } - -+ /* Do not allow using color fonts. This is a workaround for a BadLength -+ * error from Xft with color glyphs. Modelled on the Xterm workaround. See -+ * https://bugzilla.redhat.com/show_bug.cgi?id=1498269 -+ * https://lists.suckless.org/dev/1701/30932.html -+ * https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=916349 -+ * and lots more all over the internet. -+ */ -+ FcBool iscol; -+ if(FcPatternGetBool(xfont->pattern, FC_COLOR, 0, &iscol) == FcResultMatch && iscol) { -+ XftFontClose(drw->dpy, xfont); -+ return NULL; -+ } -+ - font = ecalloc(1, sizeof(Fnt)); - font->xfont = xfont; - font->pattern = pattern; -@@ -200,7 +213,7 @@ drw_scm_create(Drw *drw, const char *clrnames[], size_t clrcount) - Clr *ret; - - /* need at least two colors for a scheme */ -- if (!drw || !clrnames || clrcount < 2 || !(ret = ecalloc(clrcount, sizeof(Clr)))) -+ if (!drw || !clrnames || clrcount < 2 || !(ret = ecalloc(clrcount, sizeof(XftColor)))) - return NULL; - - for (i = 0; i < clrcount; i++) -@@ -337,6 +350,7 @@ drw_text(Drw *drw, int x, int y, unsigned int w, unsigned int h, unsigned int lp - fcpattern = FcPatternDuplicate(drw->fonts->pattern); - FcPatternAddCharSet(fcpattern, FC_CHARSET, fccharset); - FcPatternAddBool(fcpattern, FC_SCALABLE, FcTrue); -+ FcPatternAddBool(fcpattern, FC_COLOR, FcFalse); - - FcConfigSubstitute(NULL, fcpattern, FcMatchPattern); - FcDefaultSubstitute(fcpattern); - ---------------false-- - - diff --git a/desktop/dwm/sbo-patches/dwm-systray-20190208-cb3f58a.diff b/desktop/dwm/sbo-patches/dwm-systray-6.4.diff index ea946fdd0a..58e4a69499 100644 --- a/desktop/dwm/sbo-patches/dwm-systray-20190208-cb3f58a.diff +++ b/desktop/dwm/sbo-patches/dwm-systray-6.4.diff @@ -1,38 +1,47 @@ diff --git a/config.def.h b/config.def.h -index 1c0b587..2d824d1 100644 +index 9efa774..750529d 100644 --- a/config.def.h +++ b/config.def.h -@@ -3,6 +3,10 @@ +@@ -3,6 +3,11 @@ /* appearance */ static const unsigned int borderpx = 1; /* border pixel of windows */ 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 systrayonleft = 0; /* 0: systray in the right corner, >0: systray on left of status text */ +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 const 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" }; +@@ -101,8 +106,8 @@ static const Key keys[] = { + /* click can be ClkTagBar, ClkLtSymbol, ClkStatusText, ClkWinTitle, ClkClientWin, or ClkRootWin */ + static const Button buttons[] = { + /* click event mask button function argument */ +- { ClkLtSymbol, 0, Button1, setlayout, {0} }, +- { ClkLtSymbol, 0, Button3, setlayout, {.v = &layouts[2]} }, ++ { ClkTagBar, MODKEY, Button1, tag, {0} }, ++ { ClkTagBar, MODKEY, Button3, toggletag, {0} }, + { ClkWinTitle, 0, Button2, zoom, {0} }, + { ClkStatusText, 0, Button2, spawn, {.v = termcmd } }, + { ClkClientWin, MODKEY, Button1, movemouse, {0} }, diff --git a/dwm.c b/dwm.c -index 4465af1..4bccb41 100644 +index 03baf42..4611a03 100644 --- a/dwm.c +++ b/dwm.c -@@ -57,12 +57,30 @@ +@@ -57,12 +57,27 @@ #define TAGMASK ((1 << LENGTH(tags)) - 1) #define TEXTW(X) (drw_fontset_getwidth(drw, (X)) + lrpad) +#define SYSTEM_TRAY_REQUEST_DOCK 0 -+ +/* XEMBED messages */ +#define XEMBED_EMBEDDED_NOTIFY 0 +#define XEMBED_WINDOW_ACTIVATE 1 +#define XEMBED_FOCUS_IN 4 +#define XEMBED_MODALITY_ON 10 -+ +#define XEMBED_MAPPED (1 << 0) +#define XEMBED_WINDOW_ACTIVATE 1 +#define XEMBED_WINDOW_DEACTIVATE 2 -+ +#define VERSION_MAJOR 0 +#define VERSION_MINOR 0 +#define XEMBED_EMBEDDED_VERSION (VERSION_MAJOR << 16) | VERSION_MINOR @@ -48,7 +57,7 @@ index 4465af1..4bccb41 100644 enum { WMProtocols, WMDelete, WMState, WMTakeFocus, WMLast }; /* default atoms */ enum { ClkTagBar, ClkLtSymbol, ClkStatusText, ClkWinTitle, ClkClientWin, ClkRootWin, ClkLast }; /* clicks */ -@@ -141,6 +159,12 @@ typedef struct { +@@ -141,6 +156,12 @@ typedef struct { int monitor; } Rule; @@ -61,18 +70,15 @@ index 4465af1..4bccb41 100644 /* function declarations */ static void applyrules(Client *c); static int applysizehints(Client *c, int *x, int *y, int *w, int *h, int interact); -@@ -169,8 +193,10 @@ static void focus(Client *c); - static void focusin(XEvent *e); - static void focusmon(const Arg *arg); - static void focusstack(const Arg *arg); -+static Atom getatomprop(Client *c, Atom prop); +@@ -172,6 +193,7 @@ static void focusstack(const Arg *arg); + static Atom getatomprop(Client *c, Atom prop); static int getrootptr(int *x, int *y); static long getstate(Window w); +static unsigned int getsystraywidth(); static int gettextprop(Window w, Atom atom, char *text, unsigned int size); static void grabbuttons(Client *c, int focused); static void grabkeys(void); -@@ -188,13 +214,16 @@ static void pop(Client *); +@@ -189,13 +211,16 @@ static void pop(Client *c); static void propertynotify(XEvent *e); static void quit(const Arg *arg); static Monitor *recttomon(int x, int y, int w, int h); @@ -90,15 +96,15 @@ index 4465af1..4bccb41 100644 static void sendmon(Client *c, Monitor *m); static void setclientstate(Client *c, long state); static void setfocus(Client *c); -@@ -206,6 +235,7 @@ static void seturgent(Client *c, int urg); +@@ -207,6 +232,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 Monitor *systraytomon(Monitor *m); static void tag(const Arg *arg); static void tagmon(const Arg *arg); - static void tile(Monitor *); -@@ -223,18 +253,23 @@ static int updategeom(void); + static void tile(Monitor *m); +@@ -224,18 +250,23 @@ static int updategeom(void); static void updatenumlockmask(void); static void updatesizehints(Client *c); static void updatestatus(void); @@ -118,11 +124,11 @@ index 4465af1..4bccb41 100644 static void zoom(const Arg *arg); /* variables */ -+static Systray *systray = NULL; ++static Systray *systray = NULL; static const char broken[] = "broken"; static char stext[256]; static int screen; -@@ -257,9 +292,10 @@ static void (*handler[LASTEvent]) (XEvent *) = { +@@ -258,9 +289,10 @@ static void (*handler[LASTEvent]) (XEvent *) = { [MapRequest] = maprequest, [MotionNotify] = motionnotify, [PropertyNotify] = propertynotify, @@ -134,28 +140,30 @@ index 4465af1..4bccb41 100644 static int running = 1; static Cur *cursor[CurLast]; static Clr **scheme; -@@ -439,7 +475,7 @@ buttonpress(XEvent *e) +@@ -442,7 +474,7 @@ buttonpress(XEvent *e) arg.ui = 1 << i; - } else if (ev->x < x + blw) + } else if (ev->x < x + TEXTW(selmon->ltsymbol)) click = ClkLtSymbol; -- else if (ev->x > selmon->ww - TEXTW(stext)) -+ else if (ev->x > selmon->ww - TEXTW(stext) - getsystraywidth()) +- else if (ev->x > selmon->ww - (int)TEXTW(stext)) ++ else if (ev->x > selmon->ww - (int)TEXTW(stext) - getsystraywidth()) click = ClkStatusText; else click = ClkWinTitle; -@@ -482,6 +518,11 @@ cleanup(void) +@@ -485,6 +517,13 @@ cleanup(void) XUngrabKey(dpy, AnyKey, AnyModifier, root); while (mons) cleanupmon(mons); ++ + if (showsystray) { + XUnmapWindow(dpy, systray->win); + XDestroyWindow(dpy, systray->win); + free(systray); + } ++ for (i = 0; i < CurLast; i++) drw_cur_free(drw, cursor[i]); for (i = 0; i < LENGTH(colors); i++) -@@ -512,9 +553,52 @@ cleanupmon(Monitor *mon) +@@ -516,9 +555,58 @@ cleanupmon(Monitor *mon) void clientmessage(XEvent *e) { @@ -176,7 +184,12 @@ index 4465af1..4bccb41 100644 + c->mon = selmon; + c->next = systray->icons; + systray->icons = c; -+ XGetWindowAttributes(dpy, c->win, &wa); ++ if (!XGetWindowAttributes(dpy, c->win, &wa)) { ++ /* use sane defaults */ ++ wa.width = bh; ++ wa.height = bh; ++ wa.border_width = 0; ++ } + c->x = c->oldx = c->y = c->oldy = 0; + c->w = c->oldw = wa.width; + c->h = c->oldh = wa.height; @@ -205,10 +218,11 @@ index 4465af1..4bccb41 100644 + } + return; + } ++ if (!c) return; if (cme->message_type == netatom[NetWMState]) { -@@ -567,7 +651,7 @@ configurenotify(XEvent *e) +@@ -571,7 +659,7 @@ configurenotify(XEvent *e) for (c = m->clients; c; c = c->next) if (c->isfullscreen) resizeclient(c, m->mx, m->my, m->mw, m->mh); @@ -217,7 +231,7 @@ index 4465af1..4bccb41 100644 } focus(NULL); arrange(NULL); -@@ -652,6 +736,11 @@ destroynotify(XEvent *e) +@@ -656,6 +744,11 @@ destroynotify(XEvent *e) if ((c = wintoclient(ev->window))) unmanage(c, 1); @@ -229,43 +243,45 @@ index 4465af1..4bccb41 100644 } void -@@ -695,19 +784,23 @@ dirtomon(int dir) +@@ -699,7 +792,7 @@ dirtomon(int dir) void drawbar(Monitor *m) { -- int x, w, sw = 0; -+ int x, w, sw = 0, stw = 0; +- int x, w, tw = 0; ++ int x, w, tw = 0, stw = 0; int boxs = drw->fonts->h / 9; int boxw = drw->fonts->h / 6 + 2; unsigned int i, occ = 0, urg = 0; - Client *c; +@@ -708,13 +801,17 @@ drawbar(Monitor *m) + if (!m->showbar) + return; -+ if(showsystray && m == systraytomon(m)) ++ if(showsystray && m == systraytomon(m) && !systrayonleft) + stw = getsystraywidth(); + /* draw status first so it can be overdrawn by tags later */ if (m == selmon) { /* status is only drawn on selected monitor */ drw_setscheme(drw, scheme[SchemeNorm]); -- sw = TEXTW(stext) - lrpad + 2; /* 2px right padding */ -- drw_text(drw, m->ww - sw, 0, sw, bh, 0, stext, 0); -+ sw = TEXTW(stext) - lrpad / 2 + 2; /* 2px right padding */ -+ drw_text(drw, m->ww - sw - stw, 0, sw, bh, lrpad / 2 - 2, stext, 0); +- tw = TEXTW(stext) - lrpad + 2; /* 2px right padding */ +- drw_text(drw, m->ww - tw, 0, tw, bh, 0, stext, 0); ++ tw = TEXTW(stext) - lrpad / 2 + 2; /* 2px extra right padding */ ++ drw_text(drw, m->ww - tw - stw, 0, tw, bh, lrpad / 2 - 2, stext, 0); } + resizebarwin(m); for (c = m->clients; c; c = c->next) { occ |= c->tags; if (c->isurgent) -@@ -728,7 +821,7 @@ drawbar(Monitor *m) +@@ -735,7 +832,7 @@ drawbar(Monitor *m) drw_setscheme(drw, scheme[SchemeNorm]); x = drw_text(drw, x, 0, w, bh, lrpad / 2, m->ltsymbol, 0); -- if ((w = m->ww - sw - x) > bh) { -+ if ((w = m->ww - sw - stw - x) > bh) { +- if ((w = m->ww - tw - x) > bh) { ++ if ((w = m->ww - tw - stw - x) > bh) { if (m->sel) { drw_setscheme(drw, scheme[m == selmon ? SchemeSel : SchemeNorm]); drw_text(drw, x, 0, w, bh, lrpad / 2, m->sel->name, 0); -@@ -739,7 +832,7 @@ drawbar(Monitor *m) +@@ -746,7 +843,7 @@ drawbar(Monitor *m) drw_rect(drw, x, 0, w, bh, 1, 1); } } @@ -274,7 +290,7 @@ index 4465af1..4bccb41 100644 } void -@@ -776,8 +869,11 @@ expose(XEvent *e) +@@ -783,8 +880,11 @@ expose(XEvent *e) Monitor *m; XExposeEvent *ev = &e->xexpose; @@ -287,17 +303,17 @@ index 4465af1..4bccb41 100644 } void -@@ -862,10 +958,17 @@ getatomprop(Client *c, Atom prop) - unsigned long dl; +@@ -870,14 +970,32 @@ getatomprop(Client *c, Atom prop) unsigned char *p = NULL; Atom da, atom = None; + +- if (XGetWindowProperty(dpy, c->win, prop, 0L, sizeof atom, False, XA_ATOM, + /* FIXME getatomprop should return the number of items and a pointer to + * the stored data instead of this workaround */ + Atom req = XA_ATOM; + if (prop == xatom[XembedInfo]) + req = xatom[XembedInfo]; - -- if (XGetWindowProperty(dpy, c->win, prop, 0L, sizeof atom, False, XA_ATOM, ++ + if (XGetWindowProperty(dpy, c->win, prop, 0L, sizeof atom, False, req, &da, &di, &dl, &dl, &p) == Success && p) { atom = *(Atom *)p; @@ -306,8 +322,6 @@ index 4465af1..4bccb41 100644 XFree(p); } return atom; -@@ -899,6 +1002,16 @@ getstate(Window w) - return result; } +unsigned int @@ -321,31 +335,33 @@ index 4465af1..4bccb41 100644 +} + int - gettextprop(Window w, Atom atom, char *text, unsigned int size) + getrootptr(int *x, int *y) { -@@ -1003,7 +1116,7 @@ killclient(const Arg *arg) +@@ -1018,7 +1136,8 @@ killclient(const Arg *arg) { if (!selmon->sel) return; - if (!sendevent(selmon->sel, wmatom[WMDelete])) { ++ + if (!sendevent(selmon->sel->win, wmatom[WMDelete], NoEventMask, wmatom[WMDelete], CurrentTime, 0 , 0, 0)) { XGrabServer(dpy); XSetErrorHandler(xerrordummy); XSetCloseDownMode(dpy, DestroyAll); -@@ -1091,6 +1204,12 @@ maprequest(XEvent *e) - { +@@ -1105,6 +1224,13 @@ maprequest(XEvent *e) static XWindowAttributes wa; XMapRequestEvent *ev = &e->xmaprequest; + + Client *i; + if ((i = wintosystrayicon(ev->window))) { + sendevent(i->win, netatom[Xembed], StructureNotifyMask, CurrentTime, XEMBED_WINDOW_ACTIVATE, 0, systray->win, XEMBED_EMBEDDED_VERSION); + resizebarwin(selmon); + updatesystray(); + } - - if (!XGetWindowAttributes(dpy, ev->window, &wa)) ++ + if (!XGetWindowAttributes(dpy, ev->window, &wa) || wa.override_redirect) return; -@@ -1215,6 +1334,16 @@ propertynotify(XEvent *e) + if (!wintoclient(ev->window)) +@@ -1226,6 +1352,17 @@ propertynotify(XEvent *e) Window trans; XPropertyEvent *ev = &e->xproperty; @@ -359,10 +375,11 @@ index 4465af1..4bccb41 100644 + resizebarwin(selmon); + updatesystray(); + } ++ if ((ev->window == root) && (ev->atom == XA_WM_NAME)) updatestatus(); else if (ev->state == PropertyDelete) -@@ -1265,6 +1394,20 @@ recttomon(int x, int y, int w, int h) +@@ -1276,6 +1413,19 @@ recttomon(int x, int y, int w, int h) return r; } @@ -379,18 +396,17 @@ index 4465af1..4bccb41 100644 + free(i); +} + -+ void resize(Client *c, int x, int y, int w, int h, int interact) { -@@ -1272,6 +1415,14 @@ resize(Client *c, int x, int y, int w, int h, int interact) +@@ -1283,6 +1433,14 @@ resize(Client *c, int x, int y, int w, int h, int interact) resizeclient(c, x, y, w, h); } +void +resizebarwin(Monitor *m) { + unsigned int w = m->ww; -+ if (showsystray && m == systraytomon(m)) ++ if (showsystray && m == systraytomon(m) && !systrayonleft) + w -= getsystraywidth(); + XMoveResizeWindow(dpy, m->barwin, m->wx, m->by, w, bh); +} @@ -398,8 +414,8 @@ index 4465af1..4bccb41 100644 void resizeclient(Client *c, int x, int y, int w, int h) { -@@ -1344,6 +1495,19 @@ resizemouse(const Arg *arg) - } +@@ -1298,6 +1456,19 @@ resizeclient(Client *c, int x, int y, int w, int h) + XSync(dpy, False); } +void @@ -416,9 +432,9 @@ index 4465af1..4bccb41 100644 +} + void - restack(Monitor *m) + resizemouse(const Arg *arg) { -@@ -1433,26 +1597,36 @@ setclientstate(Client *c, long state) +@@ -1444,26 +1615,37 @@ setclientstate(Client *c, long state) } int @@ -447,6 +463,7 @@ index 4465af1..4bccb41 100644 + exists = True; + mt = proto; } ++ if (exists) { ev.type = ClientMessage; - ev.xclient.window = c->win; @@ -466,7 +483,7 @@ index 4465af1..4bccb41 100644 } return exists; } -@@ -1466,7 +1640,7 @@ setfocus(Client *c) +@@ -1477,7 +1659,7 @@ setfocus(Client *c) XA_WINDOW, 32, PropModeReplace, (unsigned char *) &(c->win), 1); } @@ -475,7 +492,7 @@ index 4465af1..4bccb41 100644 } void -@@ -1555,6 +1729,10 @@ setup(void) +@@ -1566,6 +1748,10 @@ setup(void) wmatom[WMTakeFocus] = XInternAtom(dpy, "WM_TAKE_FOCUS", False); netatom[NetActiveWindow] = XInternAtom(dpy, "_NET_ACTIVE_WINDOW", False); netatom[NetSupported] = XInternAtom(dpy, "_NET_SUPPORTED", False); @@ -486,7 +503,7 @@ index 4465af1..4bccb41 100644 netatom[NetWMName] = XInternAtom(dpy, "_NET_WM_NAME", False); netatom[NetWMState] = XInternAtom(dpy, "_NET_WM_STATE", False); netatom[NetWMCheck] = XInternAtom(dpy, "_NET_SUPPORTING_WM_CHECK", False); -@@ -1562,6 +1740,9 @@ setup(void) +@@ -1573,6 +1759,9 @@ setup(void) netatom[NetWMWindowType] = XInternAtom(dpy, "_NET_WM_WINDOW_TYPE", False); netatom[NetWMWindowTypeDialog] = XInternAtom(dpy, "_NET_WM_WINDOW_TYPE_DIALOG", False); netatom[NetClientList] = XInternAtom(dpy, "_NET_CLIENT_LIST", False); @@ -496,7 +513,7 @@ index 4465af1..4bccb41 100644 /* init cursors */ cursor[CurNormal] = drw_cur_create(drw, XC_left_ptr); cursor[CurResize] = drw_cur_create(drw, XC_sizing); -@@ -1570,6 +1751,8 @@ setup(void) +@@ -1581,6 +1770,8 @@ setup(void) scheme = ecalloc(LENGTH(colors), sizeof(Clr *)); for (i = 0; i < LENGTH(colors); i++) scheme[i] = drw_scm_create(drw, colors[i], 3); @@ -505,7 +522,7 @@ index 4465af1..4bccb41 100644 /* init bars */ updatebars(); updatestatus(); -@@ -1701,7 +1884,18 @@ togglebar(const Arg *arg) +@@ -1711,7 +1902,18 @@ togglebar(const Arg *arg) { selmon->showbar = !selmon->showbar; updatebarpos(selmon); @@ -525,7 +542,7 @@ index 4465af1..4bccb41 100644 arrange(selmon); } -@@ -1796,11 +1990,18 @@ unmapnotify(XEvent *e) +@@ -1807,11 +2009,18 @@ unmapnotify(XEvent *e) else unmanage(c, 0); } @@ -544,7 +561,7 @@ index 4465af1..4bccb41 100644 Monitor *m; XSetWindowAttributes wa = { .override_redirect = True, -@@ -1811,10 +2012,15 @@ updatebars(void) +@@ -1822,10 +2031,15 @@ updatebars(void) for (m = mons; m; m = m->next) { if (m->barwin) continue; @@ -561,13 +578,14 @@ index 4465af1..4bccb41 100644 XMapRaised(dpy, m->barwin); XSetClassHint(dpy, m->barwin, &ch); } -@@ -1990,6 +2196,121 @@ updatestatus(void) +@@ -2002,6 +2216,125 @@ updatestatus(void) if (!gettextprop(root, XA_WM_NAME, stext, sizeof(stext))) strcpy(stext, "dwm-"VERSION); drawbar(selmon); + updatesystray(); +} + ++ +void +updatesystrayicongeom(Client *i, int w, int h) +{ @@ -580,7 +598,7 @@ index 4465af1..4bccb41 100644 + else + i->w = (int) ((float)bh * ((float)w / (float)h)); + applysizehints(i, &(i->x), &(i->y), &(i->w), &(i->h), False); -+ /* force icons into the systray dimenons if they don't want to */ ++ /* force icons into the systray dimensions if they don't want to */ + if (i->h > bh) { + if (i->w == i->h) + i->w = bh; @@ -627,10 +645,13 @@ index 4465af1..4bccb41 100644 + Client *i; + Monitor *m = systraytomon(NULL); + unsigned int x = m->mx + m->mw; ++ unsigned int sw = TEXTW(stext) - lrpad + systrayspacing; + unsigned int w = 1; + + if (!showsystray) + return; ++ if (systrayonleft) ++ x -= sw + lrpad / 2; + if (!systray) { + /* init systray */ + if (!(systray = (Systray *)calloc(1, sizeof(Systray)))) @@ -683,7 +704,7 @@ index 4465af1..4bccb41 100644 } void -@@ -2057,6 +2378,16 @@ wintoclient(Window w) +@@ -2069,6 +2402,16 @@ wintoclient(Window w) return NULL; } @@ -700,7 +721,7 @@ index 4465af1..4bccb41 100644 Monitor * wintomon(Window w) { -@@ -2110,6 +2441,22 @@ xerrorstart(Display *dpy, XErrorEvent *ee) +@@ -2122,6 +2465,22 @@ xerrorstart(Display *dpy, XErrorEvent *ee) return -1; } diff --git a/desktop/dwm/sbo-patches/enable-keypad.patch b/desktop/dwm/sbo-patches/enable-keypad.diff index 8341b12fd9..9aca3a516b 100644 --- a/desktop/dwm/sbo-patches/enable-keypad.patch +++ b/desktop/dwm/sbo-patches/enable-keypad.diff @@ -1,5 +1,6 @@ ---- config.def.h 2019-06-04 20:24:48.426235490 +0100 -+++ config.h 2019-06-13 08:17:45.674540960 +0100 +diff -Naur a/config.def.h b/config.def.h +--- a/config.def.h 2022-10-04 17:38:18.000000000 +0000 ++++ b/config.def.h 2023-04-29 00:17:57.206415327 +0000 @@ -84,6 +84,16 @@ { MODKEY, XK_period, focusmon, {.i = +1 } }, { MODKEY|ShiftMask, XK_comma, tagmon, {.i = -1 } }, diff --git a/desktop/dwm/sbo-patches/replace-dmenu-rofi.diff b/desktop/dwm/sbo-patches/replace-dmenu-rofi.diff new file mode 100644 index 0000000000..b37d195763 --- /dev/null +++ b/desktop/dwm/sbo-patches/replace-dmenu-rofi.diff @@ -0,0 +1,39 @@ +diff -Naur a/config.def.h b/config.def.h +--- a/config.def.h 2022-10-04 17:38:18.000000000 +0000 ++++ b/config.def.h 2023-04-29 00:25:20.697595822 +0000 +@@ -56,12 +56,12 @@ + #define SHCMD(cmd) { .v = (const char*[]){ "/bin/sh", "-c", cmd, NULL } } + + /* commands */ +-static const char *dmenucmd[] = { "dmenu_run", "-fn", dmenufont, "-nb", col_gray1, "-nf", col_gray3, "-sb", col_cyan, "-sf", col_gray4, NULL }; ++static const char *roficmd[] = { "rofi", "-sort", "-show", "run", "-theme", "dwm", NULL }; + static const char *termcmd[] = { "st", NULL }; + + static const Key keys[] = { + /* modifier key function argument */ +- { MODKEY, XK_p, spawn, {.v = dmenucmd } }, ++ { MODKEY, XK_p, spawn, {.v = roficmd } }, + { MODKEY|ShiftMask, XK_Return, spawn, {.v = termcmd } }, + { MODKEY, XK_b, togglebar, {0} }, + { MODKEY, XK_j, focusstack, {.i = +1 } }, +diff -Naur a/dwm.1 b/dwm.1 +--- a/dwm.1 2022-10-04 17:38:18.000000000 +0000 ++++ b/dwm.1 2023-04-29 00:26:08.906028725 +0000 +@@ -62,7 +62,7 @@ + .TP + .B Mod1\-p + Spawn +-.BR dmenu(1) ++.BR rofi(1) + for launching other programs. + .TP + .B Mod1\-, +@@ -156,7 +156,7 @@ + dwm is customized by creating a custom config.h and (re)compiling the source + code. This keeps it fast, secure and simple. + .SH SEE ALSO +-.BR dmenu (1), ++.BR rofi (1), + .BR st (1) + .SH ISSUES + Java applications which use the XToolkit/XAWT backend may draw grey windows diff --git a/desktop/dwm/sbo-patches/replace-dmenu-rofi.patch b/desktop/dwm/sbo-patches/replace-dmenu-rofi.patch deleted file mode 100644 index 18c7905c1b..0000000000 --- a/desktop/dwm/sbo-patches/replace-dmenu-rofi.patch +++ /dev/null @@ -1,60 +0,0 @@ -diff -Naur dwm-6.2/config.def.h b/config.def.h ---- dwm-6.2/config.def.h 2019-02-02 12:55:28.000000000 +0000 -+++ b/config.def.h 2019-04-13 21:19:41.455638523 +0100 -@@ -6,7 +6,6 @@ - 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" }; --static const char dmenufont[] = "monospace:size=10"; - static const char col_gray1[] = "#222222"; - static const char col_gray2[] = "#444444"; - static const char col_gray3[] = "#bbbbbb"; -@@ -55,13 +54,12 @@ - #define SHCMD(cmd) { .v = (const char*[]){ "/bin/sh", "-c", cmd, NULL } } - - /* commands */ --static char dmenumon[2] = "0"; /* component of dmenucmd, manipulated in spawn() */ --static const char *dmenucmd[] = { "dmenu_run", "-m", dmenumon, "-fn", dmenufont, "-nb", col_gray1, "-nf", col_gray3, "-sb", col_cyan, "-sf", col_gray4, NULL }; -+static const char *roficmd[] = { "rofi", "-sort", "-show", "run", "-theme", "dwm", NULL }; - static const char *termcmd[] = { "st", NULL }; - - static Key keys[] = { - /* modifier key function argument */ -- { MODKEY, XK_p, spawn, {.v = dmenucmd } }, -+ { MODKEY, XK_p, spawn, {.v = roficmd } }, - { MODKEY|ShiftMask, XK_Return, spawn, {.v = termcmd } }, - { MODKEY, XK_b, togglebar, {0} }, - { MODKEY, XK_j, focusstack, {.i = +1 } }, -diff -Naur dwm-6.2/dwm.1 b/dwm.1 ---- dwm-6.2/dwm.1 2019-02-02 12:55:28.000000000 +0000 -+++ b/dwm.1 2019-04-13 21:12:25.685674235 +0100 -@@ -62,7 +62,7 @@ - .TP - .B Mod1\-p - Spawn --.BR dmenu(1) -+.BR rofi(1) - for launching other programs. - .TP - .B Mod1\-, -@@ -156,7 +156,7 @@ - dwm is customized by creating a custom config.h and (re)compiling the source - code. This keeps it fast, secure and simple. - .SH SEE ALSO --.BR dmenu (1), -+.BR rofi (1), - .BR st (1) - .SH ISSUES - Java applications which use the XToolkit/XAWT backend may draw grey windows -diff -Naur dwm-6.2/dwm.c b/dwm.c ---- dwm-6.2/dwm.c 2019-02-02 12:55:28.000000000 +0000 -+++ b/dwm.c 2019-04-13 21:12:10.143211844 +0100 -@@ -1639,8 +1639,6 @@ - void - spawn(const Arg *arg) - { -- if (arg->v == dmenucmd) -- dmenumon[0] = '0' + selmon->num; - if (fork() == 0) { - if (dpy) - close(ConnectionNumber(dpy)); diff --git a/desktop/dwm/sbo-patches/use-mod4.patch b/desktop/dwm/sbo-patches/use-mod4.diff index 649e39cd3d..649e39cd3d 100644 --- a/desktop/dwm/sbo-patches/use-mod4.patch +++ b/desktop/dwm/sbo-patches/use-mod4.diff diff --git a/desktop/dwm/xinitrc.dwm b/desktop/dwm/xinitrc.dwm index 4cfa744f79..d6c0390c42 100644 --- a/desktop/dwm/xinitrc.dwm +++ b/desktop/dwm/xinitrc.dwm @@ -24,9 +24,4 @@ if [ -f $usermodmap ]; then fi # Start the window manager: -if [ -z "$DESKTOP_SESSION" -a -x /usr/bin/ck-launch-session ]; then - exec ck-launch-session /usr/bin/dwm -else - exec /usr/bin/dwm -fi - +exec /usr/bin/dwm diff --git a/desktop/dwm/xinitrc.dwm.ck b/desktop/dwm/xinitrc.dwm.ck new file mode 100644 index 0000000000..f4cbd3bd24 --- /dev/null +++ b/desktop/dwm/xinitrc.dwm.ck @@ -0,0 +1,34 @@ +#!/bin/sh + +######################################################################## +## Merge in defaults and keymaps ## +######################################################################## + +userresources=$HOME/.Xresources +usermodmap=$HOME/.Xmodmap +sysresources=/etc/X11/xinit/.Xresources +sysmodmap=/etc/X11/xinit/.Xmodmap + +if [ -f $sysresources ]; then + /usr/bin/xrdb -merge $sysresources +fi + +if [ -f $sysmodmap ]; then + /usr/bin/xmodmap $sysmodmap +fi + +if [ -f $userresources ]; then + /usr/bin/xrdb -merge $userresources +fi + +if [ -f $usermodmap ]; then + /usr/bin/xmodmap $usermodmap +fi + +# Start the window manager: +if [ -z "$DESKTOP_SESSION" -a -x /usr/bin/ck-launch-session ]; then + exec ck-launch-session dbus-launch --exit-with-session /usr/bin/dwm +else + exec dbus-launch --exit-with-session /usr/bin/dwm +fi + |