diff --git a/LICENSE b/LICENSE index d221f09..995172f 100644 --- a/LICENSE +++ b/LICENSE @@ -17,6 +17,7 @@ MIT/X Consortium License © 2015-2016 Quentin Rameau © 2015-2016 Eric Pruitt © 2016-2017 Markus Teich +© 2020-2022 Chris Down Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), diff --git a/README.md b/README.md index 18e8b1a..44b6de3 100644 --- a/README.md +++ b/README.md @@ -1,4 +1,4 @@ -This dwm 6.2 (67d76bd, 2021-03-29) side project has a different take on dwm patching. It uses preprocessor directives to decide whether or not to include a patch during build time. Essentially this means that this build, for better or worse, contains both the patched _and_ the original code. The aim being that you can select which patches to include and the build will contain that code and nothing more. Due to the complexity of some of the patches dwm-flexipatch has diverged from mainstream dwm by making some core patches non-optional for maintenance reasons. For the classic dwm-flexipatch build refer to branch [dwm-flexipatch-1.0](https://github.com/bakkeby/dwm-flexipatch/tree/dwm-flexipatch-1.0). +This dwm 6.3 (8b48e30, 2022-04-26) side project has a different take on dwm patching. It uses preprocessor directives to decide whether or not to include a patch during build time. Essentially this means that this build, for better or worse, contains both the patched _and_ the original code. The aim being that you can select which patches to include and the build will contain that code and nothing more. Due to the complexity of some of the patches dwm-flexipatch has diverged from mainstream dwm by making some core patches non-optional for maintenance reasons. For the classic dwm-flexipatch build refer to branch [dwm-flexipatch-1.0](https://github.com/bakkeby/dwm-flexipatch/tree/dwm-flexipatch-1.0). For example to include the `alpha` patch then you would only need to flip this setting from 0 to 1 in [patches.h](https://github.com/bakkeby/dwm-flexipatch/blob/master/patches.def.h): ```c @@ -13,10 +13,16 @@ Refer to [https://dwm.suckless.org/](https://dwm.suckless.org/) for details on t If you are experiencing issues then you may want to check out the [Known Issues](https://github.com/bakkeby/dwm-flexipatch/discussions/categories/known-issues) discussion category. +Browsing patches? There is a [map of patches](https://coggle.it/diagram/X9IiSSM6PTWOM9Wz) diagram which tries to organise patches into categories. + --- ### Changelog: +2022-02-11 - Added the isfreesize version of the sizehints patch and the [tagsync](https://github.com/bakkeby/dwm-flexipatch/pull/219) patch (contributed by [Bagelli](https://github.com/Bagellll)) + +2021-11-23 - Added the taglabels and underlinetags patches + 2021-09-08 - Added the alwayscenter patch 2021-07-27 - Added the winicon patch @@ -467,6 +473,9 @@ If you are experiencing issues then you may want to check out the [Known Issues] - this patch adds key modes (like in vim or emacs) where chains of keyboard shortcuts can be performed + - [killunsel](https://dwm.suckless.org/patches/killunsel/) + - kills all visible clients that are not selected (only the selected client will remain) + - [~leftlayout~](http://dwm.suckless.org/patches/leftlayout/) - ~moves the layout symbol in the status bar to the left hand side~ @@ -703,6 +712,9 @@ If you are experiencing issues then you may want to check out the [Known Issues] - [taggrid](https://dwm.suckless.org/patches/taggrid/) - adds an option to place tags in rows like in many other window managers + - [taglabels](https://dwm.suckless.org/patches/taglabels/) + - shows tag + class of master client in the tags section of the bar + - [tagmonfixfs](https://github.com/bakkeby/patches/wiki/tagmonfixfs/) - allows moving a fullscreen window to another monitor while remaining in fullscreen @@ -741,13 +753,13 @@ If you are experiencing issues then you may want to check out the [Known Issues] - lets you transfer all clients between the master and stack area while increasing or decreasing the master area (nmaster) accordingly + - [underlinetags](https://dwm.suckless.org/patches/underlinetags/) + - underlines the selected tag, or optionally all tags + - [unfloatvisible](https://dwm.suckless.org/patches/unfloatvisible/) - resets isfloating on any visible windows that have it set and optionally also applies a layout - - [killunsel](https://dwm.suckless.org/patches/killunsel/) - - kills all visible clients that are not selected (only the selected client will remain) - - [~urgentborder~](https://dwm.suckless.org/patches/urgentborder/) - ~this patch makes "urgent" windows have different colors~ diff --git a/README.org b/README.org index c672f9c..d220d5d 100644 --- a/README.org +++ b/README.org @@ -268,7 +268,7 @@ exec dwm * dwm flexipatch -This dwm 6.2 (67d76bd, 2021-03-29) side project has a different take on dwm patching. It uses preprocessor directives to decide whether or not to include a patch during build time. Essentially this means that this build, for better or worse, contains both the patched *and* the original code. The aim being that you can select which patches to include and the build will contain that code and nothing more. Due to the complexity of some of the patches dwm-flexipatch has diverged from mainstream dwm by making some core patches non-optional for maintenance reasons. For the classic dwm-flexipatch build refer to branch [[https://github.com/bakkeby/dwm-flexipatch/tree/dwm-flexipatch-1.0][dwm-flexipatch-1.0]]. +This dwm 6.3 (8b48e30, 2022-04-26) side project has a different take on dwm patching. It uses preprocessor directives to decide whether or not to include a patch during build time. Essentially this means that this build, for better or worse, contains both the patched *and* the original code. The aim being that you can select which patches to include and the build will contain that code and nothing more. Due to the complexity of some of the patches dwm-flexipatch has diverged from mainstream dwm by making some core patches non-optional for maintenance reasons. For the classic dwm-flexipatch build refer to branch [[https://github.com/bakkeby/dwm-flexipatch/tree/dwm-flexipatch-1.0][dwm-flexipatch-1.0]]. For example to include the ~alpha~ patch then you would only need to flip this setting from 0 to 1 in [[https://github.com/bakkeby/dwm-flexipatch/blob/master/patches.def.h][patches.h]]: @@ -284,8 +284,14 @@ Refer to [[https://dwm.suckless.org/][https://dwm.suckless.org/]] for details on If you are experiencing issues then you may want to check out the [[https://github.com/bakkeby/dwm-flexipatch/discussions/categories/known-issues][Known Issues]] discussion category. +Browsing patches? There is a [[https://coggle.it/diagram/X9IiSSM6PTWOM9Wz][map of patches]] diagram which tries to organize patches into categories. + ** Changelog +2022-02-11 - Added the isfreesize version of the sizehints patch and the [[https://github.com/bakkeby/dwm-flexipatch/pull/219][tagsync]] patch (contributed by [[https://github.com/Bagellll][Bagelli]]) + +2021-11-23 - Added the taglabels and underlinetags patches + 2021-09-08 - Added the alwayscenter patch 2021-07-27 - Added the winicon patch @@ -475,590 +481,596 @@ If you are experiencing issues then you may want to check out the [[https://gith ** Patches Included - [[https://dwm.suckless.org/patches/activetagindicatorbar/][activetagindicatorbar]] - - this patch changes the rectangle indicating if a tag is used by a client into a bar above - the tag name + - this patch changes the rectangle indicating if a tag is used by a client into a bar above + the tag name - [[https://dwm.suckless.org/patches/alpha/][alpha]] - - adds transparency for the status bar + - adds transparency for the status bar - [[https://dwm.suckless.org/patches/alternativetags/][alternativetags]] - - adds alternative tags which can be toggled on the fly for the sole purpose of providing - visual aid + - adds alternative tags which can be toggled on the fly for the sole purpose of providing + visual aid - [[https://dwm.suckless.org/patches/alttagsdecoration/][alttagsdecoration]] - - provides the ability to use alternative text for tags which contain at least one window + - provides the ability to use alternative text for tags which contain at least one window - [[https://dwm.suckless.org/patches/alwayscenter/][alwayscenter]] - - makes all floating windows centered, like the center patch, but without a rule + - makes all floating windows centered, like the center patch, but without a rule - +[[https://dwm.suckless.org/patches/alwaysfullscreen/][alwaysfullscreen]]+ - - +prevents the focus to drift from the active fullscreen client when using focusstack\(\)+ + - +prevents the focus to drift from the active fullscreen client when using focusstack\(\)+ - [[https://dwm.suckless.org/patches/anybar/][anybar]] - - enables dwm to manage external status bars such as lemonbar and polybar - - dwm treats the external bar as it would its own, so all regular dwm commands such as - togglebar affect the external bar in the same way + - enables dwm to manage external status bars such as lemonbar and polybar + - dwm treats the external bar as it would its own, so all regular dwm commands such as + togglebar affect the external bar in the same way - [[https://dwm.suckless.org/patches/aspectresize/][aspectresize]] - - allows windows to be resized with its aspect ratio remaining constant + - allows windows to be resized with its aspect ratio remaining constant - [[https://dwm.suckless.org/patches/attachabove/][attachabove]] - - new windows are placed above selected client + - new windows are placed above selected client - [[https://dwm.suckless.org/patches/attachaside/][attachaside]] - - new windows are placed on top of the stack + - new windows are placed on top of the stack - [[https://dwm.suckless.org/patches/attachbelow/][attachbelow]] - - new windows are placed below selected client + - new windows are placed below selected client - [[https://dwm.suckless.org/patches/attachbottom/][attachbottom]] - - new windows are placed at the bottom of the stack + - new windows are placed at the bottom of the stack - [[https://dwm.suckless.org/patches/autoresize/][autoresize]] - - by default, windows that are not visible when requesting a resize/move will not get - resized/moved, with this patch, however, they will + - by default, windows that are not visible when requesting a resize/move will not get + resized/moved, with this patch, however, they will - [[https://dwm.suckless.org/patches/autostart/][autostart]] - - makes dwm run =~/.dwm/autostart_blocking.sh= and =~/.dwm/autostart.sh &= on startup + - makes dwm run =~/.dwm/autostart_blocking.sh= and =~/.dwm/autostart.sh &= on startup - [[https://dwm.suckless.org/patches/awesomebar/][awesomebar]] - - enhanced taskbar that allows focus / hiding / unhiding of windows by clicking on the status - bar + - enhanced taskbar that allows focus / hiding / unhiding of windows by clicking on the status + bar - [[https://codemadness.org/paste/dwm-border-bar.patch][bar_border]] - - adds a border around the bar similarly to how client windows have borders + - adds a border around the bar similarly to how client windows have borders - [[https://dwm.suckless.org/patches/bar_height/][bar_height]] - - allows the bar height to be explicitly set rather than being derived from font + - allows the bar height to be explicitly set rather than being derived from font - [[https://github.com/bakkeby/patches/wiki/barmodules/][barmodules]] - - splits the dwm bar into modules allowing for re-arrangement of the bar and easier - integration for new features + - splits the dwm bar into modules allowing for re-arrangement of the bar and easier + integration for new features - [[https://dwm.suckless.org/patches/barpadding/][barpadding]] - - adds vertical and horizontal space between the statusbar and the edge of the screen + - adds vertical and horizontal space between the statusbar and the edge of the screen - [[https://dwm.suckless.org/patches/bartabgroups/][bartabgroups]] - - turns the titlebar area into a mfact-respecting tab-bar showing each client's title + - turns the titlebar area into a mfact-respecting tab-bar showing each client's title - [[https://dwm.suckless.org/patches/center/][center]] - - adds an iscentered rule to automatically center clients on the current monitor + - adds an iscentered rule to automatically center clients on the current monitor - [[https://dwm.suckless.org/patches/cfacts/][cfacts]] - - the cfacts patch provides the ability to assign different weights to clients in their - respective stack in tiled layout + - the cfacts patch provides the ability to assign different weights to clients in their + respective stack in tiled layout - [[https://dwm.suckless.org/patches/clientindicators/][clientindicators]] - - draws a dot indicator overlayed on each tag icon for each client - - the selected client is drawn as a larger horizontal line + - draws a dot indicator overlayed on each tag icon for each client + - the selected client is drawn as a larger horizontal line - [[https://dwm.suckless.org/patches/cmdcustomize/][cmdcustomize]] - - allows color attributes to be set through the command line + - allows color attributes to be set through the command line - [[https://dwm.suckless.org/patches/colorbar/][colorbar]] - - lets you change the foreground and background color of every statusbar element + - lets you change the foreground and background color of every statusbar element - color_emoji - - enables color emoji in dmenu by removing a workaround for a BadLength error in the Xft - library when color glyphs are used - - enabling this will crash dwm on encountering such glyphs unless you also have an updated - Xft library that can handle them + - enables color emoji in dmenu by removing a workaround for a BadLength error in the Xft + library when color glyphs are used + - enabling this will crash dwm on encountering such glyphs unless you also have an updated + Xft library that can handle them - [[https://dwm.suckless.org/patches/combo/][combo]] - - allows you to select multiple tags by pressing all the right keys as a combo, e.g. hold MOD - and press and hold 1 and 3 together to view those two tags + - allows you to select multiple tags by pressing all the right keys as a combo, e.g. hold MOD + and press and hold 1 and 3 together to view those two tags - [[https://dwm.suckless.org/patches/cool_autostart/][cool_autostart]] - - allows dwm to execute commands from an array in the config.h file - - when dwm exits all processes from the autostart array will be killed automatically + - allows dwm to execute commands from an array in the config.h file + - when dwm exits all processes from the autostart array will be killed automatically - [[https://dwm.suckless.org/patches/cyclelayouts/][cyclelayouts]] - - lets you cycle through all your layouts + - lets you cycle through all your layouts - [[https://dwm.suckless.org/patches/decoration_hints/][decoration_hints]] - - make dwm respect =_MOTIF_WM_HINTS= property, and not draw borders around windows - requesting for it - - some applications use this property to notify window managers to not draw window - decorations - - not respecting this property leads to issues with applications that draw their own borders, - like chromium (with "Use system title bar and borders" turned off) or vlc in fullscreen mode + - make dwm respect =_MOTIF_WM_HINTS= property, and not draw borders around windows + requesting for it + - some applications use this property to notify window managers to not draw window + decorations + - not respecting this property leads to issues with applications that draw their own borders, + like chromium (with "Use system title bar and borders" turned off) or vlc in fullscreen mode - [[https://dwm.suckless.org/patches/reorganizetags/][distributetags]] - - this reorganisetags variant re-distributes all clients on the current monitor evenly across - all tags + - this reorganisetags variant re-distributes all clients on the current monitor evenly across + all tags - [[https://dwm.suckless.org/patches/dmenumatchtop][dmenumatchtop]] - - updates the position of dmenu to match that of the bar - - i.e. if topbar is 0 then dmenu will appear at the bottom and if 1 then dmenu will appear at - the top + - updates the position of dmenu to match that of the bar + - i.e. if topbar is 0 then dmenu will appear at the bottom and if 1 then dmenu will appear at + the top - [[https://github.com/bakkeby/patches/wiki/dragcfact/][dragcfact]] - - lets you resize clients' size (i.e. modify cfact) by holding modkey + shift + right-click - and dragging the mouse + - lets you resize clients' size (i.e. modify cfact) by holding modkey + shift + right-click + and dragging the mouse - [[https://github.com/bakkeby/patches/wiki/dragmfact/][dragmfact]] - - lets you resize the split in layouts (i.e. modify mfact) by holding the modkey + shift - + left-click and dragging the mouse - - this is a bespoke patch that supports vertical and horizontal layout splits as well as - centered master variants + - lets you resize the split in layouts (i.e. modify mfact) by holding the modkey + shift + + left-click and dragging the mouse + - this is a bespoke patch that supports vertical and horizontal layout splits as well as + centered master variants - [[https://gist.github.com/danbyl/54f7c1d57fc6507242a95b71c3d8fdea][dwmblocks]] - - signal integration to use dwm with a patched [[https://github.com/torrinfail/dwmblocks][dwmblocks]] - - combined with the statuscmd patch this gives a clickable statusbar + - signal integration to use dwm with a patched [[https://github.com/torrinfail/dwmblocks][dwmblocks]] + - combined with the statuscmd patch this gives a clickable statusbar - [[http://dwm.suckless.org/patches/dwmc/][dwmc]] - - a simple dwmc client using a fork of fsignal to communicate with dwm + - a simple dwmc client using a fork of fsignal to communicate with dwm - [[https://dwm.suckless.org/patches/emptyview/][emptyview]] - - allows no tag at all to be selected - - dwm will start with no tag selected and when a client with no tag rule is started and no - tag is selected then it will be opened on the first tag + - allows no tag at all to be selected + - dwm will start with no tag selected and when a client with no tag rule is started and no + tag is selected then it will be opened on the first tag - [[https://dwm.suckless.org/patches/ewmhtags/][ewmhtags]] - - adds EWMH support for =_NET_NUMBER_OF_DESKTOPS=, =_NET_CURRENT_DESKTOP=, =_NET_DESKTOP_NAMES= - and =_NET_DESKTOP_VIEWPORT=, which allows for compatibility with other bars and programs - that request workspace information, e.g. polybar's xworkspaces module + - adds EWMH support for =_NET_NUMBER_OF_DESKTOPS=, =_NET_CURRENT_DESKTOP=, =_NET_DESKTOP_NAMES= + and =_NET_DESKTOP_VIEWPORT=, which allows for compatibility with other bars and programs + that request workspace information, e.g. polybar's xworkspaces module - [[https://dwm.suckless.org/patches/exresize/][exresize]] - - this patch allows the user to change size and placement of floating windows using only the - keyboard - - it also allows for temporary vertical and horizontal extension of windows similar to other - WMs fill command + - this patch allows the user to change size and placement of floating windows using only the + keyboard + - it also allows for temporary vertical and horizontal extension of windows similar to other + WMs fill command - +[[https://dwm.suckless.org/patches/extrabar/][extrabar]]+ - - +enables an extra status bar in dwm in a similar manner to the dualstatus patch+ - - +if the primary status is at the top via topbar then the extra status bar will be placed at - the bottom and vice versa+ + - +enables an extra status bar in dwm in a similar manner to the dualstatus patch+ + - +if the primary status is at the top via topbar then the extra status bar will be placed at + the bottom and vice versa+ - extrastatus - - formerly extrabar - now only splits the status into to statuses by using a status separator + - formerly extrabar - now only splits the status into to statuses by using a status separator - [[https://dwm.suckless.org/patches/fakefullscreen/][fakefullscreen]] - - only allow clients to "fullscreen" into the space currently given to them - - as an example, this will allow you to view a fullscreen video in your browser on one half - of the screen, while having the other half available for other tasks + - only allow clients to "fullscreen" into the space currently given to them + - as an example, this will allow you to view a fullscreen video in your browser on one half + of the screen, while having the other half available for other tasks - [[https://github.com/bakkeby/patches/wiki/fakefullscreenclient/][fakefullscreenclient]] - - similarly to the fakefullscreen patch this patch only allows clients to "fullscreen" into - the space currently given to them - - as an example, this will allow you to view a fullscreen video in your browser on one half - of the screen, while having the other half available for other tasks - - the "twist" with this patch is that fake fullscreen can be toggled on a per client basis - rather than applying to all clients globally + - similarly to the fakefullscreen patch this patch only allows clients to "fullscreen" into + the space currently given to them + - as an example, this will allow you to view a fullscreen video in your browser on one half + of the screen, while having the other half available for other tasks + - the "twist" with this patch is that fake fullscreen can be toggled on a per client basis + rather than applying to all clients globally - [[https://dwm.suckless.org/patches/fancybar/][fancybar]] - - shows the titles of all visible windows in the status bar + - shows the titles of all visible windows in the status bar - flexwintitle - - based on the bartabgroups patch, this is a layout aware barmodules module for handling - window titles intended to be used with flextile-deluxe + - based on the bartabgroups patch, this is a layout aware barmodules module for handling + window titles intended to be used with flextile-deluxe - +[[https://dwm.suckless.org/patches/float_border_color/][floatbordercolor]]+ - - +this patch allows a different border color to be chosen for floating windows+ + - +this patch allows a different border color to be chosen for floating windows+ - [[https://github.com/bakkeby/patches/wiki/floatpos/][floatpos]] - - adds a float rule allowing the size and position of floating windows to be specified - - control the size and position of floating windows similar to exresize, moveresize, - moveplace patches - - specify size and position using absolute, relative or fixed co-ordinates or - - position floating windows in a grid-like manner + - adds a float rule allowing the size and position of floating windows to be specified + - control the size and position of floating windows similar to exresize, moveresize, + moveplace patches + - specify size and position using absolute, relative or fixed co-ordinates or + - position floating windows in a grid-like manner - [[https://dwm.suckless.org/patches/focusadjacenttag/][focusadjacenttag]] - - provides the ability to focus the tag on the immediate left or right of the currently - focused tag - - it also allows to send the focused window either on the left or the right tag + - provides the ability to focus the tag on the immediate left or right of the currently + focused tag + - it also allows to send the focused window either on the left or the right tag - [[https://github.com/bakkeby/patches/wiki/focusdir][focusdir]] - - allows focusing on clients based on direction (up, down, left, right) instead of client - order + - allows focusing on clients based on direction (up, down, left, right) instead of client + order - [[https://dwm.suckless.org/patches/focusmaster/][focusmaster]] - - a simple patch that just puts focus back to the master client + - a simple patch that just puts focus back to the master client - [[https://dwm.suckless.org/patches/focusonclick/][focusonclick]] - - this patch makes you switch focus only by mouse click and not sloppy (focus follows mouse - pointer) + - this patch makes you switch focus only by mouse click and not sloppy (focus follows mouse + pointer) - [[https://dwm.suckless.org/patches/focusonnetactive/][focusonnetactive]] - - by default, dwm responds to =_NET_ACTIVE_WINDOW= client messages by setting the urgency bit - on the named window - - this patch activates the window instead + - by default, dwm responds to =_NET_ACTIVE_WINDOW= client messages by setting the urgency bit + on the named window + - this patch activates the window instead - [[https://dwm.suckless.org/patches/focusurgent/][focusurgent]] - - adds a keyboard shortcut to select the next window having the urgent flag regardless of the - tag it is on + - adds a keyboard shortcut to select the next window having the urgent flag regardless of the + tag it is on - [[https://dwm.suckless.org/patches/fsignal/][fsignal]] - - send "fake signals" to dwm for handling, using xsetroot - - this will not conflict with the status bar, which also is managed using xsetroot + - send "fake signals" to dwm for handling, using xsetroot + - this will not conflict with the status bar, which also is managed using xsetroot - [[https://dwm.suckless.org/patches/fullscreen/][fullscreen]] - - applies the monocle layout with the focused client on top and hides the bar - - when pressed again it shows the bar and restores the layout that was active before going - fullscreen + - applies the monocle layout with the focused client on top and hides the bar + - when pressed again it shows the bar and restores the layout that was active before going + fullscreen - [[https://dwm.suckless.org/patches/hide_vacant_tags/][hidevacanttags]] - - prevents dwm from drawing tags with no clients (i.e. vacant) on the bar + - prevents dwm from drawing tags with no clients (i.e. vacant) on the bar - [[http://dwm.suckless.org/patches/holdbar/][holdbar]] - - with this patch dwm's built-in status bar is only shown when HOLDKEY is pressed - - additionally the bar will now overlay the display + - with this patch dwm's built-in status bar is only shown when HOLDKEY is pressed + - additionally the bar will now overlay the display - [[https://groups.google.com/forum/m/#!topic/wmii/7bncCahYIww][ignore-xft-errors-when-drawing-text]] - - sometimes dwm crashes when it cannot render some glyphs in window titles (usually emoji) - - this patch is essentially a hack to ignore any errors when drawing text on the status bar - and may be removed if a more appropriate solution comes up + - sometimes dwm crashes when it cannot render some glyphs in window titles (usually emoji) + - this patch is essentially a hack to ignore any errors when drawing text on the status bar + and may be removed if a more appropriate solution comes up - [[https://dwm.suckless.org/patches/inplacerotate/][inplacerotate]] - - allows rotation of all clients in the master or stack area without affecting the other area + - allows rotation of all clients in the master or stack area without affecting the other area - [[https://dwm.suckless.org/patches/insets/][insets]] - - lets custom insets from each edge of the screen to be defined - - an example use case would be to make space for an external bar + - lets custom insets from each edge of the screen to be defined + - an example use case would be to make space for an external bar - [[https://github.com/mihirlad55/dwm-ipc][ipc]] - - implements inter-process communication through a UNIX socket for dwm - - allows for the window manager to be queried for information, e.g. listen for events such as - tag or layout changes, as well as send commands to control the window manager via other - programs + - implements inter-process communication through a UNIX socket for dwm + - allows for the window manager to be queried for information, e.g. listen for events such as + tag or layout changes, as well as send commands to control the window manager via other + programs - [[https://github.com/bakkeby/dwm-flexipatch/issues/50][_IS_FLOATING]] - - adds the =_IS_FLOATING= xproperty for floating windows - - this can allow for a compositor to handle floating windows differently to tiled windows, - e.g. only show shadows on floating windows - - this patch is enabled via the ewmhtags patch + - adds the =_IS_FLOATING= xproperty for floating windows + - this can allow for a compositor to handle floating windows differently to tiled windows, + e.g. only show shadows on floating windows + - this patch is enabled via the ewmhtags patch - [[https://dwm.suckless.org/patches/ispermanent/][ispermanent]] - - adds rule option for clients to avoid accidental termination by killclient for sticky - windows + - adds rule option for clients to avoid accidental termination by killclient for sticky + windows - [[https://dwm.suckless.org/patches/keymodes/][keymodes]] - - this patch adds key modes (like in vim or emacs) where chains of keyboard shortcuts can be - performed - - - +[[http://dwm.suckless.org/patches/leftlayout/][leftlayout]]+ - - +moves the layout symbol in the status bar to the left hand side+ - - - LG3D - - changes the window manager name to "LG3d" instead of "dwm" as a workaround for Java - applications that assume that the window manager is using window reparenting - - refer to the ISSUES secton of the dwm man page for more details - - - [[https://github.com/bakkeby/patches/wiki/losefullscreen/][losefullscreen]] - - by default in dwm it is possible to make an application fullscreen, then use the focusstack - keybindings to focus on other windows beneath the current window - - it is also possible to spawn new windows (e.g. a terminal) that end up getting focus while - the previous window remains in fullscreen - - this patch ensures that in such scenarios the previous window loses fullscreen - - - [[https://dwm.suckless.org/patches/maximize/][maximize]] - - adds helper functions for maximizing, horizontally and vertically, floating windows using - keybindings - - - [[https://dwm.suckless.org/patches/mpdcontrol/][mpdcontrol]] - - adds keyboard bindings to control MDP (Music Player Daemon) - - - [[https://github.com/bakkeby/patches/wiki/monitorrules/][monitorrules]] - - adds rules per monitor, e.g. have default layouts per monitor - - the use case for this is if the second monitor is vertical (i.e. rotated) then you may want - to use a different default layout for this monitor than what is used for the main monitor - (for example normal vertical split for main monitor and horizontal split for the second) - - - [[https://dwm.suckless.org/patches/monoclesymbol/][monoclesymbol]] - - always display the monocle-symbol as defined in config.h if the monocle-layout is activated - - do not display the number of open clients in the current tag - - - [[https://dwm.suckless.org/patches/moveresize/][moveresize]] - - allows you to move and resize dwm's clients using keyboard bindings - - - [[https://dwm.suckless.org/patches/movestack/][movestack]] - - allows you to move clients around in the stack and swap them with the master - - - [[https://github.com/bakkeby/patches/wiki/netclientliststacking][netclientliststacking]] - - adds support for the =_NET_CLIENT_LIST_STACKING= atom, needed by certain applications - like the Zoom video conferencing application - - - [[https://dwm.suckless.org/patches/noborder/][noborder]] - - removes the border when there is only one window visible - - - [[https://git.suckless.org/sites/commit/ed68e3629de4ef2ca2d3f8893a79fb570b4c0cbc.html][nodmenu]] - - enable modifying dmenu in config.def.h which resulted previously in a compilation error - because two lines of code hardcode dmenu into dwm - - allows complete removal of dmenu, should you want to do that - - NB: this patch was removed from the patches listing on the suckless page due to it's simplicity - - - nomodbuttons - - allows for toggleable client button bindings that have no modifiers - - this can, for example, allow you to move or resize using the mouse alone without holding - down a modifier key, which can be practical if you have extra buttons on your mouse - - - [[https://github.com/szatanjl/dwm/commit/1529909466206016f2101457bbf37c67195714c8][no_transparent_borders]] - - when terminals have transparency then their borders also become transparent - - this patch ensures that borders have no transparency - - note that this patch is only relevant if you are not using the alpha patch - - - [[https://github.com/bakkeby/dwm-flexipatch/issues/51][on_empty_keys]] - - port of InstantWM's on_empty_keys functionality allowing keybindings that apply only when a - tag/view is empty - - an example use case is being able to launch applications with first hand keys like "f" to - launch firefox - - - [[https://dwm.suckless.org/patches/onlyquitonempty/][onlyquitonempty]] - - makes it so dwm will only exit via quit() if no windows are open (in order to prevent - accidental loss of work) - - - [[https://dwm.suckless.org/patches/pango/][pango]] - - adds simple markup for status messages using pango markup - - - [[https://dwm.suckless.org/patches/pertag/][pertag]] - - adds nmaster, mfact, layouts and more per tag rather than per monitor - - - [[https://github.com/bakkeby/patches/wiki/placemouse][placemouse]] - - lets the user change the position of a client in the stack using the mouse. - - - [[https://gitlab.com/udiboy1209-suckless/dwm/-/commit/071f5063e8ac4280666828179f92788d893eea40#4b1a539194be7467cefbda22f675a3b7c19ceca7][powerline]] - - adds drawing of powerline arrows (and diagonal lines) for both the status bar and the tags - - - [[https://dwm.suckless.org/patches/push/][push]] - - this patch provides a way to move clients up and down inside the client list - - - [[https://dwm.suckless.org/patches/reorganizetags/][reorganizetags]] - - shifts all clients per tag to leftmost unoccupied tags - - e.g. if clients A, B, C are tagged on tags 1, 5, 9 respectively, when reorganized they will - now be on tag 1, 2, and 3 - - - [[https://dwm.suckless.org/patches/resizecorners/][resizecorners]] - - by default, windows only resize from the bottom right corner - - with this patch the mouse is warped to the nearest corner and you resize from there - - - [[https://github.com/bakkeby/patches/wiki/resizepoint/][resizepoint]] - - practically the same as resizecorners, but the cursor does not warp to any of the window - corners - - - [[https://dwm.suckless.org/patches/restartsig/][restartsig]] - - adds a keyboard shortcut to restart dwm or alternatively by using kill -HUP dwmpid - - additionally dwm can quit cleanly by using kill -TERM dwmpid - - - [[https://github.com/bakkeby/patches/wiki/riodraw/][riodraw]] - - adds rio-like drawing to spawn new windows or to resize the selected client (ported from - instantWM) - - depends on an external tool slop being installed - - - [[https://dwm.suckless.org/patches/rotatestack/][rotatestack]] - - let's you rotate through the stack using keyboard shortcuts - - - [[https://github.com/mitchweaver/suckless/blob/master/dwm/patches/mitch-06-rounded_corners-f04cac6d6e39cd9e3fc4fae526e3d1e8df5e34b2.patch][roundedcorners]] - - adds rounded corners to client windows - - - [[https://dwm.suckless.org/patches/save_floats/][savefloats]] - - saves size and position of every floating window before it is forced into tiled mode - - if the window is made floating again then the old dimensions will be restored - - - [[https://dwm.suckless.org/patches/scratchpad/][scratchpad]] - - the scratchpad patch allows you to spawn or restore a floating terminal window - - - [[https://github.com/GasparVardanyan/dwm-scratchpad][scratchpad_alt_1]] - - this alternative patch enables a scratchpad feature in dwm similar to the scratchpad - feature in i3wm - - - [[https://dwm.suckless.org/patches/selfrestart/][selfrestart]] - - restart dwm without the unnecessary dependency of an external script - - - [[https://github.com/bakkeby/patches/wiki/sendmon_keepfocus/][sendmon_keepfocus]] - - minor patch that allow clients to keep focus when being sent to another monitor - - - [[https://dwm.suckless.org/patches/setborderpx/][setborderpx]] - - this patch allows border pixels to be changed during runtime - - - [[https://github.com/chau-bao-long/dotfiles/blob/master/suckless/dwm/shiftview.diff][shiftview]] - - adds keybindings for left and right circular shift through tags - - also see focusadjacenttag - - - [[https://github.com/bakkeby/patches/wiki/shiftviewclients/][shiftviewclients]] - - variant of the shiftview patch which skips tags that have no clients - - - [[https://dwm.suckless.org/patches/sizehints/][sizehints]] - - makes dwm obey even "soft" sizehints for new clients - - - [[https://www.mail-archive.com/hackers@suckless.org/msg09400.html][sortscreens]] - - this patch aims to address some inconsistencies when it comes to focusmon, tagmon and - similar functionality by explicitly sorting screens left to right (or top to bottom in a - vertical layout) - - - [[https://dwm.suckless.org/patches/spawn_cwd/][spawn_cwd]] - - spawns programs from currently focused client's working directory - - - [[https://dwm.suckless.org/patches/stacker/][stacker]] - - provides comprehensive utilities for managing the client stack - - - [[https://dwm.suckless.org/patches/staticstatus/][staticstatus]] - - allows the status text to be fixed to the bar on a specific monitor rather than being drawn on the focused monitor - - - [[https://dwm.suckless.org/patches/status2d/][status2d]] - - allows colors and rectangle drawing in the dwm status bar - - - [[https://dwm.suckless.org/patches/statuspadding/][statusallmons]] - - this patch draws and updates the statusbar on all monitors - - - [[https://dwm.suckless.org/patches/statusbutton/][statusbutton]] - - adds a clickable button to the left hand side of the statusbar - - - [[https://dwm.suckless.org/patches/statuscmd/][statuscmd]] - - adds the ability to execute shell commands based on the mouse button and position when - clicking the status bar - - - [[https://dwm.suckless.org/patches/statuscolors/][statuscolors]] - - enables colored text in the status bar allowing multiple color combinations for use in the - status script - - - [[https://dwm.suckless.org/patches/statuspadding/][statuspadding]] - - adds configuration options for horizontal and vertical padding in the status bar - - - [[https://github.com/bakkeby/patches/wiki/steam][steam]] - - a minor patch that works around the issue of floating Steam windows jumping around the - screen when they receive focus - - - [[https://dwm.suckless.org/patches/sticky/][sticky]] - - adds toggleable keyboard shortcut to make a client 'sticky', i.e. visible on all tags - - - [[https://dwm.suckless.org/patches/swallow/][swallow]] - - this patch adds "window swallowing" to dwm as known from Plan 9's windowing system rio - - clients marked with isterminal in config.h swallow a window opened by any child process, - e.g. running xclock in a terminal - - closing the xclock window restores the terminal window in the current position - - - [[https://dwm.suckless.org/patches/swapfocus/][swapfocus]] - - this patch depends on the pertag patch and makes it possible to switch focus with a single - shortcut (mod-s) instead of having to think if you should use mod-j or mod-k for reaching - the previously used window - - - [[https://dwm.suckless.org/patches/swaptags/][swaptags]] - - allows swapping the contents of the currently selected tag with another tag by using - keyboard shortcuts - - - [[https://dwm.suckless.org/patches/switchcol/][switchcol]] - - allows you to switch focus between the master and stack columns using a single keybinding - - - [[https://github.com/bakkeby/patches/wiki/switchtag/][switchtag]] - - when an application opens on a specific tab this patch adds the option to also switch to - that tag when the application starts - - optionally, the previous view can also be restored when the client is closed - - - [[https://dwm.suckless.org/patches/systray/][systray]] - - adds system tray in the status bar - - - [[https://dwm.suckless.org/patches/tab/][tab]] - - transforms the monocle layout into a "tabbed" layout if more than one window is present on - the monocle view - - this is essentially just a specific bar - - the patch has been added for demonstration purposes only and has limited compatibility with - other patches - - it will conflict space-wise with a second bar - - note that fancybar, awesomebar, bartabgroups and similar patches make the tab patch - redundant - - - [[https://dwm.suckless.org/patches/tagall/][tagall]] - - adds keyboard shortcuts to move all (or only floating) windows from one tag to another - - - [[https://github.com/bakkeby/patches/wiki/tagallmon/][tagallmon]] - - move all visible windows to an adjacent monitor - - - [[https://dwm.suckless.org/patches/tagintostack/][tagintostack]] - - makes new clients attach into the stack area when you toggle a new tag into view - - this means your master area will remain unchanged when toggling views - - - [[https://dwm.suckless.org/patches/taggrid/][taggrid]] - - adds an option to place tags in rows like in many other window managers - - - [[https://github.com/bakkeby/patches/wiki/tagmonfixfs/][tagmonfixfs]] - - allows moving a fullscreen window to another monitor while remaining in fullscreen - - - [[https://dwm.suckless.org/patches/tagothermonitor/][tagothermonitor]] - - adds functions and keybindings to tag a window to a desired tag on an adjacent monitor - - - [[https://github.com/bakkeby/patches/wiki/tagswapmon/][tagswapmon]] - - swap all visible windows on one monitor with those of an adjacent monitor - - - [[https://dwm.suckless.org/patches/tapresize/][tapresize]] - - allows resizing of windows using a touchpad - - uses vertical and horizontal scroll events allowing you to use one-finger tap for moving - windows and two-finger tap for resizing - - - +[[https://dwm.suckless.org/patches/titlecolor/][titlecolor]]+ - - +adds a new color scheme used by the (selected) window title in the bar+ - - - [[https://github.com/bakkeby/patches/wiki/togglefullscreen/][togglefullscreen]] - - allows you to toggle fullscreen on and off using a single shortcut key - - - [[https://github.com/bakkeby/patches/wiki/toggletag][toggletag]] - - toggle tags using the same keyboard shortcuts to view tags - - e.g. hitting ~MOD+4~ lets you view tag 4 and hitting the keybinding a second time brings - you back to where you were before - - - [[https://github.com/bakkeby/patches/wiki/togglelayout][togglelayout]] - - toggle layout using the same keyboard shortcuts to set the layout - - e.g. hitting ~MOD+m~ switches to monocle layout, hitting the same keybinding again brings - you back to the previous layout - - - [[https://dwm.suckless.org/patches/transfer/][transfer]] - - lets you transfer the currently focused client between the master and stack area while - increasing or decreasing the master area (nmaster) accordingly - - - [[https://dwm.suckless.org/patches/transfer/][transferall]] - - lets you transfer all clients between the master and stack area while increasing or - decreasing the master area (nmaster) accordingly - - - [[https://dwm.suckless.org/patches/unfloatvisible/][unfloatvisible]] - - resets isfloating on any visible windows that have it set and optionally also applies a - layout + - this patch adds key modes (like in vim or emacs) where chains of keyboard shortcuts can be + performed - [[https://dwm.suckless.org/patches/killunsel/][killunsel]] - - kills all visible clients that are not selected (only the selected client will remain) + - kills all visible clients that are not selected (only the selected client will remain) + + - +[[http://dwm.suckless.org/patches/leftlayout/][leftlayout]]+ + - +moves the layout symbol in the status bar to the left hand side+ + + - LG3D + - changes the window manager name to "LG3d" instead of "dwm" as a workaround for Java + applications that assume that the window manager is using window reparenting + - refer to the ISSUES secton of the dwm man page for more details + + - [[https://github.com/bakkeby/patches/wiki/losefullscreen/][losefullscreen]] + - by default in dwm it is possible to make an application fullscreen, then use the focusstack + keybindings to focus on other windows beneath the current window + - it is also possible to spawn new windows (e.g. a terminal) that end up getting focus while + the previous window remains in fullscreen + - this patch ensures that in such scenarios the previous window loses fullscreen + + - [[https://dwm.suckless.org/patches/maximize/][maximize]] + - adds helper functions for maximizing, horizontally and vertically, floating windows using + keybindings + + - [[https://dwm.suckless.org/patches/mpdcontrol/][mpdcontrol]] + - adds keyboard bindings to control MDP (Music Player Daemon) + + - [[https://github.com/bakkeby/patches/wiki/monitorrules/][monitorrules]] + - adds rules per monitor, e.g. have default layouts per monitor + - the use case for this is if the second monitor is vertical (i.e. rotated) then you may want + to use a different default layout for this monitor than what is used for the main monitor + (for example normal vertical split for main monitor and horizontal split for the second) + + - [[https://dwm.suckless.org/patches/monoclesymbol/][monoclesymbol]] + - always display the monocle-symbol as defined in config.h if the monocle-layout is activated + - do not display the number of open clients in the current tag + + - [[https://dwm.suckless.org/patches/moveresize/][moveresize]] + - allows you to move and resize dwm's clients using keyboard bindings + + - [[https://dwm.suckless.org/patches/movestack/][movestack]] + - allows you to move clients around in the stack and swap them with the master + + - [[https://github.com/bakkeby/patches/wiki/netclientliststacking][netclientliststacking]] + - adds support for the =_NET_CLIENT_LIST_STACKING= atom, needed by certain applications + like the Zoom video conferencing application + + - [[https://dwm.suckless.org/patches/noborder/][noborder]] + - removes the border when there is only one window visible + + - [[https://git.suckless.org/sites/commit/ed68e3629de4ef2ca2d3f8893a79fb570b4c0cbc.html][nodmenu]] + - enable modifying dmenu in config.def.h which resulted previously in a compilation error + because two lines of code hardcode dmenu into dwm + - allows complete removal of dmenu, should you want to do that + - NB: this patch was removed from the patches listing on the suckless page due to it's simplicity + + - nomodbuttons + - allows for toggleable client button bindings that have no modifiers + - this can, for example, allow you to move or resize using the mouse alone without holding + down a modifier key, which can be practical if you have extra buttons on your mouse + + - [[https://github.com/szatanjl/dwm/commit/1529909466206016f2101457bbf37c67195714c8][no_transparent_borders]] + - when terminals have transparency then their borders also become transparent + - this patch ensures that borders have no transparency + - note that this patch is only relevant if you are not using the alpha patch + + - [[https://github.com/bakkeby/dwm-flexipatch/issues/51][on_empty_keys]] + - port of InstantWM's on_empty_keys functionality allowing keybindings that apply only when a + tag/view is empty + - an example use case is being able to launch applications with first hand keys like "f" to + launch firefox + + - [[https://dwm.suckless.org/patches/onlyquitonempty/][onlyquitonempty]] + - makes it so dwm will only exit via quit() if no windows are open (in order to prevent + accidental loss of work) + + - [[https://dwm.suckless.org/patches/pango/][pango]] + - adds simple markup for status messages using pango markup + + - [[https://dwm.suckless.org/patches/pertag/][pertag]] + - adds nmaster, mfact, layouts and more per tag rather than per monitor + + - [[https://github.com/bakkeby/patches/wiki/placemouse][placemouse]] + - lets the user change the position of a client in the stack using the mouse. + + - [[https://gitlab.com/udiboy1209-suckless/dwm/-/commit/071f5063e8ac4280666828179f92788d893eea40#4b1a539194be7467cefbda22f675a3b7c19ceca7][powerline]] + - adds drawing of powerline arrows (and diagonal lines) for both the status bar and the tags + + - [[https://dwm.suckless.org/patches/push/][push]] + - this patch provides a way to move clients up and down inside the client list + + - [[https://dwm.suckless.org/patches/reorganizetags/][reorganizetags]] + - shifts all clients per tag to leftmost unoccupied tags + - e.g. if clients A, B, C are tagged on tags 1, 5, 9 respectively, when reorganized they will + now be on tag 1, 2, and 3 + + - [[https://dwm.suckless.org/patches/resizecorners/][resizecorners]] + - by default, windows only resize from the bottom right corner + - with this patch the mouse is warped to the nearest corner and you resize from there + + - [[https://github.com/bakkeby/patches/wiki/resizepoint/][resizepoint]] + - practically the same as resizecorners, but the cursor does not warp to any of the window + corners + + - [[https://dwm.suckless.org/patches/restartsig/][restartsig]] + - adds a keyboard shortcut to restart dwm or alternatively by using kill -HUP dwmpid + - additionally dwm can quit cleanly by using kill -TERM dwmpid + + - [[https://github.com/bakkeby/patches/wiki/riodraw/][riodraw]] + - adds rio-like drawing to spawn new windows or to resize the selected client (ported from + instantWM) + - depends on an external tool slop being installed + + - [[https://dwm.suckless.org/patches/rotatestack/][rotatestack]] + - let's you rotate through the stack using keyboard shortcuts + + - [[https://github.com/mitchweaver/suckless/blob/master/dwm/patches/mitch-06-rounded_corners-f04cac6d6e39cd9e3fc4fae526e3d1e8df5e34b2.patch][roundedcorners]] + - adds rounded corners to client windows + + - [[https://dwm.suckless.org/patches/save_floats/][savefloats]] + - saves size and position of every floating window before it is forced into tiled mode + - if the window is made floating again then the old dimensions will be restored + + - [[https://dwm.suckless.org/patches/scratchpad/][scratchpad]] + - the scratchpad patch allows you to spawn or restore a floating terminal window + + - [[https://github.com/GasparVardanyan/dwm-scratchpad][scratchpad_alt_1]] + - this alternative patch enables a scratchpad feature in dwm similar to the scratchpad + feature in i3wm + + - [[https://dwm.suckless.org/patches/selfrestart/][selfrestart]] + - restart dwm without the unnecessary dependency of an external script + + - [[https://github.com/bakkeby/patches/wiki/sendmon_keepfocus/][sendmon_keepfocus]] + - minor patch that allow clients to keep focus when being sent to another monitor + + - [[https://dwm.suckless.org/patches/setborderpx/][setborderpx]] + - this patch allows border pixels to be changed during runtime + + - [[https://github.com/chau-bao-long/dotfiles/blob/master/suckless/dwm/shiftview.diff][shiftview]] + - adds keybindings for left and right circular shift through tags + - also see focusadjacenttag + + - [[https://github.com/bakkeby/patches/wiki/shiftviewclients/][shiftviewclients]] + - variant of the shiftview patch which skips tags that have no clients + + - [[https://dwm.suckless.org/patches/sizehints/][sizehints]] + - makes dwm obey even "soft" sizehints for new clients + + - [[https://www.mail-archive.com/hackers@suckless.org/msg09400.html][sortscreens]] + - this patch aims to address some inconsistencies when it comes to focusmon, tagmon and + similar functionality by explicitly sorting screens left to right (or top to bottom in a + vertical layout) + + - [[https://dwm.suckless.org/patches/spawn_cwd/][spawn_cwd]] + - spawns programs from currently focused client's working directory + + - [[https://dwm.suckless.org/patches/stacker/][stacker]] + - provides comprehensive utilities for managing the client stack + + - [[https://dwm.suckless.org/patches/staticstatus/][staticstatus]] + - allows the status text to be fixed to the bar on a specific monitor rather than being drawn on the focused monitor + + - [[https://dwm.suckless.org/patches/status2d/][status2d]] + - allows colors and rectangle drawing in the dwm status bar + + - [[https://dwm.suckless.org/patches/statuspadding/][statusallmons]] + - this patch draws and updates the statusbar on all monitors + + - [[https://dwm.suckless.org/patches/statusbutton/][statusbutton]] + - adds a clickable button to the left hand side of the statusbar + + - [[https://dwm.suckless.org/patches/statuscmd/][statuscmd]] + - adds the ability to execute shell commands based on the mouse button and position when + clicking the status bar + + - [[https://dwm.suckless.org/patches/statuscolors/][statuscolors]] + - enables colored text in the status bar allowing multiple color combinations for use in the + status script + + - [[https://dwm.suckless.org/patches/statuspadding/][statuspadding]] + - adds configuration options for horizontal and vertical padding in the status bar + + - [[https://github.com/bakkeby/patches/wiki/steam][steam]] + - a minor patch that works around the issue of floating Steam windows jumping around the + screen when they receive focus + + - [[https://dwm.suckless.org/patches/sticky/][sticky]] + - adds toggleable keyboard shortcut to make a client 'sticky', i.e. visible on all tags + + - [[https://dwm.suckless.org/patches/swallow/][swallow]] + - this patch adds "window swallowing" to dwm as known from Plan 9's windowing system rio + - clients marked with isterminal in config.h swallow a window opened by any child process, + e.g. running xclock in a terminal + - closing the xclock window restores the terminal window in the current position + + - [[https://dwm.suckless.org/patches/swapfocus/][swapfocus]] + - this patch depends on the pertag patch and makes it possible to switch focus with a single + shortcut (mod-s) instead of having to think if you should use mod-j or mod-k for reaching + the previously used window + + - [[https://dwm.suckless.org/patches/swaptags/][swaptags]] + - allows swapping the contents of the currently selected tag with another tag by using + keyboard shortcuts + + - [[https://dwm.suckless.org/patches/switchcol/][switchcol]] + - allows you to switch focus between the master and stack columns using a single keybinding + + - [[https://github.com/bakkeby/patches/wiki/switchtag/][switchtag]] + - when an application opens on a specific tab this patch adds the option to also switch to + that tag when the application starts + - optionally, the previous view can also be restored when the client is closed + + - [[https://dwm.suckless.org/patches/systray/][systray]] + - adds system tray in the status bar + + - [[https://dwm.suckless.org/patches/tab/][tab]] + - transforms the monocle layout into a "tabbed" layout if more than one window is present on + the monocle view + - this is essentially just a specific bar + - the patch has been added for demonstration purposes only and has limited compatibility with + other patches + - it will conflict space-wise with a second bar + - note that fancybar, awesomebar, bartabgroups and similar patches make the tab patch + redundant + + - [[https://dwm.suckless.org/patches/tagall/][tagall]] + - adds keyboard shortcuts to move all (or only floating) windows from one tag to another + + - [[https://github.com/bakkeby/patches/wiki/tagallmon/][tagallmon]] + - move all visible windows to an adjacent monitor + + - [[https://dwm.suckless.org/patches/tagintostack/][tagintostack]] + - makes new clients attach into the stack area when you toggle a new tag into view + - this means your master area will remain unchanged when toggling views + + - [[https://dwm.suckless.org/patches/taggrid/][taggrid]] + - adds an option to place tags in rows like in many other window managers + + - [[https://dwm.suckless.org/patches/taglabels/][taglabels]] + - shows tag + class of master client in the tags section of the bar + + - [[https://github.com/bakkeby/patches/wiki/tagmonfixfs/][tagmonfixfs]] + - allows moving a fullscreen window to another monitor while remaining in fullscreen + + - [[https://dwm.suckless.org/patches/tagothermonitor/][tagothermonitor]] + - adds functions and keybindings to tag a window to a desired tag on an adjacent monitor + + - [[https://github.com/bakkeby/patches/wiki/tagswapmon/][tagswapmon]] + - swap all visible windows on one monitor with those of an adjacent monitor + + - [[https://dwm.suckless.org/patches/tapresize/][tapresize]] + - allows resizing of windows using a touchpad + - uses vertical and horizontal scroll events allowing you to use one-finger tap for moving + windows and two-finger tap for resizing + + - +[[https://dwm.suckless.org/patches/titlecolor/][titlecolor]]+ + - +adds a new color scheme used by the (selected) window title in the bar+ + + - [[https://github.com/bakkeby/patches/wiki/togglefullscreen/][togglefullscreen]] + - allows you to toggle fullscreen on and off using a single shortcut key + + - [[https://github.com/bakkeby/patches/wiki/toggletag][toggletag]] + - toggle tags using the same keyboard shortcuts to view tags + - e.g. hitting ~MOD+4~ lets you view tag 4 and hitting the keybinding a second time brings + you back to where you were before + + - [[https://github.com/bakkeby/patches/wiki/togglelayout][togglelayout]] + - toggle layout using the same keyboard shortcuts to set the layout + - e.g. hitting ~MOD+m~ switches to monocle layout, hitting the same keybinding again brings + you back to the previous layout + + - [[https://dwm.suckless.org/patches/transfer/][transfer]] + - lets you transfer the currently focused client between the master and stack area while + increasing or decreasing the master area (nmaster) accordingly + + - [[https://dwm.suckless.org/patches/transfer/][transferall]] + - lets you transfer all clients between the master and stack area while increasing or + decreasing the master area (nmaster) accordingly + + - [[https://dwm.suckless.org/patches/underlinetags/][underlinetags]] + - underlines the selected tag, or optionally all tags + + - [[https://dwm.suckless.org/patches/unfloatvisible/][unfloatvisible]] + - resets isfloating on any visible windows that have it set and optionally also applies a + layout - +[[https://dwm.suckless.org/patches/urgentborder/][urgentborder]]+ - - +this patch makes "urgent" windows have different colors+ + - +this patch makes "urgent" windows have different colors+ - [[https://github.com/bakkeby/patches/blob/master/dwm/dwm-vanitygaps-6.2.diff][vanitygaps]] - - adds configurable gaps between windows differentiating between outer, inner, horizontal and - vertical gaps + - adds configurable gaps between windows differentiating between outer, inner, horizontal and + vertical gaps - [[https://dwm.suckless.org/patches/viewontag/][viewontag]] - - follow a window to the tag it is being moved to + - follow a window to the tag it is being moved to - [[https://dwm.suckless.org/patches/vtcolors/][vtcolor]] - - this patch adds the ability for dwm to read colors from the linux virtual console - essentially allowing you to use the same color scheme as your regular tty + - this patch adds the ability for dwm to read colors from the linux virtual console + essentially allowing you to use the same color scheme as your regular tty - [[https://dwm.suckless.org/patches/warp/][warp]] - - warps the mouse cursor to the center of the currently focused window or screen when the - mouse cursor is (a) on a different screen or (b) on top of a different window + - warps the mouse cursor to the center of the currently focused window or screen when the + mouse cursor is (a) on a different screen or (b) on top of a different window - - [[https://dwm.suckless.org/patches/winicon/][winicon]] - - adds the window icon next to the window title in the bar + - [[https://dwm.suckless.org/patches/winicon/][winicon]] + - adds the window icon next to the window title in the bar - [[https://github.com/bakkeby/patches/wiki/windowrolerule/][windowrolerule]] - - sometimes a single application opens different windows depending on the task at hand and - this is often reflected in the =WM_WINDOW_ROLE(STRING)= x property - - this patch adds the role field to the rule configuration so that one can differentiate - between, say, Firefox "browser" vs "Preferences" vs "Manager" or Google-chrome "browser" - vs "pop-up". + - sometimes a single application opens different windows depending on the task at hand and + this is often reflected in the =WM_WINDOW_ROLE(STRING)= x property + - this patch adds the role field to the rule configuration so that one can differentiate + between, say, Firefox "browser" vs "Preferences" vs "Manager" or Google-chrome "browser" + vs "pop-up". - [[http://dwm.suckless.org/patches/winview/][winview]] - - allows switching the view to that of a given client from the all-window view (Mod-0) using - a keyboard shortcut + - allows switching the view to that of a given client from the all-window view (Mod-0) using + a keyboard shortcut - [[https://dwm.suckless.org/patches/xkb/][xkb]] - - remembers keyboard layout per client + - remembers keyboard layout per client - [[http://dwm.suckless.org/patches/xrdb/][xrdb]] - - allows dwm to read colors from xrdb (.Xresources) during runtime + - allows dwm to read colors from xrdb (.Xresources) during runtime - [[https://www.reddit.com/r/suckless/comments/ie5fe3/zoomfloating_my_own_simple_original_patch/][zoomfloating]] - - a simple patch that allows floating windows to be zoomed into the master stack position + - a simple patch that allows floating windows to be zoomed into the master stack position - [[https://dwm.suckless.org/patches/zoomswap/][zoomswap]] - - allows a master and a stack window to swap places rather than every window on the screen - changing position + - allows a master and a stack window to swap places rather than every window on the screen + changing position ** Layouts Included @@ -3230,7 +3242,7 @@ This can be optionally disabled in favour of other layouts. #+BEGIN_SRC makefile :tangle config.jk # dwm version -VERSION = 6.2 +VERSION = 6.3 # Customize below to fit your system @@ -3259,7 +3271,7 @@ FREETYPEINC = /usr/include/freetype2 # OpenBSD - Uncomment this for the swallow patch / SWALLOW_PATCH #KVMLIB = -lkvm -# Uncomment this for the alpha patch / BAR_ALPHA_PATCH +# Uncomment this for the alpha patch and the winicon patch (BAR_ALPHA_PATCH, BAR_WINICON_PATCH) #XRENDER = -lXrender # Uncomment this for the mdpcontrol patch / MDPCONTROL_PATCH @@ -3286,7 +3298,7 @@ LIBS = -L${X11LIB} -lX11 ${XINERAMALIBS} ${FREETYPELIBS} ${XRENDER} ${MPDCLIENT # flags CPPFLAGS = -D_DEFAULT_SOURCE -D_BSD_SOURCE -D_POSIX_C_SOURCE=200809L -DVERSION=\"${VERSION}\" ${XINERAMAFLAGS} #CFLAGS = -g -std=c99 -pedantic -Wall -O0 ${INCS} ${CPPFLAGS} -CFLAGS = -std=c99 -pedantic -Wall -Wno-deprecated-declarations -Os ${INCS} ${CPPFLAGS} +CFLAGS = -std=c99 -pedantic -Wall -Wno-unused-function -Wno-deprecated-declarations -Os ${INCS} ${CPPFLAGS} LDFLAGS = ${LIBS} # Solaris @@ -3531,6 +3543,23 @@ static const int showsystray = 1; /* 0 means no systray */ #endif // BAR_SYSTRAY_PATCH #+END_SRC +#+BEGIN_SRC c :tangle config.def.h +#if BAR_TAGLABELS_PATCH +static const char ptagf[] = "[%s %s]"; /* format of a tag label */ +static const char etagf[] = "[%s]"; /* format of an empty tag */ +static const int lcaselbl = 0; /* 1 means make tag label lowercase */ +#endif // BAR_TAGLABELS_PATCH +#+END_SRC + +#+BEGIN_SRC c :tangle config.def.h +#if BAR_UNDERLINETAGS_PATCH +static const unsigned int ulinepad = 5; /* horizontal padding between the underline and tag */ +static const unsigned int ulinestroke = 2; /* thickness / height of the underline */ +static const unsigned int ulinevoffset = 0; /* how far above the bottom of the bar the line should appear */ +static const int ulineall = 0; /* 1 to show underline on all tags, 0 for just the active ones */ +#endif // BAR_UNDERLINETAGS_PATCH +#+END_SRC + ** Indicators See patch/bar_indicators.h for options @@ -3550,7 +3579,7 @@ static int floatfakefsindicatortype = INDICATOR_PLUS_AND_LARGER_SQUARE; #+BEGIN_SRC c :tangle config.def.h #if ONLYQUITONEMPTY_PATCH -static const int quit_empty_window_count = 2; /* only allow dwm to quit if no windows are open, value here represents number of deamons */ +static const int quit_empty_window_count = 0; /* only allow dwm to quit if no (<= count) windows are open */ #endif // ONLYQUITONEMPTY_PATCH #+END_SRC @@ -3586,11 +3615,6 @@ static const char dmenufont[] = "monospace:size=10"; static char c000000[] = "#000000"; // placeholder value #+END_SRC -#+BEGIN_SRC c :tangle config.def.h -#if BAR_FLEXWINTITLE_PATCH -#endif // BAR_FLEXWINTITLE_PATCH -#+END_SRC - ** Colors *** Define Colors @@ -4019,80 +4043,82 @@ name - does nothing, intended for visual clue and for logging / debugging #+BEGIN_SRC c :tangle config.def.h static const BarRule barrules[] = { - /* monitor bar alignment widthfunc drawfunc clickfunc name */ - { -2 }, - #if BAR_STATUSBUTTON_PATCH - { -1, 0, BAR_ALIGN_LEFT, width_stbutton, draw_stbutton, click_stbutton, "statusbutton" }, - #endif // BAR_STATUSBUTTON_PATCH - #if BAR_POWERLINE_TAGS_PATCH - { 0, 0, BAR_ALIGN_LEFT, width_pwrl_tags, draw_pwrl_tags, click_pwrl_tags, "powerline_tags" }, - #endif // BAR_POWERLINE_TAGS_PATCH - #if BAR_TAGS_PATCH - { -1, 0, BAR_ALIGN_LEFT, width_tags, draw_tags, click_tags, "tags" }, - #endif // BAR_TAGS_PATCH - #if BAR_TAGGRID_PATCH - { -1, 0, BAR_ALIGN_LEFT, width_taggrid, draw_taggrid, click_taggrid, "taggrid" }, - #endif // BAR_TAGGRID_PATCH - #if BAR_SYSTRAY_PATCH - { 0, 0, BAR_ALIGN_RIGHT, width_systray, draw_systray, click_systray, "systray" }, - #endif // BAR_SYSTRAY_PATCH - #if BAR_LTSYMBOL_PATCH - { -1, 0, BAR_ALIGN_LEFT, width_ltsymbol, draw_ltsymbol, click_ltsymbol, "layout" }, - #endif // BAR_LTSYMBOL_PATCH - #if BAR_STATUSCOLORS_PATCH && BAR_STATUSCMD_PATCH - { statusmon, 0, BAR_ALIGN_RIGHT, width_statuscolors, draw_statuscolors, click_statuscmd, "statuscolors" }, - #elif BAR_STATUSCOLORS_PATCH - { statusmon, 0, BAR_ALIGN_RIGHT, width_statuscolors, draw_statuscolors, click_statuscolors, "statuscolors" }, - #elif BAR_STATUS2D_PATCH && BAR_STATUSCMD_PATCH - { statusmon, 0, BAR_ALIGN_RIGHT, width_status2d, draw_status2d, click_statuscmd, "status2d" }, - #elif BAR_STATUS2D_PATCH - { statusmon, 0, BAR_ALIGN_RIGHT, width_status2d, draw_status2d, click_status2d, "status2d" }, - #elif BAR_POWERLINE_STATUS_PATCH - { statusmon, 0, BAR_ALIGN_RIGHT, width_pwrl_status, draw_pwrl_status, click_pwrl_status, "powerline_status" }, - #elif BAR_STATUS_PATCH && BAR_STATUSCMD_PATCH - { statusmon, 0, BAR_ALIGN_RIGHT, width_status, draw_status, click_statuscmd, "status" }, - #elif BAR_STATUS_PATCH - { statusmon, 0, BAR_ALIGN_RIGHT, width_status, draw_status, click_status, "status" }, - #endif // BAR_STATUS2D_PATCH | BAR_STATUSCMD_PATCH - #if XKB_PATCH - { 0, 0, BAR_ALIGN_RIGHT, width_xkb, draw_xkb, click_xkb, "xkb" }, - #endif // XKB_PATCH - #if BAR_FLEXWINTITLE_PATCH - { -1, 0, BAR_ALIGN_NONE, width_flexwintitle, draw_flexwintitle, click_flexwintitle, "flexwintitle" }, - #elif BAR_TABGROUPS_PATCH - { -1, 0, BAR_ALIGN_NONE, width_bartabgroups, draw_bartabgroups, click_bartabgroups, "bartabgroups" }, - #elif BAR_AWESOMEBAR_PATCH - { -1, 0, BAR_ALIGN_NONE, width_awesomebar, draw_awesomebar, click_awesomebar, "awesomebar" }, - #elif BAR_FANCYBAR_PATCH - { -1, 0, BAR_ALIGN_NONE, width_fancybar, draw_fancybar, click_fancybar, "fancybar" }, - #elif BAR_WINTITLE_PATCH - { -1, 0, BAR_ALIGN_NONE, width_wintitle, draw_wintitle, click_wintitle, "wintitle" }, - #endif // BAR_TABGROUPS_PATCH | BAR_AWESOMEBAR_PATCH | BAR_FANCYBAR_PATCH | BAR_WINTITLE_PATCH - #if BAR_EXTRASTATUS_PATCH - #if BAR_STATUSCOLORS_PATCH && BAR_STATUSCMD_PATCH - { statusmon, 1, BAR_ALIGN_CENTER, width_statuscolors_es, draw_statuscolors_es, click_statuscmd_es, "statuscolors_es" }, - #elif BAR_STATUSCOLORS_PATCH - { statusmon, 1, BAR_ALIGN_CENTER, width_statuscolors_es, draw_statuscolors_es, click_statuscolors, "statuscolors_es" }, - #elif BAR_STATUS2D_PATCH && BAR_STATUSCMD_PATCH - { statusmon, 1, BAR_ALIGN_CENTER, width_status2d_es, draw_status2d_es, click_statuscmd_es, "status2d_es" }, - #elif BAR_STATUS2D_PATCH - { statusmon, 1, BAR_ALIGN_CENTER, width_status2d_es, draw_status2d_es, click_status2d, "status2d_es" }, - #elif BAR_POWERLINE_STATUS_PATCH - { statusmon, 1, BAR_ALIGN_RIGHT, width_pwrl_status_es, draw_pwrl_status_es, click_pwrl_status, "powerline_status" }, - #elif BAR_STATUSCMD_PATCH && BAR_STATUS_PATCH - { statusmon, 1, BAR_ALIGN_CENTER, width_status_es, draw_status_es, click_statuscmd_es, "status_es" }, - #elif BAR_STATUS_PATCH - { statusmon, 1, BAR_ALIGN_CENTER, width_status_es, draw_status_es, click_status, "status_es" }, - #endif // BAR_STATUS2D_PATCH | BAR_STATUSCMD_PATCH - #endif // BAR_EXTRASTATUS_PATCH - #if BAR_FLEXWINTITLE_PATCH - #if BAR_WINTITLE_HIDDEN_PATCH - { -1, 1, BAR_ALIGN_RIGHT_RIGHT, width_wintitle_hidden, draw_wintitle_hidden, click_wintitle_hidden, "wintitle_hidden" }, - #endif - #if BAR_WINTITLE_FLOATING_PATCH - { -1, 1, BAR_ALIGN_LEFT, width_wintitle_floating, draw_wintitle_floating, click_wintitle_floating, "wintitle_floating" }, - #endif // BAR_WINTITLE_FLOATING_PATCH - #endif // BAR_FLEXWINTITLE_PATCH + /* monitor bar alignment widthfunc drawfunc clickfunc name */ + #if BAR_STATUSBUTTON_PATCH + { -1, 0, BAR_ALIGN_LEFT, width_stbutton, draw_stbutton, click_stbutton, "statusbutton" }, + #endif // BAR_STATUSBUTTON_PATCH + #if BAR_POWERLINE_TAGS_PATCH + { 0, 0, BAR_ALIGN_LEFT, width_pwrl_tags, draw_pwrl_tags, click_pwrl_tags, "powerline_tags" }, + #endif // BAR_POWERLINE_TAGS_PATCH + #if BAR_TAGS_PATCH + { -1, 0, BAR_ALIGN_LEFT, width_tags, draw_tags, click_tags, "tags" }, + #endif // BAR_TAGS_PATCH + #if BAR_TAGLABELS_PATCH + { -1, 0, BAR_ALIGN_LEFT, width_taglabels, draw_taglabels, click_taglabels, "taglabels" }, + #endif // BAR_TAGLABELS_PATCH + #if BAR_TAGGRID_PATCH + { -1, 0, BAR_ALIGN_LEFT, width_taggrid, draw_taggrid, click_taggrid, "taggrid" }, + #endif // BAR_TAGGRID_PATCH + #if BAR_SYSTRAY_PATCH + { 0, 0, BAR_ALIGN_RIGHT, width_systray, draw_systray, click_systray, "systray" }, + #endif // BAR_SYSTRAY_PATCH + #if BAR_LTSYMBOL_PATCH + { -1, 0, BAR_ALIGN_LEFT, width_ltsymbol, draw_ltsymbol, click_ltsymbol, "layout" }, + #endif // BAR_LTSYMBOL_PATCH + #if BAR_STATUSCOLORS_PATCH && BAR_STATUSCMD_PATCH + { statusmon, 0, BAR_ALIGN_RIGHT, width_statuscolors, draw_statuscolors, click_statuscmd, "statuscolors" }, + #elif BAR_STATUSCOLORS_PATCH + { statusmon, 0, BAR_ALIGN_RIGHT, width_statuscolors, draw_statuscolors, click_statuscolors, "statuscolors" }, + #elif BAR_STATUS2D_PATCH && BAR_STATUSCMD_PATCH + { statusmon, 0, BAR_ALIGN_RIGHT, width_status2d, draw_status2d, click_statuscmd, "status2d" }, + #elif BAR_STATUS2D_PATCH + { statusmon, 0, BAR_ALIGN_RIGHT, width_status2d, draw_status2d, click_status2d, "status2d" }, + #elif BAR_POWERLINE_STATUS_PATCH + { statusmon, 0, BAR_ALIGN_RIGHT, width_pwrl_status, draw_pwrl_status, click_pwrl_status, "powerline_status" }, + #elif BAR_STATUS_PATCH && BAR_STATUSCMD_PATCH + { statusmon, 0, BAR_ALIGN_RIGHT, width_status, draw_status, click_statuscmd, "status" }, + #elif BAR_STATUS_PATCH + { statusmon, 0, BAR_ALIGN_RIGHT, width_status, draw_status, click_status, "status" }, + #endif // BAR_STATUS2D_PATCH | BAR_STATUSCMD_PATCH + #if XKB_PATCH + { 0, 0, BAR_ALIGN_RIGHT, width_xkb, draw_xkb, click_xkb, "xkb" }, + #endif // XKB_PATCH + #if BAR_FLEXWINTITLE_PATCH + { -1, 0, BAR_ALIGN_NONE, width_flexwintitle, draw_flexwintitle, click_flexwintitle, "flexwintitle" }, + #elif BAR_TABGROUPS_PATCH + { -1, 0, BAR_ALIGN_NONE, width_bartabgroups, draw_bartabgroups, click_bartabgroups, "bartabgroups" }, + #elif BAR_AWESOMEBAR_PATCH + { -1, 0, BAR_ALIGN_NONE, width_awesomebar, draw_awesomebar, click_awesomebar, "awesomebar" }, + #elif BAR_FANCYBAR_PATCH + { -1, 0, BAR_ALIGN_NONE, width_fancybar, draw_fancybar, click_fancybar, "fancybar" }, + #elif BAR_WINTITLE_PATCH + { -1, 0, BAR_ALIGN_NONE, width_wintitle, draw_wintitle, click_wintitle, "wintitle" }, + #endif // BAR_TABGROUPS_PATCH | BAR_AWESOMEBAR_PATCH | BAR_FANCYBAR_PATCH | BAR_WINTITLE_PATCH + #if BAR_EXTRASTATUS_PATCH + #if BAR_STATUSCOLORS_PATCH && BAR_STATUSCMD_PATCH + { statusmon, 1, BAR_ALIGN_CENTER, width_statuscolors_es, draw_statuscolors_es, click_statuscmd_es, "statuscolors_es" }, + #elif BAR_STATUSCOLORS_PATCH + { statusmon, 1, BAR_ALIGN_CENTER, width_statuscolors_es, draw_statuscolors_es, click_statuscolors, "statuscolors_es" }, + #elif BAR_STATUS2D_PATCH && BAR_STATUSCMD_PATCH + { statusmon, 1, BAR_ALIGN_CENTER, width_status2d_es, draw_status2d_es, click_statuscmd_es, "status2d_es" }, + #elif BAR_STATUS2D_PATCH + { statusmon, 1, BAR_ALIGN_CENTER, width_status2d_es, draw_status2d_es, click_status2d, "status2d_es" }, + #elif BAR_POWERLINE_STATUS_PATCH + { statusmon, 1, BAR_ALIGN_RIGHT, width_pwrl_status_es, draw_pwrl_status_es, click_pwrl_status, "powerline_status" }, + #elif BAR_STATUSCMD_PATCH && BAR_STATUS_PATCH + { statusmon, 1, BAR_ALIGN_CENTER, width_status_es, draw_status_es, click_statuscmd_es, "status_es" }, + #elif BAR_STATUS_PATCH + { statusmon, 1, BAR_ALIGN_CENTER, width_status_es, draw_status_es, click_status, "status_es" }, + #endif // BAR_STATUS2D_PATCH | BAR_STATUSCMD_PATCH + #endif // BAR_EXTRASTATUS_PATCH + #if BAR_FLEXWINTITLE_PATCH + #if BAR_WINTITLE_HIDDEN_PATCH + { -1, 1, BAR_ALIGN_RIGHT_RIGHT, width_wintitle_hidden, draw_wintitle_hidden, click_wintitle_hidden, "wintitle_hidden" }, + #endif + #if BAR_WINTITLE_FLOATING_PATCH + { -1, 1, BAR_ALIGN_LEFT, width_wintitle_floating, draw_wintitle_floating, click_wintitle_floating, "wintitle_floating" }, + #endif // BAR_WINTITLE_FLOATING_PATCH + #endif // BAR_FLEXWINTITLE_PATCH }; #+END_SRC @@ -4111,6 +4137,7 @@ static const int nstack = 0; /* number of clients in primary stack area #+BEGIN_SRC c :tangle config.def.h static const int resizehints = 0; /* 1 means respect size hints in tiled resizals */ +static const int lockfullscreen = 1; /* 1 will force focus on the fullscreen window */ #+END_SRC #+BEGIN_SRC c :tangle config.def.h diff --git a/config.def.h b/config.def.h index 462187f..1c0404f 100644 --- a/config.def.h +++ b/config.def.h @@ -108,6 +108,19 @@ static const unsigned int systrayspacing = 2; /* systray spacing */ static const int showsystray = 1; /* 0 means no systray */ #endif // BAR_SYSTRAY_PATCH +#if BAR_TAGLABELS_PATCH +static const char ptagf[] = "[%s %s]"; /* format of a tag label */ +static const char etagf[] = "[%s]"; /* format of an empty tag */ +static const int lcaselbl = 0; /* 1 means make tag label lowercase */ +#endif // BAR_TAGLABELS_PATCH + +#if BAR_UNDERLINETAGS_PATCH +static const unsigned int ulinepad = 5; /* horizontal padding between the underline and tag */ +static const unsigned int ulinestroke = 2; /* thickness / height of the underline */ +static const unsigned int ulinevoffset = 0; /* how far above the bottom of the bar the line should appear */ +static const int ulineall = 0; /* 1 to show underline on all tags, 0 for just the active ones */ +#endif // BAR_UNDERLINETAGS_PATCH + static int tagindicatortype = INDICATOR_TOP_LEFT_SQUARE; static int tiledindicatortype = INDICATOR_NONE; static int floatindicatortype = INDICATOR_TOP_LEFT_SQUARE; @@ -118,7 +131,7 @@ static int floatfakefsindicatortype = INDICATOR_PLUS_AND_LARGER_SQUARE; #endif // FAKEFULLSCREEN_CLIENT_PATCH #if ONLYQUITONEMPTY_PATCH -static const int quit_empty_window_count = 2; /* only allow dwm to quit if no windows are open, value here represents number of deamons */ +static const int quit_empty_window_count = 0; /* only allow dwm to quit if no (<= count) windows are open */ #endif // ONLYQUITONEMPTY_PATCH #if BAR_EXTRASTATUS_PATCH @@ -143,9 +156,6 @@ static const char dmenufont[] = "monospace:size=10"; static char c000000[] = "#000000"; // placeholder value -#if BAR_FLEXWINTITLE_PATCH -#endif // BAR_FLEXWINTITLE_PATCH - static char normfgcolor[] = "#F8F8F2"; static char normbgcolor[] = "#282A36"; static char normbordercolor[] = "#4D4D4D"; @@ -453,80 +463,82 @@ static const Inset default_inset = { #endif // INSETS_PATCH static const BarRule barrules[] = { - /* monitor bar alignment widthfunc drawfunc clickfunc name */ - { -2 }, - #if BAR_STATUSBUTTON_PATCH - { -1, 0, BAR_ALIGN_LEFT, width_stbutton, draw_stbutton, click_stbutton, "statusbutton" }, - #endif // BAR_STATUSBUTTON_PATCH - #if BAR_POWERLINE_TAGS_PATCH - { 0, 0, BAR_ALIGN_LEFT, width_pwrl_tags, draw_pwrl_tags, click_pwrl_tags, "powerline_tags" }, - #endif // BAR_POWERLINE_TAGS_PATCH - #if BAR_TAGS_PATCH - { -1, 0, BAR_ALIGN_LEFT, width_tags, draw_tags, click_tags, "tags" }, - #endif // BAR_TAGS_PATCH - #if BAR_TAGGRID_PATCH - { -1, 0, BAR_ALIGN_LEFT, width_taggrid, draw_taggrid, click_taggrid, "taggrid" }, - #endif // BAR_TAGGRID_PATCH - #if BAR_SYSTRAY_PATCH - { 0, 0, BAR_ALIGN_RIGHT, width_systray, draw_systray, click_systray, "systray" }, - #endif // BAR_SYSTRAY_PATCH - #if BAR_LTSYMBOL_PATCH - { -1, 0, BAR_ALIGN_LEFT, width_ltsymbol, draw_ltsymbol, click_ltsymbol, "layout" }, - #endif // BAR_LTSYMBOL_PATCH - #if BAR_STATUSCOLORS_PATCH && BAR_STATUSCMD_PATCH - { statusmon, 0, BAR_ALIGN_RIGHT, width_statuscolors, draw_statuscolors, click_statuscmd, "statuscolors" }, - #elif BAR_STATUSCOLORS_PATCH - { statusmon, 0, BAR_ALIGN_RIGHT, width_statuscolors, draw_statuscolors, click_statuscolors, "statuscolors" }, - #elif BAR_STATUS2D_PATCH && BAR_STATUSCMD_PATCH - { statusmon, 0, BAR_ALIGN_RIGHT, width_status2d, draw_status2d, click_statuscmd, "status2d" }, - #elif BAR_STATUS2D_PATCH - { statusmon, 0, BAR_ALIGN_RIGHT, width_status2d, draw_status2d, click_status2d, "status2d" }, - #elif BAR_POWERLINE_STATUS_PATCH - { statusmon, 0, BAR_ALIGN_RIGHT, width_pwrl_status, draw_pwrl_status, click_pwrl_status, "powerline_status" }, - #elif BAR_STATUS_PATCH && BAR_STATUSCMD_PATCH - { statusmon, 0, BAR_ALIGN_RIGHT, width_status, draw_status, click_statuscmd, "status" }, - #elif BAR_STATUS_PATCH - { statusmon, 0, BAR_ALIGN_RIGHT, width_status, draw_status, click_status, "status" }, - #endif // BAR_STATUS2D_PATCH | BAR_STATUSCMD_PATCH - #if XKB_PATCH - { 0, 0, BAR_ALIGN_RIGHT, width_xkb, draw_xkb, click_xkb, "xkb" }, - #endif // XKB_PATCH - #if BAR_FLEXWINTITLE_PATCH - { -1, 0, BAR_ALIGN_NONE, width_flexwintitle, draw_flexwintitle, click_flexwintitle, "flexwintitle" }, - #elif BAR_TABGROUPS_PATCH - { -1, 0, BAR_ALIGN_NONE, width_bartabgroups, draw_bartabgroups, click_bartabgroups, "bartabgroups" }, - #elif BAR_AWESOMEBAR_PATCH - { -1, 0, BAR_ALIGN_NONE, width_awesomebar, draw_awesomebar, click_awesomebar, "awesomebar" }, - #elif BAR_FANCYBAR_PATCH - { -1, 0, BAR_ALIGN_NONE, width_fancybar, draw_fancybar, click_fancybar, "fancybar" }, - #elif BAR_WINTITLE_PATCH - { -1, 0, BAR_ALIGN_NONE, width_wintitle, draw_wintitle, click_wintitle, "wintitle" }, - #endif // BAR_TABGROUPS_PATCH | BAR_AWESOMEBAR_PATCH | BAR_FANCYBAR_PATCH | BAR_WINTITLE_PATCH - #if BAR_EXTRASTATUS_PATCH - #if BAR_STATUSCOLORS_PATCH && BAR_STATUSCMD_PATCH - { statusmon, 1, BAR_ALIGN_CENTER, width_statuscolors_es, draw_statuscolors_es, click_statuscmd_es, "statuscolors_es" }, - #elif BAR_STATUSCOLORS_PATCH - { statusmon, 1, BAR_ALIGN_CENTER, width_statuscolors_es, draw_statuscolors_es, click_statuscolors, "statuscolors_es" }, - #elif BAR_STATUS2D_PATCH && BAR_STATUSCMD_PATCH - { statusmon, 1, BAR_ALIGN_CENTER, width_status2d_es, draw_status2d_es, click_statuscmd_es, "status2d_es" }, - #elif BAR_STATUS2D_PATCH - { statusmon, 1, BAR_ALIGN_CENTER, width_status2d_es, draw_status2d_es, click_status2d, "status2d_es" }, - #elif BAR_POWERLINE_STATUS_PATCH - { statusmon, 1, BAR_ALIGN_RIGHT, width_pwrl_status_es, draw_pwrl_status_es, click_pwrl_status, "powerline_status" }, - #elif BAR_STATUSCMD_PATCH && BAR_STATUS_PATCH - { statusmon, 1, BAR_ALIGN_CENTER, width_status_es, draw_status_es, click_statuscmd_es, "status_es" }, - #elif BAR_STATUS_PATCH - { statusmon, 1, BAR_ALIGN_CENTER, width_status_es, draw_status_es, click_status, "status_es" }, - #endif // BAR_STATUS2D_PATCH | BAR_STATUSCMD_PATCH - #endif // BAR_EXTRASTATUS_PATCH - #if BAR_FLEXWINTITLE_PATCH - #if BAR_WINTITLE_HIDDEN_PATCH - { -1, 1, BAR_ALIGN_RIGHT_RIGHT, width_wintitle_hidden, draw_wintitle_hidden, click_wintitle_hidden, "wintitle_hidden" }, - #endif - #if BAR_WINTITLE_FLOATING_PATCH - { -1, 1, BAR_ALIGN_LEFT, width_wintitle_floating, draw_wintitle_floating, click_wintitle_floating, "wintitle_floating" }, - #endif // BAR_WINTITLE_FLOATING_PATCH - #endif // BAR_FLEXWINTITLE_PATCH + /* monitor bar alignment widthfunc drawfunc clickfunc name */ + #if BAR_STATUSBUTTON_PATCH + { -1, 0, BAR_ALIGN_LEFT, width_stbutton, draw_stbutton, click_stbutton, "statusbutton" }, + #endif // BAR_STATUSBUTTON_PATCH + #if BAR_POWERLINE_TAGS_PATCH + { 0, 0, BAR_ALIGN_LEFT, width_pwrl_tags, draw_pwrl_tags, click_pwrl_tags, "powerline_tags" }, + #endif // BAR_POWERLINE_TAGS_PATCH + #if BAR_TAGS_PATCH + { -1, 0, BAR_ALIGN_LEFT, width_tags, draw_tags, click_tags, "tags" }, + #endif // BAR_TAGS_PATCH + #if BAR_TAGLABELS_PATCH + { -1, 0, BAR_ALIGN_LEFT, width_taglabels, draw_taglabels, click_taglabels, "taglabels" }, + #endif // BAR_TAGLABELS_PATCH + #if BAR_TAGGRID_PATCH + { -1, 0, BAR_ALIGN_LEFT, width_taggrid, draw_taggrid, click_taggrid, "taggrid" }, + #endif // BAR_TAGGRID_PATCH + #if BAR_SYSTRAY_PATCH + { 0, 0, BAR_ALIGN_RIGHT, width_systray, draw_systray, click_systray, "systray" }, + #endif // BAR_SYSTRAY_PATCH + #if BAR_LTSYMBOL_PATCH + { -1, 0, BAR_ALIGN_LEFT, width_ltsymbol, draw_ltsymbol, click_ltsymbol, "layout" }, + #endif // BAR_LTSYMBOL_PATCH + #if BAR_STATUSCOLORS_PATCH && BAR_STATUSCMD_PATCH + { statusmon, 0, BAR_ALIGN_RIGHT, width_statuscolors, draw_statuscolors, click_statuscmd, "statuscolors" }, + #elif BAR_STATUSCOLORS_PATCH + { statusmon, 0, BAR_ALIGN_RIGHT, width_statuscolors, draw_statuscolors, click_statuscolors, "statuscolors" }, + #elif BAR_STATUS2D_PATCH && BAR_STATUSCMD_PATCH + { statusmon, 0, BAR_ALIGN_RIGHT, width_status2d, draw_status2d, click_statuscmd, "status2d" }, + #elif BAR_STATUS2D_PATCH + { statusmon, 0, BAR_ALIGN_RIGHT, width_status2d, draw_status2d, click_status2d, "status2d" }, + #elif BAR_POWERLINE_STATUS_PATCH + { statusmon, 0, BAR_ALIGN_RIGHT, width_pwrl_status, draw_pwrl_status, click_pwrl_status, "powerline_status" }, + #elif BAR_STATUS_PATCH && BAR_STATUSCMD_PATCH + { statusmon, 0, BAR_ALIGN_RIGHT, width_status, draw_status, click_statuscmd, "status" }, + #elif BAR_STATUS_PATCH + { statusmon, 0, BAR_ALIGN_RIGHT, width_status, draw_status, click_status, "status" }, + #endif // BAR_STATUS2D_PATCH | BAR_STATUSCMD_PATCH + #if XKB_PATCH + { 0, 0, BAR_ALIGN_RIGHT, width_xkb, draw_xkb, click_xkb, "xkb" }, + #endif // XKB_PATCH + #if BAR_FLEXWINTITLE_PATCH + { -1, 0, BAR_ALIGN_NONE, width_flexwintitle, draw_flexwintitle, click_flexwintitle, "flexwintitle" }, + #elif BAR_TABGROUPS_PATCH + { -1, 0, BAR_ALIGN_NONE, width_bartabgroups, draw_bartabgroups, click_bartabgroups, "bartabgroups" }, + #elif BAR_AWESOMEBAR_PATCH + { -1, 0, BAR_ALIGN_NONE, width_awesomebar, draw_awesomebar, click_awesomebar, "awesomebar" }, + #elif BAR_FANCYBAR_PATCH + { -1, 0, BAR_ALIGN_NONE, width_fancybar, draw_fancybar, click_fancybar, "fancybar" }, + #elif BAR_WINTITLE_PATCH + { -1, 0, BAR_ALIGN_NONE, width_wintitle, draw_wintitle, click_wintitle, "wintitle" }, + #endif // BAR_TABGROUPS_PATCH | BAR_AWESOMEBAR_PATCH | BAR_FANCYBAR_PATCH | BAR_WINTITLE_PATCH + #if BAR_EXTRASTATUS_PATCH + #if BAR_STATUSCOLORS_PATCH && BAR_STATUSCMD_PATCH + { statusmon, 1, BAR_ALIGN_CENTER, width_statuscolors_es, draw_statuscolors_es, click_statuscmd_es, "statuscolors_es" }, + #elif BAR_STATUSCOLORS_PATCH + { statusmon, 1, BAR_ALIGN_CENTER, width_statuscolors_es, draw_statuscolors_es, click_statuscolors, "statuscolors_es" }, + #elif BAR_STATUS2D_PATCH && BAR_STATUSCMD_PATCH + { statusmon, 1, BAR_ALIGN_CENTER, width_status2d_es, draw_status2d_es, click_statuscmd_es, "status2d_es" }, + #elif BAR_STATUS2D_PATCH + { statusmon, 1, BAR_ALIGN_CENTER, width_status2d_es, draw_status2d_es, click_status2d, "status2d_es" }, + #elif BAR_POWERLINE_STATUS_PATCH + { statusmon, 1, BAR_ALIGN_RIGHT, width_pwrl_status_es, draw_pwrl_status_es, click_pwrl_status, "powerline_status" }, + #elif BAR_STATUSCMD_PATCH && BAR_STATUS_PATCH + { statusmon, 1, BAR_ALIGN_CENTER, width_status_es, draw_status_es, click_statuscmd_es, "status_es" }, + #elif BAR_STATUS_PATCH + { statusmon, 1, BAR_ALIGN_CENTER, width_status_es, draw_status_es, click_status, "status_es" }, + #endif // BAR_STATUS2D_PATCH | BAR_STATUSCMD_PATCH + #endif // BAR_EXTRASTATUS_PATCH + #if BAR_FLEXWINTITLE_PATCH + #if BAR_WINTITLE_HIDDEN_PATCH + { -1, 1, BAR_ALIGN_RIGHT_RIGHT, width_wintitle_hidden, draw_wintitle_hidden, click_wintitle_hidden, "wintitle_hidden" }, + #endif + #if BAR_WINTITLE_FLOATING_PATCH + { -1, 1, BAR_ALIGN_LEFT, width_wintitle_floating, draw_wintitle_floating, click_wintitle_floating, "wintitle_floating" }, + #endif // BAR_WINTITLE_FLOATING_PATCH + #endif // BAR_FLEXWINTITLE_PATCH }; static const float mfact = 0.50; /* factor of master area size [0.05..0.95] */ @@ -537,6 +549,7 @@ static const int nstack = 0; /* number of clients in primary stack area #endif // FLEXTILE_DELUXE_LAYOUT static const int resizehints = 0; /* 1 means respect size hints in tiled resizals */ +static const int lockfullscreen = 1; /* 1 will force focus on the fullscreen window */ #if DECORATION_HINTS_PATCH static const int decorhints = 1; /* 1 means respect decoration hints */ diff --git a/config.mk b/config.mk index 7d2d943..9232078 100644 --- a/config.mk +++ b/config.mk @@ -1,5 +1,5 @@ # dwm version -VERSION = 6.2 +VERSION = 6.3 # Customize below to fit your system @@ -28,7 +28,7 @@ FREETYPEINC = /usr/include/freetype2 # OpenBSD - Uncomment this for the swallow patch / SWALLOW_PATCH #KVMLIB = -lkvm -# Uncomment this for the alpha patch / BAR_ALPHA_PATCH +# Uncomment this for the alpha patch and the winicon patch (BAR_ALPHA_PATCH, BAR_WINICON_PATCH) #XRENDER = -lXrender # Uncomment this for the mdpcontrol patch / MDPCONTROL_PATCH @@ -58,7 +58,7 @@ LIBS = -L${X11LIB} -lX11 ${XINERAMALIBS} ${FREETYPELIBS} ${XRENDER} ${MPDCLIENT # flags CPPFLAGS = -D_DEFAULT_SOURCE -D_BSD_SOURCE -D_POSIX_C_SOURCE=200809L -DVERSION=\"${VERSION}\" ${XINERAMAFLAGS} #CFLAGS = -g -std=c99 -pedantic -Wall -O0 ${INCS} ${CPPFLAGS} -CFLAGS = -std=c99 -pedantic -Wall -Wno-deprecated-declarations -Os ${INCS} ${CPPFLAGS} +CFLAGS = -std=c99 -pedantic -Wall -Wno-unused-function -Wno-deprecated-declarations -Os ${INCS} ${CPPFLAGS} LDFLAGS = ${LIBS} # Solaris diff --git a/drw.c b/drw.c index 0fc9f05..1e53132 100644 --- a/drw.c +++ b/drw.c @@ -89,9 +89,15 @@ drw_create(Display *dpy, int screen, Window root, unsigned int w, unsigned int h drw->depth = depth; drw->cmap = cmap; drw->drawable = XCreatePixmap(dpy, root, w, h, depth); + #if BAR_WINICON_PATCH + drw->picture = XRenderCreatePicture(dpy, drw->drawable, XRenderFindVisualFormat(dpy, visual), 0, NULL); + #endif // BAR_WINICON_PATCH drw->gc = XCreateGC(dpy, drw->drawable, 0, NULL); #else drw->drawable = XCreatePixmap(dpy, root, w, h, DefaultDepth(dpy, screen)); + #if BAR_WINICON_PATCH + drw->picture = XRenderCreatePicture(dpy, drw->drawable, XRenderFindVisualFormat(dpy, DefaultVisual(dpy, screen)), 0, NULL); + #endif // BAR_WINICON_PATCH drw->gc = XCreateGC(dpy, root, 0, NULL); #endif // BAR_ALPHA_PATCH XSetLineAttributes(dpy, drw->gc, 1, LineSolid, CapButt, JoinMiter); @@ -107,18 +113,31 @@ drw_resize(Drw *drw, unsigned int w, unsigned int h) drw->w = w; drw->h = h; + #if BAR_WINICON_PATCH + if (drw->picture) + XRenderFreePicture(drw->dpy, drw->picture); + #endif // BAR_WINICON_PATCH if (drw->drawable) XFreePixmap(drw->dpy, drw->drawable); #if BAR_ALPHA_PATCH drw->drawable = XCreatePixmap(drw->dpy, drw->root, w, h, drw->depth); - #else + #if BAR_WINICON_PATCH + drw->picture = XRenderCreatePicture(drw->dpy, drw->drawable, XRenderFindVisualFormat(drw->dpy, drw->visual), 0, NULL); + #endif // BAR_WINICON_PATCH + #else // !BAR_ALPHA_PATCH drw->drawable = XCreatePixmap(drw->dpy, drw->root, w, h, DefaultDepth(drw->dpy, drw->screen)); + #if BAR_WINICON_PATCH + drw->picture = XRenderCreatePicture(drw->dpy, drw->drawable, XRenderFindVisualFormat(drw->dpy, DefaultVisual(drw->dpy, drw->screen)), 0, NULL); + #endif // BAR_WINICON_PATCH #endif // BAR_ALPHA_PATCH } void drw_free(Drw *drw) { + #if BAR_WINICON_PATCH + XRenderFreePicture(drw->dpy, drw->picture); + #endif // BAR_WINICON_PATCH XFreePixmap(drw->dpy, drw->drawable); XFreeGC(drw->dpy, drw->gc); drw_fontset_free(drw->fonts); @@ -507,8 +526,8 @@ drw_text(Drw *drw, int x, int y, unsigned int w, unsigned int h, unsigned int lp if (utf8strlen) { drw_font_getexts(usedfont, utf8str, utf8strlen, &ew, NULL); /* shorten text if necessary */ - for (len = MIN(utf8strlen, sizeof(buf) - 1); len && ew > w; len--) - drw_font_getexts(usedfont, utf8str, len, &ew, NULL); + for (len = MIN(utf8strlen, sizeof(buf) - 1); len && ew > w; drw_font_getexts(usedfont, utf8str, len, &ew, NULL)) + len--; if (len) { memcpy(buf, utf8str, len); diff --git a/drw.h b/drw.h index 42dad5a..ec24e02 100644 --- a/drw.h +++ b/drw.h @@ -35,6 +35,9 @@ typedef struct { Colormap cmap; #endif // BAR_ALPHA_PATCH Drawable drawable; + #if BAR_WINICON_PATCH + Picture picture; + #endif // BAR_WINICON_PATCH GC gc; Clr *scheme; Fnt *fonts; diff --git a/dwm.c b/dwm.c index 2bd28e6..9f70675 100644 --- a/dwm.c +++ b/dwm.c @@ -336,7 +336,7 @@ struct Client { int sfx, sfy, sfw, sfh; /* stored float geometry, used on mode revert */ #endif // SAVEFLOATS_PATCH / EXRESIZE_PATCH int oldx, oldy, oldw, oldh; - int basew, baseh, incw, inch, maxw, maxh, minw, minh; + int basew, baseh, incw, inch, maxw, maxh, minw, minh, hintsvalid; int bw, oldbw; unsigned int tags; #if SWITCHTAG_PATCH @@ -368,6 +368,9 @@ struct Client { #if PLACEMOUSE_PATCH int beingmoved; #endif // PLACEMOUSE_PATCH + #if SIZEHINTS_ISFREESIZE_PATCH + int isfreesize; + #endif // SIZEHINTS_ISFREESIZE_PATCH #if SWALLOW_PATCH int isterminal, noswallow; pid_t pid; @@ -392,7 +395,8 @@ struct Client { XkbInfo *xkb; #endif // XKB_PATCH #if BAR_WINICON_PATCH - XImage *icon; + unsigned int icw, ich; + Picture icon; #endif // BAR_WINICON_PATCH }; @@ -436,7 +440,6 @@ typedef struct { typedef struct Pertag Pertag; #endif // PERTAG_PATCH struct Monitor { - int index; char ltsymbol[16]; float mfact; #if FLEXTILE_DELUXE_LAYOUT @@ -485,6 +488,9 @@ struct Monitor { #if INSETS_PATCH Inset inset; #endif // INSETS_PATCH + #if BAR_TAGLABELS_PATCH + char taglabel[NUMTAGS][64]; + #endif // BAR_TAGLABELS_PATCH #if IPC_PATCH char lastltsymbol[16]; TagState tagstate; @@ -512,6 +518,9 @@ typedef struct { #if SELECTIVEFAKEFULLSCREEN_PATCH && FAKEFULLSCREEN_CLIENT_PATCH && !FAKEFULLSCREEN_PATCH int isfakefullscreen; #endif // SELECTIVEFAKEFULLSCREEN_PATCH + #if SIZEHINTS_ISFREESIZE_PATCH + int isfreesize; + #endif // SIZEHINTS_ISFREESIZE_PATCH #if ISPERMANENT_PATCH int ispermanent; #endif // ISPERMANENT_PATCH @@ -822,6 +831,9 @@ applyrules(Client *c) #if SWALLOW_PATCH c->noswallow = -1; #endif // SWALLOW_PATCH + #if SIZEHINTS_ISFREESIZE_PATCH + c->isfreesize = 1; + #endif // SIZEHINTS_ISFREESIZE_PATCH c->isfloating = 0; c->tags = 0; XGetClassHint(dpy, c->win, &ch); @@ -860,6 +872,9 @@ applyrules(Client *c) c->isterminal = r->isterminal; c->noswallow = r->noswallow; #endif // SWALLOW_PATCH + #if SIZEHINTS_ISFREESIZE_PATCH + c->isfreesize = r->isfreesize; + #endif // SIZEHINTS_ISFREESIZE_PATCH c->isfloating = r->isfloating; c->tags |= r->tags; #if SCRATCHPADS_PATCH @@ -908,8 +923,14 @@ applyrules(Client *c) view(&((Arg) { .ui = newtagset })); #endif // PERTAG_PATCH } else { + #if TAGSYNC_PATCH + for (m = mons; m; m = m->next) + m->tagset[m->seltags] = newtagset; + arrange(NULL); + #else c->mon->tagset[c->mon->seltags] = newtagset; arrange(c->mon); + #endif // TAGSYNC_PATCH } } } @@ -980,6 +1001,8 @@ applysizehints(Client *c, int *x, int *y, int *w, int *h, int interact) if (*w < bh) *w = bh; if (resizehints || c->isfloating || !c->mon->lt[c->mon->sellt]->arrange) { + if (!c->hintsvalid) + updatesizehints(c); /* see last two sentences in ICCCM 4.1.2.3 */ baseismin = c->basew == c->minw && c->baseh == c->minh; if (!baseismin) { /* temporarily remove base dimensions */ @@ -1095,7 +1118,7 @@ buttonpress(XEvent *e) br = &barrules[r]; if (br->bar != bar->idx || (br->monitor == 'A' && m != selmon) || br->clickfunc == NULL) continue; - if (br->monitor != 'A' && br->monitor != -1 && br->monitor != bar->mon->index) + if (br->monitor != 'A' && br->monitor != -1 && br->monitor != bar->mon->num) continue; if (bar->x[r] <= ev->x && ev->x <= bar->x[r] + bar->w[r]) { carg.x = ev->x - bar->x[r]; @@ -1532,11 +1555,11 @@ createmon(void) m->gappov = gappov; #endif // VANITYGAPS_PATCH for (mi = 0, mon = mons; mon; mon = mon->next, mi++); // monitor index - m->index = mi; + m->num = mi; #if MONITOR_RULES_PATCH for (j = 0; j < LENGTH(monrules); j++) { mr = &monrules[j]; - if ((mr->monitor == -1 || mr->monitor == mi) + if ((mr->monitor == -1 || mr->monitor == m->num) #if PERTAG_PATCH && (mr->tag <= 0 || (m->tagset[0] & (1 << (mr->tag - 1)))) #endif // PERTAG_PATCH @@ -1567,7 +1590,7 @@ createmon(void) /* Derive the number of bars for this monitor based on bar rules */ for (n = -1, i = 0; i < LENGTH(barrules); i++) { br = &barrules[i]; - if (br->monitor == 'A' || br->monitor == -1 || br->monitor == mi) + if (br->monitor == 'A' || br->monitor == -1 || br->monitor == m->num) n = MAX(br->bar, n); } @@ -1628,7 +1651,7 @@ createmon(void) #if MONITOR_RULES_PATCH for (j = 0; j < LENGTH(monrules); j++) { mr = &monrules[j]; - if ((mr->monitor == -1 || mr->monitor == mi) && (mr->tag == -1 || mr->tag == i)) { + if ((mr->monitor == -1 || mr->monitor == m->num) && (mr->tag == -1 || mr->tag == i)) { layout = MAX(mr->layout, 0); layout = MIN(layout, LENGTH(layouts) - 1); m->pertag->ltidxs[i][0] = &layouts[layout]; @@ -1750,8 +1773,12 @@ void drawbar(Monitor *m) { Bar *bar; - for (bar = m->bar; bar; bar = bar->next) - drawbarwin(bar); + + #if !BAR_FLEXWINTITLE_PATCH + if (m->showbar) + #endif // BAR_FLEXWINTITLE_PATCH + for (bar = m->bar; bar; bar = bar->next) + drawbarwin(bar); } void @@ -1789,7 +1816,7 @@ drawbarwin(Bar *bar) br = &barrules[r]; if (br->bar != bar->idx || !br->widthfunc || (br->monitor == 'A' && bar->mon != selmon)) continue; - if (br->monitor != 'A' && br->monitor != -1 && br->monitor != bar->mon->index) + if (br->monitor != 'A' && br->monitor != -1 && br->monitor != bar->mon->num) continue; drw_setscheme(drw, scheme[SchemeNorm]); warg.w = (br->alignment < BAR_ALIGN_RIGHT_LEFT ? lw : rw); @@ -2013,7 +2040,7 @@ focusstack(const Arg *arg) if (!selmon->sel || (selmon->sel->isfullscreen && !selmon->sel->fakefullscreen)) return; #else - if (!selmon->sel || selmon->sel->isfullscreen) + if (!selmon->sel || (selmon->sel->isfullscreen && lockfullscreen)) return; #endif // LOSEFULLSCREEN_PATCH #if BAR_WINTITLEACTIONS_PATCH @@ -2301,7 +2328,6 @@ manage(Window w, XWindowAttributes *wa) c->cfact = 1.0; #endif // CFACTS_PATCH #if BAR_WINICON_PATCH - c->icon = NULL; updateicon(c); #endif // BAR_WINICON_PATCH updatetitle(c); @@ -2705,7 +2731,7 @@ propertynotify(XEvent *e) arrange(c->mon); break; case XA_WM_NORMAL_HINTS: - updatesizehints(c); + c->hintsvalid = 0; break; case XA_WM_HINTS: updatewmhints(c); @@ -2744,27 +2770,27 @@ quit(const Arg *arg) #if COOL_AUTOSTART_PATCH size_t i; #endif // COOL_AUTOSTART_PATCH - #if ONLYQUITONEMPTY_PATCH - unsigned int n; - Window *junk = malloc(1); - - XQueryTree(dpy, root, junk, junk, &junk, &n); - - if (n <= quit_empty_window_count) - { - #if RESTARTSIG_PATCH - restart = arg->i; - #endif // RESTARTSIG_PATCH - running = 0; - } - else - printf("[dwm] not exiting (n=%d)\n", n); - - free(junk); - #else // !ONLYQUITONEMPTY_PATCH #if RESTARTSIG_PATCH restart = arg->i; #endif // RESTARTSIG_PATCH + #if ONLYQUITONEMPTY_PATCH + Monitor *m; + Client *c; + unsigned int n = 0; + + for (m = mons; m; m = m->next) + for (c = m->clients; c; c = c->next, n++); + + #if RESTARTSIG_PATCH + if (restart || n <= quit_empty_window_count) + #else + if (n <= quit_empty_window_count) + #endif // RESTARTSIG_PATCH + running = 0; + else + fprintf(stderr, "[dwm] not exiting (n=%d)\n", n); + + #else // !ONLYQUITONEMPTY_PATCH running = 0; #endif // ONLYQUITONEMPTY_PATCH @@ -2995,7 +3021,7 @@ resizemouse(const Arg *arg) void restack(Monitor *m) { - Client *c; + Client *c, *f = NULL; XEvent ev; XWindowChanges wc; #if WARP_PATCH && FLEXTILE_DELUXE_LAYOUT @@ -3010,11 +3036,17 @@ restack(Monitor *m) return; if (m->sel->isfloating || !m->lt[m->sellt]->arrange) XRaiseWindow(dpy, m->sel->win); - if (m->lt[m->sellt]->arrange && m->bar) { + if (m->lt[m->sellt]->arrange) { wc.stack_mode = Below; - wc.sibling = m->bar->win; + if (m->bar) { + wc.sibling = m->bar->win; + } else { + for (f = m->stack; f && (f->isfloating || !ISVISIBLE(f)); f = f->snext); // find first tiled stack client + if (f) + wc.sibling = f->win; + } for (c = m->stack; c; c = c->snext) - if (!c->isfloating && ISVISIBLE(c)) { + if (!c->isfloating && ISVISIBLE(c) && c != f) { XConfigureWindow(dpy, c->win, CWSibling|CWStackMode, &wc); wc.sibling = c->win; } @@ -3492,6 +3524,9 @@ setup(void) signal(SIGTERM, sigterm); #endif // RESTARTSIG_PATCH + /* the one line of bloat that would have saved a lot of time for a lot of people */ + putenv("_JAVA_AWT_WM_NONREPARENTING=1"); + /* init screen */ screen = DefaultScreen(dpy); sw = DisplayWidth(dpy, screen); @@ -3942,6 +3977,10 @@ togglebar(const Arg *arg) updatebarpos(selmon); for (bar = selmon->bar; bar; bar = bar->next) XMoveResizeWindow(dpy, bar->win, bar->bx, bar->by, bar->bw, bar->bh); + #if BAR_SYSTRAY_PATCH + if (!selmon->showbar && systray) + XMoveWindow(dpy, systray->win, -32000, -32000); + #endif // BAR_SYSTRAY_PATCH arrange(selmon); } @@ -4022,7 +4061,11 @@ toggletag(const Arg *arg) void toggleview(const Arg *arg) { - unsigned int newtagset = selmon->tagset[selmon->seltags] ^ (arg->ui & TAGMASK); + unsigned int newtagset = selmon->tagset[selmon->seltags] ^ (arg->ui & TAGMASK);; + #if TAGSYNC_PATCH + Monitor *origselmon = selmon; + for (selmon = mons; selmon; selmon = selmon->next) { + #endif // TAGSYNC_PATCH #if PERTAG_PATCH int i; #endif // PERTAG_PATCH @@ -4093,11 +4136,25 @@ toggleview(const Arg *arg) togglebar(NULL); #endif // PERTAGBAR_PATCH #endif // PERTAG_PATCH + #if !TAGSYNC_PATCH focus(NULL); arrange(selmon); + #endif // TAGSYNC_PATCH #if !EMPTYVIEW_PATCH } #endif // EMPTYVIEW_PATCH + #if TAGSYNC_PATCH + } + selmon = origselmon; + #if !EMPTYVIEW_PATCH + if (newtagset) { + #endif // EMPTYVIEW_PATCH + focus(NULL); + arrange(NULL); + #if !EMPTYVIEW_PATCH + } + #endif // EMPTYVIEW_PATCH + #endif // TAGSYNC_PATCH #if BAR_EWMHTAGS_PATCH updatecurrentdesktop(); #endif // BAR_EWMHTAGS_PATCH @@ -4313,13 +4370,22 @@ updatebarpos(Monitor *m) m->ww = m->mw; m->wh = m->mh; Bar *bar; - #if BAR_PADDING_PATCH - int y_pad = vertpad; - int x_pad = sidepad; - #else int y_pad = 0; int x_pad = 0; - #endif // BAR_PADDING_PATCH + #if BAR_PADDING_VANITYGAPS_PATCH && VANITYGAPS_PATCH + #if PERTAG_VANITYGAPS_PATCH && PERTAG_PATCH + if (!selmon || selmon->pertag->enablegaps[selmon->pertag->curtag]) + #else + if (enablegaps) + #endif // PERTAG_VANITYGAPS_PATCH + { + y_pad = gappoh; + x_pad = gappov; + } + #elif BAR_PADDING_PATCH + y_pad = vertpad; + x_pad = sidepad; + #endif // BAR_PADDING_PATCH | BAR_PADDING_VANITYGAPS_PATCH #if INSETS_PATCH // Custom insets @@ -4419,46 +4485,42 @@ updategeom(void) #if SORTSCREENS_PATCH sortscreens(unique, nn); #endif // SORTSCREENS_PATCH - if (n <= nn) { /* new monitors available */ - for (i = 0; i < (nn - n); i++) { - for (m = mons; m && m->next; m = m->next); - if (m) - m->next = createmon(); - else - mons = createmon(); - } - for (i = 0, m = mons; i < nn && m; m = m->next, i++) { - if (i >= n - || unique[i].x_org != m->mx || unique[i].y_org != m->my - || unique[i].width != m->mw || unique[i].height != m->mh) - { - dirty = 1; - m->num = i; - m->mx = m->wx = unique[i].x_org; - m->my = m->wy = unique[i].y_org; - m->mw = m->ww = unique[i].width; - m->mh = m->wh = unique[i].height; - updatebarpos(m); - } - } - } else { /* less monitors available nn < n */ - for (i = nn; i < n; i++) { - for (m = mons; m && m->next; m = m->next); - while ((c = m->clients)) { - dirty = 1; - m->clients = c->next; - detachstack(c); - c->mon = mons; - attach(c); - attachstack(c); - } - if (m == selmon) - selmon = mons; - cleanupmon(m); - } + /* new monitors if nn > n */ + for (i = n; i < nn; i++) { + for (m = mons; m && m->next; m = m->next); + if (m) + m->next = createmon(); + else + mons = createmon(); + } + for (i = 0, m = mons; i < nn && m; m = m->next, i++) + if (i >= n + || unique[i].x_org != m->mx || unique[i].y_org != m->my + || unique[i].width != m->mw || unique[i].height != m->mh) + { + dirty = 1; + m->num = i; + m->mx = m->wx = unique[i].x_org; + m->my = m->wy = unique[i].y_org; + m->mw = m->ww = unique[i].width; + m->mh = m->wh = unique[i].height; + updatebarpos(m); + } + /* removed monitors if n > nn */ + for (i = nn; i < n; i++) { + for (m = mons; m && m->next; m = m->next); + while ((c = m->clients)) { + dirty = 1; + m->clients = c->next; + detachstack(c); + c->mon = mons; + attach(c); + attachstack(c); + } + if (m == selmon) + selmon = mons; + cleanupmon(m); } - for (i = 0, m = mons; m; m = m->next, i++) - m->index = i; free(unique); } else #endif /* XINERAMA */ @@ -4503,11 +4565,11 @@ updatesizehints(Client *c) if (!XGetWMNormalHints(dpy, c->win, &size, &msize)) /* size is uninitialized, ensure that size.flags aren't used */ - #if SIZEHINTS_PATCH || SIZEHINTS_RULED_PATCH + #if SIZEHINTS_PATCH || SIZEHINTS_RULED_PATCH || SIZEHINTS_ISFREESIZE_PATCH size.flags = 0; #else size.flags = PSize; - #endif // SIZEHINTS_PATCH | SIZEHINTS_RULED_PATCH + #endif // SIZEHINTS_PATCH | SIZEHINTS_RULED_PATCH | SIZEHINTS_ISFREESIZE_PATCH if (size.flags & PBaseSize) { c->basew = size.base_width; c->baseh = size.base_height; @@ -4539,8 +4601,13 @@ updatesizehints(Client *c) c->maxa = (float)size.max_aspect.x / size.max_aspect.y; } else c->maxa = c->mina = 0.0; - #if SIZEHINTS_PATCH || SIZEHINTS_RULED_PATCH - if (size.flags & PSize) { + #if SIZEHINTS_PATCH || SIZEHINTS_RULED_PATCH || SIZEHINTS_ISFREESIZE_PATCH + #if SIZEHINTS_ISFREESIZE_PATCH + if ((size.flags & PSize) && c->isfreesize) + #else + if (size.flags & PSize) + #endif // SIZEHINTS_ISFREESIZE_PATCH + { c->basew = size.base_width; c->baseh = size.base_height; c->isfloating = 1; @@ -4550,6 +4617,7 @@ updatesizehints(Client *c) #endif // SIZEHINTS_RULED_PATCH #endif // SIZEHINTS_PATCH c->isfixed = (c->maxw && c->maxh && c->maxw == c->minw && c->maxh == c->minh); + c->hintsvalid = 1; } void @@ -4641,6 +4709,10 @@ updatewmhints(Client *c) void view(const Arg *arg) { + #if TAGSYNC_PATCH + Monitor *origselmon = selmon; + for (selmon = mons; selmon; selmon = selmon->next) { + #endif // TAGSYNC_PATCH #if EMPTYVIEW_PATCH if (arg->ui && (arg->ui & TAGMASK) == selmon->tagset[selmon->seltags]) #else @@ -4655,18 +4727,20 @@ view(const Arg *arg) selmon->seltags ^= 1; /* toggle sel tagset */ #if PERTAG_PATCH pertagview(arg); - #if SWAPFOCUS_PATCH - Client *unmodified = selmon->pertag->prevclient[selmon->pertag->curtag]; - #endif // SWAPFOCUS_PATCH #else if (arg->ui & TAGMASK) selmon->tagset[selmon->seltags] = arg->ui & TAGMASK; #endif // PERTAG_PATCH + #if TAGSYNC_PATCH + } + selmon = origselmon; + #endif // TAGSYNC_PATCH focus(NULL); - #if SWAPFOCUS_PATCH && PERTAG_PATCH - selmon->pertag->prevclient[selmon->pertag->curtag] = unmodified; - #endif // SWAPFOCUS_PATCH + #if TAGSYNC_PATCH + arrange(NULL); + #else arrange(selmon); + #endif // TAGSYNC_PATCH #if BAR_EWMHTAGS_PATCH updatecurrentdesktop(); #endif // BAR_EWMHTAGS_PATCH diff --git a/patch/bar_awesomebar.c b/patch/bar_awesomebar.c index b02c6e7..c6fe8f1 100644 --- a/patch/bar_awesomebar.c +++ b/patch/bar_awesomebar.c @@ -7,8 +7,14 @@ width_awesomebar(Bar *bar, BarArg *a) int draw_awesomebar(Bar *bar, BarArg *a) { - int n = 0, scm, remainder = 0, tabw, pad; + int n = 0, scm, remainder = 0, tabw, tpad, tx, tw; unsigned int i; + #if BAR_CENTEREDWINDOWNAME_PATCH + int cpad; + #endif // BAR_CENTEREDWINDOWNAME_PATCH + #if BAR_WINICON_PATCH + int ipad; + #endif // BAR_WINICON_PATCH #if BAR_TITLE_LEFT_PAD_PATCH && BAR_TITLE_RIGHT_PAD_PATCH int x = a->x + lrpad / 2, w = a->w - lrpad; #elif BAR_TITLE_LEFT_PAD_PATCH @@ -39,22 +45,49 @@ draw_awesomebar(Bar *bar, BarArg *a) else scm = SchemeTitleNorm; - pad = lrpad / 2; + tpad = lrpad / 2; #if BAR_CENTEREDWINDOWNAME_PATCH + cpad = 0; + #endif // BAR_CENTEREDWINDOWNAME_PATCH + #if BAR_WINICON_PATCH + ipad = c->icon ? c->icw + ICONSPACING : 0; + #endif // BAR_WINICON_PATCH + + tx = x; + tw = tabw; + + #if BAR_WINICON_PATCH && BAR_CENTEREDWINDOWNAME_PATCH + if (TEXTW(c->name) + ipad < tabw) + cpad = (tabw - TEXTW(c->name) - ipad) / 2; + #elif BAR_CENTEREDWINDOWNAME_PATCH if (TEXTW(c->name) < tabw) - pad = (tabw - TEXTW(c->name) + lrpad) / 2; + cpad = (tabw - TEXTW(c->name)) / 2; #endif // BAR_CENTEREDWINDOWNAME_PATCH drw_setscheme(drw, scheme[scm]); + XSetForeground(drw->dpy, drw->gc, drw->scheme[ColBg].pixel); + XFillRectangle(drw->dpy, drw->drawable, drw->gc, tx, a->y, tw, a->h); + + #if BAR_CENTEREDWINDOWNAME_PATCH + /* Apply center padding, if any */ + tx += cpad; + tw -= cpad; + #endif // BAR_CENTEREDWINDOWNAME_PATCH + + tx += tpad; + tw -= lrpad; + #if BAR_WINICON_PATCH - drw_text(drw, x, a->y, tabw + (i < remainder ? 1 : 0), a->h, pad + (c->icon ? c->icon->width + ICONSPACING : 0), c->name, 0, False); - if (c->icon) - drw_img(drw, x + pad, a->y + (a->h - c->icon->height) / 2, c->icon, tmpicon); - #else - drw_text(drw, x, a->y, tabw + (i < remainder ? 1 : 0), a->h, pad, c->name, 0, False); + if (ipad) { + drw_pic(drw, tx, a->y + (a->h - c->ich) / 2, c->icw, c->ich, c->icon); + tx += ipad; + tw -= ipad; + } #endif // BAR_WINICON_PATCH + drw_text(drw, tx, a->y, tw, a->h, 0, c->name, 0, False); + drawstateindicator(c->mon, c, 1, x, a->y, tabw + (i < remainder ? 1 : 0), a->h, 0, 0, c->isfixed); x += tabw + (i < remainder ? 1 : 0); } diff --git a/patch/bar_ewmhtags.c b/patch/bar_ewmhtags.c index d86fd88..46ee5e4 100644 --- a/patch/bar_ewmhtags.c +++ b/patch/bar_ewmhtags.c @@ -50,4 +50,3 @@ updatecurrentdesktop(void) long data[] = { i }; XChangeProperty(dpy, root, netatom[NetCurrentDesktop], XA_CARDINAL, 32, PropModeReplace, (unsigned char *)data, 1); } - diff --git a/patch/bar_fancybar.c b/patch/bar_fancybar.c index 10bac83..40a1883 100644 --- a/patch/bar_fancybar.c +++ b/patch/bar_fancybar.c @@ -7,7 +7,10 @@ width_fancybar(Bar *bar, BarArg *a) int draw_fancybar(Bar *bar, BarArg *a) { - int ftw, mw, ew = 0, n = 0; + int tabw, mw, ew = 0, n = 0, tx, tw; + #if BAR_WINICON_PATCH + int ipad; + #endif // BAR_WINICON_PATCH unsigned int i; Client *c; Monitor *m = bar->mon; @@ -28,25 +31,25 @@ draw_fancybar(Bar *bar, BarArg *a) } if (n > 0) { - ftw = TEXTW(m->sel->name); + tabw = TEXTW(m->sel->name); #if BAR_WINICON_PATCH if (m->sel->icon) - ftw += m->sel->icon->width + ICONSPACING; + tabw += m->sel->icw + ICONSPACING; #endif // BAR_WINICON_PATCH - mw = (ftw >= w || n == 1) ? 0 : (w - ftw) / (n - 1); + mw = (tabw >= w || n == 1) ? 0 : (w - tabw) / (n - 1); i = 0; for (c = m->clients; c; c = c->next) { if (!ISVISIBLE(c) || c == m->sel) continue; - ftw = TEXTW(c->name); + tabw = TEXTW(c->name); #if BAR_WINICON_PATCH if (c->icon) - ftw += c->icon->width + ICONSPACING; + tabw += c->icw + ICONSPACING; #endif // BAR_WINICON_PATCH - if (ftw < mw) - ew += (mw - ftw); + if (tabw < mw) + ew += (mw - tabw); else i++; } @@ -57,24 +60,36 @@ draw_fancybar(Bar *bar, BarArg *a) for (c = m->clients; c; c = c->next) { if (!ISVISIBLE(c)) continue; - ftw = MIN(m->sel == c ? w : mw, TEXTW(c->name)); + tabw = MIN(m->sel == c ? w : mw, TEXTW(c->name)); + #if BAR_WINICON_PATCH + ipad = c->icon ? c->icw + ICONSPACING : 0; + tabw += ipad; + #endif // BAR_WINICON_PATCH + tx = x; + tw = tabw; drw_setscheme(drw, scheme[m->sel == c ? SchemeTitleSel : SchemeTitleNorm]); - if (ftw > 0) { /* trap special handling of 0 in drw_text */ - drw_text(drw, x, a->y, ftw, a->h, lrpad / 2, c->name, 0, False); + XSetForeground(drw->dpy, drw->gc, drw->scheme[ColBg].pixel); + XFillRectangle(drw->dpy, drw->drawable, drw->gc, tx, a->y, tw, a->h); - #if BAR_WINICON_PATCH - drw_text(drw, x, a->y, ftw, a->h, lrpad / 2 + (c->icon ? c->icon->width + ICONSPACING : 0), c->name, 0, False); - if (c->icon) - drw_img(drw, x + lrpad / 2, a->y + (a->h - c->icon->height) / 2, c->icon, tmpicon); - #else - drw_text(drw, x, a->y, ftw, a->h, lrpad / 2, c->name, 0, False); - #endif // BAR_WINICON_PATCH + if (tabw <= 0) /* trap special handling of 0 in drw_text */ + continue; + tx += lrpad / 2; + tw -= lrpad; + + #if BAR_WINICON_PATCH + if (ipad) { + drw_pic(drw, tx, a->y + (a->h - c->ich) / 2, c->icw, c->ich, c->icon); + tx += ipad; + tw -= ipad; } - drawstateindicator(c->mon, c, 1, x, a->y, ftw, a->h, 0, 0, c->isfixed); - x += ftw; - w -= ftw; + #endif // BAR_WINICON_PATCH + + drw_text(drw, tx, a->y, tw, a->h, 0, c->name, 0, False); + drawstateindicator(c->mon, c, 1, x, a->y, tabw, a->h, 0, 0, c->isfixed); + x += tabw; + w -= tabw; } } return n; diff --git a/patch/bar_flexwintitle.c b/patch/bar_flexwintitle.c index 0e17443..e71a98d 100644 --- a/patch/bar_flexwintitle.c +++ b/patch/bar_flexwintitle.c @@ -166,11 +166,21 @@ getselschemefor(int scheme) } void -flextitledraw(Monitor *m, Client *c, int unused, int x, int w, int tabscheme, Arg *arg, BarArg *barg) +flextitledraw(Monitor *m, Client *c, int unused, int x, int w, int tabscheme, Arg *arg, BarArg *a) { if (!c) return; - int i, nclienttags = 0, nviewtags = 0, pad = lrpad / 2; + int i, nclienttags = 0, nviewtags = 0; + int tpad = lrpad / 2; + #if BAR_WINICON_PATCH + int ipad = c->icon ? c->icw + ICONSPACING : 0; + #endif // BAR_WINICON_PATCH + #if BAR_CENTEREDWINDOWNAME_PATCH + int cpad = 0; + #endif // BAR_CENTEREDWINDOWNAME_PATCH + int tx = x; + int tw = w; + int clientscheme = ( c == selmon->sel && HIDDEN(c) ? SchemeHidSel @@ -182,30 +192,49 @@ flextitledraw(Monitor *m, Client *c, int unused, int x, int w, int tabscheme, Ar ? SchemeUrg : tabscheme ); + drw_setscheme(drw, scheme[clientscheme]); XSetWindowBorder(dpy, c->win, scheme[clientscheme][ColBorder].pixel); - if (w <= TEXTW("A") - lrpad + pad) // reduce text padding if wintitle is too small - pad = (w - TEXTW("A") + lrpad < 0 ? 0 : (w - TEXTW("A") + lrpad) / 2); - #if BAR_CENTEREDWINDOWNAME_PATCH + + if (w <= TEXTW("A") - lrpad + tpad) // reduce text padding if wintitle is too small + tpad = (w - TEXTW("A") + lrpad < 0 ? 0 : (w - TEXTW("A") + lrpad) / 2); + #if BAR_WINICON_PATCH && BAR_CENTEREDWINDOWNAME_PATCH + else if (TEXTW(c->name) + ipad < w) + cpad = (w - TEXTW(c->name) - ipad) / 2; + #elif BAR_CENTEREDWINDOWNAME_PATCH else if (TEXTW(c->name) < w) - pad = (w - TEXTW(c->name) + lrpad) / 2; + cpad = (w - TEXTW(c->name)) / 2; #endif // BAR_CENTEREDWINDOWNAME_PATCH + XSetForeground(drw->dpy, drw->gc, drw->scheme[ColBg].pixel); + XFillRectangle(drw->dpy, drw->drawable, drw->gc, x, a->y, w, a->h); + + #if BAR_CENTEREDWINDOWNAME_PATCH + /* Apply center padding, if any */ + tx += cpad; + tw -= cpad; + #endif // BAR_CENTEREDWINDOWNAME_PATCH + + tx += tpad; + tw -= lrpad; + #if BAR_WINICON_PATCH - drw_text(drw, x, barg->y, w, barg->h, pad + (c->icon ? c->icon->width + ICONSPACING : 0), c->name, 0, False); - if (c->icon) - drw_img(drw, x + pad, barg->y + (barg->h - c->icon->height) / 2, c->icon, tmpicon); - #else - drw_text(drw, x, barg->y, w, barg->h, pad, c->name, 0, False); + if (ipad) { + drw_pic(drw, tx, a->y + (a->h - c->ich) / 2, c->icw, c->ich, c->icon); + tx += ipad; + tw -= ipad; + } #endif // BAR_WINICON_PATCH - drawstateindicator(m, c, 1, x + 2, barg->y, w, barg->h, 0, 0, 0); + drw_text(drw, tx, a->y, tw, a->h, 0, c->name, 0, False); + drawstateindicator(m, c, 1, x + 2, a->y, w, a->h, 0, 0, 0); if (FLEXWINTITLE_BORDERS) { XSetForeground(drw->dpy, drw->gc, scheme[SchemeSel][ColBorder].pixel); - XFillRectangle(drw->dpy, drw->drawable, drw->gc, x, barg->y, 1, barg->h); - XFillRectangle(drw->dpy, drw->drawable, drw->gc, x + w - (x + w >= barg->w ? 1 : 0), barg->y, 1, barg->h); + XFillRectangle(drw->dpy, drw->drawable, drw->gc, x, a->y, 1, a->h); + XFillRectangle(drw->dpy, drw->drawable, drw->gc, x + w - (x + w >= a->w ? 1 : 0), a->y, 1, a->h); } + /* Optional tags icons */ for (i = 0; i < NUMTAGS; i++) { if ((m->tagset[m->seltags] >> i) & 1) @@ -215,7 +244,7 @@ flextitledraw(Monitor *m, Client *c, int unused, int x, int w, int tabscheme, Ar } if (TAGSINDICATOR == 2 || nclienttags > 1 || nviewtags > 1) - drawindicator(m, c, 1, x, barg->y, w, barg->h, 0, 0, 0, INDICATOR_RIGHT_TAGS); + drawindicator(m, c, 1, x, a->y, w, a->h, 0, 0, 0, INDICATOR_RIGHT_TAGS); } #ifndef HIDDEN diff --git a/patch/bar_holdbar.c b/patch/bar_holdbar.c index 1e00dc8..7597a38 100644 --- a/patch/bar_holdbar.c +++ b/patch/bar_holdbar.c @@ -8,6 +8,7 @@ holdbar(const Arg *arg) updatebarpos(selmon); for (bar = selmon->bar; bar; bar = bar->next) XMoveResizeWindow(dpy, bar->win, bar->bx, bar->by, bar->bw, bar->bh); + drawbar(selmon); } void @@ -29,6 +30,10 @@ keyrelease(XEvent *e) updatebarpos(selmon); for (bar = selmon->bar; bar; bar = bar->next) XMoveResizeWindow(dpy, bar->win, bar->bx, bar->by, bar->bw, bar->bh); + #if BAR_SYSTRAY_PATCH + if (!selmon->showbar && systray) + XMoveWindow(dpy, systray->win, -32000, -32000); + #endif // BAR_SYSTRAY_PATCH arrange(selmon); } #if COMBO_PATCH diff --git a/patch/bar_tabgroups.c b/patch/bar_tabgroups.c index 1498bc2..b61a0db 100644 --- a/patch/bar_tabgroups.c +++ b/patch/bar_tabgroups.c @@ -36,11 +36,21 @@ click_bartabgroups(Bar *bar, Arg *arg, BarArg *a) } void -bartabdraw(Monitor *m, Client *c, int unused, int x, int w, int groupactive, Arg *arg, BarArg *barg) +bartabdraw(Monitor *m, Client *c, int unused, int x, int w, int groupactive, Arg *arg, BarArg *a) { if (!c) return; - int i, nclienttags = 0, nviewtags = 0, pad = lrpad / 2; + int i, nclienttags = 0, nviewtags = 0; + int tpad = lrpad / 2; + #if BAR_WINICON_PATCH + int ipad = c->icon ? c->icw + ICONSPACING : 0; + #endif // BAR_WINICON_PATCH + #if BAR_CENTEREDWINDOWNAME_PATCH + int cpad = 0; + #endif // BAR_CENTEREDWINDOWNAME_PATCH + int tx = x; + int tw = w; + drw_setscheme(drw, scheme[ m->sel == c #ifdef HIDDEN @@ -55,27 +65,44 @@ bartabdraw(Monitor *m, Client *c, int unused, int x, int w, int groupactive, Arg ? SchemeTitleSel : SchemeTitleNorm ]); - if (w <= TEXTW("A") - lrpad + pad) // reduce text padding if wintitle is too small - pad = (w - TEXTW("A") + lrpad < 0 ? 0 : (w - TEXTW("A") + lrpad) / 2); - #if BAR_CENTEREDWINDOWNAME_PATCH + if (w <= TEXTW("A") - lrpad + tpad) // reduce text padding if wintitle is too small + tpad = (w - TEXTW("A") + lrpad < 0 ? 0 : (w - TEXTW("A") + lrpad) / 2); + #if BAR_WINICON_PATCH && BAR_CENTEREDWINDOWNAME_PATCH + else if (TEXTW(c->name) + ipad < w) + cpad = (w - TEXTW(c->name) - ipad) / 2; + #elif BAR_CENTEREDWINDOWNAME_PATCH else if (TEXTW(c->name) < w) - pad = (w - TEXTW(c->name) + lrpad) / 2; + cpad = (w - TEXTW(c->name)) / 2; #endif // BAR_CENTEREDWINDOWNAME_PATCH + XSetForeground(drw->dpy, drw->gc, drw->scheme[ColBg].pixel); + XFillRectangle(drw->dpy, drw->drawable, drw->gc, x, a->y, w, a->h); + + #if BAR_CENTEREDWINDOWNAME_PATCH + /* Apply center padding, if any */ + tx += cpad; + tw -= cpad; + #endif // BAR_CENTEREDWINDOWNAME_PATCH + + tx += tpad; + tw -= lrpad; + #if BAR_WINICON_PATCH - drw_text(drw, x, barg->y, w, barg->h, pad + (c->icon ? c->icon->width + ICONSPACING : 0), c->name, 0, False); - if (c->icon) - drw_img(drw, x + pad, barg->y + (barg->h - c->icon->height) / 2, c->icon, tmpicon); - #else - drw_text(drw, x, barg->y, w, barg->h, pad, c->name, 0, False); + if (ipad) { + drw_pic(drw, tx, a->y + (a->h - c->ich) / 2, c->icw, c->ich, c->icon); + tx += ipad; + tw -= ipad; + } #endif // BAR_WINICON_PATCH - drawstateindicator(m, c, 1, x, barg->y, w, barg->h, 0, 0, c->isfixed); + drw_text(drw, tx, a->y, tw, a->h, 0, c->name, 0, False); + + drawstateindicator(m, c, 1, x, a->y, w, a->h, 0, 0, c->isfixed); if (BARTAB_BORDERS) { XSetForeground(drw->dpy, drw->gc, scheme[SchemeSel][ColBorder].pixel); - XFillRectangle(drw->dpy, drw->drawable, drw->gc, x, barg->y, 1, barg->h); - XFillRectangle(drw->dpy, drw->drawable, drw->gc, x + w - (x + w >= barg->w ? 1 : 0), barg->y, 1, barg->h); + XFillRectangle(drw->dpy, drw->drawable, drw->gc, x, a->y, 1, a->h); + XFillRectangle(drw->dpy, drw->drawable, drw->gc, x + w - (x + w >= a->w ? 1 : 0), a->y, 1, a->h); } /* Optional tags icons */ for (i = 0; i < NUMTAGS; i++) { @@ -86,7 +113,7 @@ bartabdraw(Monitor *m, Client *c, int unused, int x, int w, int groupactive, Arg } if (TAGSINDICATOR == 2 || nclienttags > 1 || nviewtags > 1) - drawindicator(m, c, 1, x, barg->y, w, barg->h, 0, 0, 0, INDICATOR_RIGHT_TAGS); + drawindicator(m, c, 1, x, a->y, w, a->h, 0, 0, 0, INDICATOR_RIGHT_TAGS); } #ifndef HIDDEN diff --git a/patch/bar_tagicons.c b/patch/bar_tagicons.c index 235a6e2..fa1b96c 100644 --- a/patch/bar_tagicons.c +++ b/patch/bar_tagicons.c @@ -4,7 +4,7 @@ tagicon(Monitor *m, int tag) #if BAR_ALTTAGSDECORATION_PATCH Client *c; #endif // BAR_ALTTAGSDECORATION_PATCH - int tagindex = tag + NUMTAGS * m->index; + int tagindex = tag + NUMTAGS * m->num; if (tagindex >= LENGTH(tagicons[DEFAULT_TAGS])) tagindex = tagindex % LENGTH(tagicons[DEFAULT_TAGS]); #if BAR_ALTTAGSDECORATION_PATCH diff --git a/patch/bar_taglabels.c b/patch/bar_taglabels.c new file mode 100644 index 0000000..9e6d441 --- /dev/null +++ b/patch/bar_taglabels.c @@ -0,0 +1,91 @@ +int +width_taglabels(Bar *bar, BarArg *a) +{ + int w, i; + Client *c; + Monitor *m = bar->mon; + char *icon; + unsigned int occ = 0; + + for (c = m->clients; c; c = c->next) + occ |= c->tags == 255 ? 0 : c->tags; + + for (w = 0, i = 0; i < NUMTAGS; i++) { + m->taglabel[i][0] = '\0'; + #if BAR_HIDEVACANTTAGS_PATCH + if (!(occ & 1 << i || m->tagset[m->seltags] & 1 << i)) + continue; + #endif // BAR_HIDEVACANTTAGS_PATCH + icon = tagicon(m, i); + XClassHint ch = { NULL, NULL }; + for (c = m->clients; c; c = c->next) { + if (c->tags & (1 << i)) { + XGetClassHint(dpy, c->win, &ch); + break; + } + } + if (ch.res_class) { + if (lcaselbl) + ch.res_class[0] = tolower(ch.res_class[0]); + snprintf(m->taglabel[i], 64, ptagf, icon, ch.res_class); + } else + snprintf(m->taglabel[i], 64, etagf, icon); + + w += TEXTW(m->taglabel[i]); + } + return w; +} + +int +draw_taglabels(Bar *bar, BarArg *a) +{ + int invert = 0; + int w, x = a->x; + unsigned int i, occ = 0, urg = 0; + Client *c; + Monitor *m = bar->mon; + + for (c = m->clients; c; c = c->next) + if (c->isurgent) + urg |= c->tags; + + for (i = 0; i < NUMTAGS; i++) { + /* do not draw vacant tags */ + if (!m->taglabel[i][0]) + continue; + drw_setscheme(drw, scheme[ + m->tagset[m->seltags] & 1 << i + ? SchemeTagsSel + : urg & 1 << i + ? SchemeUrg + : SchemeTagsNorm + ]); + w = TEXTW(m->taglabel[i]); + drw_text(drw, x, a->y, w, a->h, lrpad / 2, m->taglabel[i], invert, False); + drawindicator(m, NULL, occ, x, a->y, w, a->h, i, -1, invert, tagindicatortype); + #if BAR_UNDERLINETAGS_PATCH + if (ulineall || m->tagset[m->seltags] & 1 << i) + drw_rect(drw, x + ulinepad, bh - ulinestroke - ulinevoffset, w - (ulinepad * 2), ulinestroke, 1, 0); + #endif // BAR_UNDERLINETAGS_PATCH + x += w; + } + + return 1; +} + +int +click_taglabels(Bar *bar, Arg *arg, BarArg *a) +{ + int i = 0, x = lrpad / 2; + Monitor *m = bar->mon; + + do { + if (!m->taglabel[i][0]) + continue; + x += TEXTW(m->taglabel[i]); + } while (a->x >= x && ++i < NUMTAGS); + if (i < NUMTAGS) { + arg->ui = 1 << i; + } + return ClkTagBar; +} diff --git a/patch/bar_taglabels.h b/patch/bar_taglabels.h new file mode 100644 index 0000000..57250f9 --- /dev/null +++ b/patch/bar_taglabels.h @@ -0,0 +1,5 @@ +#include /* for making tab label lowercase, very tiny standard library */ + +static int width_taglabels(Bar *bar, BarArg *a); +static int draw_taglabels(Bar *bar, BarArg *a); +static int click_taglabels(Bar *bar, Arg *arg, BarArg *a); \ No newline at end of file diff --git a/patch/bar_tags.c b/patch/bar_tags.c index c00818d..8b9092d 100644 --- a/patch/bar_tags.c +++ b/patch/bar_tags.c @@ -57,6 +57,10 @@ draw_tags(Bar *bar, BarArg *a) ]); drw_text(drw, x, a->y, w, a->h, lrpad / 2, icon, invert, False); drawindicator(m, NULL, occ, x, a->y, w, a->h, i, -1, invert, tagindicatortype); + #if BAR_UNDERLINETAGS_PATCH + if (ulineall || m->tagset[m->seltags] & 1 << i) + drw_rect(drw, x + ulinepad, bh - ulinestroke - ulinevoffset, w - (ulinepad * 2), ulinestroke, 1, 0); + #endif // BAR_UNDERLINETAGS_PATCH x += w; } @@ -66,7 +70,7 @@ draw_tags(Bar *bar, BarArg *a) int click_tags(Bar *bar, Arg *arg, BarArg *a) { - int i = 0, x = lrpad / 2; + int i = 0, x = 0; #if BAR_HIDEVACANTTAGS_PATCH Client *c; unsigned int occ = 0; diff --git a/patch/bar_winicon.c b/patch/bar_winicon.c index 5ae7fe7..697e8b9 100644 --- a/patch/bar_winicon.c +++ b/patch/bar_winicon.c @@ -1,60 +1,12 @@ -static uint32_t tmpicon[ICONSIZE * ICONSIZE]; - static uint32_t prealpha(uint32_t p) { uint8_t a = p >> 24u; uint32_t rb = (a * (p & 0xFF00FFu)) >> 8u; uint32_t g = (a * (p & 0x00FF00u)) >> 8u; - return (rb & 0xFF00FFu) | (g & 0x00FF00u) | ((~a) << 24u); + return (rb & 0xFF00FFu) | (g & 0x00FF00u) | (a << 24u); } -#if BAR_ALPHA_PATCH -static uint8_t div255(uint16_t x) { return (x*0x8081u) >> 23u; } -static uint32_t blend(uint32_t p1rb, uint32_t p1g, uint8_t p1a, uint32_t p2) { - uint8_t a = p2 >> 24u; - uint32_t rb = (p2 & 0xFF00FFu) + ( (a * p1rb) >> 8u ); - uint32_t g = (p2 & 0x00FF00u) + ( (a * p1g) >> 8u ); - return (rb & 0xFF00FFu) | (g & 0x00FF00u) | div255(~a * 255u + a * p1a) << 24u; -} - -void -drw_img(Drw *drw, int x, int y, XImage *img, uint32_t *tmp) -{ - if (!drw || !drw->scheme) - return; - uint32_t *data = (uint32_t *)img->data, p = drw->scheme[ColBg].pixel, - prb = p & 0xFF00FFu, pg = p & 0x00FF00u; - uint8_t pa = p >> 24u; - int icsz = img->width * img->height, i; - for (i = 0; i < icsz; ++i) tmp[i] = blend(prb, pg, pa, data[i]); - - img->data = (char *) tmp; - XPutImage(drw->dpy, drw->drawable, drw->gc, img, 0, 0, x, y, img->width, img->height); - img->data = (char *) data; -} -#else -static uint32_t blend(uint32_t p1rb, uint32_t p1g, uint32_t p2) { - uint8_t a = p2 >> 24u; - uint32_t rb = (p2 & 0xFF00FFu) + ( (a * p1rb) >> 8u ); - uint32_t g = (p2 & 0x00FF00u) + ( (a * p1g) >> 8u ); - return (rb & 0xFF00FFu) | (g & 0x00FF00u) | ((~a) << 24u); -} - -void -drw_img(Drw *drw, int x, int y, XImage *img, uint32_t *tmp) -{ - if (!drw || !drw->scheme) - return; - uint32_t *data = (uint32_t *)img->data, p = drw->scheme[ColBg].pixel, prb = p & 0xFF00FFu, pg = p & 0x00FF00u; - int icsz = img->width * img->height, i; - for (i = 0; i < icsz; ++i) tmp[i] = blend(prb, pg, data[i]); - img->data = (char *) tmp; - XPutImage(drw->dpy, drw->drawable, drw->gc, img, 0, 0, x, y, img->width, img->height); - img->data = (char *) data; -} -#endif // BAR_ALPHA_PATCH - -XImage * -geticonprop(Window win) +Picture +geticonprop(Window win, unsigned int *picw, unsigned int *pich) { int format; unsigned long n, extra, *p = NULL; @@ -62,34 +14,32 @@ geticonprop(Window win) if (XGetWindowProperty(dpy, win, netatom[NetWMIcon], 0L, LONG_MAX, False, AnyPropertyType, &real, &format, &n, &extra, (unsigned char **)&p) != Success) - return NULL; - if (n == 0 || format != 32) { XFree(p); return NULL; } + return None; + if (n == 0 || format != 32) { XFree(p); return None; } unsigned long *bstp = NULL; uint32_t w, h, sz; - { - const unsigned long *end = p + n; - unsigned long *i; + unsigned long *i; const unsigned long *end = p + n; uint32_t bstd = UINT32_MAX, d, m; for (i = p; i < end - 1; i += sz) { - if ((w = *i++) > UINT16_MAX || (h = *i++) > UINT16_MAX) { XFree(p); return NULL; } + if ((w = *i++) >= 16384 || (h = *i++) >= 16384) { XFree(p); return None; } if ((sz = w * h) > end - i) break; if ((m = w > h ? w : h) >= ICONSIZE && (d = m - ICONSIZE) < bstd) { bstd = d; bstp = i; } } if (!bstp) { for (i = p; i < end - 1; i += sz) { - if ((w = *i++) > UINT16_MAX || (h = *i++) > UINT16_MAX) { XFree(p); return NULL; } + if ((w = *i++) >= 16384 || (h = *i++) >= 16384) { XFree(p); return None; } if ((sz = w * h) > end - i) break; if ((d = ICONSIZE - (w > h ? w : h)) < bstd) { bstd = d; bstp = i; } } } - if (!bstp) { XFree(p); return NULL; } + if (!bstp) { XFree(p); return None; } } - if ((w = *(bstp - 2)) == 0 || (h = *(bstp - 1)) == 0) { XFree(p); return NULL; } + if ((w = *(bstp - 2)) == 0 || (h = *(bstp - 1)) == 0) { XFree(p); return None; } - uint32_t icw, ich, icsz; + uint32_t icw, ich; if (w <= h) { ich = ICONSIZE; icw = w * ICONSIZE / h; if (icw == 0) icw = 1; @@ -98,43 +48,92 @@ geticonprop(Window win) icw = ICONSIZE; ich = h * ICONSIZE / w; if (ich == 0) ich = 1; } - icsz = icw * ich; + *picw = icw; *pich = ich; - uint32_t i; -#if ULONG_MAX > UINT32_MAX - uint32_t *bstp32 = (uint32_t *)bstp; - for (sz = w * h, i = 0; i < sz; ++i) bstp32[i] = bstp[i]; -#endif - uint32_t *icbuf = malloc(icsz << 2); if(!icbuf) { XFree(p); return NULL; } - if (w == icw && h == ich) memcpy(icbuf, bstp, icsz << 2); - else { - Imlib_Image origin = imlib_create_image_using_data(w, h, (DATA32 *)bstp); - if (!origin) { XFree(p); free(icbuf); return NULL; } + uint32_t i, *bstp32 = (uint32_t *)bstp; + for (sz = w * h, i = 0; i < sz; ++i) bstp32[i] = prealpha(bstp[i]); + + Picture ret = drw_picture_create_resized(drw, (char *)bstp, w, h, icw, ich); + XFree(p); + + return ret; +} + +Picture +drw_picture_create_resized(Drw *drw, char *src, unsigned int srcw, unsigned int srch, unsigned int dstw, unsigned int dsth) { + Pixmap pm; + Picture pic; + GC gc; + + if (srcw <= (dstw << 1u) && srch <= (dsth << 1u)) { + XImage img = { + srcw, srch, 0, ZPixmap, src, + ImageByteOrder(drw->dpy), BitmapUnit(drw->dpy), BitmapBitOrder(drw->dpy), 32, + 32, 0, 32, + 0, 0, 0 + }; + XInitImage(&img); + + pm = XCreatePixmap(drw->dpy, drw->root, srcw, srch, 32); + gc = XCreateGC(drw->dpy, pm, 0, NULL); + XPutImage(drw->dpy, pm, gc, &img, 0, 0, 0, 0, srcw, srch); + XFreeGC(drw->dpy, gc); + + pic = XRenderCreatePicture(drw->dpy, pm, XRenderFindStandardFormat(drw->dpy, PictStandardARGB32), 0, NULL); + XFreePixmap(drw->dpy, pm); + + XRenderSetPictureFilter(drw->dpy, pic, FilterBilinear, NULL, 0); + XTransform xf; + xf.matrix[0][0] = (srcw << 16u) / dstw; xf.matrix[0][1] = 0; xf.matrix[0][2] = 0; + xf.matrix[1][0] = 0; xf.matrix[1][1] = (srch << 16u) / dsth; xf.matrix[1][2] = 0; + xf.matrix[2][0] = 0; xf.matrix[2][1] = 0; xf.matrix[2][2] = 65536; + XRenderSetPictureTransform(drw->dpy, pic, &xf); + } else { + Imlib_Image origin = imlib_create_image_using_data(srcw, srch, (DATA32 *)src); + if (!origin) return None; imlib_context_set_image(origin); imlib_image_set_has_alpha(1); - Imlib_Image scaled = imlib_create_cropped_scaled_image(0, 0, w, h, icw, ich); + Imlib_Image scaled = imlib_create_cropped_scaled_image(0, 0, srcw, srch, dstw, dsth); imlib_free_image_and_decache(); - if (!scaled) { XFree(p); free(icbuf); return NULL; } + if (!scaled) return None; imlib_context_set_image(scaled); imlib_image_set_has_alpha(1); - memcpy(icbuf, imlib_image_get_data_for_reading_only(), icsz << 2); + + XImage img = { + dstw, dsth, 0, ZPixmap, (char *)imlib_image_get_data_for_reading_only(), + ImageByteOrder(drw->dpy), BitmapUnit(drw->dpy), BitmapBitOrder(drw->dpy), 32, + 32, 0, 32, + 0, 0, 0 + }; + XInitImage(&img); + + pm = XCreatePixmap(drw->dpy, drw->root, dstw, dsth, 32); + gc = XCreateGC(drw->dpy, pm, 0, NULL); + XPutImage(drw->dpy, pm, gc, &img, 0, 0, 0, 0, dstw, dsth); imlib_free_image_and_decache(); + XFreeGC(drw->dpy, gc); + + pic = XRenderCreatePicture(drw->dpy, pm, XRenderFindStandardFormat(drw->dpy, PictStandardARGB32), 0, NULL); + XFreePixmap(drw->dpy, pm); } - XFree(p); - for (i = 0; i < icsz; ++i) icbuf[i] = prealpha(icbuf[i]); - #if BAR_ALPHA_PATCH - return XCreateImage(dpy, drw->visual, drw->depth, ZPixmap, 0, (char *)icbuf, icw, ich, 32, 0); - #else - return XCreateImage(dpy, DefaultVisual(dpy, screen), DefaultDepth(dpy, screen), ZPixmap, 0, (char *)icbuf, icw, ich, 32, 0); - #endif // BAR_ALPHA_PATCH + + return pic; +} + +void +drw_pic(Drw *drw, int x, int y, unsigned int w, unsigned int h, Picture pic) +{ + if (!drw) + return; + XRenderComposite(drw->dpy, PictOpOver, pic, None, drw->picture, 0, 0, 0, 0, x, y, w, h); } void freeicon(Client *c) { if (c->icon) { - XDestroyImage(c->icon); - c->icon = NULL; + XRenderFreePicture(dpy, c->icon); + c->icon = None; } } @@ -142,5 +141,5 @@ void updateicon(Client *c) { freeicon(c); - c->icon = geticonprop(c->win); -} \ No newline at end of file + c->icon = geticonprop(c->win, &c->icw, &c->ich); +} diff --git a/patch/bar_winicon.h b/patch/bar_winicon.h index 791182e..56fc6e3 100644 --- a/patch/bar_winicon.h +++ b/patch/bar_winicon.h @@ -2,7 +2,8 @@ #include #include -void drw_img(Drw *drw, int x, int y, XImage *img, uint32_t *tmp); -static XImage *geticonprop(Window win); +static Picture drw_picture_create_resized(Drw *drw, char *src, unsigned int src_w, unsigned int src_h, unsigned int dst_w, unsigned int dst_h); +static void drw_pic(Drw *drw, int x, int y, unsigned int w, unsigned int h, Picture pic); +static Picture geticonprop(Window w, unsigned int *icw, unsigned int *ich); static void freeicon(Client *c); -static void updateicon(Client *c); \ No newline at end of file +static void updateicon(Client *c); diff --git a/patch/bar_wintitle.c b/patch/bar_wintitle.c index d2241d2..fdb54ae 100644 --- a/patch/bar_wintitle.c +++ b/patch/bar_wintitle.c @@ -18,7 +18,6 @@ draw_wintitle(Bar *bar, BarArg *a) #endif // BAR_TITLE_LEFT_PAD_PATCH | BAR_TITLE_RIGHT_PAD_PATCH Monitor *m = bar->mon; Client *c = m->sel; - int pad = lrpad / 2; if (!c) { drw_setscheme(drw, scheme[SchemeTitleNorm]); @@ -26,23 +25,53 @@ draw_wintitle(Bar *bar, BarArg *a) return 0; } + int tpad = lrpad / 2; + #if BAR_WINICON_PATCH + int ipad = c->icon ? c->icw + ICONSPACING : 0; + #endif // BAR_WINICON_PATCH + #if BAR_CENTEREDWINDOWNAME_PATCH + int cpad = 0; + #endif // BAR_CENTEREDWINDOWNAME_PATCH + int tx = x; + int tw = w; + drw_setscheme(drw, scheme[m == selmon ? SchemeTitleSel : SchemeTitleNorm]); #if BAR_IGNORE_XFT_ERRORS_WHEN_DRAWING_TEXT_PATCH XSetErrorHandler(xerrordummy); #endif // BAR_IGNORE_XFT_ERRORS_WHEN_DRAWING_TEXT_PATCH - #if BAR_CENTEREDWINDOWNAME_PATCH - if (TEXTW(c->name) < w) - pad = (w - TEXTW(c->name) + lrpad) / 2; + + if (w <= TEXTW("A") - lrpad + tpad) // reduce text padding if wintitle is too small + tpad = (w - TEXTW("A") + lrpad < 0 ? 0 : (w - TEXTW("A") + lrpad) / 2); + #if BAR_WINICON_PATCH && BAR_CENTEREDWINDOWNAME_PATCH + else if (TEXTW(c->name) + ipad < w) + cpad = (w - TEXTW(c->name) - ipad) / 2; + #elif BAR_CENTEREDWINDOWNAME_PATCH + else if (TEXTW(c->name) < w) + cpad = (w - TEXTW(c->name)) / 2; #endif // BAR_CENTEREDWINDOWNAME_PATCH + XSetForeground(drw->dpy, drw->gc, drw->scheme[ColBg].pixel); + XFillRectangle(drw->dpy, drw->drawable, drw->gc, x, a->y, w, a->h); + + #if BAR_CENTEREDWINDOWNAME_PATCH + /* Apply center padding, if any */ + tx += cpad; + tw -= cpad; + #endif // BAR_CENTEREDWINDOWNAME_PATCH + + tx += tpad; + tw -= lrpad; + #if BAR_WINICON_PATCH - drw_text(drw, x, a->y, w, a->h, pad + (c->icon ? c->icon->width + ICONSPACING : 0), c->name, 0, False); - if (c->icon) - drw_img(drw, x + pad, a->y + (a->h - c->icon->height) / 2, c->icon, tmpicon); - #else - drw_text(drw, x, a->y, w, a->h, pad, c->name, 0, False); + if (ipad) { + drw_pic(drw, tx, a->y + (a->h - c->ich) / 2, c->icw, c->ich, c->icon); + tx += ipad; + tw -= ipad; + } #endif // BAR_WINICON_PATCH + drw_text(drw, tx, a->y, tw, a->h, 0, c->name, 0, False); + #if BAR_IGNORE_XFT_ERRORS_WHEN_DRAWING_TEXT_PATCH XSync(dpy, False); XSetErrorHandler(xerror); diff --git a/patch/combo.c b/patch/combo.c index 058b1f9..58b31f1 100644 --- a/patch/combo.c +++ b/patch/combo.c @@ -30,21 +30,10 @@ combotag(const Arg *arg) void comboview(const Arg *arg) { - unsigned newtags = arg->ui & TAGMASK; if (combo) { - selmon->tagset[selmon->seltags] |= newtags; + view(&((Arg) { .ui = selmon->tagset[selmon->seltags] | (arg->ui & TAGMASK) })); } else { - selmon->seltags ^= 1; /*toggle tagset*/ combo = 1; - if (newtags) { - #if PERTAG_PATCH - pertagview(&((Arg) { .ui = newtags })); - #else - selmon->tagset[selmon->seltags] = newtags; - #endif // PERTAG_PATCH - } + view(arg); } - focus(NULL); - arrange(selmon); } - diff --git a/patch/distributetags.c b/patch/distributetags.c index 284b24c..f20f53f 100644 --- a/patch/distributetags.c +++ b/patch/distributetags.c @@ -1,9 +1,16 @@ void distributetags(const Arg *arg) { + Client *c; unsigned int ui = 1; int i = 0; - for (Client *c = selmon->clients; c; c = c->next) { + + #if TAGSYNC_PATCH + Monitor *origselmon = selmon; + for (selmon = mons; selmon; selmon = selmon->next) { + #endif // TAGSYNC_PATCH + + for (c = selmon->clients; c; c = c->next) { if (HIDDEN(c)) continue; if (!(c->tags & TAGMASK)) @@ -11,7 +18,14 @@ distributetags(const Arg *arg) c->tags = (ui << i) & TAGMASK; i = (i + 1) % NUMTAGS; } + + #if TAGSYNC_PATCH + } + selmon = origselmon; + focus(NULL); + arrange(NULL); + #else focus(NULL); arrange(selmon); + #endif // TAGSYNC_PATCH } - diff --git a/patch/focusadjacenttag.c b/patch/focusadjacenttag.c index 85d9d74..67dd768 100644 --- a/patch/focusadjacenttag.c +++ b/patch/focusadjacenttag.c @@ -1,8 +1,9 @@ void tagtoleft(const Arg *arg) { + unsigned int MASK = (1 << NUMTAGS) - 1; if (selmon->sel != NULL - && __builtin_popcount(selmon->tagset[selmon->seltags] & TAGMASK) == 1 + && __builtin_popcount(selmon->tagset[selmon->seltags] & MASK) == 1 && selmon->tagset[selmon->seltags] > 1) { selmon->sel->tags >>= 1; focus(NULL); @@ -13,9 +14,10 @@ tagtoleft(const Arg *arg) void tagtoright(const Arg *arg) { + unsigned int MASK = (1 << NUMTAGS) - 1; if (selmon->sel != NULL - && __builtin_popcount(selmon->tagset[selmon->seltags] & TAGMASK) == 1 - && selmon->tagset[selmon->seltags] & (TAGMASK >> 1)) { + && __builtin_popcount(selmon->tagset[selmon->seltags] & MASK) == 1 + && selmon->tagset[selmon->seltags] & (MASK >> 1)) { selmon->sel->tags <<= 1; focus(NULL); arrange(selmon); @@ -25,80 +27,43 @@ tagtoright(const Arg *arg) void viewtoleft(const Arg *arg) { - if (__builtin_popcount(selmon->tagset[selmon->seltags] & TAGMASK) == 1 + unsigned int MASK = (1 << NUMTAGS) - 1; + if (__builtin_popcount(selmon->tagset[selmon->seltags] & MASK) == 1 && selmon->tagset[selmon->seltags] > 1) { - selmon->seltags ^= 1; /* toggle sel tagset */ - #if PERTAG_PATCH - pertagview(&((Arg) { .ui = selmon->tagset[selmon->seltags ^ 1] >> 1 })); - #else - selmon->tagset[selmon->seltags] = selmon->tagset[selmon->seltags ^ 1] >> 1; - #endif // pertagview - focus(NULL); - arrange(selmon); - #if BAR_EWMHTAGS_PATCH - updatecurrentdesktop(); - #endif // BAR_EWMHTAGS_PATCH + view(&((Arg) { .ui = selmon->tagset[selmon->seltags] >> 1 })); } } void viewtoright(const Arg *arg) { - if (__builtin_popcount(selmon->tagset[selmon->seltags] & TAGMASK) == 1 - && selmon->tagset[selmon->seltags] & (TAGMASK >> 1)) { - selmon->seltags ^= 1; /* toggle sel tagset */ - #if PERTAG_PATCH - pertagview(&((Arg) { .ui = selmon->tagset[selmon->seltags ^ 1] << 1 })); - #else - selmon->tagset[selmon->seltags] = selmon->tagset[selmon->seltags ^ 1] << 1; - #endif // pertagview - focus(NULL); - arrange(selmon); - #if BAR_EWMHTAGS_PATCH - updatecurrentdesktop(); - #endif // BAR_EWMHTAGS_PATCH + unsigned int MASK = (1 << NUMTAGS) - 1; + if (__builtin_popcount(selmon->tagset[selmon->seltags] & MASK) == 1 + && selmon->tagset[selmon->seltags] & (MASK >> 1)) { + view(&((Arg) { .ui = selmon->tagset[selmon->seltags] << 1 })); } } void tagandviewtoleft(const Arg *arg) { + unsigned int MASK = (1 << NUMTAGS) - 1; if (selmon->sel != NULL - && __builtin_popcount(selmon->tagset[selmon->seltags] & TAGMASK) == 1 + && __builtin_popcount(selmon->tagset[selmon->seltags] & MASK) == 1 && selmon->tagset[selmon->seltags] > 1) { selmon->sel->tags >>= 1; - selmon->seltags ^= 1; /* toggle sel tagset */ - #if PERTAG_PATCH - pertagview(&((Arg) { .ui = selmon->tagset[selmon->seltags ^ 1] >> 1 })); - #else - selmon->tagset[selmon->seltags] = selmon->tagset[selmon->seltags ^ 1] >> 1; - #endif // pertagview - focus(selmon->sel); - arrange(selmon); - #if BAR_EWMHTAGS_PATCH - updatecurrentdesktop(); - #endif // BAR_EWMHTAGS_PATCH + view(&((Arg) { .ui = selmon->tagset[selmon->seltags] >> 1 })); } } void tagandviewtoright(const Arg *arg) { + unsigned int MASK = (1 << NUMTAGS) - 1; if (selmon->sel != NULL - && __builtin_popcount(selmon->tagset[selmon->seltags] & TAGMASK) == 1 - && selmon->tagset[selmon->seltags] & (TAGMASK >> 1)) { + && __builtin_popcount(selmon->tagset[selmon->seltags] & MASK) == 1 + && selmon->tagset[selmon->seltags] & (MASK >> 1)) { selmon->sel->tags <<= 1; - selmon->seltags ^= 1; /* toggle sel tagset */ - #if PERTAG_PATCH - pertagview(&((Arg) { .ui = selmon->tagset[selmon->seltags ^ 1] << 1 })); - #else - selmon->tagset[selmon->seltags] = selmon->tagset[selmon->seltags ^ 1] << 1; - #endif // pertagview - focus(selmon->sel); - arrange(selmon); - #if BAR_EWMHTAGS_PATCH - updatecurrentdesktop(); - #endif // BAR_EWMHTAGS_PATCH + view(&((Arg) { .ui = selmon->tagset[selmon->seltags] << 1 })); } } - diff --git a/patch/include.c b/patch/include.c index 29dac83..676e2ae 100644 --- a/patch/include.c +++ b/patch/include.c @@ -20,9 +20,6 @@ #if COMBO_PATCH #include "combo.c" #endif -#if BAR_HOLDBAR_PATCH -#include "bar_holdbar.c" -#endif #if BAR_LTSYMBOL_PATCH #include "bar_ltsymbol.c" #endif @@ -56,6 +53,9 @@ #if BAR_TAGS_PATCH #include "bar_tags.c" #endif +#if BAR_TAGLABELS_PATCH +#include "bar_taglabels.c" +#endif #if BAR_TAGGRID_PATCH #include "bar_taggrid.c" #endif @@ -80,6 +80,9 @@ #if BAR_SYSTRAY_PATCH #include "bar_systray.c" #endif +#if BAR_HOLDBAR_PATCH +#include "bar_holdbar.c" +#endif #if BAR_VTCOLORS_PATCH #include "bar_vtcolors.c" #endif diff --git a/patch/include.h b/patch/include.h index eea37a8..f26f36e 100644 --- a/patch/include.h +++ b/patch/include.h @@ -56,6 +56,9 @@ #if BAR_TAGS_PATCH #include "bar_tags.h" #endif +#if BAR_TAGLABELS_PATCH +#include "bar_taglabels.h" +#endif #if BAR_TAGGRID_PATCH #include "bar_taggrid.h" #endif diff --git a/patch/placemouse.c b/patch/placemouse.c index 0208baf..0851e89 100644 --- a/patch/placemouse.c +++ b/patch/placemouse.c @@ -88,8 +88,10 @@ placemouse(const Arg *arg) if ((r && r != prevr) || (attachmode != prevattachmode)) { detachstack(c); detach(c); - if (c->mon != r->mon) + if (c->mon != r->mon) { arrangemon(c->mon); + c->tags = r->mon->tagset[r->mon->seltags]; + } c->mon = r->mon; r->mon->sel = r; diff --git a/patch/push.c b/patch/push.c index 9410e61..68123a6 100644 --- a/patch/push.c +++ b/patch/push.c @@ -40,9 +40,11 @@ pushup(const Arg *arg) } else { /* move to the end */ for (c = sel; c->next; c = c->next); - detach(sel); - sel->next = NULL; - c->next = sel; + if (sel != c) { + detach(sel); + sel->next = NULL; + c->next = sel; + } } focus(sel); arrange(selmon); diff --git a/patch/reorganizetags.c b/patch/reorganizetags.c index 1aff54a..440d75c 100644 --- a/patch/reorganizetags.c +++ b/patch/reorganizetags.c @@ -1,28 +1,42 @@ void reorganizetags(const Arg *arg) { - Client *c; - unsigned int occ, unocc, i; - unsigned int tagdest[NUMTAGS]; + Client *c; + unsigned int occ, unocc, i; + unsigned int tagdest[NUMTAGS]; - occ = 0; - for (c = selmon->clients; c; c = c->next) - occ |= (1 << (ffs(c->tags)-1)); - unocc = 0; - for (i = 0; i < NUMTAGS; ++i) { - while (unocc < i && (occ & (1 << unocc))) - unocc++; - if (occ & (1 << i)) { - tagdest[i] = unocc; - occ &= ~(1 << i); - occ |= 1 << unocc; - } - } + #if TAGSYNC_PATCH + Monitor *origselmon = selmon; + for (selmon = mons; selmon; selmon = selmon->next) { + #endif // TAGSYNC_PATCH - for (c = selmon->clients; c; c = c->next) - c->tags = 1 << tagdest[ffs(c->tags)-1]; - if (selmon->sel) - selmon->tagset[selmon->seltags] = selmon->sel->tags; - arrange(selmon); + occ = 0; + for (c = selmon->clients; c; c = c->next) + occ |= (1 << (ffs(c->tags)-1)); + unocc = 0; + for (i = 0; i < NUMTAGS; ++i) { + while (unocc < i && (occ & (1 << unocc))) + unocc++; + if (occ & (1 << i)) { + tagdest[i] = unocc; + occ &= ~(1 << i); + occ |= 1 << unocc; + } + } + + for (c = selmon->clients; c; c = c->next) + c->tags = 1 << tagdest[ffs(c->tags)-1]; + #if TAGSYNC_PATCH + } + selmon = origselmon; + #endif // TAGSYNC_PATCH + + if (selmon->sel) + view(&((Arg) { .ui = selmon->sel->tags })); + else + #if TAGSYNC_PATCH + arrange(NULL); + #else + arrange(selmon); + #endif // TAGSYNC_PATCH } - diff --git a/patch/setborderpx.c b/patch/setborderpx.c index 948d6f6..56c7636 100644 --- a/patch/setborderpx.c +++ b/patch/setborderpx.c @@ -2,44 +2,55 @@ void setborderpx(const Arg *arg) { Client *c; - int prev_borderpx = selmon->borderpx; - - if (arg->i == 0) - selmon->borderpx = borderpx; - else if (selmon->borderpx + arg->i < 0) - selmon->borderpx = 0; - else - selmon->borderpx += arg->i; + Monitor *m = selmon; + #if BAR_BORDER_PATCH + Bar *bar; + #endif // BAR_BORDER_PATCH + int prev_borderpx = m->borderpx; + m->borderpx = arg->i + ? MAX(m->borderpx + arg->i, 0) + : m->borderpx == borderpx + ? 0 + : borderpx; + int delta = 2 * (m->borderpx - prev_borderpx); #if BAR_BORDER_PATCH - for (bar = selmon->bar; bar; bar = bar->next) { - bar->bh = bar->bh - 2 * bar->borderpx + 2 * selmon->borderpx; - bar->borderpx = selmon->borderpx; + for (bar = m->bar; bar; bar = bar->next) { + bar->bh = bar->bh - 2 * bar->borderpx + 2 * m->borderpx; + bar->borderpx = m->borderpx; } - updatebarpos(selmon); - for (bar = selmon->bar; bar; bar = bar->next) + updatebarpos(m); + for (bar = m->bar; bar; bar = bar->next) XMoveResizeWindow(dpy, bar->win, bar->bx, bar->by, bar->bw, bar->bh); #endif // BAR_BORDER_PATCH - for (c = selmon->clients; c; c = c->next) - { - if (c->bw + arg->i < 0) - c->bw = 0; - else - c->bw = selmon->borderpx; + for (c = m->clients; c; c = c->next) { + c->bw = m->borderpx; + #if !FAKEFULLSCREEN_PATCH + #if FAKEFULLSCREEN_CLIENT_PATCH + if (c->isfullscreen && !c->fakefullscreen) + continue; + #else + if (c->isfullscreen) + continue; + #endif // FAKEFULLSCREEN_CLIENT_PATCH + #endif // FAKEFULLSCREEN_PATCH + #if BAR_WINTITLEACTIONS_PATCH + if (HIDDEN(c)) + continue; + #endif // BAR_WINTITLEACTIONS_PATCH + #if SCRATCHPADS_PATCH + if ((c->tags & SPTAGMASK) && !ISVISIBLE(c)) + continue; + #endif // SCRATCHPADS_PATCH + #if SCRATCHPAD_ALT_1_PATCH + if ((c->tags & SCRATCHPAD_MASK)) + continue; + #endif // SCRATCHPAD_ALT_1_PATCH + if (!c->isfloating && m->lt[m->sellt]->arrange) + continue; - if (c->isfloating || !selmon->lt[selmon->sellt]->arrange) - { - if (arg->i != 0 && prev_borderpx + arg->i >= 0) - resize(c, c->x, c->y, c->w-(arg->i*2), c->h-(arg->i*2), 0); - else if (arg->i != 0) - resizeclient(c, c->x, c->y, c->w, c->h); - else if (prev_borderpx > borderpx) - resize(c, c->x, c->y, c->w + 2*(prev_borderpx - borderpx), c->h + 2*(prev_borderpx - borderpx), 0); - else if (prev_borderpx < borderpx) - resize(c, c->x, c->y, c->w - 2*(borderpx - prev_borderpx), c->h - 2*(borderpx - prev_borderpx), 0); - } + resizeclient(c, c->x, c->y, c->w - delta, c->h - delta); } - arrange(selmon); + arrange(m); } - diff --git a/patch/shiftview.c b/patch/shiftview.c index 423d74b..b9c811a 100644 --- a/patch/shiftview.c +++ b/patch/shiftview.c @@ -8,12 +8,12 @@ shiftview(const Arg *arg) unsigned int seltagset = selmon->tagset[selmon->seltags]; #endif // SCRATCHPADS_PATCH if (arg->i > 0) // left circular shift - shifted.ui = (seltagset << arg->i) - | (seltagset >> (NUMTAGS - arg->i)); + shifted.ui = (seltagset << arg->i) | (seltagset >> (NUMTAGS - arg->i)); else // right circular shift - shifted.ui = seltagset >> -arg->i - | seltagset << (NUMTAGS + arg->i); + shifted.ui = (seltagset >> -arg->i) | (seltagset << (NUMTAGS + arg->i)); + #if SCRATCHPADS_PATCH + shifted.ui &= ~SPTAGMASK; + #endif // SCRATCHPADS_PATCH view(&shifted); } - diff --git a/patch/shiftview.h b/patch/shiftview.h index 1d7fd1f..7bf3a14 100644 --- a/patch/shiftview.h +++ b/patch/shiftview.h @@ -1,2 +1 @@ static void shiftview(const Arg *arg); - diff --git a/patch/shiftviewclients.c b/patch/shiftviewclients.c index 1bf9de8..adeaab7 100644 --- a/patch/shiftviewclients.c +++ b/patch/shiftviewclients.c @@ -5,7 +5,11 @@ shiftviewclients(const Arg *arg) Client *c; unsigned int tagmask = 0; - for (c = selmon->clients; c; c = c->next) + #if TAGSYNC_PATCH + Monitor *origselmon = selmon; + for (selmon = mons; selmon; selmon = selmon->next) + #endif // TAGSYNC_PATCH + for (c = selmon->clients; c; c = c->next) { #if SCRATCHPADS_PATCH if (!(c->tags & SPTAGMASK)) tagmask = tagmask | c->tags; @@ -15,28 +19,28 @@ shiftviewclients(const Arg *arg) #else tagmask = tagmask | c->tags; #endif // SCRATCHPADS_PATCH + } + #if TAGSYNC_PATCH + selmon = origselmon; + #endif // TAGSYNC_PATCH #if SCRATCHPADS_PATCH shifted.ui = selmon->tagset[selmon->seltags] & ~SPTAGMASK; #else shifted.ui = selmon->tagset[selmon->seltags]; #endif // SCRATCHPADS_PATCH - if (arg->i > 0) // left circular shift - do { + + do { + if (arg->i > 0) // left circular shift shifted.ui = (shifted.ui << arg->i) | (shifted.ui >> (NUMTAGS - arg->i)); - #if SCRATCHPADS_PATCH - shifted.ui &= ~SPTAGMASK; - #endif // SCRATCHPADS_PATCH - } while (tagmask && !(shifted.ui & tagmask)); - else // right circular shift - do { - shifted.ui = (shifted.ui >> (- arg->i) - | shifted.ui << (NUMTAGS + arg->i)); - #if SCRATCHPADS_PATCH - shifted.ui &= ~SPTAGMASK; - #endif // SCRATCHPADS_PATCH - } while (tagmask && !(shifted.ui & tagmask)); + else // right circular shift + shifted.ui = (shifted.ui >> -arg->i) + | (shifted.ui << (NUMTAGS + arg->i)); + #if SCRATCHPADS_PATCH + shifted.ui &= ~SPTAGMASK; + #endif // SCRATCHPADS_PATCH + } while (tagmask && !(shifted.ui & tagmask)); view(&shifted); } diff --git a/patch/shiftviewclients.h b/patch/shiftviewclients.h index 49aeb51..2f652cd 100644 --- a/patch/shiftviewclients.h +++ b/patch/shiftviewclients.h @@ -1,2 +1 @@ static void shiftviewclients(const Arg *arg); - diff --git a/patch/sizehints_ruled.c b/patch/sizehints_ruled.c index 99c7e62..ce2eeb9 100644 --- a/patch/sizehints_ruled.c +++ b/patch/sizehints_ruled.c @@ -2,6 +2,10 @@ void checkfloatingrules(Client *c) { const char *class, *instance; + Atom wintype; + #if WINDOWROLERULE_PATCH + char role[64]; + #endif // WINDOWROLERULE_PATCH unsigned int i; const Rule *r; XClassHint ch = { NULL, NULL }; @@ -9,13 +13,23 @@ checkfloatingrules(Client *c) XGetClassHint(dpy, c->win, &ch); class = ch.res_class ? ch.res_class : broken; instance = ch.res_name ? ch.res_name : broken; + wintype = getatomprop(c, netatom[NetWMWindowType]); + #if WINDOWROLERULE_PATCH + gettextprop(c->win, wmatom[WMWindowRole], role, sizeof(role)); + #endif // WINDOWROLERULE_PATCH for (i = 0; i < LENGTH(rules); i++) { r = &rules[i]; if ((!r->title || strstr(c->name, r->title)) && (!r->class || strstr(class, r->class)) - && (!r->instance || strstr(instance, r->instance))) + #if WINDOWROLERULE_PATCH + && (!r->role || strstr(role, r->role)) + #endif // WINDOWROLERULE_PATCH + && (!r->instance || strstr(instance, r->instance)) + && (!r->wintype || wintype == XInternAtom(dpy, r->wintype, False))) + { c->isfloating = r->isfloating; + } } if (ch.res_class) XFree(ch.res_class); diff --git a/patch/swaptags.c b/patch/swaptags.c index d6a72d7..7e1e920 100644 --- a/patch/swaptags.c +++ b/patch/swaptags.c @@ -1,23 +1,31 @@ void swaptags(const Arg *arg) { - unsigned int newtag = arg->ui & TAGMASK; - unsigned int curtag = selmon->tagset[selmon->seltags]; + Client *c; + unsigned int newtag = arg->ui & TAGMASK; + unsigned int curtag = selmon->tagset[selmon->seltags]; - if (newtag == curtag || !curtag || (curtag & (curtag-1))) - return; + if (newtag == curtag || !curtag || (curtag & (curtag-1))) + return; - for (Client *c = selmon->clients; c != NULL; c = c->next) { - if ((c->tags & newtag) || (c->tags & curtag)) - c->tags ^= curtag ^ newtag; + #if TAGSYNC_PATCH + Monitor *origselmon = selmon; + for (selmon = mons; selmon; selmon = selmon->next) { + #endif // TAGSYNC_PATCH - if (!c->tags) - c->tags = newtag; - } + for (c = selmon->clients; c != NULL; c = c->next) { + if ((c->tags & newtag) || (c->tags & curtag)) + c->tags ^= curtag ^ newtag; - selmon->tagset[selmon->seltags] = newtag; + if (!c->tags) + c->tags = newtag; + } - focus(NULL); - arrange(selmon); + #if TAGSYNC_PATCH + } + selmon = origselmon; + #endif // TAGSYNC_PATCH + + view(&((Arg) { .ui = newtag })); } diff --git a/patch/vanitygaps.c b/patch/vanitygaps.c index be2ef08..d322ded 100644 --- a/patch/vanitygaps.c +++ b/patch/vanitygaps.c @@ -86,6 +86,16 @@ togglegaps(const Arg *arg) #else enablegaps = !enablegaps; #endif // PERTAG_VANITYGAPS_PATCH + + #if BAR_PADDING_VANITYGAPS_PATCH + updatebarpos(selmon); + for (Bar *bar = selmon->bar; bar; bar = bar->next) + XMoveResizeWindow(dpy, bar->win, bar->bx, bar->by, bar->bw, bar->bh); + + #if BAR_SYSTRAY_PATCH + drawbarwin(systray->bar); + #endif // BAR_SYSTRAY_PATCH + #endif // BAR_PADDING_VANITYGAPS_PATCH arrange(NULL); }