diff --git a/dwm/.dwm.old/.gitignore b/dwm/.dwm.old/.gitignore deleted file mode 100644 index ca093f8..0000000 --- a/dwm/.dwm.old/.gitignore +++ /dev/null @@ -1,5 +0,0 @@ -*.o -dwm -dwm-msg -config.h -patches.h diff --git a/dwm/.dwm.old/LICENSE b/dwm/.dwm.old/LICENSE deleted file mode 100644 index 995172f..0000000 --- a/dwm/.dwm.old/LICENSE +++ /dev/null @@ -1,38 +0,0 @@ -MIT/X Consortium License - -© 2006-2019 Anselm R Garbe -© 2006-2009 Jukka Salmi -© 2006-2007 Sander van Dijk -© 2007-2011 Peter Hartlich -© 2007-2009 Szabolcs Nagy -© 2007-2009 Christof Musik -© 2007-2009 Premysl Hruby -© 2007-2008 Enno Gottox Boland -© 2008 Martin Hurton -© 2008 Neale Pickett -© 2009 Mate Nagy -© 2010-2016 Hiltjo Posthuma -© 2010-2012 Connor Lane Smith -© 2011 Christoph Lohmann <20h@r-36.net> -© 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"), -to deal in the Software without restriction, including without limitation -the rights to use, copy, modify, merge, publish, distribute, sublicense, -and/or sell copies of the Software, and to permit persons to whom the -Software is furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in -all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL -THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING -FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER -DEALINGS IN THE SOFTWARE. diff --git a/dwm/.dwm.old/Makefile b/dwm/.dwm.old/Makefile deleted file mode 100644 index 65c9b5a..0000000 --- a/dwm/.dwm.old/Makefile +++ /dev/null @@ -1,77 +0,0 @@ -# dwm - dynamic window manager -# See LICENSE file for copyright and license details. - -include config.mk - -SRC = drw.c dwm.c util.c -OBJ = ${SRC:.c=.o} - -# FreeBSD users, prefix all ifdef, else and endif statements with a . for this to work (e.g. .ifdef) - -ifdef YAJLLIBS -all: options dwm dwm-msg -else -all: options dwm -endif - -options: - @echo dwm build options: - @echo "CFLAGS = ${CFLAGS}" - @echo "LDFLAGS = ${LDFLAGS}" - @echo "CC = ${CC}" - -.c.o: - ${CC} -c ${CFLAGS} $< - -${OBJ}: config.h config.mk patches.h - -config.h: - cp config.def.h $@ - -patches.h: - cp patches.def.h $@ - -dwm: ${OBJ} - ${CC} -o $@ ${OBJ} ${LDFLAGS} - -ifdef YAJLLIBS -dwm-msg: - ${CC} -o $@ patch/ipc/dwm-msg.c ${LDFLAGS} -endif - -clean: - rm -f dwm ${OBJ} dwm-${VERSION}.tar.gz - rm -f dwm-msg - -dist: clean - mkdir -p dwm-${VERSION} - cp -R LICENSE Makefile README config.def.h config.mk\ - dwm.1 drw.h util.h ${SRC} dwm.png transient.c dwm-${VERSION} - tar -cf dwm-${VERSION}.tar dwm-${VERSION} - gzip dwm-${VERSION}.tar - rm -rf dwm-${VERSION} - -install: all - mkdir -p ${DESTDIR}${PREFIX}/bin - cp -f dwm ${DESTDIR}${PREFIX}/bin -ifdef YAJLLIBS - cp -f dwm-msg ${DESTDIR}${PREFIX}/bin -endif - #cp -f patch/dwmc ${DESTDIR}${PREFIX}/bin - chmod 755 ${DESTDIR}${PREFIX}/bin/dwm -ifdef YAJLLIBS - chmod 755 ${DESTDIR}${PREFIX}/bin/dwm-msg -endif - mkdir -p ${DESTDIR}${MANPREFIX}/man1 - sed "s/VERSION/${VERSION}/g" < dwm.1 > ${DESTDIR}${MANPREFIX}/man1/dwm.1 - chmod 644 ${DESTDIR}${MANPREFIX}/man1/dwm.1 - mkdir -p ${DESTDIR}${PREFIX}/share/xsessions - cp -n dwm.desktop ${DESTDIR}${PREFIX}/share/xsessions - chmod 644 ${DESTDIR}${PREFIX}/share/xsessions/dwm.desktop - -uninstall: - rm -f ${DESTDIR}${PREFIX}/bin/dwm\ - ${DESTDIR}${MANPREFIX}/man1/dwm.1\ - ${DESTDIR}${PREFIX}/share/xsessions/dwm.desktop - -.PHONY: all options clean dist install uninstall diff --git a/dwm/.dwm.old/README b/dwm/.dwm.old/README deleted file mode 100644 index 95d4fd0..0000000 --- a/dwm/.dwm.old/README +++ /dev/null @@ -1,48 +0,0 @@ -dwm - dynamic window manager -============================ -dwm is an extremely fast, small, and dynamic window manager for X. - - -Requirements ------------- -In order to build dwm you need the Xlib header files. - - -Installation ------------- -Edit config.mk to match your local setup (dwm is installed into -the /usr/local namespace by default). - -Afterwards enter the following command to build and install dwm (if -necessary as root): - - make clean install - - -Running dwm ------------ -Add the following line to your .xinitrc to start dwm using startx: - - exec dwm - -In order to connect dwm to a specific display, make sure that -the DISPLAY environment variable is set correctly, e.g.: - - DISPLAY=foo.bar:1 exec dwm - -(This will start dwm on display :1 of the host foo.bar.) - -In order to display status info in the bar, you can do something -like this in your .xinitrc: - - while xsetroot -name "`date` `uptime | sed 's/.*,//'`" - do - sleep 1 - done & - exec dwm - - -Configuration -------------- -The configuration of dwm is done by creating a custom config.h -and (re)compiling the source code. diff --git a/dwm/.dwm.old/README.md b/dwm/.dwm.old/README.md deleted file mode 100644 index 633f953..0000000 --- a/dwm/.dwm.old/README.md +++ /dev/null @@ -1,894 +0,0 @@ -This dwm 6.4 (712d663, 2023-01-28) 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 -#define BAR_ALPHA_PATCH 1 -``` - -So if you have ever been curious about trying out dwm, but have been discouraged by manual patching, then this may be a good starting point to see what a "fully fledged" dwm can look like. Want to try out the `pertag` patch? Just flip a config and recompile. Once you have found out what works for you and what doesn't then you should be in a better position to choose patches should you want to start patching from scratch. - -Alternatively if you have found the patches you want, but don't want the rest of the flexipatch entanglement on your plate then you may want to have a look at [flexipatch-finalizer](https://github.com/bakkeby/flexipatch-finalizer); a custom pre-processor tool that removes all the unused flexipatch code leaving you with a build that contains the patches you selected. - -Refer to [https://dwm.suckless.org/](https://dwm.suckless.org/) for details on the dwm window manager, how to install it and how it works. - -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: - -2023-01-18 - Added the view history patch - -2022-10-08 - Added the alt-tab patch - -2022-08-12 - Added the nametag patch - -2022-08-02 - Added the bidi patch - -2022-07-05 - Added the tagpreview patch - -2022-07-04 - Added the shift-tools patch(es) with individual toggles - -2022-06-20 - Added the renamed scratchpads patch - -2022-06-17 - Ported the seamless restart feature from dusk into dwm-flexipatch - -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 - -2021-05-30 - Added togglelayout and toggletag patches - -2021-04-16 - Vanitygaps: replaced smartgaps with smartgaps\_fact, allowing gaps to be disabled or increased when there is only one client. - -2021-04-14 - Upgraded the dwmblocks patch for statuscmd which changes the signalling mechanism from SIGUSR1 to SIGRTMIN which is likely to cause issues for those that already have a working setup. A compatibility option has been added which changes this back to SIGUSR1. Note that configuration was also changed. - -2021-04-07 - Added xkb patch - -2021-04-06 - Added the distributetags patch - -2021-04-04 - Added option for having different gaps on a per tag basis - -2021-03-31 - Added tapresize patch (contributed by [verschmelzen](https://github.com/verschmelzen)) - -2021-03-29 - Removed alwaysfullscreen patch (merged into dwm 6.2) - -2021-03-09 - Added the tab patch and the LG3D patch - -2021-02-11 - Added the riodraw and focusdir patches - -2021-01-22 - Added the placemouse patch - -2021-01-02 - Added the Layoutmenu patch - -2020-10-26 - Added the \_NET\_CLIENT\_LIST\_STACKING patch - -2020-09-29 - Added the on\_empty\_keys patch (ported from InstantOS) - -2020-09-28 - Added the \_IS\_FLOATING patch (embedded in the EWMHTAGS patch) - -2020-09-18 - Added the nomodbuttons patch allowing for toggleable mouse button bindings that have no modifiers - -2020-09-10 - Added the anybar patch (with experimental support for dwm bar(s) + anybar) - -2020-09-09 - Added the bar border patch - -2020-09-08 - Added ipc v1.5.5 patch - -2020-09-07 - Scratchpads improvement (multi-monitor support) - -2020-09-05 - Assortment of fullscreen improvements - -2020-08-27 - Added aspectresize patch - -2020-08-25 - Unified tag icon handling while adding support for different icons per monitor. Added alttagsdecoration patch. - -2020-08-22 - Added logic to auto-hide bars if nothing is drawn on them (e.g. for standalone bars that only show certain clients). Added clientindicators patch and unified indicator code. Simplified Pango integration by settling on common function signatures. - -2020-08-21 - Simplification of color configuration; settling on a set of color schemes that is shared between multiple patches (urgentborder, floatborder and titlecolor patches made non-optional) - -2020-08-20 - Added experimental flexwintitle patch based on bartabgroups - -2020-08-13 - Added bartabgroups patch - -2020-08-11 - Added decoration hints and focusmaster patches - -2020-08-10 - Added cool autostart, insets and steam patches - -2020-08-02 - Added reorganizetags patch - -2020-07-19 - Added barmodules patch - making extrabar, leftlayout, staticstatus and statusallmons patches redundant, added powerline patch - -2020-07-18 - **Note**: Up until now building dwm-flexipath without any patches selected would have given you something more or less identical with mainstream dwm. In order to reduce complexity when it comes to maintainance future versions of dwm-flexipatch may diverge from this by making some patches non-optional. For the classic dwm-flexipatch and its many patch integration hints refer to branch [dwm-flexipatch-1.0](https://github.com/bakkeby/dwm-flexipatch/tree/dwm-flexipatch-1.0) which will be subject to bug fixes and mainstream dwm updates as far as feasible. - -2020-07-05 - Extrabar compatibility improvements (staticstatus, status2d, dwmblocks) and fix for systray randomly causing dwm to crash when first systray application starts - -2020-06-24 - Added resizepoint, statusbutton and sendmon_keepfocus patches - -2020-06-21 - Added floatpos and bar_height patches - -2020-06-19 - Added tagothermonitor patch - -2020-06-15 - Added sizehints patch - -2020-06-14 - Added RULE macro to replace rules setup making the default config less of an abomination and making it simpler to include new rules based patches - -2020-06-11 - Added the pango patch - -2020-06-10 - Added the staticstatus patch - -2020-05-31 - Added the keymodes patch - -2020-05-29 - Added the color emoji patch - -2020-05-26 - Added the status2d patch (with alpha, systray, statuspadding and dwmblocks compatibility, no statuscolors or extrabar compatibility) - -2020-05-21 - Added the moveplace and moveresize patches - -2020-05-03 - Added the shiftviewclients patch and the no transparent borders patch which removes opacity from window borders when the alpha patch is not used - -2020-05-02 - Added dwmblocks patch - -2020-04-27 - Upgraded the tagmonfixfs patch to better support moving fullscreen windows to adjacent monitors - -2020-04-26 - Expanded monitor rules patch to include nmaster, showbar and topbar options - -2020-04-23 - Improved swallow and switchtag compatibility - -2020-04-16 - Upgraded the scratchpad patch to the multiple scratchpads patch \[[ref](https://lists.suckless.org/hackers/2004/17205.html)\]. Updated the statuscolors patch with the width computation fix \[[ref](https://lists.suckless.org/hackers/2004/17207.html)\]. - -2020-04-13 - Added statuscmd patch - -2020-03-31 - Added the rounded corners patch - -2020-03-27 - Revamped the dragmfact patch to support both horizontal and vertical layout splits as well as centered master variants - -2020-03-25 - Added dragcfact patch - -2020-03-23 - Added stacker patch - -2020-03-21 - Reworked a series of layouts to re-allocate remaining pixels following an even (or cfacts) split with the aim of presenting a pixel perfect layout. This affects the following layouts: tile, bstack, bstackhoriz, centered master, centered floating master, columns, deck, and corresponding flextile-deluxe layouts - -2020-02-11 - Added swaptags and vtcolor patches - -2020-02-09 - Added alternative scratchpad patch - -2020-02-02 - Added fsignal and transferall patches - -2020-01-29 - Added swapfocus and shiftview patches - -2020-01-26 - Added transfer patch - -2020-01-24 - Added barpadding patch (incl. statusallmons, statuspadding, statuscolors, systray, alpha, holdbar and extrabar patch compatibility). Moved patches.h to patches.def.h to mimic the config pattern of having default and personal settings. - -2020-01-17 - Added inplacerotate patch - -2019-12-15 - Updated dragmfact patch to include fix patch to make it work with multiple monitors - -2019-11-26 - Added dmenumatchtop patch, added improvements to the switchtag patch based on ideas from the switchtotag patch - -2019-11-21 - Added fakefullscreenclient patch - -2019-10-24 - Added dragmfact, extrabar, exresize and nodmenu patches - -2019-10-22 - Added ispermanent and swallow patches - -2019-10-16 - Introduced [flexipatch-finalizer](https://github.com/bakkeby/flexipatch-finalizer) - -2019-10-11 - Added the patch to ignore Xft errors when drawing text in the status bar - -2019-10-10 - Added mpdcontrol, scratchpad and spawn_cwd cpatches - -2019-10-08 - Added columns layout and fakefullscreen patch - -2019-10-07 - Added sortscreens and dwmc patches, fixed minor cross-compatibility issues for combo, holdbar, leftlayout, hidevacanttags, taggrid and activetagindicatorbar - -2019-10-06 - Added statuscolors and statusallmons patches, fixed minor cross-compatibility issues for killunsel, fullscreen, noborder, tagintostack patches - -2019-10-05 - Added killunsel, taggrid, hidevacanttags and cmdcustomize patches - -2019-10-04 - Added maximize, movestack, monoclesymbol, noborder, tagall and tagintostack patches - -2019-10-03 - Added onlyquitonempty and switchcol patches - -2019-10-02 - Added restartsig, emptyview, focusurgent and focusadjacenttag patches - -2019-10-01 - Added leftlayout, fullscreen, holdbar and unfloatvisible patches - -2019-09-30 - Replaced flextile with flextile-deluxe, refactored monitor rules to support predetermined layouts per tag - -2019-09-15 - Added focusonclick, xrdb, viewontag, urgentborder and winview patches - -2019-09-14 - Added setborderpx, selfrestart and push (no master variant), sticky and warp patches - -2019-09-13 - Added titlecolor and push patches - -2019-09-12 - Added activetagindicatorbar, alwaysfullscreen and autoresize patches - -2019-09-11 - Added monitor rules, combo and ewmhtags patches - -2019-09-10 - Minor tweaks to awesomebar patch (incl. alpha and systray compatibility). Added floatbordercolor patch. - -2019-09-09 - Added deck, fibonacci (dwindle and spiral), gridmode, gapplessgrid, horizgrid, nrowgrid, centeredmaster and flextile layouts. Added alternativetags and awesomebar patches. - -2019-09-08 - Added cfacts and vanitygaps patches, added bstack and bstackhoriz layouts - -2019-09-07 - Added cyclelayouts, resizecorners, rotatestack, savefloats, statuspadding, switchtag, center and windowrolerule patches - -2019-09-06 - Added attachabove, attachaside, attachbelow, attachbottom, autostart, fancybar, focusonnetactive and losefullscreen patches - -2019-09-05 - Alpha, systray, togglefullscreen, tagallmon, tagmonfixfs, tagswapmon, pertag and zoomswap patches added - -### Patches included: - - - [activetagindicatorbar](https://dwm.suckless.org/patches/activetagindicatorbar/) - - this patch changes the rectangle indicating if a tag is used by a client into a bar above - the tag name - - - [alpha](https://dwm.suckless.org/patches/alpha/) - - adds transparency for the status bar - - - [alt-tab](https://dwm.suckless.org/patches/alt-tab/) - - adds a window task switcher toggled using alt-tab - - - [alternativetags](https://dwm.suckless.org/patches/alternativetags/) - - adds alternative tags which can be toggled on the fly for the sole purpose of providing - visual aid - - - [alttagsdecoration](https://dwm.suckless.org/patches/alttagsdecoration/) - - provides the ability to use alternative text for tags which contain at least one window - - - [alwayscenter](https://dwm.suckless.org/patches/alwayscenter/) - - makes all floating windows centered, like the center patch, but without a rule - - - [~alwaysfullscreen~](https://dwm.suckless.org/patches/alwaysfullscreen/) - - ~prevents the focus to drift from the active fullscreen client when using focusstack\(\)~ - - - [anybar](https://dwm.suckless.org/patches/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 - - - [aspectresize](https://dwm.suckless.org/patches/aspectresize/) - - allows windows to be resized with its aspect ratio remaining constant - - - [attachabove](https://dwm.suckless.org/patches/attachabove/) - - new windows are placed above selected client - - - [attachaside](https://dwm.suckless.org/patches/attachaside/) - - new windows are placed on top of the stack - - - [attachbelow](https://dwm.suckless.org/patches/attachbelow/) - - new windows are placed below selected client - - - [attachbottom](https://dwm.suckless.org/patches/attachbottom/) - - new windows are placed at the bottom of the stack - - - [autoresize](https://dwm.suckless.org/patches/autoresize/) - - by default, windows that are not visible when requesting a resize/move will not get - resized/moved, with this patch, however, they will - - - [autostart](https://dwm.suckless.org/patches/autostart/) - - makes dwm run `~/.dwm/autostart_blocking.sh` and `~/.dwm/autostart.sh &` on startup - - - [awesomebar](https://dwm.suckless.org/patches/awesomebar/) - - enhanced taskbar that allows focus / hiding / unhiding of windows by clicking on the status - bar - - - [bar_border](https://codemadness.org/paste/dwm-border-bar.patch) - - adds a border around the bar similarly to how client windows have borders - - - [bar_height](https://dwm.suckless.org/patches/bar_height/) - - allows the bar height to be explicitly set rather than being derived from font - - - [barmodules](https://github.com/bakkeby/patches/wiki/barmodules/) - - splits the dwm bar into modules allowing for re-arrangement of the bar and easier - integration for new features - - - [barpadding](https://dwm.suckless.org/patches/barpadding/) - - adds vertical and horizontal space between the statusbar and the edge of the screen - - - [bartabgroups](https://dwm.suckless.org/patches/bartabgroups/) - - turns the titlebar area into a mfact-respecting tab-bar showing each client's title - - - [bidi](https://dwm.suckless.org/patches/bidi/) - - adds proper support for Right-To-Left (RTL) languages (such as Farsi, Arabic or Hebrew) - - - [center](https://dwm.suckless.org/patches/center/) - - adds an iscentered rule to automatically center clients on the current monitor - - - [cfacts](https://dwm.suckless.org/patches/cfacts/) - - the cfacts patch provides the ability to assign different weights to clients in their - respective stack in tiled layout - - - [clientindicators](https://dwm.suckless.org/patches/clientindicators/) - - draws a dot indicator overlayed on each tag icon for each client - - the selected client is drawn as a larger horizontal line - - - [cmdcustomize](https://dwm.suckless.org/patches/cmdcustomize/) - - allows color attributes to be set through the command line - - - [colorbar](https://dwm.suckless.org/patches/colorbar/) - - 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~ - - - [combo](https://dwm.suckless.org/patches/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 - - - [cool_autostart](https://dwm.suckless.org/patches/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 - - - [cyclelayouts](https://dwm.suckless.org/patches/cyclelayouts/) - - lets you cycle through all your layouts - - - [decoration_hints](https://dwm.suckless.org/patches/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 - - - [distributetags](https://dwm.suckless.org/patches/reorganizetags/) - - this reorganisetags variant re-distributes all clients on the current monitor evenly across - all tags - - - [dmenumatchtop](https://dwm.suckless.org/patches/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 - - - [dragcfact](https://github.com/bakkeby/patches/wiki/dragcfact/) - - lets you resize clients' size (i.e. modify cfact) by holding modkey + shift + right-click - and dragging the mouse - - - [dragmfact](https://github.com/bakkeby/patches/wiki/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 - - - [dwmblocks](https://gist.github.com/danbyl/54f7c1d57fc6507242a95b71c3d8fdea) - - signal integration to use dwm with a patched [dwmblocks](https://github.com/torrinfail/dwmblocks) - - combined with the statuscmd patch this gives a clickable statusbar - - - [dwmc](http://dwm.suckless.org/patches/dwmc/) - - a simple dwmc client using a fork of fsignal to communicate with dwm - - - [emptyview](https://dwm.suckless.org/patches/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 - - - [ewmhtags](https://dwm.suckless.org/patches/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 - - - [exresize](https://dwm.suckless.org/patches/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 - - - [~extrabar~](https://dwm.suckless.org/patches/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~ - - - extrastatus - - formerly extrabar - now only splits the status into to statuses by using a status separator - - - [fakefullscreen](https://dwm.suckless.org/patches/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 - - - [fakefullscreenclient](https://github.com/bakkeby/patches/wiki/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 - - - [fancybar](https://dwm.suckless.org/patches/fancybar/) - - 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 - - - [~floatbordercolor~](https://dwm.suckless.org/patches/float_border_color/) - - ~this patch allows a different border color to be chosen for floating windows~ - - - [floatpos](https://github.com/bakkeby/patches/wiki/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 - - - [focusadjacenttag](https://dwm.suckless.org/patches/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 - - - [focusdir](https://github.com/bakkeby/patches/wiki/focusdir) - - allows focusing on clients based on direction (up, down, left, right) instead of client - order - - - [focusmaster](https://dwm.suckless.org/patches/focusmaster/) - - a simple patch that just puts focus back to the master client - - - [focusonclick](https://dwm.suckless.org/patches/focusonclick/) - - this patch makes you switch focus only by mouse click and not sloppy (focus follows mouse - pointer) - - - [focusonnetactive](https://dwm.suckless.org/patches/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 - - - [focusurgent](https://dwm.suckless.org/patches/focusurgent/) - - adds a keyboard shortcut to select the next window having the urgent flag regardless of the - tag it is on - - - [fsignal](https://dwm.suckless.org/patches/fsignal/) - - send "fake signals" to dwm for handling, using xsetroot - - this will not conflict with the status bar, which also is managed using xsetroot - - - [fullscreen](https://dwm.suckless.org/patches/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 - - - [hidevacanttags](https://dwm.suckless.org/patches/hide_vacant_tags/) - - prevents dwm from drawing tags with no clients (i.e. vacant) on the bar - - - [holdbar](http://dwm.suckless.org/patches/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 - - - [ignore-xft-errors-when-drawing-text](https://groups.google.com/forum/m/#!topic/wmii/7bncCahYIww) - - 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 - - - [inplacerotate](https://dwm.suckless.org/patches/inplacerotate/) - - allows rotation of all clients in the master or stack area without affecting the other area - - - [insets](https://dwm.suckless.org/patches/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 - - - [ipc](https://github.com/mihirlad55/dwm-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 - - - [\_IS\_FLOATING](https://github.com/bakkeby/dwm-flexipatch/issues/50) - - 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 - - - [ispermanent](https://dwm.suckless.org/patches/ispermanent/) - - adds rule option for clients to avoid accidental termination by killclient for sticky - windows - - - [keymodes](https://dwm.suckless.org/patches/keymodes/) - - 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~ - - - 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 - - - [losefullscreen](https://github.com/bakkeby/patches/wiki/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 - - - [maximize](https://dwm.suckless.org/patches/maximize/) - - adds helper functions for maximizing, horizontally and vertically, floating windows using - keybindings - - - [mpdcontrol](https://dwm.suckless.org/patches/mpdcontrol/) - - adds keyboard bindings to control MDP (Music Player Daemon) - - - [monitorrules](https://github.com/bakkeby/patches/wiki/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) - - - [monoclesymbol](https://dwm.suckless.org/patches/monoclesymbol/) - - always display the 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 - - - [moveresize](https://dwm.suckless.org/patches/moveresize/) - - allows you to move and resize dwm's clients using keyboard bindings - - - [movestack](https://dwm.suckless.org/patches/movestack/) - - allows you to move clients around in the stack and swap them with the master - - - [nametag](https://dwm.suckless.org/patches/nametag/) - - allows the names of tags to be changed during runtime - - - [netclientliststacking](https://github.com/bakkeby/patches/wiki/netclientliststacking) - - adds support for the \_NET\_CLIENT\_LIST\_STACKING atom, needed by certain applications - like the Zoom video conferencing application - - - [noborder](https://dwm.suckless.org/patches/noborder/) - - removes the border when there is only one window visible - - - [nodmenu](https://git.suckless.org/sites/commit/ed68e3629de4ef2ca2d3f8893a79fb570b4c0cbc.html) - - 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 - - - [no\_transparent\_borders](https://github.com/szatanjl/dwm/commit/1529909466206016f2101457bbf37c67195714c8) - - 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 - - - [on\_empty\_keys](https://github.com/bakkeby/dwm-flexipatch/issues/51) - - port of InstantVM'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 - - - [onlyquitonempty](https://dwm.suckless.org/patches/onlyquitonempty/) - - makes it so dwm will only exit via quit() if no windows are open (in order to prevent - accidental loss of work) - - - [pango](https://dwm.suckless.org/patches/pango/) - - adds simple markup for status messages using pango markup - - - [pertag](https://dwm.suckless.org/patches/pertag/) - - adds nmaster, mfact, layouts and more per tag rather than per monitor - - - [placemouse](https://github.com/bakkeby/patches/wiki/placemouse) - - lets the user change the position of a client in the stack using the mouse. - - - [powerline](https://gitlab.com/udiboy1209-suckless/dwm/-/commit/071f5063e8ac4280666828179f92788d893eea40#4b1a539194be7467cefbda22f675a3b7c19ceca7) - - adds drawing of powerline arrows (and diagonal lines) for both the status bar and the tags - - - [push](https://dwm.suckless.org/patches/push/) - - this patch provides a way to move clients up and down inside the client list - - - [renamed_scratchpads](https://github.com/bakkeby/patches/wiki/renamedscratchpads) - - variant of the [named scratchpads](https://dwm.suckless.org/patches/namedscratchpads/) patch - - - [reorganizetags](https://dwm.suckless.org/patches/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 - - - [resizecorners](https://dwm.suckless.org/patches/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 - - - [resizepoint](https://github.com/bakkeby/patches/wiki/resizepoint/) - - practically the same as resizecorners, but the cursor does not warp to any of the window - corners - - - [restartsig](https://dwm.suckless.org/patches/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 - - - [riodraw](https://github.com/bakkeby/patches/wiki/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 - - - [rotatestack](https://dwm.suckless.org/patches/rotatestack/) - - let's you rotate through the stack using keyboard shortcuts - - - [roundedcorners](https://github.com/mitchweaver/suckless/blob/master/dwm/patches/mitch-06-rounded_corners-f04cac6d6e39cd9e3fc4fae526e3d1e8df5e34b2.patch) - - adds rounded corners to client windows - - - [savefloats](https://dwm.suckless.org/patches/save_floats/) - - 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 - - - [scratchpad](https://dwm.suckless.org/patches/scratchpad/) - - the scratchpad patch allows you to spawn or restore a floating terminal window - - - [scratchpad\_alt\_1](https://github.com/GasparVardanyan/dwm-scratchpad) - - this alternative patch enables a scratchpad feature in dwm similar to the scratchpad - feature in i3wm - - - seamless\_restart - - allows for selected layout, assigned tags, etc. to be persisted across restarts - - - [selfrestart](https://dwm.suckless.org/patches/selfrestart/) - - restart dwm without the unnecessary dependency of an external script - - - [sendmon\_keepfocus](https://github.com/bakkeby/patches/wiki/sendmon_keepfocus/) - - minor patch that allow clients to keep focus when being sent to another monitor - - - [setborderpx](https://dwm.suckless.org/patches/setborderpx/) - - this patch allows border pixels to be changed during runtime - - - [shift-tools](https://dwm.suckless.org/patches/shift-tools/) - - a group of functions that shift clients or views left or right - - - [shiftview](https://github.com/chau-bao-long/dotfiles/blob/master/suckless/dwm/shiftview.diff) - - adds keybindings for left and right circular shift through tags - - also see focusadjacenttag - - - [shiftviewclients](https://github.com/bakkeby/patches/wiki/shiftviewclients/) - - variant of the shiftview patch which skips tags that have no clients - - - [sizehints](https://dwm.suckless.org/patches/sizehints/) - - makes dwm obey even "soft" sizehints for new clients - - - [sortscreens](https://www.mail-archive.com/hackers@suckless.org/msg09400.html) - - 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) - - - [spawn\_cwd](https://dwm.suckless.org/patches/spawn_cwd/) - - spawns programs from currently focused client's working directory - - - [stacker](https://dwm.suckless.org/patches/stacker/) - - provides comprehensive utilities for managing the client stack - - - [staticstatus](https://dwm.suckless.org/patches/staticstatus/) - - allows the status text to be fixed to the bar on a specific monitor rather than being - drawn on the focused monitor - - - [status2d](https://dwm.suckless.org/patches/status2d/) - - allows colors and rectangle drawing in the dwm status bar - - - [statusallmons](https://dwm.suckless.org/patches/statuspadding/) - - this patch draws and updates the statusbar on all monitors - - - [statusbutton](https://dwm.suckless.org/patches/statusbutton/) - - adds a clickable button to the left hand side of the statusbar - - - [statuscmd](https://dwm.suckless.org/patches/statuscmd/) - - adds the ability to execute shell commands based on the mouse button and position when - clicking the status bar - - - [statuscolors](https://dwm.suckless.org/patches/statuscolors/) - - enables colored text in the status bar allowing multiple color combinations for use in the - status script - - - [statuspadding](https://dwm.suckless.org/patches/statuspadding/) - - adds configuration options for horizontal and vertical padding in the status bar - - - [steam](https://github.com/bakkeby/patches/wiki/steam) - - a minor patch that works around the issue of floating Steam windows jumping around the - screen when they receive focus - - - [sticky](https://dwm.suckless.org/patches/sticky/) - - adds toggleable keyboard shortcut to make a client 'sticky', i.e. visible on all tags - - - [swallow](https://dwm.suckless.org/patches/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 - - - [swapfocus](https://dwm.suckless.org/patches/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 - - - [swaptags](https://dwm.suckless.org/patches/swaptags/) - - allows swapping the contents of the currently selected tag with another tag by using - keyboard shortcuts - - - [switchcol](https://dwm.suckless.org/patches/switchcol/) - - allows you to switch focus between the master and stack columns using a single keybinding - - - [switchtag](https://github.com/bakkeby/patches/wiki/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 - - - [systray](https://dwm.suckless.org/patches/systray/) - - adds system tray in the status bar - - - [tab](https://dwm.suckless.org/patches/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 - - - [tagall](https://dwm.suckless.org/patches/tagall/) - - adds keyboard shortcuts to move all (or only floating) windows from one tag to another - - - [tagallmon](https://github.com/bakkeby/patches/wiki/tagallmon/) - - move all visible windows to an adjacent monitor - - - [tagintostack](https://dwm.suckless.org/patches/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 - - - [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 - - - [tagothermonitor](https://dwm.suckless.org/patches/tagothermonitor/) - - adds functions and keybindings to tag a window to a desired tag on an adjacent monitor - - - [tagpreview](https://dwm.suckless.org/patches/tag-previews/) - - shows a preview of a tag when hovering the tag icon using the mouse - - - [tagswapmon](https://github.com/bakkeby/patches/wiki/tagswapmon/) - - swap all visible windows on one monitor with those of an adjacent monitor - - - [tapresize](https://dwm.suckless.org/patches/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 - - - [~titlecolor~](https://dwm.suckless.org/patches/titlecolor/) - - ~adds a new color scheme used by the (selected) window title in the bar~ - - - [togglefullscreen](https://github.com/bakkeby/patches/wiki/togglefullscreen/) - - allows you to toggle fullscreen on and off using a single shortcut key - - - [toggletag](https://github.com/bakkeby/patches/wiki/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 - - - [togglelayout](https://github.com/bakkeby/patches/wiki/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 - - - [transfer](https://dwm.suckless.org/patches/transfer/) - - lets you transfer the currently focused client between the master and stack area while - increasing or decreasing the master area (nmaster) accordingly - - - [transferall](https://dwm.suckless.org/patches/transfer/) - - 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 - - - [~urgentborder~](https://dwm.suckless.org/patches/urgentborder/) - - ~this patch makes "urgent" windows have different colors~ - - - [vanitygaps](https://github.com/bakkeby/patches/blob/master/dwm/dwm-vanitygaps-6.2.diff) - - adds configurable gaps between windows differentiating between outer, inner, horizontal and - vertical gaps - - - viewhistory - - adds a tag change history that is longer than the default current and previous tag - - `MOD`+Tab (`view(0)`) can be pressed multiple times to go further back to earlier tag - selections - - - [viewontag](https://dwm.suckless.org/patches/viewontag/) - - follow a window to the tag it is being moved to - - - [vtcolor](https://dwm.suckless.org/patches/vtcolors/) - - 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 - - - [warp](https://dwm.suckless.org/patches/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 - - - [winicon](https://dwm.suckless.org/patches/winicon/) - - adds the window icon next to the window title in the bar - - - [windowrolerule](https://github.com/bakkeby/patches/wiki/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". - - - [winview](http://dwm.suckless.org/patches/winview/) - - allows switching the view to that of a given client from the all-window view (Mod-0) using - a keyboard shortcut - - - [xkb](https://dwm.suckless.org/patches/xkb/) - - remembers keyboard layout per client - - - [xrdb](http://dwm.suckless.org/patches/xrdb/) - - allows dwm to read colors from xrdb (.Xresources) during runtime - - - [zoomfloating](https://www.reddit.com/r/suckless/comments/ie5fe3/zoomfloating_my_own_simple_original_patch/) - - a simple patch that allows floating windows to be zoomed into the master stack position - - - [zoomswap](https://dwm.suckless.org/patches/zoomswap/) - - allows a master and a stack window to swap places rather than every window on the screen - changing position - -### Layouts included: - - - [bstack](https://dwm.suckless.org/patches/bottomstack/) - - bottomstack layout - - - [bstackhoriz](https://dwm.suckless.org/patches/bottomstack/) - - bottomstack horizontal layout - - - [centeredmaster](https://dwm.suckless.org/patches/centeredmaster/) - - centeredmaster layout - - - [centeredfloatingmaster](https://dwm.suckless.org/patches/centeredmaster/) - - centeredfloatingmaster layout - - - [columns](https://dwm.suckless.org/patches/columns/) - - same as the default tile layout except clients in the master area are arranged in columns - (i.e. left to right) - - - [deck](https://dwm.suckless.org/patches/deck/) - - deck layout - clients in the stack area are arranged on top of each other (like monocle) - - - [fibonacci](https://dwm.suckless.org/patches/fibonacci/) - - fibonacci (dwindle and spiral) layouts - - - [flextile-deluxe](https://github.com/bakkeby/patches/wiki/flextile-deluxe/) - - a re-envisioned, flexible and over-the-top version of the original - [flextile](https://dwm.suckless.org/patches/flextile/) patch supporting - - multiple split layouts (horizontal, vertical, centered, floating, fixed) - - tile arrangement on a per split basis (stack horizontally, stack vertically, grids, - fibonacci) - - pertag, cfacts, rmaster, vanitygaps compatibility - - tile, deck, monocle, centeredmaster, bstack, bstackhoriz, gapplessgrid and more - - this gives you a lot of versatility in terms of layout - - - [gapplessgrid](https://dwm.suckless.org/patches/gaplessgrid/) - - gappless grid layout - - - [gridmode](https://dwm.suckless.org/patches/gridmode/) - - gridmode (grid) layout - - - [horizgrid](https://dwm.suckless.org/patches/horizgrid/) - - horizontal grid layout - - - [nrowgrid](https://dwm.suckless.org/patches/nrowgrid/) - - nrowgrid layout, number of rows in grid controlled by nmaster diff --git a/dwm/.dwm.old/bar.sh b/dwm/.dwm.old/bar.sh deleted file mode 100755 index 18b6501..0000000 --- a/dwm/.dwm.old/bar.sh +++ /dev/null @@ -1,121 +0,0 @@ -#!/bin/bash - -# ^c$var^ = fg color -# ^b$var^ = bg color - -interval=0 - -# load colors -# . ~/.config/bar_themes/onedark - -# colors - -rosewater=#f4dbd6 -flamingo=#f0c6c6 -pink=#f5bde6 -mauve=#c6a0f6 -red=#ed8796 -maroon=#ee99a0 -peach=#f5a97f -yellow=#eed49f -green=#a6da95 -teal=#8bd5ca -sky=#91d7e3 -sapphire=#7dc4e4 -blue=#8aadf4 -lavender=#b7bdf8 -text=#cad3f5 -subtext1=#b8c0e0 -subtext0=#a5adcb -overlay2=#939ab7 -overlay1=#8087a2 -overlay0=#6e738d -surface2=#5b6078 -surface1=#494d64 -surface0=#363a4f -base=#24273a -mantle=#1e2030 -crust=#181926 - -pulse () { - VOL=$(pamixer --get-volume) - STATE=$(pamixer --get-mute) - - printf "%s" "$SEP1" - if [ "$STATE" = "true" ] || [ "$VOL" -eq 0 ]; then - printf "AMUT%%" - elif [ "$VOL" -gt 0 ] && [ "$VOL" -le 33 ]; then - printf "A%s%%" "$VOL" - elif [ "$VOL" -gt 33 ] && [ "$VOL" -le 66 ]; then - printf "A%s%%" "$VOL" - else - printf "A%s%%" "$VOL" - fi - printf "%s\n" "$SEP2" -} - -cpu() { - cpu_val=$(grep -o "^[^ ]*" /proc/loadavg) - - printf "^c$crust^ ^b$yellow^ 󰇄 " - printf "^c$crust^ ^b$yellow^$cpu_val" -} - -battery() { - capacity_0="$(cat /sys/class/power_supply/BAT0/capacity)" - capacity_1="$(cat /sys/class/power_supply/BAT1/capacity)" - - capacity="$capacity_0+$capacity_1" - # capacity=$(((capacity_0 + capacity_1) / 2)) - - printf " B$capacity%% " -} - -brightness() { - value=$(cat /sys/class/backlight/*/brightness) - percentage=$(echo "scale=2; $value / 8.54" | bc) - printf "L%.0f%%" "$percentage" -} - -mem() { - printf "^c$crust^^b$green^  " - printf "^c$crust^^b$green^ $(free -h | awk '/^Mem/ { print $3 }' | sed s/i//g)" -} - -wlan() { - case "$(cat /sys/class/net/wl*/operstate 2>/dev/null)" in - up) printf "^c$crust^ ^b$blue^ 󰤨 ^c$crust^ ^b$blue^Connected" ;; - down) printf "^c$crust^ ^b$blue^ 󰤭 ^c$crust^ ^b$blue^Disconnected" ;; - esac -} - -clock() { - printf " $(date '+%I:%M %P') " -} - -today() { - printf " $(date '+%b %e') " -} - -net() { - if nc -zw1 google.com 443; then - printf "^c$crust^^b$green^ i " - else - printf "^c$crust^^b$red^ ! " - fi -} - -while true; do - - # [ $interval = 0 ] || [ $(($interval % 3600)) = 0 ] && updates=$(pkg_updates) - # interval=$((interval + 1)) - - # sleep 1 && xsetroot -name "$updates $(battery) $(brightness) $(cpu) $(mem) $(wlan) $(clock)" - # sleep 1 && xsetroot -name "$(battery) $(brightness) $(cpu) $(mem) $(wlan) $(clock)" - if hash dockd 2>/dev/null; then - sleep 1 && xsetroot -name "^c$text^^b$surface0^ $(brightness) ^b$base^ $(battery) $(net)^c$text^^b$base^ $(today) ^b$surface0^ $(clock) ^b$surface1^ $(pulse) " - else - sleep 1 && xsetroot -name "^c$text^$(net)^c$text^^b$base^ $(today) ^b$surface0^ $(clock) ^b$surface1^ $(pulse) " - fi - -done diff --git a/dwm/.dwm.old/bar/CONTRIBUTING.md b/dwm/.dwm.old/bar/CONTRIBUTING.md deleted file mode 100644 index addab74..0000000 --- a/dwm/.dwm.old/bar/CONTRIBUTING.md +++ /dev/null @@ -1,28 +0,0 @@ -# Contributing to dwm-bar -One goal of this project is to support as many (reasonable) plugins as possible which the user can enable or disable depending on their needs. This means that new plugins will almost always be a welcome addition. -To ensure that dwm-bar stays compatible, uniform, and efficient there are a few guidelines that should be followed. - -The most important part of this project is to have fun using shell scripts. I created this project to learn, and learning only happens when mistakes are made, so don't worry too much. -## Making/editing a plugin -* Ensure that plugins are POSIX compliant (use ```#!/bin/sh``` instead of ```#!/bin/bash``` etc.). A good way to check this is by using [ShellCheck](https://www.shellcheck.net/) on your script and amending compatibility errors. -* Display plugin output in the terminal. This is easily done by wiriting the plugin in a function and calling the function at the end of the script. This helps with debugging and spotting errors. -* Include a dependencies section at the top of the script (```Dependencies: example1, example2```). -## Editing dwm_bar.sh -* Do not remove functions from the main script. -## Editing README.md -* When adding a plugin to README.md, follow this template: -``` - ### plugin_name - Description of the plugin - ``` - [❗ Plugin output on bar] - ``` - Dependencies: example1, example2 -``` -* Ensure additons are added to the table of contents: -``` -- [Current Functions])(#current-functions) - -[plugin_name](#plugin_name) -``` -## Edditing Dependency Listings -* When adding a plugin, please add your dependencies to the dependency listing file in dep folder. diff --git a/dwm/.dwm.old/bar/LICENSE b/dwm/.dwm.old/bar/LICENSE deleted file mode 100644 index f288702..0000000 --- a/dwm/.dwm.old/bar/LICENSE +++ /dev/null @@ -1,674 +0,0 @@ - GNU GENERAL PUBLIC LICENSE - Version 3, 29 June 2007 - - Copyright (C) 2007 Free Software Foundation, Inc. - Everyone is permitted to copy and distribute verbatim copies - of this license document, but changing it is not allowed. - - Preamble - - The GNU General Public License is a free, copyleft license for -software and other kinds of works. - - The licenses for most software and other practical works are designed -to take away your freedom to share and change the works. By contrast, -the GNU General Public License is intended to guarantee your freedom to -share and change all versions of a program--to make sure it remains free -software for all its users. We, the Free Software Foundation, use the -GNU General Public License for most of our software; it applies also to -any other work released this way by its authors. You can apply it to -your programs, too. - - When we speak of free software, we are referring to freedom, not -price. Our General Public Licenses are designed to make sure that you -have the freedom to distribute copies of free software (and charge for -them if you wish), that you receive source code or can get it if you -want it, that you can change the software or use pieces of it in new -free programs, and that you know you can do these things. - - To protect your rights, we need to prevent others from denying you -these rights or asking you to surrender the rights. Therefore, you have -certain responsibilities if you distribute copies of the software, or if -you modify it: responsibilities to respect the freedom of others. - - For example, if you distribute copies of such a program, whether -gratis or for a fee, you must pass on to the recipients the same -freedoms that you received. You must make sure that they, too, receive -or can get the source code. And you must show them these terms so they -know their rights. - - Developers that use the GNU GPL protect your rights with two steps: -(1) assert copyright on the software, and (2) offer you this License -giving you legal permission to copy, distribute and/or modify it. - - For the developers' and authors' protection, the GPL clearly explains -that there is no warranty for this free software. For both users' and -authors' sake, the GPL requires that modified versions be marked as -changed, so that their problems will not be attributed erroneously to -authors of previous versions. - - Some devices are designed to deny users access to install or run -modified versions of the software inside them, although the manufacturer -can do so. This is fundamentally incompatible with the aim of -protecting users' freedom to change the software. The systematic -pattern of such abuse occurs in the area of products for individuals to -use, which is precisely where it is most unacceptable. Therefore, we -have designed this version of the GPL to prohibit the practice for those -products. If such problems arise substantially in other domains, we -stand ready to extend this provision to those domains in future versions -of the GPL, as needed to protect the freedom of users. - - Finally, every program is threatened constantly by software patents. -States should not allow patents to restrict development and use of -software on general-purpose computers, but in those that do, we wish to -avoid the special danger that patents applied to a free program could -make it effectively proprietary. To prevent this, the GPL assures that -patents cannot be used to render the program non-free. - - The precise terms and conditions for copying, distribution and -modification follow. - - TERMS AND CONDITIONS - - 0. Definitions. - - "This License" refers to version 3 of the GNU General Public License. - - "Copyright" also means copyright-like laws that apply to other kinds of -works, such as semiconductor masks. - - "The Program" refers to any copyrightable work licensed under this -License. Each licensee is addressed as "you". "Licensees" and -"recipients" may be individuals or organizations. - - To "modify" a work means to copy from or adapt all or part of the work -in a fashion requiring copyright permission, other than the making of an -exact copy. The resulting work is called a "modified version" of the -earlier work or a work "based on" the earlier work. - - A "covered work" means either the unmodified Program or a work based -on the Program. - - To "propagate" a work means to do anything with it that, without -permission, would make you directly or secondarily liable for -infringement under applicable copyright law, except executing it on a -computer or modifying a private copy. Propagation includes copying, -distribution (with or without modification), making available to the -public, and in some countries other activities as well. - - To "convey" a work means any kind of propagation that enables other -parties to make or receive copies. Mere interaction with a user through -a computer network, with no transfer of a copy, is not conveying. - - An interactive user interface displays "Appropriate Legal Notices" -to the extent that it includes a convenient and prominently visible -feature that (1) displays an appropriate copyright notice, and (2) -tells the user that there is no warranty for the work (except to the -extent that warranties are provided), that licensees may convey the -work under this License, and how to view a copy of this License. If -the interface presents a list of user commands or options, such as a -menu, a prominent item in the list meets this criterion. - - 1. Source Code. - - The "source code" for a work means the preferred form of the work -for making modifications to it. "Object code" means any non-source -form of a work. - - A "Standard Interface" means an interface that either is an official -standard defined by a recognized standards body, or, in the case of -interfaces specified for a particular programming language, one that -is widely used among developers working in that language. - - The "System Libraries" of an executable work include anything, other -than the work as a whole, that (a) is included in the normal form of -packaging a Major Component, but which is not part of that Major -Component, and (b) serves only to enable use of the work with that -Major Component, or to implement a Standard Interface for which an -implementation is available to the public in source code form. A -"Major Component", in this context, means a major essential component -(kernel, window system, and so on) of the specific operating system -(if any) on which the executable work runs, or a compiler used to -produce the work, or an object code interpreter used to run it. - - The "Corresponding Source" for a work in object code form means all -the source code needed to generate, install, and (for an executable -work) run the object code and to modify the work, including scripts to -control those activities. However, it does not include the work's -System Libraries, or general-purpose tools or generally available free -programs which are used unmodified in performing those activities but -which are not part of the work. For example, Corresponding Source -includes interface definition files associated with source files for -the work, and the source code for shared libraries and dynamically -linked subprograms that the work is specifically designed to require, -such as by intimate data communication or control flow between those -subprograms and other parts of the work. - - The Corresponding Source need not include anything that users -can regenerate automatically from other parts of the Corresponding -Source. - - The Corresponding Source for a work in source code form is that -same work. - - 2. Basic Permissions. - - All rights granted under this License are granted for the term of -copyright on the Program, and are irrevocable provided the stated -conditions are met. This License explicitly affirms your unlimited -permission to run the unmodified Program. The output from running a -covered work is covered by this License only if the output, given its -content, constitutes a covered work. This License acknowledges your -rights of fair use or other equivalent, as provided by copyright law. - - You may make, run and propagate covered works that you do not -convey, without conditions so long as your license otherwise remains -in force. You may convey covered works to others for the sole purpose -of having them make modifications exclusively for you, or provide you -with facilities for running those works, provided that you comply with -the terms of this License in conveying all material for which you do -not control copyright. Those thus making or running the covered works -for you must do so exclusively on your behalf, under your direction -and control, on terms that prohibit them from making any copies of -your copyrighted material outside their relationship with you. - - Conveying under any other circumstances is permitted solely under -the conditions stated below. Sublicensing is not allowed; section 10 -makes it unnecessary. - - 3. Protecting Users' Legal Rights From Anti-Circumvention Law. - - No covered work shall be deemed part of an effective technological -measure under any applicable law fulfilling obligations under article -11 of the WIPO copyright treaty adopted on 20 December 1996, or -similar laws prohibiting or restricting circumvention of such -measures. - - When you convey a covered work, you waive any legal power to forbid -circumvention of technological measures to the extent such circumvention -is effected by exercising rights under this License with respect to -the covered work, and you disclaim any intention to limit operation or -modification of the work as a means of enforcing, against the work's -users, your or third parties' legal rights to forbid circumvention of -technological measures. - - 4. Conveying Verbatim Copies. - - You may convey verbatim copies of the Program's source code as you -receive it, in any medium, provided that you conspicuously and -appropriately publish on each copy an appropriate copyright notice; -keep intact all notices stating that this License and any -non-permissive terms added in accord with section 7 apply to the code; -keep intact all notices of the absence of any warranty; and give all -recipients a copy of this License along with the Program. - - You may charge any price or no price for each copy that you convey, -and you may offer support or warranty protection for a fee. - - 5. Conveying Modified Source Versions. - - You may convey a work based on the Program, or the modifications to -produce it from the Program, in the form of source code under the -terms of section 4, provided that you also meet all of these conditions: - - a) The work must carry prominent notices stating that you modified - it, and giving a relevant date. - - b) The work must carry prominent notices stating that it is - released under this License and any conditions added under section - 7. This requirement modifies the requirement in section 4 to - "keep intact all notices". - - c) You must license the entire work, as a whole, under this - License to anyone who comes into possession of a copy. This - License will therefore apply, along with any applicable section 7 - additional terms, to the whole of the work, and all its parts, - regardless of how they are packaged. This License gives no - permission to license the work in any other way, but it does not - invalidate such permission if you have separately received it. - - d) If the work has interactive user interfaces, each must display - Appropriate Legal Notices; however, if the Program has interactive - interfaces that do not display Appropriate Legal Notices, your - work need not make them do so. - - A compilation of a covered work with other separate and independent -works, which are not by their nature extensions of the covered work, -and which are not combined with it such as to form a larger program, -in or on a volume of a storage or distribution medium, is called an -"aggregate" if the compilation and its resulting copyright are not -used to limit the access or legal rights of the compilation's users -beyond what the individual works permit. Inclusion of a covered work -in an aggregate does not cause this License to apply to the other -parts of the aggregate. - - 6. Conveying Non-Source Forms. - - You may convey a covered work in object code form under the terms -of sections 4 and 5, provided that you also convey the -machine-readable Corresponding Source under the terms of this License, -in one of these ways: - - a) Convey the object code in, or embodied in, a physical product - (including a physical distribution medium), accompanied by the - Corresponding Source fixed on a durable physical medium - customarily used for software interchange. - - b) Convey the object code in, or embodied in, a physical product - (including a physical distribution medium), accompanied by a - written offer, valid for at least three years and valid for as - long as you offer spare parts or customer support for that product - model, to give anyone who possesses the object code either (1) a - copy of the Corresponding Source for all the software in the - product that is covered by this License, on a durable physical - medium customarily used for software interchange, for a price no - more than your reasonable cost of physically performing this - conveying of source, or (2) access to copy the - Corresponding Source from a network server at no charge. - - c) Convey individual copies of the object code with a copy of the - written offer to provide the Corresponding Source. This - alternative is allowed only occasionally and noncommercially, and - only if you received the object code with such an offer, in accord - with subsection 6b. - - d) Convey the object code by offering access from a designated - place (gratis or for a charge), and offer equivalent access to the - Corresponding Source in the same way through the same place at no - further charge. You need not require recipients to copy the - Corresponding Source along with the object code. If the place to - copy the object code is a network server, the Corresponding Source - may be on a different server (operated by you or a third party) - that supports equivalent copying facilities, provided you maintain - clear directions next to the object code saying where to find the - Corresponding Source. Regardless of what server hosts the - Corresponding Source, you remain obligated to ensure that it is - available for as long as needed to satisfy these requirements. - - e) Convey the object code using peer-to-peer transmission, provided - you inform other peers where the object code and Corresponding - Source of the work are being offered to the general public at no - charge under subsection 6d. - - A separable portion of the object code, whose source code is excluded -from the Corresponding Source as a System Library, need not be -included in conveying the object code work. - - A "User Product" is either (1) a "consumer product", which means any -tangible personal property which is normally used for personal, family, -or household purposes, or (2) anything designed or sold for incorporation -into a dwelling. In determining whether a product is a consumer product, -doubtful cases shall be resolved in favor of coverage. For a particular -product received by a particular user, "normally used" refers to a -typical or common use of that class of product, regardless of the status -of the particular user or of the way in which the particular user -actually uses, or expects or is expected to use, the product. A product -is a consumer product regardless of whether the product has substantial -commercial, industrial or non-consumer uses, unless such uses represent -the only significant mode of use of the product. - - "Installation Information" for a User Product means any methods, -procedures, authorization keys, or other information required to install -and execute modified versions of a covered work in that User Product from -a modified version of its Corresponding Source. The information must -suffice to ensure that the continued functioning of the modified object -code is in no case prevented or interfered with solely because -modification has been made. - - If you convey an object code work under this section in, or with, or -specifically for use in, a User Product, and the conveying occurs as -part of a transaction in which the right of possession and use of the -User Product is transferred to the recipient in perpetuity or for a -fixed term (regardless of how the transaction is characterized), the -Corresponding Source conveyed under this section must be accompanied -by the Installation Information. But this requirement does not apply -if neither you nor any third party retains the ability to install -modified object code on the User Product (for example, the work has -been installed in ROM). - - The requirement to provide Installation Information does not include a -requirement to continue to provide support service, warranty, or updates -for a work that has been modified or installed by the recipient, or for -the User Product in which it has been modified or installed. Access to a -network may be denied when the modification itself materially and -adversely affects the operation of the network or violates the rules and -protocols for communication across the network. - - Corresponding Source conveyed, and Installation Information provided, -in accord with this section must be in a format that is publicly -documented (and with an implementation available to the public in -source code form), and must require no special password or key for -unpacking, reading or copying. - - 7. Additional Terms. - - "Additional permissions" are terms that supplement the terms of this -License by making exceptions from one or more of its conditions. -Additional permissions that are applicable to the entire Program shall -be treated as though they were included in this License, to the extent -that they are valid under applicable law. If additional permissions -apply only to part of the Program, that part may be used separately -under those permissions, but the entire Program remains governed by -this License without regard to the additional permissions. - - When you convey a copy of a covered work, you may at your option -remove any additional permissions from that copy, or from any part of -it. (Additional permissions may be written to require their own -removal in certain cases when you modify the work.) You may place -additional permissions on material, added by you to a covered work, -for which you have or can give appropriate copyright permission. - - Notwithstanding any other provision of this License, for material you -add to a covered work, you may (if authorized by the copyright holders of -that material) supplement the terms of this License with terms: - - a) Disclaiming warranty or limiting liability differently from the - terms of sections 15 and 16 of this License; or - - b) Requiring preservation of specified reasonable legal notices or - author attributions in that material or in the Appropriate Legal - Notices displayed by works containing it; or - - c) Prohibiting misrepresentation of the origin of that material, or - requiring that modified versions of such material be marked in - reasonable ways as different from the original version; or - - d) Limiting the use for publicity purposes of names of licensors or - authors of the material; or - - e) Declining to grant rights under trademark law for use of some - trade names, trademarks, or service marks; or - - f) Requiring indemnification of licensors and authors of that - material by anyone who conveys the material (or modified versions of - it) with contractual assumptions of liability to the recipient, for - any liability that these contractual assumptions directly impose on - those licensors and authors. - - All other non-permissive additional terms are considered "further -restrictions" within the meaning of section 10. If the Program as you -received it, or any part of it, contains a notice stating that it is -governed by this License along with a term that is a further -restriction, you may remove that term. If a license document contains -a further restriction but permits relicensing or conveying under this -License, you may add to a covered work material governed by the terms -of that license document, provided that the further restriction does -not survive such relicensing or conveying. - - If you add terms to a covered work in accord with this section, you -must place, in the relevant source files, a statement of the -additional terms that apply to those files, or a notice indicating -where to find the applicable terms. - - Additional terms, permissive or non-permissive, may be stated in the -form of a separately written license, or stated as exceptions; -the above requirements apply either way. - - 8. Termination. - - You may not propagate or modify a covered work except as expressly -provided under this License. Any attempt otherwise to propagate or -modify it is void, and will automatically terminate your rights under -this License (including any patent licenses granted under the third -paragraph of section 11). - - However, if you cease all violation of this License, then your -license from a particular copyright holder is reinstated (a) -provisionally, unless and until the copyright holder explicitly and -finally terminates your license, and (b) permanently, if the copyright -holder fails to notify you of the violation by some reasonable means -prior to 60 days after the cessation. - - Moreover, your license from a particular copyright holder is -reinstated permanently if the copyright holder notifies you of the -violation by some reasonable means, this is the first time you have -received notice of violation of this License (for any work) from that -copyright holder, and you cure the violation prior to 30 days after -your receipt of the notice. - - Termination of your rights under this section does not terminate the -licenses of parties who have received copies or rights from you under -this License. If your rights have been terminated and not permanently -reinstated, you do not qualify to receive new licenses for the same -material under section 10. - - 9. Acceptance Not Required for Having Copies. - - You are not required to accept this License in order to receive or -run a copy of the Program. Ancillary propagation of a covered work -occurring solely as a consequence of using peer-to-peer transmission -to receive a copy likewise does not require acceptance. However, -nothing other than this License grants you permission to propagate or -modify any covered work. These actions infringe copyright if you do -not accept this License. Therefore, by modifying or propagating a -covered work, you indicate your acceptance of this License to do so. - - 10. Automatic Licensing of Downstream Recipients. - - Each time you convey a covered work, the recipient automatically -receives a license from the original licensors, to run, modify and -propagate that work, subject to this License. You are not responsible -for enforcing compliance by third parties with this License. - - An "entity transaction" is a transaction transferring control of an -organization, or substantially all assets of one, or subdividing an -organization, or merging organizations. If propagation of a covered -work results from an entity transaction, each party to that -transaction who receives a copy of the work also receives whatever -licenses to the work the party's predecessor in interest had or could -give under the previous paragraph, plus a right to possession of the -Corresponding Source of the work from the predecessor in interest, if -the predecessor has it or can get it with reasonable efforts. - - You may not impose any further restrictions on the exercise of the -rights granted or affirmed under this License. For example, you may -not impose a license fee, royalty, or other charge for exercise of -rights granted under this License, and you may not initiate litigation -(including a cross-claim or counterclaim in a lawsuit) alleging that -any patent claim is infringed by making, using, selling, offering for -sale, or importing the Program or any portion of it. - - 11. Patents. - - A "contributor" is a copyright holder who authorizes use under this -License of the Program or a work on which the Program is based. The -work thus licensed is called the contributor's "contributor version". - - A contributor's "essential patent claims" are all patent claims -owned or controlled by the contributor, whether already acquired or -hereafter acquired, that would be infringed by some manner, permitted -by this License, of making, using, or selling its contributor version, -but do not include claims that would be infringed only as a -consequence of further modification of the contributor version. For -purposes of this definition, "control" includes the right to grant -patent sublicenses in a manner consistent with the requirements of -this License. - - Each contributor grants you a non-exclusive, worldwide, royalty-free -patent license under the contributor's essential patent claims, to -make, use, sell, offer for sale, import and otherwise run, modify and -propagate the contents of its contributor version. - - In the following three paragraphs, a "patent license" is any express -agreement or commitment, however denominated, not to enforce a patent -(such as an express permission to practice a patent or covenant not to -sue for patent infringement). To "grant" such a patent license to a -party means to make such an agreement or commitment not to enforce a -patent against the party. - - If you convey a covered work, knowingly relying on a patent license, -and the Corresponding Source of the work is not available for anyone -to copy, free of charge and under the terms of this License, through a -publicly available network server or other readily accessible means, -then you must either (1) cause the Corresponding Source to be so -available, or (2) arrange to deprive yourself of the benefit of the -patent license for this particular work, or (3) arrange, in a manner -consistent with the requirements of this License, to extend the patent -license to downstream recipients. "Knowingly relying" means you have -actual knowledge that, but for the patent license, your conveying the -covered work in a country, or your recipient's use of the covered work -in a country, would infringe one or more identifiable patents in that -country that you have reason to believe are valid. - - If, pursuant to or in connection with a single transaction or -arrangement, you convey, or propagate by procuring conveyance of, a -covered work, and grant a patent license to some of the parties -receiving the covered work authorizing them to use, propagate, modify -or convey a specific copy of the covered work, then the patent license -you grant is automatically extended to all recipients of the covered -work and works based on it. - - A patent license is "discriminatory" if it does not include within -the scope of its coverage, prohibits the exercise of, or is -conditioned on the non-exercise of one or more of the rights that are -specifically granted under this License. You may not convey a covered -work if you are a party to an arrangement with a third party that is -in the business of distributing software, under which you make payment -to the third party based on the extent of your activity of conveying -the work, and under which the third party grants, to any of the -parties who would receive the covered work from you, a discriminatory -patent license (a) in connection with copies of the covered work -conveyed by you (or copies made from those copies), or (b) primarily -for and in connection with specific products or compilations that -contain the covered work, unless you entered into that arrangement, -or that patent license was granted, prior to 28 March 2007. - - Nothing in this License shall be construed as excluding or limiting -any implied license or other defenses to infringement that may -otherwise be available to you under applicable patent law. - - 12. No Surrender of Others' Freedom. - - If conditions are imposed on you (whether by court order, agreement or -otherwise) that contradict the conditions of this License, they do not -excuse you from the conditions of this License. If you cannot convey a -covered work so as to satisfy simultaneously your obligations under this -License and any other pertinent obligations, then as a consequence you may -not convey it at all. For example, if you agree to terms that obligate you -to collect a royalty for further conveying from those to whom you convey -the Program, the only way you could satisfy both those terms and this -License would be to refrain entirely from conveying the Program. - - 13. Use with the GNU Affero General Public License. - - Notwithstanding any other provision of this License, you have -permission to link or combine any covered work with a work licensed -under version 3 of the GNU Affero General Public License into a single -combined work, and to convey the resulting work. The terms of this -License will continue to apply to the part which is the covered work, -but the special requirements of the GNU Affero General Public License, -section 13, concerning interaction through a network will apply to the -combination as such. - - 14. Revised Versions of this License. - - The Free Software Foundation may publish revised and/or new versions of -the GNU General Public License from time to time. Such new versions will -be similar in spirit to the present version, but may differ in detail to -address new problems or concerns. - - Each version is given a distinguishing version number. If the -Program specifies that a certain numbered version of the GNU General -Public License "or any later version" applies to it, you have the -option of following the terms and conditions either of that numbered -version or of any later version published by the Free Software -Foundation. If the Program does not specify a version number of the -GNU General Public License, you may choose any version ever published -by the Free Software Foundation. - - If the Program specifies that a proxy can decide which future -versions of the GNU General Public License can be used, that proxy's -public statement of acceptance of a version permanently authorizes you -to choose that version for the Program. - - Later license versions may give you additional or different -permissions. However, no additional obligations are imposed on any -author or copyright holder as a result of your choosing to follow a -later version. - - 15. Disclaimer of Warranty. - - THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY -APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT -HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY -OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, -THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR -PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM -IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF -ALL NECESSARY SERVICING, REPAIR OR CORRECTION. - - 16. Limitation of Liability. - - IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING -WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MODIFIES AND/OR CONVEYS -THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY -GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE -USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF -DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD -PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS), -EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF -SUCH DAMAGES. - - 17. Interpretation of Sections 15 and 16. - - If the disclaimer of warranty and limitation of liability provided -above cannot be given local legal effect according to their terms, -reviewing courts shall apply local law that most closely approximates -an absolute waiver of all civil liability in connection with the -Program, unless a warranty or assumption of liability accompanies a -copy of the Program in return for a fee. - - END OF TERMS AND CONDITIONS - - How to Apply These Terms to Your New Programs - - If you develop a new program, and you want it to be of the greatest -possible use to the public, the best way to achieve this is to make it -free software which everyone can redistribute and change under these terms. - - To do so, attach the following notices to the program. It is safest -to attach them to the start of each source file to most effectively -state the exclusion of warranty; and each file should have at least -the "copyright" line and a pointer to where the full notice is found. - - - Copyright (C) - - This program is free software: you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation, either version 3 of the License, or - (at your option) any later version. - - This program is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU General Public License - along with this program. If not, see . - -Also add information on how to contact you by electronic and paper mail. - - If the program does terminal interaction, make it output a short -notice like this when it starts in an interactive mode: - - Copyright (C) - This program comes with ABSOLUTELY NO WARRANTY; for details type `show w'. - This is free software, and you are welcome to redistribute it - under certain conditions; type `show c' for details. - -The hypothetical commands `show w' and `show c' should show the appropriate -parts of the General Public License. Of course, your program's commands -might be different; for a GUI interface, you would use an "about box". - - You should also get your employer (if you work as a programmer) or school, -if any, to sign a "copyright disclaimer" for the program, if necessary. -For more information on this, and how to apply and follow the GNU GPL, see -. - - The GNU General Public License does not permit incorporating your program -into proprietary programs. If your program is a subroutine library, you -may consider it more useful to permit linking proprietary applications with -the library. If this is what you want to do, use the GNU Lesser General -Public License instead of this License. But first, please read -. diff --git a/dwm/.dwm.old/bar/README.md b/dwm/.dwm.old/bar/README.md deleted file mode 100644 index 220db2d..0000000 --- a/dwm/.dwm.old/bar/README.md +++ /dev/null @@ -1,265 +0,0 @@ -# dwm-bar -A modular statusbar for dwm -![screenshot](https://raw.githubusercontent.com/joestandring/dwm-bar/master/sshot.png) -## Table of Contents -- [Installation](#installation) -- [Configuration](#configuration) - - [Enabling Functions](#enabling-functions) - - [Refresh Rate](#refresh-rate) - - [Configuring Functions](#configuring-functions) - - [Identifiers](#identifiers) -- [Current Functions](#current-functions) - - [dwm_alsa](#dwm_alsa) - - [dwm_pulse](#dwm_pulse) - - [dwm_battery](#dwm_battery) - - [dwm_countdown](#dwm_countdown) - - [dwm_alarm](#dwm_alarm) - - [dwm_keyboard](#dwm_keyboard) - - [dwm_resources](#dwm_resources) - - [dwm_cmus](#dwm_cmus) - - [dwm_mpc](#dwm_mpc) - - [dwm_spotify](#dwm_mpc) - - [dwm_date](#dwm_date) - - [dwm_mail](#dwm_mail) - - [dwm_weather](#dwm_weather) - - [dwm_networkmanager](#dwm_networkmanager) - - [dwm_wpa](#dwm_wpa) - - [dwm_vpn](#dwm_vpn) - - [dwm_ccurse](#dwm_ccurse) - - [dwm_transmission](#dwm_transmission) - - [dwm_backlight](#dwm_backlight) - - [dwm_connman](#dwm_connman) - - [dwm_loadavg](#dwm_loadavg) - - [dwm_currency](#dwm_currency) - - [dwm_solar_panel](#dwm_solar_panel) - - [dwm_network_speed](#dwm_network_speed) -- [Contributing](#contributing) -- [Acknowledgements](#acknowledgements) -> :warning: While I try to be as active as I can be, it may take me some time to resolve issues as I am much busier these days than when I started this project. I appreciate ALL contributions and will try my best to respond as soon as I am able to. Thank you for understanding :) - @joestandring -## Installation -1. Clone and enter the repository: -``` -git clone https://github.com/joestandring/dwm-bar -cd dwm-bar -``` -2. (Optional) Install Dependencies from ```dep/YourDisto.txt```. This will install dependencies for ALL functions so consider excluding ones you do not plan to use. These can be found at the top of each bar function. -``` -sudo xbps-install -S $(cat dep/void.txt) # Void -sudo pacman -S $(cat dep/arch.txt) # Arch -sudo dnf install $(cat dep/fedora.txt) # Fedora -``` -> :warning: There are no dnf packages for [spotifyd](https://github.com/Spotifyd/spotifyd), [pamixer](https://github.com/cdemoulins/pamixer) and [cmus](https://github.com/cmus/cmus). If you want to utilise these packages, please install them manually as shown in the corresponding gihub repos. -3. (Optional) If you plan to use unicode identifiers, you should install a font which includes these ([Nerd Fonts](https://github.com/ryanoasis/nerd-fonts), [siji](https://github.com/stark/siji)) -4. Enable/disable desired functions (see [Configuration](#configuration)). -5. Run the script -``` -./dwm_bar.sh -``` - -## Configuration -dwm-bar will require some setup before it can be used. -### Enabling Functions -Functions can be enabled by adding them to the import and upperbar variable in dwm_bar.sh. By default, all available functions will be commented here. If you are using the [extrabar](https://dwm.suckless.org/patches/extrabar/) patch, functions can also be added to lowerbar to appear on the bottom of the screen. Some more intensive functions are parallelized to prevent the bar freezing. These are imported the same as regular functions but added to the ```parallelize()``` function first. These use different names to regular functions and are commented out by default in dwm_bar.sh. - -To enable dwm_battery and dwm_backlight on the top bar and dwm_pulse and dwm_weather (parallelized) on the bottom bar, for example, you should use: -``` -# Import the modules -. "$DIR/bar-functions/dwm_battery.sh" -. "$DIR/bar-functions/dwm_backlight.sh" -. "$DIR/bar-functions/dwm_pulse.sh" -. "$DIR/bar-functions/dwm_weather.sh" - -parallelize() { - while true - do - printf "Running parallel processes\n" - dwm_weather & - sleep 5 - done -} -parallelize & - -# Update dwm status bar every second -while true -do - # Append results of each func one by one to the upperbar string - upperbar="" - upperbar="$upperbar$(dwm_battery)" - upperbar="$upperbar$(dwm_backlight)" - - # Append results of each func one by one to the lowerbar string - lowerbar="" - lowerbar="$lowerbar$(dwm_pulse)" - lowerbar="$lowerbar$(__DWM_BAR_WEATHER__)" - - #xsetroot -name "$upperbar" - - # Uncomment the line below to enable the lowerbar - xsetroot -name "$upperbar;$lowerbar" - sleep 1 -done -``` -### Refresh rate -If updating the bar every second is an issue, you can change the ```sleep``` amount of both regular and parallelized functions in dwm_bar.sh. -### Configuring functions -Some functions, such as dwm_weather require additional setup and will be outlined with a comment where this is the case. -### Identifiers -Unicode or plaintext identifiers can be used by altering the ```$IDENTIFIER``` value in dwm_bar.sh. For example, when set to ```"unicode"```, dwm_mail will display: -``` -[📫 0] -``` -Otherwise, when not set it will display: -``` -[MAIL 0] -``` -## Current Functions -### dwm_alsa -Displays the current master volume of ALSA -``` -[🔉 55%] -``` -Dependencies: ```alsa-utils``` -### dwm_pulse -Displays the current master volume of PulseAudio -``` -[🔉 55%] -``` -Dependencies: ```pamixer``` -### dwm_battery -Displays battery level and status -``` -[🔋 100% full] -``` -### dwm_countdown -Displays the status of [countdown](https://github.com/joestandring/countdown) -``` -[⏳ 00:10:00] -``` -Dependencies: ```countdown.sh``` -### dwm_alarm -Displays upcoming alarms from [alarm](https://github.com/joestandring/alarm) -``` -[⏰ 22:30:00] -``` -Dependencies: ```alarm.sh``` -### dwm_keyboard -Displays the current keyboard layout -``` -[⌨ gb] -``` -Dependencies: ```xorg-setxkbmap``` -### dwm_resources -Displays information regarding memory, CPU temperature, and storage -``` -[🖥 MEM 1.3Gi/15Gi CPU 45C STO 2.3G/200G: 2%] -``` -### dwm_cmus -Displays current cmus status, artist, track, position, duration, and shuffle -``` -[▶ The Unicorns - Tuff Ghost 0:43/2:56 🔀] -``` -Dependencies: ```cmus``` -### dwm_mpc -Displays current mpc status, artist, track, position, duration, and shuffle -``` -[▶ The Unicorns - Tuff Ghost 0:43/2:56 🔀] -``` -Dependencies: ```mpc``` -### dwm_spotify -Displays current Spotify status, artist, track, and duration - -Either the official Spotify client or spotifyd can be used. Unfortunately, only spotifyd can provide track position and shuffle status -``` -[▶ The Unicorns - Tuff Ghost 0:43/2:56 🔀] -``` -Dependencies: ```spotify/spotifyd, playerctl``` - -### dwm_date -Displays the current date and time -``` -[🕰 Mon 06-05-19 21:31:58] -``` -### dwm_mail -Displays the current number of emails in an inbox -``` -[📫 2] -``` -### dwm_weather -Displays the current weather provided by [wttr.in](https://wttr.in) - -Please remember wttr.in has a limited number of requests, so this module may occasionally not be able to recieve weather information when experiencing high traffic. -``` -[☀ +20°C] -``` -### dwm_networkmanager -Displays the current network connection, private IP, and public IP using NetworkManager -``` -[🌐 enp7s0: 192.168.0.1/24 | 185.199.109.153] -``` -Dependencies: ```NetworkManager, curl``` -### dwm_wpa -Displays the current network connection and private IP using wpa_cli -``` -[襤 My-Wifi 192.168.0.3] -``` -Dependencies: ```wpa_cli``` -### dwm_vpn -Displays the current VPN connections with OpenVPN or Wireguard -``` -[🔒 Sweden - Stockholm] -``` -Dependencies: ```NetworkManager, NetworkManager-openvpn (for OpenVPN connections)``` -### dwm_ccurse -Displays the next appointment from calcurse -``` -[💡 18/04/19 19:00 20:00 Upload dwm_ccurse] -``` -Dependencies: ```calcurse``` -### dwm_transmission -Displays the current status of a torrent with transmission-remote -``` -[⏬ archlinux-2019.06.01... | 92% 1min ⬆3.4 ⬇1.5] -``` -Dependencies: ```transmission-remote``` -### dwm_backlight -Displays the current backlight level with xbacklight -``` -[☀ 80] -``` -Dependencies: ```xbacklight``` -### dwm_connman -Shows network information IP, SSID, WLan strength (if connected to WLan) using connman. -``` -[🌐 192.169.189.12 HomeNetworkName 53%] -``` -Dependencies: ```connman``` -### dwm_loadavg -Displays the average system load -``` -[⏱ 0.14 0.17 0.18] -``` -### dwm_solar_panel -Displays how much power is being produced from your solar panels -``` -[💡 3.012 W ] -``` -### dwm_currency -Displays the current rate of your currency in comparison to the USD provided by [rate.sx](http://rate.sx/) -``` -[💡 1.225 ] -``` -Dependencies: ```curl``` -### dwm_network_speed -Displays the speed of download and upload. -``` -[李 0KB/s 0KB/s] -``` -## Contributing -See [CONTRIBUTING.md](CONTRIBUTING.md) before contributing. -## Acknowledgements -Code for some functions was modified from: -* [Klemens Nanni](https://notabug.org/kl3) -* [@boylemic](https://github.com/boylemic/configs/blob/master/dwm_status) -* [Parket Johnson](https://github.com/ronno/scripts/blob/master/xsetcmus) -* [suckless.org](https://dwm.suckless.org/status_monitor/) -* [@mcallistertyler95](https://github.com/mcallistertyler95/dwm-bar) diff --git a/dwm/.dwm.old/bar/bar-functions/dwm_alarm.sh b/dwm/.dwm.old/bar/bar-functions/dwm_alarm.sh deleted file mode 100755 index 2f82f1f..0000000 --- a/dwm/.dwm.old/bar/bar-functions/dwm_alarm.sh +++ /dev/null @@ -1,25 +0,0 @@ -#!/bin/sh - -# A dwm_status function that displays upcoming alarms from alarm.sh -# Joe Standring -# GNU GPLv3 - -# Dependencies: https://github.com/joestandring/alarm - -dwm_alarm () { - for f in /tmp/alarm.*; do - if [ -e "$f" ]; then - printf "%s" "$SEP1" - if [ "$IDENTIFIER" = "unicode" ]; then - printf "⏰ %s" "$(cat /tmp/alarm.*)" - else - printf "ALM %s" "$(cat /tmp/alarm.*)" - fi - printf "%s\n" "$SEP2" - - break - fi - done -} - -dwm_alarm diff --git a/dwm/.dwm.old/bar/bar-functions/dwm_alsa.sh b/dwm/.dwm.old/bar/bar-functions/dwm_alsa.sh deleted file mode 100755 index c339078..0000000 --- a/dwm/.dwm.old/bar/bar-functions/dwm_alsa.sh +++ /dev/null @@ -1,43 +0,0 @@ -#!/bin/sh - -# A dwm_bar function to show the master volume of ALSA -# Joe Standring -# GNU GPLv3 - -# Dependencies: alsa-utils - -dwm_alsa () { - STATUS=$(amixer sget Master | tail -n1 | sed -r "s/.*\[(.*)\]/\1/") - VOL=$(amixer get Master | tail -n1 | sed -r "s/.*\[(.*)%\].*/\1/") - printf "%s" "$SEP1" - if [ "$IDENTIFIER" = "unicode" ]; then - if [ "$STATUS" = "off" ]; then - printf "🔇" - else - #removed this line becuase it may get confusing - if [ "$VOL" -gt 0 ] && [ "$VOL" -le 33 ]; then - printf "🔈 %s%%" "$VOL" - elif [ "$VOL" -gt 33 ] && [ "$VOL" -le 66 ]; then - printf "🔉 %s%%" "$VOL" - else - printf "🔊 %s%%" "$VOL" - fi - fi - else - if [ "$STATUS" = "off" ]; then - printf "MUTE" - else - # removed this line because it may get confusing - if [ "$VOL" -gt 0 ] && [ "$VOL" -le 33 ]; then - printf "VOL %s%%" "$VOL" - elif [ "$VOL" -gt 33 ] && [ "$VOL" -le 66 ]; then - printf "VOL %s%%" "$VOL" - else - printf "VOL %s%%" "$VOL" - fi - fi - fi - printf "%s\n" "$SEP2" -} - -dwm_alsa diff --git a/dwm/.dwm.old/bar/bar-functions/dwm_backlight.sh b/dwm/.dwm.old/bar/bar-functions/dwm_backlight.sh deleted file mode 100755 index c0968d8..0000000 --- a/dwm/.dwm.old/bar/bar-functions/dwm_backlight.sh +++ /dev/null @@ -1,13 +0,0 @@ -#!/bin/sh - -# A dwm_bar module to display the current backlight brighness with xbacklight -# Joe Standring -# GNU GPLv3 - -# Dependencies: xbacklight - -dwm_backlight () { - printf "%s☀ %.0f%s\n" "$SEP1" "$(xbacklight)" "$SEP2" -} - -dwm_backlight diff --git a/dwm/.dwm.old/bar/bar-functions/dwm_battery.sh b/dwm/.dwm.old/bar/bar-functions/dwm_battery.sh deleted file mode 100755 index 6321e64..0000000 --- a/dwm/.dwm.old/bar/bar-functions/dwm_battery.sh +++ /dev/null @@ -1,26 +0,0 @@ -#!/bin/sh - -# A dwm_bar function to read the battery level and status -# Joe Standring -# GNU GPLv3 - -dwm_battery () { - # Change BAT1 to whatever your battery is identified as. Typically BAT0 or BAT1 - CHARGE=$(cat /sys/class/power_supply/BAT1/capacity) - STATUS=$(cat /sys/class/power_supply/BAT1/status) - - printf "%s" "$SEP1" - if [ "$IDENTIFIER" = "unicode" ]; then - if [ "$STATUS" = "Charging" ]; then - printf "🔌 %s%% %s" "$CHARGE" "$STATUS" - else - printf "🔋 %s%% %s" "$CHARGE" "$STATUS" - fi - else - printf "BAT %s%% %s" "$CHARGE" "$STATUS" - fi - printf "%s\n" "$SEP2" -} - -dwm_battery - diff --git a/dwm/.dwm.old/bar/bar-functions/dwm_ccurse.sh b/dwm/.dwm.old/bar/bar-functions/dwm_ccurse.sh deleted file mode 100755 index 578336c..0000000 --- a/dwm/.dwm.old/bar/bar-functions/dwm_ccurse.sh +++ /dev/null @@ -1,24 +0,0 @@ -#!/bin/sh - -# A dwm_bar function to show the closest appointment in calcurse -# Joe Standring -# GNU GPLv3 - -# Dependencies: calcurse - -dwm_ccurse () { - APTSFILE="$HOME/.calcurse/apts" - APPOINTMENT=$(head -n 1 "$APTSFILE" | sed -r 's/\[1\] //') - - if [ "$APPOINTMENT" != "" ]; then - printf "%s" "$SEP1" - if [ "$IDENTIFIER" = "unicode" ]; then - printf "💡 %s" "$APPOINTMENT" - else - printf "APT %s" "$APPOINTMENT" - fi - printf "%s\n" "$SEP2" - fi -} - -dwm_ccurse diff --git a/dwm/.dwm.old/bar/bar-functions/dwm_cmus.sh b/dwm/.dwm.old/bar/bar-functions/dwm_cmus.sh deleted file mode 100755 index a5d5a05..0000000 --- a/dwm/.dwm.old/bar/bar-functions/dwm_cmus.sh +++ /dev/null @@ -1,52 +0,0 @@ -#!/bin/sh - -# A dwm_bar function that shows the current artist, track, position, duration, and status from cmus -# Joe Standring -# GNU GPLv3 - -# Dependencies: cmus - -dwm_cmus () { - if ps -C cmus > /dev/null; then - CMUSDATA=$(cmus-remote -Q) - ARTIST=$(echo "$CMUSDATA" | grep -w '^tag artist' | awk '{gsub("tag artist ", "");print}') - TRACK=$(echo "$CMUSDATA" | grep -w '^tag title' | awk '{gsub("tag title ", "");print}') - POSITION=$(echo "$CMUSDATA" | grep -w '^position' | awk '{gsub("position ", "");print}') - DURATION=$(echo "$CMUSDATA" | grep -w '^duration' | awk '{gsub("duration ", "");print}') - STATUS=$(echo "$CMUSDATA" | grep -w '^status' | awk '{gsub("status ", "");print}') - SHUFFLE=$(echo "$CMUSDATA" | grep -w '^set shuffle' | awk '{gsub("set shuffle ", "");print}') - - if [ "$IDENTIFIER" = "unicode" ]; then - if [ "$STATUS" = "playing" ]; then - STATUS="▶" - else - STATUS="⏸" - fi - - if [ "$SHUFFLE" = "true" ]; then - SHUFFLE=" 🔀" - else - SHUFFLE="" - fi - else - if [ "$STATUS" = "playing" ]; then - STATUS="PLA" - else - STATUS="PAU" - fi - - if [ "$SHUFFLE" = "true" ]; then - SHUFFLE=" S" - else - SHUFFLE="" - fi - fi - - printf "%s%s %s - %s " "$SEP1" "$STATUS" "$ARTIST" "$TRACK" - printf "%0d:%02d/" $((POSITION%3600/60)) $((POSITION%60)) - printf "%0d:%02d" $((DURATION%3600/60)) $((DURATION%60)) - printf "%s%s\n" "$SHUFFLE" "$SEP2" - fi -} - -dwm_cmus diff --git a/dwm/.dwm.old/bar/bar-functions/dwm_connman.sh b/dwm/.dwm.old/bar/bar-functions/dwm_connman.sh deleted file mode 100755 index ce0f933..0000000 --- a/dwm/.dwm.old/bar/bar-functions/dwm_connman.sh +++ /dev/null @@ -1,42 +0,0 @@ -#!/bin/sh - -# A dwm_bar function to show the current network connection/SSID, Wifi Strength, private IP using Connmanctl. -# procrastimax -# GNU GPLv3 - -# Dependencies: connman - -dwm_connman () { - printf "%s" "$SEP1" - if [ "$IDENTIFIER" = "unicode" ]; then - printf "🌐 " - else - printf "NET " - fi - - # get the connmanctl service name - # this is a UID starting with 'vpn_', 'wifi_', or 'ethernet_', we dont care for the vpn one - # if the servicename string is empty, there is no online connection - SERVICENAME=$(connmanctl services | grep -E "^\*AO|^\*O" | grep -Eo 'wifi_.*|ethernet_.*') - - if [ ! "$SERVICENAME" ]; then - printf "OFFLINE" - printf "%s\n" "$SEP2" - return - else - STRENGTH=$(connmanctl services "$SERVICENAME" | sed -n -e 's/Strength =//p' | tr -d ' ') - CONNAME=$(connmanctl services "$SERVICENAME" | sed -n -e 's/Name =//p' | tr -d ' ') - IP=$(connmanctl services "$SERVICENAME" | grep 'IPv4 =' | awk '{print $5}' | sed -n -e 's/Address=//p' | tr -d ',') - fi - - # if STRENGTH is empty, we have a wired connection - if [ "$STRENGTH" ]; then - printf "%s %s %s%%" "$IP" "$CONNAME" "$STRENGTH" - else - printf "%s %s" "$IP" "$CONNAME" - fi - - printf "%s\n" "$SEP2" -} - -dwm_connman diff --git a/dwm/.dwm.old/bar/bar-functions/dwm_countdown.sh b/dwm/.dwm.old/bar/bar-functions/dwm_countdown.sh deleted file mode 100755 index cc4db51..0000000 --- a/dwm/.dwm.old/bar/bar-functions/dwm_countdown.sh +++ /dev/null @@ -1,25 +0,0 @@ -#!/bin/sh - -# A dwm_status function that displays the status of countdown.sh -# Joe Standring -# GNU GPLv3 - -# Dependencies: https://github.com/joestandring/countdown - -dwm_countdown () { - for f in /tmp/countdown.*; do - if [ -e "$f" ]; then - printf "%s" "$SEP1" - if [ "$IDENTIFIER" = "unicode" ]; then - printf "⏳ %s" "$(tail -1 /tmp/countdown.*)" - else - printf "CDN %s" "$(tail -1 /tmp/countdown.*)" - fi - printf "%s\n" "$SEP2" - - break - fi - done -} - -dwm_countdown diff --git a/dwm/.dwm.old/bar/bar-functions/dwm_currency.sh b/dwm/.dwm.old/bar/bar-functions/dwm_currency.sh deleted file mode 100755 index 3f99042..0000000 --- a/dwm/.dwm.old/bar/bar-functions/dwm_currency.sh +++ /dev/null @@ -1,23 +0,0 @@ -#!/bin/sh - -# A dwm_bar function to print the rate of CURRENCY/USD from rate.sx using rate.sx/1CURRENCY -# Creator of the project: Joe Standring -# Additional plugin added by Brayan de Albuquerque -# GNU GPLv3 - -# Dependencies: curl - -# Change the value of CURRENCY to match your currency code -dwm_currency() { - CURRENCY=EUR - - printf "%s" "$SEP1" - if [ "$IDENTIFIER" = "unicode" ]; then - printf "%s" "$(curl -s rate.sx/1$CURRENCY)" - else - printf "%s %.5s" "$CURRENCY" "$(curl -s rate.sx/1$CURRENCY)" - fi - printf "%s\n" "$SEP2" -} - -dwm_currency diff --git a/dwm/.dwm.old/bar/bar-functions/dwm_date.sh b/dwm/.dwm.old/bar/bar-functions/dwm_date.sh deleted file mode 100755 index 654def1..0000000 --- a/dwm/.dwm.old/bar/bar-functions/dwm_date.sh +++ /dev/null @@ -1,18 +0,0 @@ -#!/bin/sh - -# A dwm_bar function that shows the current date and time -# Joe Standring -# GNU GPLv3 - -# Date is formatted like like this: "[Mon 01-01-00 00:00:00]" -dwm_date () { - printf "%s" "$SEP1" - if [ "$IDENTIFIER" = "unicode" ]; then - printf "📆 %s" "$(date "+%a %d-%m-%y %T")" - else - printf "DAT %s" "$(date "+%a %d-%m-%y %T")" - fi - printf "%s\n" "$SEP2" -} - -dwm_date diff --git a/dwm/.dwm.old/bar/bar-functions/dwm_keyboard.sh b/dwm/.dwm.old/bar/bar-functions/dwm_keyboard.sh deleted file mode 100755 index a9ae912..0000000 --- a/dwm/.dwm.old/bar/bar-functions/dwm_keyboard.sh +++ /dev/null @@ -1,19 +0,0 @@ -#!/bin/sh - -# A dwm_bar function that displays the current keyboard layout -# Joe Standring -# GNU GPLv3 - -# Dependencies: xorg-setxkbmap - -dwm_keyboard () { - printf "%s" "$SEP1" - if [ "$IDENTIFIER" = "unicode" ]; then - printf "⌨ %s" "$(setxkbmap -query | awk '/layout/{print $2}')" - else - printf "KEY %s" "$(setxkbmap -query | awk '/layout/{print $2}')" - fi - printf "%s\n" "$SEP2" -} - -dwm_keyboard diff --git a/dwm/.dwm.old/bar/bar-functions/dwm_loadavg.sh b/dwm/.dwm.old/bar/bar-functions/dwm_loadavg.sh deleted file mode 100755 index 145d5d8..0000000 --- a/dwm/.dwm.old/bar/bar-functions/dwm_loadavg.sh +++ /dev/null @@ -1,26 +0,0 @@ -#!/bin/sh - -# A dwm_bar function to read the average system load -# Alvar Penning -# GNU GPLv3 - -dwm_loadavg () { - # LOAD_FIELDS specifies the load average values to be displayed. Values - # within 1-3 are allowed, passed as a range (-) or comma-separated. - # - 1: load average within the last minute - # - 2: load average within the last five minutes - # - 3: load average within the last fifteen minutes - LOAD_FIELDS=1,2,3 - - LOAD_AVG=$(cut -d " " -f ${LOAD_FIELDS} /proc/loadavg) - - printf "%s" "$SEP1" - if [ "$IDENTIFIER" = "unicode" ]; then - printf "⏱ %s" "$LOAD_AVG" - else - printf "AVG %s" "$LOAD_AVG" - fi - printf "%s\n" "$SEP2" -} - -dwm_loadavg diff --git a/dwm/.dwm.old/bar/bar-functions/dwm_mail.sh b/dwm/.dwm.old/bar/bar-functions/dwm_mail.sh deleted file mode 100755 index 27f3d51..0000000 --- a/dwm/.dwm.old/bar/bar-functions/dwm_mail.sh +++ /dev/null @@ -1,25 +0,0 @@ -#!/bin/sh - -# A dwm_bar function to display the number of emails in an inbox -# Joe Standring -# GNU GPLv3 - -# To count mail in an inbox, change "/path/to/inbox" below to the location of your inbox. For example, "/home/$USER/.mail/new" - -dwm_mail () { - MAILBOX=$(ls /path/to/inbox | wc -l) - - printf "%s" "$SEP1" - if [ "$IDENTIFIER" = "unicode" ]; then - if [ "$MAILBOX" -eq 0 ]; then - printf "📪 %s" "$MAILBOX" - else - printf "📫 %s" "$MAILBOX" - fi - else - printf "MAI %s" "$MAILBOX" - fi - printf "%s\n" "$SEP2" -} - -dwm_mail diff --git a/dwm/.dwm.old/bar/bar-functions/dwm_mpc.sh b/dwm/.dwm.old/bar/bar-functions/dwm_mpc.sh deleted file mode 100755 index 770aeb8..0000000 --- a/dwm/.dwm.old/bar/bar-functions/dwm_mpc.sh +++ /dev/null @@ -1,48 +0,0 @@ -#!/bin/sh - -# A dwm_bar function that shows the current artist, track, position, duration, and status from mpc -# Joe Standring -# GNU GPLv3 - -# Dependencies: mpc - -dwm_mpc () { - if ps -C mpd > /dev/null; then - ARTIST=$(mpc current -f %artist%) - TRACK=$(mpc current -f %title%) - POSITION=$(mpc status | grep "%)" | awk '{ print $3 }' | awk -F/ '{ print $1 }') - DURATION=$(mpc current -f %time%) - STATUS=$(mpc status | sed -n 2p | awk '{print $1;}') - SHUFFLE=$(mpc status | tail -n 1 | awk '{print $6}') - - if [ "$IDENTIFIER" = "unicode" ]; then - if [ "$STATUS" = "[playing]" ]; then - STATUS="▶" - else - STATUS="⏸" - fi - - if [ "$SHUFFLE" = "on" ]; then - SHUFFLE=" 🔀" - else - SHUFFLE="" - fi - else - if [ "$STATUS" = "[playing]" ]; then - STATUS="PLA" - else - STATUS="PAU" - fi - - if [ "$SHUFFLE" = "on" ]; then - SHUFFLE=" S" - else - SHUFFLE="" - fi - fi - - printf "%s%s %s - %s %s/%s%s%s" "$SEP1" "$STATUS" "$ARTIST" "$TRACK" "$POSITION" "$DURATION" "$SHUFFLE" "$SEP2" - fi -} - -dwm_mpc diff --git a/dwm/.dwm.old/bar/bar-functions/dwm_network_speed.sh b/dwm/.dwm.old/bar/bar-functions/dwm_network_speed.sh deleted file mode 100755 index 1a9e789..0000000 --- a/dwm/.dwm.old/bar/bar-functions/dwm_network_speed.sh +++ /dev/null @@ -1,65 +0,0 @@ -#!/bin/sh - -# A dwm_bar function to show the speed of download and upload. -# Johan Chane -# GNU GPLv3 - -# Dependencies: - -# This function parses /proc/net/dev file searching for a line containing $interface data. -# Within that line, the first and ninth numbers after ':' are respectively the received and transmited bytes. -# parameters: name_of_received_bytes, name_of_transmitted_bytes -function get_bytes { - # Find active network interface - #interface=$(ip route get 8.8.8.8 2>/dev/null | grep 'dev \S\+' -o | awk '{print $2}') - local interface=$(route | grep '^default' | grep -o '[^ ]*$') - local bytes_concat_args=$(grep ${interface:-lo} /proc/net/dev | cut -d ':' -f 2 | awk -v rb="$1" -v tb="$2" '{print rb"="$1, tb"="$9}') - eval $bytes_concat_args -} - -# Function which calculates the speed using actual and old byte number. -# Speed is shown in KByte per second when greater or equal than 1 KByte per second. -# This function should be called each second. -# parameters: value, old_value, now, old_time -function get_velocity { - local timediff=$(($3 - $4)) - local vel_kb=$(echo "1000000000 * ($1 - $2) / 1024 / $timediff" | bc) - if test "$vel_kb" -gt 1024; then - echo $(echo "scale = 2; $vel_kb / 1024" | bc)MB/s - else - echo ${vel_kb}KB/s - fi -} - -function dwm_network_speed_record { - get_bytes 'received_bytes' 'transmitted_bytes' - old_received_bytes=$received_bytes - old_transmitted_bytes=$transmitted_bytes - - old_time=$(date +%s%N) -} - -function download_speed { - get_velocity $received_bytes $old_received_bytes $now $old_time -} - -function upload_speed { - get_velocity $transmitted_bytes $old_transmitted_bytes $now $old_time -} - -# The greater interval ($now - $old_time) is, the be exacter the speed is. -function dwm_network_speed { - get_bytes 'received_bytes' 'transmitted_bytes' - now=$(date +%s%N) - - printf "%s" "$SEP1" - if [ "$IDENTIFIER" = "unicode" ]; then - printf "李 %s %s" "$(download_speed)" "$(upload_speed)" - else - printf "Net %s %s" "$(download_speed)" "$(upload_speed)" - fi - printf "%s\n" "$SEP2" -} - -dwm_network_speed_record -dwm_network_speed diff --git a/dwm/.dwm.old/bar/bar-functions/dwm_networkmanager.sh b/dwm/.dwm.old/bar/bar-functions/dwm_networkmanager.sh deleted file mode 100755 index db39a7e..0000000 --- a/dwm/.dwm.old/bar/bar-functions/dwm_networkmanager.sh +++ /dev/null @@ -1,25 +0,0 @@ -#!/bin/sh - -# A dwm_bar function to show the current network connection/SSID, private IP, and public IP using NetworkManager -# Joe Standring -# GNU GPLv3 - -# Dependencies: NetworkManager, curl - -dwm_networkmanager () { - CONNAME=$(nmcli -a | grep 'Wired connection' | awk 'NR==1{print $1}') - if [ "$CONNAME" = "" ]; then - CONNAME=$(nmcli -t -f active,ssid dev wifi | grep '^yes' | cut -c 5-) - fi - - PRIVATE=$(nmcli -a | grep 'inet4 192' | awk '{print $2}') - PUBLIC=$(curl -s https://ipinfo.io/ip) - - if [ "$IDENTIFIER" = "unicode" ]; then - export __DWM_BAR_NETWORKMANAGER__="${SEP1}🌐 ${CONNAME} ${PRIVATE} ${PUBLIC}${SEP2}" - else - export __DWM_BAR_NETWORKMANAGER__="${SEP1}NET ${CONNAME} ${PRIVATE} ${PUBLIC}${SEP2}" - fi -} - -dwm_networkmanager diff --git a/dwm/.dwm.old/bar/bar-functions/dwm_pulse.sh b/dwm/.dwm.old/bar/bar-functions/dwm_pulse.sh deleted file mode 100755 index 2bd2661..0000000 --- a/dwm/.dwm.old/bar/bar-functions/dwm_pulse.sh +++ /dev/null @@ -1,38 +0,0 @@ -#!/bin/sh - -# A dwm_bar function to show the master volume of PulseAudio -# Joe Standring -# GNU GPLv3 - -# Dependencies: pamixer - -dwm_pulse () { - VOL=$(pamixer --get-volume) - STATE=$(pamixer --get-mute) - - printf "%s" "$SEP1" - if [ "$IDENTIFIER" = "unicode" ]; then - if [ "$STATE" = "true" ] || [ "$VOL" -eq 0 ]; then - printf "🔇" - elif [ "$VOL" -gt 0 ] && [ "$VOL" -le 33 ]; then - printf "🔈 %s%%" "$VOL" - elif [ "$VOL" -gt 33 ] && [ "$VOL" -le 66 ]; then - printf "🔉 %s%%" "$VOL" - else - printf "🔊 %s%%" "$VOL" - fi - else - if [ "$STATE" = "true" ] || [ "$VOL" -eq 0 ]; then - printf "MUTE" - elif [ "$VOL" -gt 0 ] && [ "$VOL" -le 33 ]; then - printf "VOL %s%%" "$VOL" - elif [ "$VOL" -gt 33 ] && [ "$VOL" -le 66 ]; then - printf "VOL %s%%" "$VOL" - else - printf "VOL %s%%" "$VOL" - fi - fi - printf "%s\n" "$SEP2" -} - -dwm_pulse diff --git a/dwm/.dwm.old/bar/bar-functions/dwm_resources.sh b/dwm/.dwm.old/bar/bar-functions/dwm_resources.sh deleted file mode 100755 index 61beecc..0000000 --- a/dwm/.dwm.old/bar/bar-functions/dwm_resources.sh +++ /dev/null @@ -1,33 +0,0 @@ -#!/bin/sh - -# A dwm_bar function to display information regarding system memory, CPU temperature, and storage -# Joe Standring -# GNU GPLv3 - -df_check_location='/home' - -dwm_resources () { - # get all the infos first to avoid high resources usage - free_output=$(free -h | grep Mem) - df_output=$(df -h $df_check_location | tail -n 1) - # Used and total memory - MEMUSED=$(echo $free_output | awk '{print $3}') - MEMTOT=$(echo $free_output | awk '{print $2}') - # CPU temperature - CPU=$(top -bn1 | grep Cpu | awk '{print $2}')% - #CPU=$(sysctl -n hw.sensors.cpu0.temp0 | cut -d. -f1) - # Used and total storage in /home (rounded to 1024B) - STOUSED=$(echo $df_output | awk '{print $3}') - STOTOT=$(echo $df_output | awk '{print $2}') - STOPER=$(echo $df_output | awk '{print $5}') - - printf "%s" "$SEP1" - if [ "$IDENTIFIER" = "unicode" ]; then - printf "💻 MEM %s/%s CPU %s STO %s/%s: %s" "$MEMUSED" "$MEMTOT" "$CPU" "$STOUSED" "$STOTOT" "$STOPER" - else - printf "STA | MEM %s/%s CPU %s STO %s/%s: %s" "$MEMUSED" "$MEMTOT" "$CPU" "$STOUSED" "$STOTOT" "$STOPER" - fi - printf "%s\n" "$SEP2" -} - -dwm_resources diff --git a/dwm/.dwm.old/bar/bar-functions/dwm_solar_panel.sh b/dwm/.dwm.old/bar/bar-functions/dwm_solar_panel.sh deleted file mode 100755 index 489159f..0000000 --- a/dwm/.dwm.old/bar/bar-functions/dwm_solar_panel.sh +++ /dev/null @@ -1,55 +0,0 @@ -#!/bin/bash -# This module can get data from a SMA Inverter. -# Its purpose is to show you how much Watts are being produced -# To make it work change the INVERTER_IP variable and your User password -# Vincenzo Petrolo -# For infos on how i made it, and help or bugs, you cant contact me or -# open an issue -# GNU GPLv3 - -# P.s: Be careful when trying to modify urls, as they contains special -# characters that may change the behaviour of the query - -dwm_solar_panel () { - - INVERTER_IP="YOUR INVERTER IP" - PASSWORD="YOUR PASSWORD" - - - if [[ -f ~/.cache/solar_panel.cache ]]; - then - read SID < ~/.cache/solar_panel.cache - if [ "$SID" == "null" ]; - then - #Getting session id - SID=$( curl -s --location --request POST "http://$INVERTER_IP/dyn/login.json" \ - --header 'Content-Type: text/plain' \ - --data-raw "{\"right\":\"usr\",\"pass\":\""$PASSWORD\""}" | jq .result.sid) - SID=${SID//\"} - fi - #checks if it got a session token - - if [ "$SID" != "" ] && [ "$SID" != "null" ]; - then - echo $SID > ~/.cache/solar_panel.cache - WATTS=$(curl -s --location --request POST "http://$INVERTER_IP/dyn/getValues.json?sid=$SID" \ - --header 'Content-Type: text/plain' \ - --data-raw '{"destDev":[],"keys":["6100_00543100","6800_008AA200","6100_40263F00","6800_00832A00","6180_08214800","6180_08414900","6180_08522F00","6400_00543A00","6400_00260100","6800_08811F00","6400_00462E00"]}' | jq '.result."0156-76BC3EC6"."6100_40263F00"."1"[0].val') - - if [ "$WATTS" == "" ] || [ "$WATTS" == "null" ]; - then - echo "null" > ~/.cache/solar_panel.cache - else - printf "%s💡 $WATTS W %s" "$SEP1" "$SEP2" - fi - - fi - else - touch ~/.cache/solar_panel.cache - - echo "null" > ~/.cache/solar_panel.cache - fi - -} -dwm_solar_panel - diff --git a/dwm/.dwm.old/bar/bar-functions/dwm_spotify.sh b/dwm/.dwm.old/bar/bar-functions/dwm_spotify.sh deleted file mode 100755 index 2d8123d..0000000 --- a/dwm/.dwm.old/bar/bar-functions/dwm_spotify.sh +++ /dev/null @@ -1,65 +0,0 @@ -#!/bin/sh - -# A dwm_bar function that shows the current artist, track, duration, and status from Spotify using playerctl -# Joe Standring -# GNU GPLv3 - -# Dependencies: spotify/spotifyd, playerctl - -# NOTE: The official spotify client does not provide the track position or shuffle status through playerctl. This does work through spotifyd however. - -dwm_spotify () { - if ps -C spotify > /dev/null; then - PLAYER="spotify" - elif ps -C spotifyd > /dev/null; then - PLAYER="spotifyd" - fi - - if [ "$PLAYER" = "spotify" ] || [ "$PLAYER" = "spotifyd" ]; then - ARTIST=$(playerctl metadata artist) - TRACK=$(playerctl metadata title) - POSITION=$(playerctl position | sed 's/..\{6\}$//') - DURATION=$(playerctl metadata mpris:length | sed 's/.\{6\}$//') - STATUS=$(playerctl status) - SHUFFLE=$(playerctl shuffle) - - if [ "$IDENTIFIER" = "unicode" ]; then - if [ "$STATUS" = "Playing" ]; then - STATUS="▶" - else - STATUS="⏸" - fi - - if [ "$SHUFFLE" = "On" ]; then - SHUFFLE=" 🔀" - else - SHUFFLE="" - fi - else - if [ "$STATUS" = "Playing" ]; then - STATUS="PLA" - else - STATUS="PAU" - fi - - if [ "$SHUFFLE" = "On" ]; then - SHUFFLE=" S" - else - SHUFFLE="" - fi - fi - - if [ "$PLAYER" = "spotify" ]; then - printf "%s%s %s - %s " "$SEP1" "$STATUS" "$ARTIST" "$TRACK" - printf "%0d:%02d" $((DURATION%3600/60)) $((DURATION%60)) - printf "%s\n" "$SEP2" - else - printf "%s%s %s - %s " "$SEP1" "$STATUS" "$ARTIST" "$TRACK" - printf "%0d:%02d/" $((POSITION%3600/60)) $((POSITION%60)) - printf "%0d:%02d" $((DURATION%3600/60)) $((DURATION%60)) - printf "%s%s\n" "$SHUFFLE" "$SEP2" - fi - fi -} - -dwm_spotify diff --git a/dwm/.dwm.old/bar/bar-functions/dwm_transmission.sh b/dwm/.dwm.old/bar/bar-functions/dwm_transmission.sh deleted file mode 100755 index f11c719..0000000 --- a/dwm/.dwm.old/bar/bar-functions/dwm_transmission.sh +++ /dev/null @@ -1,50 +0,0 @@ -#!/bin/sh - -# A dwm_bar function to show the status of a torrent woth transmission-remote -# Joe Standring -# GNU GPLv3 - -# Dependencies: transmission-remote - -dwm_transmission () { - TORRENT=$(transmission-remote -l | sed '2q;d' | sed 's/\(.\) /\1/g') - ID=$(printf "%s" "$TORRENT" | awk '{print $1;}') - STATUS=$(printf "%s" "$TORRENT" | awk '{print $8;}') - ETA=$(printf "%s" "$TORRENT" | awk '{print $4;}') - NAME=$(printf "%s" "$TORRENT" | awk '{for(i=9;i<=NF;++i)print $i}' | tr -d "\n" | head -c 20; printf "...") - DONE=$(printf "%s" "$TORRENT" | awk '{print $2;}') - UP=$(printf "%s" "$TORRENT" | awk '{print $5;}') - DOWN=$(printf "%s" "$TORRENT" | awk '{print $5;}') - - if [ "$ID" != "Sum:" ]; then - printf "%s" "$SEP1" - if [ "$IDENTIFIER" = "unicode" ]; then - case "$STATUS" in - "Idle") - printf "🛑 %s | %s %s ⬆%s ⬇%s" "$NAME" "$DONE" "$ETA" "$UP" "$DOWN" - ;; - "Seeding") - printf "🌱 %s | ⬆%s ⬇%s" "$NAME" "$UP" "$DOWN" - ;; - "Downloading") - printf "⏬ %s | %s %s ⬆%s ⬇%s" "$NAME" "$DONE" "$ETA" "$UP" "$DOWN" - ;; - esac - else - case "$STATUS" in - "Idle") - printf "IDLE %s | %s %s ⬆%s ⬇%s" "$NAME" "$DONE" "$ETA" "$UP" "$DOWN" - ;; - "Seeding") - printf "SEEDING %s | ⬆%s ⬇%s" "$NAME" "$UP" "$DOWN" - ;; - "Downloading") - printf "DOWNLOADING %s | %s %s ⬆%s ⬇%s" "$NAME" "$DONE" "$ETA" "$UP" "$DOWN" - ;; - esac - fi - printf "%s\n" "$SEP2" - fi -} - -dwm_transmission diff --git a/dwm/.dwm.old/bar/bar-functions/dwm_vpn.sh b/dwm/.dwm.old/bar/bar-functions/dwm_vpn.sh deleted file mode 100755 index 56972ed..0000000 --- a/dwm/.dwm.old/bar/bar-functions/dwm_vpn.sh +++ /dev/null @@ -1,28 +0,0 @@ -#!/bin/sh - -# A dwm_bar function to show VPN connections with OpenVPN or WireGuard (if any are active) -# Joe Standring -# GNU GPLv3 - -# Dependencies: NetworkManager, NetworkManager-openvpn (for OpenVPN connections) - -dwm_vpn () { - VPN=$(nmcli -a | grep 'VPN connection' | sed -e 's/\( VPN connection\)*$//g') - - if [ "$VPN" = "" ]; then - VPN=$(nmcli connection | grep 'wireguard' | sed 's/\s.*$//') - fi - - if [ "$VPN" != "" ]; then - printf "%s" "$SEP1" - if [ "$IDENTIFIER" = "unicode" ]; then - printf "🔒 %s" "$VPN" - else - printf "VPN %s" "$VPN" - fi - printf "%s\n" "$SEP2" - fi -} - - -dwm_vpn diff --git a/dwm/.dwm.old/bar/bar-functions/dwm_weather.sh b/dwm/.dwm.old/bar/bar-functions/dwm_weather.sh deleted file mode 100755 index 8689a8d..0000000 --- a/dwm/.dwm.old/bar/bar-functions/dwm_weather.sh +++ /dev/null @@ -1,22 +0,0 @@ -#!/bin/sh - -# A dwm_bar function to print the weather from wttr.in -# Joe Standring -# GNU GPLv3 - -# Dependencies: curl - -# Change the value of LOCATION to match your city -dwm_weather() { - LOCATION=London - - if [ "$IDENTIFIER" = "unicode" ]; then - DATA=$(curl -s wttr.in/$LOCATION?format=1) - export __DWM_BAR_WEATHER__="${SEP1} ${DATA} ${SEP2}" - else - DATA=$(curl -s wttr.in/$LOCATION?format=1 | grep -o ".[0-9].*") - export __DWM_BAR_WEATHER__="${SEP1} WEA ${DATA} ${SEP2}" - fi -} - -dwm_weather diff --git a/dwm/.dwm.old/bar/bar-functions/dwm_wpa.sh b/dwm/.dwm.old/bar/bar-functions/dwm_wpa.sh deleted file mode 100755 index 9462612..0000000 --- a/dwm/.dwm.old/bar/bar-functions/dwm_wpa.sh +++ /dev/null @@ -1,82 +0,0 @@ -#!/bin/sh - -# Dependancies: wpa_cli - -dwm_wpa() { - CONSTATE=$(wpa_cli status | sed -n '/wpa_state/s/^.*=//p') - - case $CONSTATE in - 'COMPLETED') - CONSSID=$(wpa_cli status | sed -n '/\/s/^.*=//p') - CONIP=$(wpa_cli status | sed -n '/ip_address/s/^.*=//p') - CONRSSI=$(wpa_cli signal_poll | sed -n '/AVG_RSSI/s/^.*=//p') - if [ "$CONRSSI" -gt -35 ]; then - printf "%s" "$SEP1" - printf "\uF927 %s %s" "$CONSSID" "$CONIP" - printf "%s\n" "$SEP2" - elif [ "$CONRSSI" -ge -55 ] && [ "$CONRSSI" -lt -35 ]; then - printf "%s" "$SEP1" - printf "\uF924 %s %s" "$CONSSID" "$CONIP" - printf "%s\n" "$SEP2" - elif [ "$CONRSSI" -ge -75 ] && [ "$CONRSSI" -lt -55 ]; then - printf "%s" "$SEP1" - printf "\uF921 %s %s" "$CONSSID" "$CONIP" - printf "%s\n" "$SEP2" - else - printf "%s" "$SEP1" - printf "\uF91E %s %s" "$CONSSID" "$CONIP" - printf "%s\n" "$SEP2" - fi - ;; -#======================================================================# - 'DISCONNECTED') - printf "%s" "$SEP1" - printf "\uF92D %s" "$CONSTATE" - printf "%s\n" "$SEP2" - ;; - 'INTERFACE_DISABLED') - printf "%s" "$SEP1" - printf "\uF92D %s" "$CONSTATE" - printf "%s\n" "$SEP2" - ;; -#======================================================================# - 'SCANNING') - printf "%s" "$SEP1" - printf "\uF92A %s" "$CONSTATE" - printf "%s\n" "$SEP2" - ;; - 'ASSOCIATING') - printf "%s" "$SEP1" - printf "\uF92A %s" "$CONSTATE" - printf "%s\n" "$SEP2" - ;; - 'ASSOCIATED') - printf "%s" "$SEP1" - printf "\uF92A %s" "$CONSTATE" - printf "%s\n" "$SEP2" - ;; - 'AUTHENTICATING') - printf "%s" "$SEP1" - printf "\uF92A %s" "$CONSTATE" - printf "%s\n" "$SEP2" - ;; -#======================================================================# - '4WAY_HANDSHAKE') - printf "%s" "$SEP1" - printf "\uF92B %s" "$CONSTATE" - printf "%s\n" "$SEP2" - ;; - 'GROUP_HANDSHAKE') - printf "%s" "$SEP1" - printf "\uF92B %s" "$CONSTATE" - printf "%s\n" "$SEP2" - ;; - 'INACTIVE') - printf "%s" "$SEP1" - printf "\uF92B %s" "$CONSTATE" - printf "%s\n" "$SEP2" - ;; - esac -} - -dwm_wpa diff --git a/dwm/.dwm.old/bar/dep/arch.txt b/dwm/.dwm.old/bar/dep/arch.txt deleted file mode 100644 index dccc812..0000000 --- a/dwm/.dwm.old/bar/dep/arch.txt +++ /dev/null @@ -1,15 +0,0 @@ -alsa-utils -cmus -xorg-setxkbmap -extra/mpc -wpa_supplicant -networkmanager -networkmanager-openvpn -calcurse -transmission-remote-gtk -xorg-xbacklight -connman -curl -pamixer -spotifyd -playerctl diff --git a/dwm/.dwm.old/bar/dep/fedora.txt b/dwm/.dwm.old/bar/dep/fedora.txt deleted file mode 100644 index 0f496ce..0000000 --- a/dwm/.dwm.old/bar/dep/fedora.txt +++ /dev/null @@ -1,14 +0,0 @@ -alsa-utils -setxkbmap -mpc -wpa_supplicant -NetworkManager -NetworkManager-openvpn -calcurse -transmission-remote-gtk -xbacklight -connman -connman-devel -curl -playerctl -playerctl-devel diff --git a/dwm/.dwm.old/bar/dep/void.txt b/dwm/.dwm.old/bar/dep/void.txt deleted file mode 100644 index 14a7bfa..0000000 --- a/dwm/.dwm.old/bar/dep/void.txt +++ /dev/null @@ -1,16 +0,0 @@ -alsa-utils -cmus -setxkbmap -mpc -wpa_supplicant -NetworkManager -NetworkManager-openvpn -calcurse -transmission-remote-gtk -xbacklight -connman -curl -pamixer -spotifyd -playerctl -xsetroot diff --git a/dwm/.dwm.old/bar/dwm_bar.sh b/dwm/.dwm.old/bar/dwm_bar.sh deleted file mode 100755 index 732d5a4..0000000 --- a/dwm/.dwm.old/bar/dwm_bar.sh +++ /dev/null @@ -1,94 +0,0 @@ -#!/bin/sh - -# A modular status bar for dwm -# Joe Standring -# GNU GPLv3 - -# Dependencies: xorg-xsetroot - -# Import functions with "$include /route/to/module" -# It is recommended that you place functions in the subdirectory ./bar-functions and use: . "$DIR/bar-functions/dwm_example.sh" - -# Store the directory the script is running from -LOC=$(readlink -f "$0") -DIR=$(dirname "$LOC") - -# Change the appearance of the module identifier. if this is set to "unicode", then symbols will be used as identifiers instead of text. E.g. [📪 0] instead of [MAIL 0]. -# Requires a font with adequate unicode character support -export IDENTIFIER="unicode" - -# Change the charachter(s) used to seperate modules. If two are used, they will be placed at the start and end. -export SEP1="[" -export SEP2="]" - -# Import the modules -#. "$DIR/bar-functions/dwm_alarm.sh" -# . "$DIR/bar-functions/dwm_alsa.sh" -#. "$DIR/bar-functions/dwm_backlight.sh" -#. "$DIR/bar-functions/dwm_battery.sh" -#. "$DIR/bar-functions/dwm_ccurse.sh" -#. "$DIR/bar-functions/dwm_cmus.sh" -#. "$DIR/bar-functions/dwm_connman.sh" -#. "$DIR/bar-functions/dwm_countdown.sh" -#. "$DIR/bar-functions/dwm_currency.sh" -. "$DIR/bar-functions/dwm_date.sh" -. "$DIR/bar-functions/dwm_keyboard.sh" -#. "$DIR/bar-functions/dwm_loadavg.sh" -# . "$DIR/bar-functions/dwm_mail.sh" -#. "$DIR/bar-functions/dwm_mpc.sh" -# . "$DIR/bar-functions/dwm_networkmanager.sh" -. "$DIR/bar-functions/dwm_pulse.sh" -. "$DIR/bar-functions/dwm_resources.sh" -. "$DIR/bar-functions/dwm_spotify.sh" -#. "$DIR/bar-functions/dwm_transmission.sh" -#. "$DIR/bar-functions/dwm_vpn.sh" -. "$DIR/bar-functions/dwm_weather.sh" -#. "$DIR/bar-functions/dwm_network_speed.sh" - -parallelize() { - while true - do - printf "Running parallel processes\n" - #dwm_networkmanager & - #dwm_weather & - sleep 5 - done -} -parallelize & - -# Update dwm status bar every second -while true -do - # Append results of each func one by one to the upperbar string - upperbar="" - #upperbar="$upperbar$(dwm_alarm)" - #upperbar="$upperbar$(dwm_backlight)" - #upperbar="$upperbar$(dwm_battery)" - #upperbar="$upperbar$(dwm_ccurse)" - #upperbar="$upperbar$(dwm_cmus)" - #upperbar="$upperbar$(dwm_connman)" - #upperbar="$upperbar$(dwm_countdown)" - #upperbar="$upperbar$(dwm_currency)" - # upperbar="$upperbar$(dwm_keyboard)" - #upperbar="$upperbar$(dwm_loadavg)" - #upperbar="$upperbar$(dwm_mail)" - #upperbar="$upperbar$(dwm_mpc)" - upperbar="$upperbar$(dwm_pulse)" - # upperbar="$upperbar$(dwm_resources)" - upperbar="$upperbar$(dwm_spotify)" - #upperbar="$upperbar$(dwm_transmission)" - #upperbar="$upperbar$(dwm_vpn)" - #upperbar="$upperbar${__DWM_BAR_NETWORKMANAGER__}" - #upperbar="$upperbar${__DWM_BAR_WEATHER__}" - #upperbar="$upperbar$(dwm_network_speed)"; dwm_network_speed_record - # upperbar="$upperbar$(dwm_alsa)" - upperbar="$upperbar$(dwm_date)" - - # Append results of each func one by one to the lowerbar string - lowerbar="" - - xsetroot -name "$upperbar" - # Uncomment the line below to enable the lowerbar - #xsetroot -name "$upperbar;$lowerbar" - sleep 1 -done diff --git a/dwm/.dwm.old/bar/sshot.png b/dwm/.dwm.old/bar/sshot.png deleted file mode 100644 index b8651d2..0000000 Binary files a/dwm/.dwm.old/bar/sshot.png and /dev/null differ diff --git a/dwm/.dwm.old/config.def.h b/dwm/.dwm.old/config.def.h deleted file mode 100644 index 1a25227..0000000 --- a/dwm/.dwm.old/config.def.h +++ /dev/null @@ -1,1793 +0,0 @@ -/* See LICENSE file for copyright and license details. */ - -#include - -/* appearance */ -#if ROUNDED_CORNERS_PATCH -static const unsigned int borderpx = 0; /* border pixel of windows */ -static const int corner_radius = 10; -#else -static const unsigned int borderpx = 1; /* border pixel of windows */ -#endif // ROUNDED_CORNERS_PATCH -static const unsigned int snap = 28; /* snap pixel */ -#if SWALLOW_PATCH -static const int swallowfloating = 0; /* 1 means swallow floating windows by default */ -#endif // SWALLOW_PATCH -#if BAR_TAGPREVIEW_PATCH -static const int scalepreview = 4; /* Tag preview scaling */ -#endif // BAR_TAGPREVIEW_PATCH -#if NO_MOD_BUTTONS_PATCH -static int nomodbuttons = 1; /* allow client mouse button bindings that have no modifier */ -#endif // NO_MOD_BUTTONS_PATCH -#if VANITYGAPS_PATCH -static const unsigned int gappih = 20; /* horiz inner gap between windows */ -static const unsigned int gappiv = 10; /* vert inner gap between windows */ -static const unsigned int gappoh = 10; /* horiz outer gap between windows and screen edge */ -static const unsigned int gappov = 30; /* vert outer gap between windows and screen edge */ -static const int smartgaps_fact = 1; /* gap factor when there is only one client; 0 = no gaps, 3 = 3x outer gaps */ -#endif // VANITYGAPS_PATCH -#if AUTOSTART_PATCH -static const char autostartblocksh[] = "autostart_blocking.sh"; -static const char autostartsh[] = "autostart.sh"; -static const char dwmdir[] = "dwm"; -static const char localshare[] = ".local/share"; -#endif // AUTOSTART_PATCH -#if BAR_ANYBAR_PATCH -static const int usealtbar = 1; /* 1 means use non-dwm status bar */ -static const char *altbarclass = "Polybar"; /* Alternate bar class name */ -static const char *altbarcmd = "$HOME/bar.sh"; /* Alternate bar launch command */ -#endif // BAR_ANYBAR_PATCH -#if BAR_HOLDBAR_PATCH -static const int showbar = 0; /* 0 means no bar */ -#else -static const int showbar = 1; /* 0 means no bar */ -#endif // BAR_HOLDBAR_PATCH -static const int topbar = 1; /* 0 means bottom bar */ -#if TAB_PATCH -/* Display modes of the tab bar: never shown, always shown, shown only in */ -/* monocle mode in the presence of several windows. */ -/* Modes after showtab_nmodes are disabled. */ -enum showtab_modes { showtab_never, showtab_auto, showtab_nmodes, showtab_always}; -static const int showtab = showtab_auto; /* Default tab bar show mode */ -static const int toptab = False; /* False means bottom tab bar */ -#endif // TAB_PATCH -#if BAR_HEIGHT_PATCH -static const int bar_height = 32; /* 0 means derive from font, >= 1 explicit height */ -#endif // BAR_HEIGHT_PATCH -#if BAR_PADDING_PATCH -static const int vertpad = 10; /* vertical padding of bar */ -static const int sidepad = 10; /* horizontal padding of bar */ -#endif // BAR_PADDING_PATCH -#if BAR_WINICON_PATCH -#define ICONSIZE 20 /* icon size */ -#define ICONSPACING 5 /* space between icon and title */ -#endif // BAR_WINICON_PATCH -#if FOCUSONCLICK_PATCH -static const int focusonwheel = 0; -#endif // FOCUSONCLICK_PATCH -#if FLOATPOS_PATCH -static int floatposgrid_x = 5; /* float grid columns */ -static int floatposgrid_y = 5; /* float grid rows */ -#endif // FLOATPOS_PATCH -#if RIODRAW_PATCH -static const char slopspawnstyle[] = "-t 0 -c 0.92,0.85,0.69,0.3 -o"; /* do NOT define -f (format) here */ -static const char slopresizestyle[] = "-t 0 -c 0.92,0.85,0.69,0.3"; /* do NOT define -f (format) here */ -static const int riodraw_borders = 0; /* 0 or 1, indicates whether the area drawn using slop includes the window borders */ -#if SWALLOW_PATCH -static const int riodraw_matchpid = 1; /* 0 or 1, indicates whether to match the PID of the client that was spawned with riospawn */ -#endif // SWALLOW_PATCH -#endif // RIODRAW_PATCH -/* Status is to be shown on: -1 (all monitors), 0 (a specific monitor by index), 'A' (active monitor) */ -#if BAR_STATUSALLMONS_PATCH -static const int statusmon = -1; -#elif BAR_STATICSTATUS_PATCH -static const int statusmon = 0; -#else -static const int statusmon = 'A'; -#endif // BAR_STATUSALLMONS_PATCH | BAR_STATICSTATUS_PATCH -#if BAR_STATUSPADDING_PATCH -static const int horizpadbar = 2; /* horizontal padding for statusbar */ -static const int vertpadbar = 0; /* vertical padding for statusbar */ -#endif // BAR_STATUSPADDING_PATCH -#if BAR_STATUSBUTTON_PATCH -static const char buttonbar[] = ""; -#endif // BAR_STATUSBUTTON_PATCH -#if BAR_SYSTRAY_PATCH -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 = 4; /* 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 - -#if NAMETAG_PATCH -#if NAMETAG_PREPEND_PATCH -/* The format in which the tag is written when named. E.g. %d: %.12s will write the tag number - * followed the first 12 characters of the given string. You can also just use "%d: %s" here. */ -#define NAMETAG_FORMAT "%d: %.12s" -#else -#define NAMETAG_FORMAT "%s" -#endif // NAMETAG_PREPEND_PATCH -/* The maximum amount of bytes reserved for each tag text. */ -#define MAX_TAGLEN 16 -/* The command to run (via popen). This can be tailored by adding a prompt, passing other command - * line arguments or providing name options. Optionally you can use other dmenu like alternatives - * like rofi -dmenu. */ -#define NAMETAG_COMMAND "dmenu < /dev/null" -#endif // NAMETAG_PATCH - -#if ALT_TAB_PATCH -/* alt-tab configuration */ -static const unsigned int tabmodkey = 0x40; /* (Alt) when this key is held down the alt-tab functionality stays active. Must be the same modifier as used to run alttabstart */ -static const unsigned int tabcyclekey = 0x17; /* (Tab) when this key is hit the menu moves one position forward in client stack. Must be the same key as used to run alttabstart */ -static const unsigned int tabposy = 1; /* tab position on Y axis, 0 = top, 1 = center, 2 = bottom */ -static const unsigned int tabposx = 1; /* tab position on X axis, 0 = left, 1 = center, 2 = right */ -static const unsigned int maxwtab = 600; /* tab menu width */ -static const unsigned int maxhtab = 200; /* tab menu height */ -#endif // ALT_TAB_PATCH - -/* Indicators: see patch/bar_indicators.h for options */ -static int tagindicatortype = INDICATOR_TOP_LEFT_SQUARE; -static int tiledindicatortype = INDICATOR_NONE; -static int floatindicatortype = INDICATOR_TOP_LEFT_SQUARE; -#if FAKEFULLSCREEN_CLIENT_PATCH && !FAKEFULLSCREEN_PATCH -static int fakefsindicatortype = INDICATOR_PLUS; -static int floatfakefsindicatortype = INDICATOR_PLUS_AND_LARGER_SQUARE; -#endif // FAKEFULLSCREEN_CLIENT_PATCH -#if ONLYQUITONEMPTY_PATCH -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 -static const char statussep = ';'; /* separator between status bars */ -#endif // BAR_EXTRASTATUS_PATCH -#if BAR_TABGROUPS_PATCH -#if MONOCLE_LAYOUT -static void (*bartabmonfns[])(Monitor *) = { monocle /* , customlayoutfn */ }; -#else -static void (*bartabmonfns[])(Monitor *) = { NULL /* , customlayoutfn */ }; -#endif // MONOCLE_LAYOUT -#endif // BAR_TABGROUPS_PATCH -#if BAR_PANGO_PATCH -static const char font[] = "monospace 11"; -#else -static const char *fonts[] = { "Noto Nerd Font:size=11:antialias=true", "monospace:size=11:antialias=true" }; -#endif // BAR_PANGO_PATCH -static const char dmenufont[] = "Noto Nerd Font:size=11:antialias=true"; - -static char c000000[] = "#000000"; // placeholder value - -static char normfgcolor[] = "#cad3f5"; -static char normbgcolor[] = "#24273a"; -static char normbordercolor[] = "#494d64"; -static char normfloatcolor[] = "#5b6078"; - -static char selfgcolor[] = "#181926"; -static char selbgcolor[] = "#ed8796"; -static char selbordercolor[] = "#ee99a0"; -static char selfloatcolor[] = "#ee99a0"; - -static char titlenormfgcolor[] = "#cad3f5"; -static char titlenormbgcolor[] = "#24273a"; -static char titlenormbordercolor[] = "#363a4f"; -static char titlenormfloatcolor[] = "#c6a0f6"; - -static char titleselfgcolor[] = "#a6da95"; -static char titleselbgcolor[] = "#363a4f"; -static char titleselbordercolor[] = "#5b6078"; -static char titleselfloatcolor[] = "#5b6078"; - -static char tagsnormfgcolor[] = "#cad3f5"; -static char tagsnormbgcolor[] = "#24273a"; -static char tagsnormbordercolor[] = "#363a4f"; -static char tagsnormfloatcolor[] = "#363a4f"; - -static char tagsselfgcolor[] = "#a6da95"; -static char tagsselbgcolor[] = "#181926"; -static char tagsselbordercolor[] = "#eed49f"; -static char tagsselfloatcolor[] = "#8bd5ca"; - -static char hidnormfgcolor[] = "#5b6078"; -static char hidselfgcolor[] = "#5b6078"; -static char hidnormbgcolor[] = "#181926"; -static char hidselbgcolor[] = "#181926"; - -static char urgfgcolor[] = "#181926"; -static char urgbgcolor[] = "#ed8796"; -static char urgbordercolor[] = "#ed8796"; -static char urgfloatcolor[] = "#ed8796"; - -static const char *mutevol[] = {"/usr/bin/pactl", "set-sink-mute", "0", "toggle", NULL}; -static const char *downvol[] = {"/usr/bin/pactl", "set-sink-volume", "0", "-3%", NULL}; -static const char *upvol[] = {"/usr/bin/pactl", "set-sink-volume", "0", "+3%", NULL}; -static const char *mutemic[] = {"/usr/bin/pactl", "set-source-mute", "0", "toggle", NULL}; -static const char *downbrt[] = {"xbacklight", "-dec", "5", NULL}; -static const char *upbrt[] = {"xbacklight", "-inc", "5", NULL}; -static const char *displ[] = {"arandr", NULL}; -static const char *wlan[] = {"alacritty", "-e", "nmtui", NULL}; -static const char *tools[] = {"lxappearance"}; -static const char *search[] = {"rofi", "-show", "drun", NULL}; -// static const char *launcha[] = {alttabstart}; -static const char *explorer[] = {"nemo", NULL}; -static const char *locksession[] = {"loginctl", "lock-session", NULL}; - -#if RENAMED_SCRATCHPADS_PATCH -static char scratchselfgcolor[] = "#FFF7D4"; -static char scratchselbgcolor[] = "#77547E"; -static char scratchselbordercolor[] = "#894B9F"; -static char scratchselfloatcolor[] = "#894B9F"; - -static char scratchnormfgcolor[] = "#FFF7D4"; -static char scratchnormbgcolor[] = "#664C67"; -static char scratchnormbordercolor[] = "#77547E"; -static char scratchnormfloatcolor[] = "#77547E"; -#endif // RENAMED_SCRATCHPADS_PATCH - -#if BAR_FLEXWINTITLE_PATCH -static char normTTBbgcolor[] = "#330000"; -static char normLTRbgcolor[] = "#330033"; -static char normMONObgcolor[] = "#000033"; -static char normGRIDbgcolor[] = "#003300"; -static char normGRD1bgcolor[] = "#003300"; -static char normGRD2bgcolor[] = "#003300"; -static char normGRDMbgcolor[] = "#506600"; -static char normHGRDbgcolor[] = "#b96600"; -static char normDWDLbgcolor[] = "#003333"; -static char normSPRLbgcolor[] = "#333300"; -static char normfloatbgcolor[] = "#115577"; -static char actTTBbgcolor[] = "#440000"; -static char actLTRbgcolor[] = "#440044"; -static char actMONObgcolor[] = "#000044"; -static char actGRIDbgcolor[] = "#004400"; -static char actGRD1bgcolor[] = "#004400"; -static char actGRD2bgcolor[] = "#004400"; -static char actGRDMbgcolor[] = "#507711"; -static char actHGRDbgcolor[] = "#b97711"; -static char actDWDLbgcolor[] = "#004444"; -static char actSPRLbgcolor[] = "#444400"; -static char actfloatbgcolor[] = "#116688"; -static char selTTBbgcolor[] = "#550000"; -static char selLTRbgcolor[] = "#550055"; -static char selMONObgcolor[] = "#212171"; -static char selGRIDbgcolor[] = "#005500"; -static char selGRD1bgcolor[] = "#005500"; -static char selGRD2bgcolor[] = "#005500"; -static char selGRDMbgcolor[] = "#508822"; -static char selHGRDbgcolor[] = "#b98822"; -static char selDWDLbgcolor[] = "#005555"; -static char selSPRLbgcolor[] = "#555500"; -static char selfloatbgcolor[] = "#117799"; -#endif // BAR_FLEXWINTITLE_PATCH - -#if BAR_ALPHA_PATCH -static const unsigned int baralpha = 0xd0; -static const unsigned int borderalpha = OPAQUE; -static const unsigned int alphas[][3] = { - /* fg bg border */ - [SchemeNorm] = { OPAQUE, baralpha, borderalpha }, - [SchemeSel] = { OPAQUE, baralpha, borderalpha }, - [SchemeTitleNorm] = { OPAQUE, baralpha, borderalpha }, - [SchemeTitleSel] = { OPAQUE, baralpha, borderalpha }, - [SchemeTagsNorm] = { OPAQUE, baralpha, borderalpha }, - [SchemeTagsSel] = { OPAQUE, baralpha, borderalpha }, - [SchemeHidNorm] = { OPAQUE, baralpha, borderalpha }, - [SchemeHidSel] = { OPAQUE, baralpha, borderalpha }, - [SchemeUrg] = { OPAQUE, baralpha, borderalpha }, - #if RENAMED_SCRATCHPADS_PATCH - [SchemeScratchSel] = { OPAQUE, baralpha, borderalpha }, - [SchemeScratchNorm] = { OPAQUE, baralpha, borderalpha }, - #endif // RENAMED_SCRATCHPADS_PATCH - #if BAR_FLEXWINTITLE_PATCH - [SchemeFlexActTTB] = { OPAQUE, baralpha, borderalpha }, - [SchemeFlexActLTR] = { OPAQUE, baralpha, borderalpha }, - [SchemeFlexActMONO] = { OPAQUE, baralpha, borderalpha }, - [SchemeFlexActGRID] = { OPAQUE, baralpha, borderalpha }, - [SchemeFlexActGRD1] = { OPAQUE, baralpha, borderalpha }, - [SchemeFlexActGRD2] = { OPAQUE, baralpha, borderalpha }, - [SchemeFlexActGRDM] = { OPAQUE, baralpha, borderalpha }, - [SchemeFlexActHGRD] = { OPAQUE, baralpha, borderalpha }, - [SchemeFlexActDWDL] = { OPAQUE, baralpha, borderalpha }, - [SchemeFlexActSPRL] = { OPAQUE, baralpha, borderalpha }, - [SchemeFlexActFloat] = { OPAQUE, baralpha, borderalpha }, - [SchemeFlexInaTTB] = { OPAQUE, baralpha, borderalpha }, - [SchemeFlexInaLTR] = { OPAQUE, baralpha, borderalpha }, - [SchemeFlexInaMONO] = { OPAQUE, baralpha, borderalpha }, - [SchemeFlexInaGRID] = { OPAQUE, baralpha, borderalpha }, - [SchemeFlexInaGRD1] = { OPAQUE, baralpha, borderalpha }, - [SchemeFlexInaGRD2] = { OPAQUE, baralpha, borderalpha }, - [SchemeFlexInaGRDM] = { OPAQUE, baralpha, borderalpha }, - [SchemeFlexInaHGRD] = { OPAQUE, baralpha, borderalpha }, - [SchemeFlexInaDWDL] = { OPAQUE, baralpha, borderalpha }, - [SchemeFlexInaSPRL] = { OPAQUE, baralpha, borderalpha }, - [SchemeFlexInaFloat] = { OPAQUE, baralpha, borderalpha }, - [SchemeFlexSelTTB] = { OPAQUE, baralpha, borderalpha }, - [SchemeFlexSelLTR] = { OPAQUE, baralpha, borderalpha }, - [SchemeFlexSelMONO] = { OPAQUE, baralpha, borderalpha }, - [SchemeFlexSelGRID] = { OPAQUE, baralpha, borderalpha }, - [SchemeFlexSelGRD1] = { OPAQUE, baralpha, borderalpha }, - [SchemeFlexSelGRD2] = { OPAQUE, baralpha, borderalpha }, - [SchemeFlexSelGRDM] = { OPAQUE, baralpha, borderalpha }, - [SchemeFlexSelHGRD] = { OPAQUE, baralpha, borderalpha }, - [SchemeFlexSelDWDL] = { OPAQUE, baralpha, borderalpha }, - [SchemeFlexSelSPRL] = { OPAQUE, baralpha, borderalpha }, - [SchemeFlexSelFloat] = { OPAQUE, baralpha, borderalpha }, - #endif // BAR_FLEXWINTITLE_PATCH -}; -#endif // BAR_ALPHA_PATCH -#if BAR_VTCOLORS_PATCH -static const char title_bg_dark[] = "#303030"; -static const char title_bg_light[] = "#fdfdfd"; -static const int color_ptrs[][ColCount] = { - /* fg bg border float */ - [SchemeNorm] = { -1, -1, 5, 12 }, - [SchemeSel] = { -1, -1, 11, 13 }, - [SchemeTitleNorm] = { 6, -1, -1, -1 }, - [SchemeTitleSel] = { 6, -1, -1, -1 }, - [SchemeTagsNorm] = { 2, 0, 0, -1 }, - [SchemeTagsSel] = { 6, 5, 5, -1 }, - [SchemeHidNorm] = { 5, 0, 0, -1 }, - [SchemeHidSel] = { 6, -1, -1, -1 }, - [SchemeUrg] = { 7, 9, 9, 15 }, -}; -#endif // BAR_VTCOLORS_PATCH - -static char *colors[][ColCount] = { - /* fg bg border float */ - [SchemeNorm] = { normfgcolor, normbgcolor, normbordercolor, normfloatcolor }, - [SchemeSel] = { selfgcolor, selbgcolor, selbordercolor, selfloatcolor }, - [SchemeTitleNorm] = { titlenormfgcolor, titlenormbgcolor, titlenormbordercolor, titlenormfloatcolor }, - [SchemeTitleSel] = { titleselfgcolor, titleselbgcolor, titleselbordercolor, titleselfloatcolor }, - [SchemeTagsNorm] = { tagsnormfgcolor, tagsnormbgcolor, tagsnormbordercolor, tagsnormfloatcolor }, - [SchemeTagsSel] = { tagsselfgcolor, tagsselbgcolor, tagsselbordercolor, tagsselfloatcolor }, - [SchemeHidNorm] = { hidnormfgcolor, hidnormbgcolor, c000000, c000000 }, - [SchemeHidSel] = { hidselfgcolor, hidselbgcolor, c000000, c000000 }, - [SchemeUrg] = { urgfgcolor, urgbgcolor, urgbordercolor, urgfloatcolor }, - #if RENAMED_SCRATCHPADS_PATCH - [SchemeScratchSel] = { scratchselfgcolor, scratchselbgcolor, scratchselbordercolor, scratchselfloatcolor }, - [SchemeScratchNorm] = { scratchnormfgcolor, scratchnormbgcolor, scratchnormbordercolor, scratchnormfloatcolor }, - #endif // RENAMED_SCRATCHPADS_PATCH - #if BAR_FLEXWINTITLE_PATCH - [SchemeFlexActTTB] = { titleselfgcolor, actTTBbgcolor, actTTBbgcolor, c000000 }, - [SchemeFlexActLTR] = { titleselfgcolor, actLTRbgcolor, actLTRbgcolor, c000000 }, - [SchemeFlexActMONO] = { titleselfgcolor, actMONObgcolor, actMONObgcolor, c000000 }, - [SchemeFlexActGRID] = { titleselfgcolor, actGRIDbgcolor, actGRIDbgcolor, c000000 }, - [SchemeFlexActGRD1] = { titleselfgcolor, actGRD1bgcolor, actGRD1bgcolor, c000000 }, - [SchemeFlexActGRD2] = { titleselfgcolor, actGRD2bgcolor, actGRD2bgcolor, c000000 }, - [SchemeFlexActGRDM] = { titleselfgcolor, actGRDMbgcolor, actGRDMbgcolor, c000000 }, - [SchemeFlexActHGRD] = { titleselfgcolor, actHGRDbgcolor, actHGRDbgcolor, c000000 }, - [SchemeFlexActDWDL] = { titleselfgcolor, actDWDLbgcolor, actDWDLbgcolor, c000000 }, - [SchemeFlexActSPRL] = { titleselfgcolor, actSPRLbgcolor, actSPRLbgcolor, c000000 }, - [SchemeFlexActFloat] = { titleselfgcolor, actfloatbgcolor, actfloatbgcolor, c000000 }, - [SchemeFlexInaTTB] = { titlenormfgcolor, normTTBbgcolor, normTTBbgcolor, c000000 }, - [SchemeFlexInaLTR] = { titlenormfgcolor, normLTRbgcolor, normLTRbgcolor, c000000 }, - [SchemeFlexInaMONO] = { titlenormfgcolor, normMONObgcolor, normMONObgcolor, c000000 }, - [SchemeFlexInaGRID] = { titlenormfgcolor, normGRIDbgcolor, normGRIDbgcolor, c000000 }, - [SchemeFlexInaGRD1] = { titlenormfgcolor, normGRD1bgcolor, normGRD1bgcolor, c000000 }, - [SchemeFlexInaGRD2] = { titlenormfgcolor, normGRD2bgcolor, normGRD2bgcolor, c000000 }, - [SchemeFlexInaGRDM] = { titlenormfgcolor, normGRDMbgcolor, normGRDMbgcolor, c000000 }, - [SchemeFlexInaHGRD] = { titlenormfgcolor, normHGRDbgcolor, normHGRDbgcolor, c000000 }, - [SchemeFlexInaDWDL] = { titlenormfgcolor, normDWDLbgcolor, normDWDLbgcolor, c000000 }, - [SchemeFlexInaSPRL] = { titlenormfgcolor, normSPRLbgcolor, normSPRLbgcolor, c000000 }, - [SchemeFlexInaFloat] = { titlenormfgcolor, normfloatbgcolor, normfloatbgcolor, c000000 }, - [SchemeFlexSelTTB] = { titleselfgcolor, selTTBbgcolor, selTTBbgcolor, c000000 }, - [SchemeFlexSelLTR] = { titleselfgcolor, selLTRbgcolor, selLTRbgcolor, c000000 }, - [SchemeFlexSelMONO] = { titleselfgcolor, selMONObgcolor, selMONObgcolor, c000000 }, - [SchemeFlexSelGRID] = { titleselfgcolor, selGRIDbgcolor, selGRIDbgcolor, c000000 }, - [SchemeFlexSelGRD1] = { titleselfgcolor, selGRD1bgcolor, selGRD1bgcolor, c000000 }, - [SchemeFlexSelGRD2] = { titleselfgcolor, selGRD2bgcolor, selGRD2bgcolor, c000000 }, - [SchemeFlexSelGRDM] = { titleselfgcolor, selGRDMbgcolor, selGRDMbgcolor, c000000 }, - [SchemeFlexSelHGRD] = { titleselfgcolor, selHGRDbgcolor, selHGRDbgcolor, c000000 }, - [SchemeFlexSelDWDL] = { titleselfgcolor, selDWDLbgcolor, selDWDLbgcolor, c000000 }, - [SchemeFlexSelSPRL] = { titleselfgcolor, selSPRLbgcolor, selSPRLbgcolor, c000000 }, - [SchemeFlexSelFloat] = { titleselfgcolor, selfloatbgcolor, selfloatbgcolor, c000000 }, - #endif // BAR_FLEXWINTITLE_PATCH -}; - -#if BAR_POWERLINE_STATUS_PATCH -static char *statuscolors[][ColCount] = { - /* fg bg border float */ - [SchemeNorm] = { normfgcolor, normbgcolor, normbordercolor, normfloatcolor }, - [SchemeSel] = { selfgcolor, selbgcolor, selbordercolor, selfloatcolor }, - [SchemeTitleNorm] = { titlenormfgcolor, titlenormbgcolor, titlenormbordercolor, titlenormfloatcolor }, - [SchemeTitleSel] = { titleselfgcolor, titleselbgcolor, titleselbordercolor, titleselfloatcolor }, - [SchemeTagsNorm] = { tagsnormfgcolor, tagsnormbgcolor, tagsnormbordercolor, tagsnormfloatcolor }, - [SchemeTagsSel] = { tagsselfgcolor, tagsselbgcolor, tagsselbordercolor, tagsselfloatcolor }, - [SchemeHidNorm] = { hidnormfgcolor, hidnormbgcolor, c000000, c000000 }, - [SchemeHidSel] = { hidselfgcolor, hidselbgcolor, c000000, c000000 }, - [SchemeUrg] = { urgfgcolor, urgbgcolor, urgbordercolor, urgfloatcolor }, -}; -#endif // BAR_POWERLINE_STATUS_PATCH - -#if BAR_LAYOUTMENU_PATCH -static const char *layoutmenu_cmd = "layoutmenu.sh"; -#endif - -#if COOL_AUTOSTART_PATCH -static const char *const autostart[] = { - "st", NULL, - NULL /* terminate */ -}; -#endif // COOL_AUTOSTART_PATCH - -#if RENAMED_SCRATCHPADS_PATCH -static const char *scratchpadcmd[] = {"s", "st", "-n", "spterm", NULL}; -#elif SCRATCHPADS_PATCH -const char *spcmd1[] = {"alacritty", "-t", "scratchpad", "--option", "window.dimensions.columns=120", "--option", "window.dimensions.lines=34", NULL }; -static Sp scratchpads[] = { - /* name cmd */ - {"spterm", spcmd1}, -}; -#endif // SCRATCHPADS_PATCH - -/* Tags - * In a traditional dwm the number of tags in use can be changed simply by changing the number - * of strings in the tags array. This build does things a bit different which has some added - * benefits. If you need to change the number of tags here then change the NUMTAGS macro in dwm.c. - * - * Examples: - * - * 1) static char *tagicons[][NUMTAGS*2] = { - * [DEFAULT_TAGS] = { "1", "2", "3", "4", "5", "6", "7", "8", "9", "A", "B", "C", "D", "E", "F", "G", "H", "I" }, - * } - * - * 2) static char *tagicons[][1] = { - * [DEFAULT_TAGS] = { "•" }, - * } - * - * The first example would result in the tags on the first monitor to be 1 through 9, while the - * tags for the second monitor would be named A through I. A third monitor would start again at - * 1 through 9 while the tags on a fourth monitor would also be named A through I. Note the tags - * count of NUMTAGS*2 in the array initialiser which defines how many tag text / icon exists in - * the array. This can be changed to *3 to add separate icons for a third monitor. - * - * For the second example each tag would be represented as a bullet point. Both cases work the - * same from a technical standpoint - the icon index is derived from the tag index and the monitor - * index. If the icon index is is greater than the number of tag icons then it will wrap around - * until it an icon matches. Similarly if there are two tag icons then it would alternate between - * them. This works seamlessly with alternative tags and alttagsdecoration patches. - */ -#if NAMETAG_PATCH -static char tagicons[][NUMTAGS][MAX_TAGLEN] = -#else -static char *tagicons[][NUMTAGS] = -#endif // NAMETAG_PATCH -{ - [DEFAULT_TAGS] = { "1", "2", "3", "4", "5", "6", "7", "8", "9" }, - [ALTERNATIVE_TAGS] = { "A", "B", "C", "D", "E", "F", "G", "H", "I" }, - [ALT_TAGS_DECORATION] = { "<1>", "<2>", "<3>", "<4>", "<5>", "<6>", "<7>", "<8>", "<9>" }, -}; - -#if BAR_TAGGRID_PATCH -/* grid of tags */ -#define SWITCHTAG_UP 1 << 0 -#define SWITCHTAG_DOWN 1 << 1 -#define SWITCHTAG_LEFT 1 << 2 -#define SWITCHTAG_RIGHT 1 << 3 -#define SWITCHTAG_TOGGLETAG 1 << 4 -#define SWITCHTAG_TAG 1 << 5 -#define SWITCHTAG_VIEW 1 << 6 -#define SWITCHTAG_TOGGLEVIEW 1 << 7 - -static const int tagrows = 2; -#endif // BAR_TAGGRID_PATCH - -/* There are two options when it comes to per-client rules: - * - a typical struct table or - * - using the RULE macro - * - * A traditional struct table looks like this: - * // class instance title wintype tags mask isfloating monitor - * { "Gimp", NULL, NULL, NULL, 1 << 4, 0, -1 }, - * { "Firefox", NULL, NULL, NULL, 1 << 7, 0, -1 }, - * - * The RULE macro has the default values set for each field allowing you to only - * specify the values that are relevant for your rule, e.g. - * - * RULE(.class = "Gimp", .tags = 1 << 4) - * RULE(.class = "Firefox", .tags = 1 << 7) - * - * Refer to the Rule struct definition for the list of available fields depending on - * the patches you enable. - */ -static const Rule rules[] = { - /* xprop(1): - * WM_CLASS(STRING) = instance, class - * WM_NAME(STRING) = title - * WM_WINDOW_ROLE(STRING) = role - * _NET_WM_WINDOW_TYPE(ATOM) = wintype - */ - RULE(.wintype = WTYPE "DIALOG", .isfloating = 1) - RULE(.wintype = WTYPE "UTILITY", .isfloating = 1) - RULE(.wintype = WTYPE "TOOLBAR", .isfloating = 1) - RULE(.wintype = WTYPE "SPLASH", .isfloating = 1) - RULE(.class = "Gimp", .tags = 1 << 4) - RULE(.class = "Firefox", .tags = 1 << 7) - #if RENAMED_SCRATCHPADS_PATCH - RULE(.instance = "spterm", .scratchkey = 's', .isfloating = 1) - #elif SCRATCHPADS_PATCH - RULE(.instance = "spterm", .tags = SPTAG(0), .isfloating = 1) - #endif // SCRATCHPADS_PATCH -}; - -#if MONITOR_RULES_PATCH -#if PERTAG_PATCH -static const MonitorRule monrules[] = { - /* monitor tag layout mfact nmaster showbar topbar */ - { 1, -1, 2, -1, -1, -1, -1 }, // use a different layout for the second monitor - { -1, -1, 0, -1, -1, -1, -1 }, // default -}; -#else -static const MonitorRule monrules[] = { - /* monitor layout mfact nmaster showbar topbar */ - { 1, 2, -1, -1, -1, -1 }, // use a different layout for the second monitor - { -1, 0, -1, -1, -1, -1 }, // default -}; -#endif // PERTAG_PATCH -#endif // MONITOR_RULES_PATCH - -#if INSETS_PATCH -static const Inset default_inset = { - .x = 0, - .y = 30, - .w = 0, - .h = 0, -}; -#endif // INSETS_PATCH - -/* Bar rules allow you to configure what is shown where on the bar, as well as - * introducing your own bar modules. - * - * monitor: - * -1 show on all monitors - * 0 show on monitor 0 - * 'A' show on active monitor (i.e. focused / selected) (or just -1 for active?) - * bar - bar index, 0 is default, 1 is extrabar - * alignment - how the module is aligned compared to other modules - * widthfunc, drawfunc, clickfunc - providing bar module width, draw and click functions - * name - does nothing, intended for visual clue and for logging / debugging - */ -static const BarRule barrules[] = { - /* monitor bar alignment widthfunc drawfunc clickfunc hoverfunc name */ - #if BAR_STATUSBUTTON_PATCH - { -1, 0, BAR_ALIGN_LEFT, width_stbutton, draw_stbutton, click_stbutton, NULL, "statusbutton" }, - #endif // BAR_STATUSBUTTON_PATCH - #if BAR_POWERLINE_TAGS_PATCH - { 0, 0, BAR_ALIGN_LEFT, width_pwrl_tags, draw_pwrl_tags, click_pwrl_tags, NULL, "powerline_tags" }, - #endif // BAR_POWERLINE_TAGS_PATCH - #if BAR_TAGS_PATCH - { -1, 0, BAR_ALIGN_LEFT, width_tags, draw_tags, click_tags, hover_tags, "tags" }, - #endif // BAR_TAGS_PATCH - #if BAR_TAGLABELS_PATCH - { -1, 0, BAR_ALIGN_LEFT, width_taglabels, draw_taglabels, click_taglabels, NULL, "taglabels" }, - #endif // BAR_TAGLABELS_PATCH - #if BAR_TAGGRID_PATCH - { -1, 0, BAR_ALIGN_LEFT, width_taggrid, draw_taggrid, click_taggrid, NULL, "taggrid" }, - #endif // BAR_TAGGRID_PATCH - #if BAR_SYSTRAY_PATCH - { 0, 0, BAR_ALIGN_RIGHT, width_systray, draw_systray, click_systray, NULL, "systray" }, - #endif // BAR_SYSTRAY_PATCH - #if BAR_LTSYMBOL_PATCH - { -1, 0, BAR_ALIGN_LEFT, width_ltsymbol, draw_ltsymbol, click_ltsymbol, NULL, "layout" }, - #endif // BAR_LTSYMBOL_PATCH - #if BAR_STATUSCOLORS_PATCH && BAR_STATUSCMD_PATCH - { statusmon, 0, BAR_ALIGN_RIGHT, width_statuscolors, draw_statuscolors, click_statuscmd, NULL, "statuscolors" }, - #elif BAR_STATUSCOLORS_PATCH - { statusmon, 0, BAR_ALIGN_RIGHT, width_statuscolors, draw_statuscolors, click_statuscolors, NULL, "statuscolors" }, - #elif BAR_STATUS2D_PATCH && BAR_STATUSCMD_PATCH - { statusmon, 0, BAR_ALIGN_RIGHT, width_status2d, draw_status2d, click_statuscmd, NULL, "status2d" }, - #elif BAR_STATUS2D_PATCH - { statusmon, 0, BAR_ALIGN_RIGHT, width_status2d, draw_status2d, click_status2d, NULL, "status2d" }, - #elif BAR_POWERLINE_STATUS_PATCH - { statusmon, 0, BAR_ALIGN_RIGHT, width_pwrl_status, draw_pwrl_status, click_pwrl_status, NULL, "powerline_status" }, - #elif BAR_STATUS_PATCH && BAR_STATUSCMD_PATCH - { statusmon, 0, BAR_ALIGN_RIGHT, width_status, draw_status, click_statuscmd, NULL, "status" }, - #elif BAR_STATUS_PATCH - { statusmon, 0, BAR_ALIGN_RIGHT, width_status, draw_status, click_status, NULL, "status" }, - #endif // BAR_STATUS2D_PATCH | BAR_STATUSCMD_PATCH - #if XKB_PATCH - { 0, 0, BAR_ALIGN_RIGHT, width_xkb, draw_xkb, click_xkb, NULL, "xkb" }, - #endif // XKB_PATCH - #if BAR_FLEXWINTITLE_PATCH - { -1, 0, BAR_ALIGN_NONE, width_flexwintitle, draw_flexwintitle, click_flexwintitle, NULL, "flexwintitle" }, - #elif BAR_TABGROUPS_PATCH - { -1, 0, BAR_ALIGN_NONE, width_bartabgroups, draw_bartabgroups, click_bartabgroups, NULL, "bartabgroups" }, - #elif BAR_AWESOMEBAR_PATCH - { -1, 0, BAR_ALIGN_NONE, width_awesomebar, draw_awesomebar, click_awesomebar, NULL, "awesomebar" }, - #elif BAR_FANCYBAR_PATCH - { -1, 0, BAR_ALIGN_NONE, width_fancybar, draw_fancybar, click_fancybar, NULL, "fancybar" }, - #elif BAR_WINTITLE_PATCH - { -1, 0, BAR_ALIGN_NONE, width_wintitle, draw_wintitle, click_wintitle, NULL, "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, NULL, "statuscolors_es" }, - #elif BAR_STATUSCOLORS_PATCH - { statusmon, 1, BAR_ALIGN_CENTER, width_statuscolors_es, draw_statuscolors_es, click_statuscolors, NULL, "statuscolors_es" }, - #elif BAR_STATUS2D_PATCH && BAR_STATUSCMD_PATCH - { statusmon, 1, BAR_ALIGN_CENTER, width_status2d_es, draw_status2d_es, click_statuscmd_es, NULL, "status2d_es" }, - #elif BAR_STATUS2D_PATCH - { statusmon, 1, BAR_ALIGN_CENTER, width_status2d_es, draw_status2d_es, click_status2d, NULL, "status2d_es" }, - #elif BAR_POWERLINE_STATUS_PATCH - { statusmon, 1, BAR_ALIGN_RIGHT, width_pwrl_status_es, draw_pwrl_status_es, click_pwrl_status, NULL, "powerline_status" }, - #elif BAR_STATUSCMD_PATCH && BAR_STATUS_PATCH - { statusmon, 1, BAR_ALIGN_CENTER, width_status_es, draw_status_es, click_statuscmd_es, NULL, "status_es" }, - #elif BAR_STATUS_PATCH - { statusmon, 1, BAR_ALIGN_CENTER, width_status_es, draw_status_es, click_status, NULL, "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, NULL, "wintitle_hidden" }, - #endif - #if BAR_WINTITLE_FLOATING_PATCH - { -1, 1, BAR_ALIGN_LEFT, width_wintitle_floating, draw_wintitle_floating, click_wintitle_floating, NULL, "wintitle_floating" }, - #endif // BAR_WINTITLE_FLOATING_PATCH - #endif // BAR_FLEXWINTITLE_PATCH -}; - -/* layout(s) */ -static const float mfact = 0.55; /* factor of master area size [0.05..0.95] */ -static const int nmaster = 1; /* number of clients in master area */ -#if FLEXTILE_DELUXE_LAYOUT -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 */ -#endif // DECORATION_HINTS_PATCH - -#if NROWGRID_LAYOUT -#define FORCE_VSPLIT 1 -#endif - -#if TAPRESIZE_PATCH -/* mouse scroll resize */ -static const int scrollsensetivity = 30; /* 1 means resize window by 1 pixel for each scroll event */ -/* resizemousescroll direction argument list */ -static const int scrollargs[][2] = { - /* width change height change */ - { +scrollsensetivity, 0 }, - { -scrollsensetivity, 0 }, - { 0, +scrollsensetivity }, - { 0, -scrollsensetivity }, -}; -#endif // TAPRESIZE_PATCH - -#if FLEXTILE_DELUXE_LAYOUT -static const Layout layouts[] = { - /* symbol arrange function, { nmaster, nstack, layout, master axis, stack axis, secondary stack axis, symbol func } */ - { "[]=", flextile, { -1, -1, SPLIT_VERTICAL, TOP_TO_BOTTOM, TOP_TO_BOTTOM, 0, NULL } }, // default tile layout - { "><>", NULL, {0} }, /* no layout function means floating behavior */ - { "[M]", flextile, { -1, -1, NO_SPLIT, MONOCLE, MONOCLE, 0, NULL } }, // monocle - { "|||", flextile, { -1, -1, SPLIT_VERTICAL, LEFT_TO_RIGHT, TOP_TO_BOTTOM, 0, NULL } }, // columns (col) layout - { ">M>", flextile, { -1, -1, FLOATING_MASTER, LEFT_TO_RIGHT, LEFT_TO_RIGHT, 0, NULL } }, // floating master - { "[D]", flextile, { -1, -1, SPLIT_VERTICAL, TOP_TO_BOTTOM, MONOCLE, 0, NULL } }, // deck - { "TTT", flextile, { -1, -1, SPLIT_HORIZONTAL, LEFT_TO_RIGHT, LEFT_TO_RIGHT, 0, NULL } }, // bstack - { "===", flextile, { -1, -1, SPLIT_HORIZONTAL, LEFT_TO_RIGHT, TOP_TO_BOTTOM, 0, NULL } }, // bstackhoriz - { "|M|", flextile, { -1, -1, SPLIT_CENTERED_VERTICAL, LEFT_TO_RIGHT, TOP_TO_BOTTOM, TOP_TO_BOTTOM, NULL } }, // centeredmaster - { "-M-", flextile, { -1, -1, SPLIT_CENTERED_HORIZONTAL, TOP_TO_BOTTOM, LEFT_TO_RIGHT, LEFT_TO_RIGHT, NULL } }, // centeredmaster horiz - { ":::", flextile, { -1, -1, NO_SPLIT, GAPPLESSGRID, GAPPLESSGRID, 0, NULL } }, // gappless grid - { "[\\]", flextile, { -1, -1, NO_SPLIT, DWINDLE, DWINDLE, 0, NULL } }, // fibonacci dwindle - { "(@)", flextile, { -1, -1, NO_SPLIT, SPIRAL, SPIRAL, 0, NULL } }, // fibonacci spiral - { "[T]", flextile, { -1, -1, SPLIT_VERTICAL, LEFT_TO_RIGHT, TATAMI, 0, NULL } }, // tatami mats - #if TILE_LAYOUT - { "[]=", tile, {0} }, - #endif - #if MONOCLE_LAYOUT - { "[M]", monocle, {0} }, - #endif - #if BSTACK_LAYOUT - { "TTT", bstack, {0} }, - #endif - #if BSTACKHORIZ_LAYOUT - { "===", bstackhoriz, {0} }, - #endif - #if CENTEREDMASTER_LAYOUT - { "|M|", centeredmaster, {0} }, - #endif - #if CENTEREDFLOATINGMASTER_LAYOUT - { ">M>", centeredfloatingmaster, {0} }, - #endif - #if COLUMNS_LAYOUT - { "|||", col, {0} }, - #endif - #if DECK_LAYOUT - { "[D]", deck, {0} }, - #endif - #if FIBONACCI_SPIRAL_LAYOUT - { "(@)", spiral, {0} }, - #endif - #if FIBONACCI_DWINDLE_LAYOUT - { "[\\]", dwindle, {0} }, - #endif - #if GRIDMODE_LAYOUT - { "HHH", grid, {0} }, - #endif - #if HORIZGRID_LAYOUT - { "---", horizgrid, {0} }, - #endif - #if GAPPLESSGRID_LAYOUT - { ":::", gaplessgrid, {0} }, - #endif - #if NROWGRID_LAYOUT - { "###", nrowgrid, {0} }, - #endif -}; -#else -static const Layout layouts[] = { - /* symbol arrange function */ - #if TILE_LAYOUT - { "[]=", tile }, /* first entry is default */ - #endif - { "><>", NULL }, /* no layout function means floating behavior */ - #if MONOCLE_LAYOUT - { "[M]", monocle }, - #endif - #if BSTACK_LAYOUT - { "TTT", bstack }, - #endif - #if BSTACKHORIZ_LAYOUT - { "===", bstackhoriz }, - #endif - #if CENTEREDMASTER_LAYOUT - { "|M|", centeredmaster }, - #endif - #if CENTEREDFLOATINGMASTER_LAYOUT - { ">M>", centeredfloatingmaster }, - #endif - #if COLUMNS_LAYOUT - { "|||", col }, - #endif - #if DECK_LAYOUT - { "[D]", deck }, - #endif - #if FIBONACCI_SPIRAL_LAYOUT - { "(@)", spiral }, - #endif - #if FIBONACCI_DWINDLE_LAYOUT - { "[\\]", dwindle }, - #endif - #if GRIDMODE_LAYOUT - { "HHH", grid }, - #endif - #if HORIZGRID_LAYOUT - { "---", horizgrid }, - #endif - #if GAPPLESSGRID_LAYOUT - { ":::", gaplessgrid }, - #endif - #if NROWGRID_LAYOUT - { "###", nrowgrid }, - #endif -}; -#endif // FLEXTILE_DELUXE_LAYOUT - -#if XKB_PATCH -/* xkb frontend */ -static const char *xkb_layouts[] = { - "en", - "ru", -}; -#endif // XKB_PATCH - -/* key definitions */ -#define MODKEY Mod4Mask -#if COMBO_PATCH && SWAPTAGS_PATCH && TAGOTHERMONITOR_PATCH -#define TAGKEYS(KEY,TAG) \ - { MODKEY, KEY, comboview, {.ui = 1 << TAG} }, \ - { MODKEY|ControlMask, KEY, toggleview, {.ui = 1 << TAG} }, \ - { MODKEY|ShiftMask, KEY, combotag, {.ui = 1 << TAG} }, \ - { MODKEY|ControlMask|ShiftMask, KEY, toggletag, {.ui = 1 << TAG} }, \ - { MODKEY|Mod1Mask|ShiftMask, KEY, swaptags, {.ui = 1 << TAG} }, \ - { MODKEY|Mod1Mask, KEY, tagnextmon, {.ui = 1 << TAG} }, \ - { MODKEY|Mod1Mask|ControlMask, KEY, tagprevmon, {.ui = 1 << TAG} }, -#elif COMBO_PATCH && SWAPTAGS_PATCH -#define TAGKEYS(KEY,TAG) \ - { MODKEY, KEY, comboview, {.ui = 1 << TAG} }, \ - { MODKEY|ControlMask, KEY, toggleview, {.ui = 1 << TAG} }, \ - { MODKEY|ShiftMask, KEY, combotag, {.ui = 1 << TAG} }, \ - { MODKEY|ControlMask|ShiftMask, KEY, toggletag, {.ui = 1 << TAG} }, \ - { MODKEY|Mod1Mask|ShiftMask, KEY, swaptags, {.ui = 1 << TAG} }, -#elif COMBO_PATCH && TAGOTHERMONITOR_PATCH -#define TAGKEYS(KEY,TAG) \ - { MODKEY, KEY, comboview, {.ui = 1 << TAG} }, \ - { MODKEY|ControlMask, KEY, toggleview, {.ui = 1 << TAG} }, \ - { MODKEY|ShiftMask, KEY, combotag, {.ui = 1 << TAG} }, \ - { MODKEY|ControlMask|ShiftMask, KEY, toggletag, {.ui = 1 << TAG} }, \ - { MODKEY|Mod1Mask, KEY, tagnextmon, {.ui = 1 << TAG} }, \ - { MODKEY|Mod1Mask|ControlMask, KEY, tagprevmon, {.ui = 1 << TAG} }, -#elif COMBO_PATCH -#define TAGKEYS(KEY,TAG) \ - { MODKEY, KEY, comboview, {.ui = 1 << TAG} }, \ - { MODKEY|ControlMask, KEY, toggleview, {.ui = 1 << TAG} }, \ - { MODKEY|ShiftMask, KEY, combotag, {.ui = 1 << TAG} }, \ - { MODKEY|ControlMask|ShiftMask, KEY, toggletag, {.ui = 1 << TAG} }, -#elif SWAPTAGS_PATCH && TAGOTHERMONITOR_PATCH -#define TAGKEYS(KEY,TAG) \ - { MODKEY, KEY, view, {.ui = 1 << TAG} }, \ - { MODKEY|ControlMask, KEY, toggleview, {.ui = 1 << TAG} }, \ - { MODKEY|ShiftMask, KEY, tag, {.ui = 1 << TAG} }, \ - { MODKEY|ControlMask|ShiftMask, KEY, toggletag, {.ui = 1 << TAG} }, \ - { MODKEY|Mod1Mask|ShiftMask, KEY, swaptags, {.ui = 1 << TAG} }, \ - { MODKEY|Mod1Mask, KEY, tagnextmon, {.ui = 1 << TAG} }, \ - { MODKEY|Mod1Mask|ControlMask, KEY, tagprevmon, {.ui = 1 << TAG} }, -#elif SWAPTAGS_PATCH -#define TAGKEYS(KEY,TAG) \ - { MODKEY, KEY, view, {.ui = 1 << TAG} }, \ - { MODKEY|ControlMask, KEY, toggleview, {.ui = 1 << TAG} }, \ - { MODKEY|ShiftMask, KEY, tag, {.ui = 1 << TAG} }, \ - { MODKEY|ControlMask|ShiftMask, KEY, toggletag, {.ui = 1 << TAG} }, \ - { MODKEY|Mod1Mask|ShiftMask, KEY, swaptags, {.ui = 1 << TAG} }, -#elif TAGOTHERMONITOR_PATCH -#define TAGKEYS(KEY,TAG) \ - { MODKEY, KEY, view, {.ui = 1 << TAG} }, \ - { MODKEY|ControlMask, KEY, toggleview, {.ui = 1 << TAG} }, \ - { MODKEY|ShiftMask, KEY, tag, {.ui = 1 << TAG} }, \ - { MODKEY|ControlMask|ShiftMask, KEY, toggletag, {.ui = 1 << TAG} }, \ - { MODKEY|Mod1Mask, KEY, tagnextmon, {.ui = 1 << TAG} }, \ - { MODKEY|Mod1Mask|ControlMask, KEY, tagprevmon, {.ui = 1 << TAG} }, -#else -#define TAGKEYS(KEY,TAG) \ - { MODKEY, KEY, view, {.ui = 1 << TAG} }, \ - { MODKEY|ControlMask, KEY, toggleview, {.ui = 1 << TAG} }, \ - { MODKEY|ShiftMask, KEY, tag, {.ui = 1 << TAG} }, \ - { MODKEY|ControlMask|ShiftMask, KEY, toggletag, {.ui = 1 << TAG} }, -#endif // COMBO_PATCH / SWAPTAGS_PATCH / TAGOTHERMONITOR_PATCH - -#if STACKER_PATCH -#define STACKKEYS(MOD,ACTION) \ - { MOD, XK_j, ACTION##stack, {.i = INC(+1) } }, \ - { MOD, XK_k, ACTION##stack, {.i = INC(-1) } }, \ - { MOD, XK_s, ACTION##stack, {.i = PREVSEL } }, \ - { MOD, XK_w, ACTION##stack, {.i = 0 } }, \ - { MOD, XK_e, ACTION##stack, {.i = 1 } }, \ - { MOD, XK_a, ACTION##stack, {.i = 2 } }, \ - { MOD, XK_z, ACTION##stack, {.i = -1 } }, -#endif // STACKER_PATCH - -#if BAR_HOLDBAR_PATCH -#define HOLDKEY 0 // replace 0 with the keysym to activate holdbar -#endif // BAR_HOLDBAR_PATCH - -/* helper for spawning shell commands in the pre dwm-5.0 fashion */ -#define SHCMD(cmd) { .v = (const char*[]){ "/bin/sh", "-c", cmd, NULL } } - -/* commands */ -#if !NODMENU_PATCH -static char dmenumon[2] = "0"; /* component of dmenucmd, manipulated in spawn() */ -#endif // NODMENU_PATCH -static const char *rofidruncmd[] = {"rofi", "-show", "drun", "-modi", "drun,run,window,calc", "-no-show-match", "-no-sort", "-automatic-save-to-history", NULL}; -static const char *dmenucmd[] = { - "dmenu_run", - #if !NODMENU_PATCH - "-m", dmenumon, - #endif // NODMENU_PATCH - "-fn", dmenufont, - "-nb", normbgcolor, - "-nf", normfgcolor, - "-sb", selbgcolor, - "-sf", selfgcolor, - #if BAR_DMENUMATCHTOP_PATCH - topbar ? NULL : "-b", - #endif // BAR_DMENUMATCHTOP_PATCH - NULL -}; -static const char *termcmd[] = { "alacritty", NULL }; - -#if BAR_STATUSCMD_PATCH -#if BAR_DWMBLOCKS_PATCH -/* This defines the name of the executable that handles the bar (used for signalling purposes) */ -#define STATUSBAR "dwmblocks" -#else -/* commands spawned when clicking statusbar, the mouse button pressed is exported as BUTTON */ -static const StatusCmd statuscmds[] = { - { "notify-send Volume$BUTTON", 1 }, - { "notify-send CPU$BUTTON", 2 }, - { "notify-send Battery$BUTTON", 3 }, -}; -/* test the above with: xsetroot -name "$(printf '\x01Volume |\x02 CPU |\x03 Battery')" */ -static const char *statuscmd[] = { "/bin/sh", "-c", NULL, NULL }; -#endif // BAR_DWMBLOCKS_PATCH -#endif // BAR_STATUSCMD_PATCH - -#if ON_EMPTY_KEYS_PATCH -static const char* firefoxcmd[] = {"firefox", NULL}; -static const Key on_empty_keys[] = { - /* modifier key function argument */ - { 0, XK_f, spawn, {.v = firefoxcmd } }, -}; -#endif // ON_EMPTY_KEYS_PATCH - -static const Key keys[] = { - /* modifier key function argument */ - {0, XF86XK_AudioMute, spawn, {.v = mutevol}}, - {0, XF86XK_AudioLowerVolume, spawn, {.v = downvol}}, - {0, XF86XK_AudioRaiseVolume, spawn, {.v = upvol}}, - {0, XF86XK_AudioMicMute, spawn, {.v = mutemic}}, - {0, XF86XK_MonBrightnessDown, spawn, {.v = downbrt}}, - {0, XF86XK_MonBrightnessUp, spawn, {.v = upbrt}}, - {0, XF86XK_Display, spawn, {.v = displ}}, - {0, XF86XK_WLAN, spawn, {.v = wlan}}, - {0, XF86XK_Tools, spawn, {.v = tools}}, - {0, XF86XK_Search, spawn, {.v = search}}, - {0, XF86XK_LaunchA, alttabstart, {0}}, - {0, XF86XK_Explorer, spawn, {.v = explorer}}, - { MODKEY, XK_n, spawn, {.v = explorer} }, - { MODKEY|ShiftMask, XK_l, spawn, {.v = locksession} }, - #if KEYMODES_PATCH - { MODKEY, XK_Escape, setkeymode, {.ui = COMMANDMODE} }, - #endif // KEYMODES_PATCH - { MODKEY, XK_p, spawn, {.v = dmenucmd } }, - { MODKEY|ShiftMask, XK_Return, spawn, {.v = termcmd } }, - #if RIODRAW_PATCH - { MODKEY|ControlMask, XK_p, riospawnsync, {.v = dmenucmd } }, - { MODKEY|ControlMask, XK_Return, riospawn, {.v = termcmd } }, - { MODKEY, XK_s, rioresize, {0} }, - #endif // RIODRAW_PATCH - { MODKEY, XK_b, togglebar, {0} }, - #if TAB_PATCH - { MODKEY|ControlMask, XK_b, tabmode, {-1} }, - #endif // TAB_PATCH - #if FOCUSMASTER_PATCH - { MODKEY|ControlMask, XK_space, focusmaster, {0} }, - #endif // FOCUSMASTER_PATCH - #if STACKER_PATCH - STACKKEYS(MODKEY, focus) - STACKKEYS(MODKEY|ShiftMask, push) - #else - { MODKEY, XK_j, focusstack, {.i = +1 } }, - { MODKEY, XK_k, focusstack, {.i = -1 } }, - #endif // STACKER_PATCH - #if FOCUSDIR_PATCH - { MODKEY, XK_Left, focusdir, {.i = 0 } }, // left - { MODKEY, XK_Right, focusdir, {.i = 1 } }, // right - { MODKEY, XK_Up, focusdir, {.i = 2 } }, // up - { MODKEY, XK_Down, focusdir, {.i = 3 } }, // down - #endif // FOCUSDIR_PATCH - #if SWAPFOCUS_PATCH && PERTAG_PATCH - { MODKEY, XK_s, swapfocus, {.i = -1 } }, - #endif // SWAPFOCUS_PATCH - #if SWITCHCOL_PATCH - { MODKEY, XK_v, switchcol, {0} }, - #endif // SWITCHCOL_PATCH - #if ROTATESTACK_PATCH - { MODKEY|Mod1Mask, XK_j, rotatestack, {.i = +1 } }, - { MODKEY|Mod1Mask, XK_k, rotatestack, {.i = -1 } }, - #endif // ROTATESTACK_PATCH - #if INPLACEROTATE_PATCH - { MODKEY|Mod1Mask, XK_j, inplacerotate, {.i = +2 } }, // same as rotatestack - { MODKEY|Mod1Mask, XK_k, inplacerotate, {.i = -2 } }, // same as reotatestack - { MODKEY|Mod1Mask|ShiftMask, XK_j, inplacerotate, {.i = +1} }, - { MODKEY|Mod1Mask|ShiftMask, XK_k, inplacerotate, {.i = -1} }, - #endif // INPLACEROTATE_PATCH - #if PUSH_PATCH || PUSH_NO_MASTER_PATCH - { MODKEY|ControlMask, XK_j, pushdown, {0} }, - { MODKEY|ControlMask, XK_k, pushup, {0} }, - #endif // PUSH_PATCH / PUSH_NO_MASTER_PATCH - { MODKEY, XK_i, incnmaster, {.i = +1 } }, - { MODKEY, XK_d, incnmaster, {.i = -1 } }, - #if FLEXTILE_DELUXE_LAYOUT - { MODKEY|ControlMask, XK_i, incnstack, {.i = +1 } }, - { MODKEY|ControlMask, XK_u, incnstack, {.i = -1 } }, - #endif // FLEXTILE_DELUXE_LAYOUT - { MODKEY, XK_h, setmfact, {.f = -0.05} }, - { MODKEY, XK_l, setmfact, {.f = +0.05} }, - #if CFACTS_PATCH - { MODKEY|ShiftMask, XK_h, setcfact, {.f = +0.25} }, - { MODKEY|ShiftMask, XK_l, setcfact, {.f = -0.25} }, - { MODKEY|ShiftMask, XK_o, setcfact, {0} }, - #endif // CFACTS_PATCH - #if ASPECTRESIZE_PATCH - { MODKEY|ControlMask|ShiftMask, XK_e, aspectresize, {.i = +24} }, - { MODKEY|ControlMask|ShiftMask, XK_r, aspectresize, {.i = -24} }, - #endif // ASPECTRESIZE_PATCH - #if MOVERESIZE_PATCH - { MODKEY|Mod1Mask, XK_Down, moveresize, {.v = "0x 25y 0w 0h" } }, - { MODKEY|Mod1Mask, XK_Up, moveresize, {.v = "0x -25y 0w 0h" } }, - { MODKEY|Mod1Mask, XK_Right, moveresize, {.v = "25x 0y 0w 0h" } }, - { MODKEY|Mod1Mask, XK_Left, moveresize, {.v = "-25x 0y 0w 0h" } }, - { MODKEY|Mod1Mask|ShiftMask, XK_Down, moveresize, {.v = "0x 0y 0w 25h" } }, - { MODKEY|Mod1Mask|ShiftMask, XK_Up, moveresize, {.v = "0x 0y 0w -25h" } }, - { MODKEY|Mod1Mask|ShiftMask, XK_Right, moveresize, {.v = "0x 0y 25w 0h" } }, - { MODKEY|Mod1Mask|ShiftMask, XK_Left, moveresize, {.v = "0x 0y -25w 0h" } }, - #endif // MOVERESIZE_PATCH - #if MOVESTACK_PATCH - { MODKEY|ShiftMask, XK_j, movestack, {.i = +1 } }, - { MODKEY|ShiftMask, XK_k, movestack, {.i = -1 } }, - #endif // MOVESTACK_PATCH - #if TRANSFER_PATCH - { MODKEY, XK_x, transfer, {0} }, - #endif // TRANSFER_PATCH - #if TRANSFER_ALL_PATCH - { MODKEY|ControlMask, XK_x, transferall, {0} }, - #endif // TRANSFER_ALL_PATCH - #if REORGANIZETAGS_PATCH - { MODKEY|ControlMask, XK_r, reorganizetags, {0} }, - #endif // REORGANIZETAGS_PATCH - #if DISTRIBUTETAGS_PATCH - { MODKEY|ControlMask, XK_d, distributetags, {0} }, - #endif // DISTRIBUTETAGS_PATCH - #if INSETS_PATCH - { MODKEY|ShiftMask|ControlMask, XK_a, updateinset, {.v = &default_inset } }, - #endif // INSETS_PATCH - { MODKEY, XK_Return, zoom, {0} }, - #if VANITYGAPS_PATCH - { MODKEY|Mod1Mask, XK_u, incrgaps, {.i = +1 } }, - { MODKEY|Mod1Mask|ShiftMask, XK_u, incrgaps, {.i = -1 } }, - { MODKEY|Mod1Mask, XK_i, incrigaps, {.i = +1 } }, - { MODKEY|Mod1Mask|ShiftMask, XK_i, incrigaps, {.i = -1 } }, - { MODKEY|Mod1Mask, XK_o, incrogaps, {.i = +1 } }, - { MODKEY|Mod1Mask|ShiftMask, XK_o, incrogaps, {.i = -1 } }, - { MODKEY|Mod1Mask, XK_6, incrihgaps, {.i = +1 } }, - { MODKEY|Mod1Mask|ShiftMask, XK_6, incrihgaps, {.i = -1 } }, - { MODKEY|Mod1Mask, XK_7, incrivgaps, {.i = +1 } }, - { MODKEY|Mod1Mask|ShiftMask, XK_7, incrivgaps, {.i = -1 } }, - { MODKEY|Mod1Mask, XK_8, incrohgaps, {.i = +1 } }, - { MODKEY|Mod1Mask|ShiftMask, XK_8, incrohgaps, {.i = -1 } }, - { MODKEY|Mod1Mask, XK_9, incrovgaps, {.i = +1 } }, - { MODKEY|Mod1Mask|ShiftMask, XK_9, incrovgaps, {.i = -1 } }, - { MODKEY|Mod1Mask, XK_0, togglegaps, {0} }, - { MODKEY|Mod1Mask|ShiftMask, XK_0, defaultgaps, {0} }, - #endif // VANITYGAPS_PATCH - #if ALT_TAB_PATCH - { Mod1Mask, XK_Tab, alttabstart, {0} }, - #else - { MODKEY, XK_Tab, view, {0} }, - #endif // ALT_TAB_PATCH - #if SHIFTTAG_PATCH - { MODKEY|ShiftMask, XK_Left, shifttag, { .i = -1 } }, // note keybinding conflict with focusadjacenttag tagtoleft - { MODKEY|ShiftMask, XK_Right, shifttag, { .i = +1 } }, // note keybinding conflict with focusadjacenttag tagtoright - #endif // SHIFTTAG_PATCH - #if SHIFTTAGCLIENTS_PATCH - { MODKEY|ShiftMask|ControlMask, XK_Left, shifttagclients, { .i = -1 } }, - { MODKEY|ShiftMask|ControlMask, XK_Right, shifttagclients, { .i = +1 } }, - #endif // SHIFTTAGCLIENTS_PATCH - #if SHIFTVIEW_PATCH - { MODKEY|ShiftMask, XK_Tab, shiftview, { .i = -1 } }, - { MODKEY|ShiftMask, XK_backslash, shiftview, { .i = +1 } }, - #endif // SHIFTVIEW_PATCH - #if SHIFTVIEW_CLIENTS_PATCH - { MODKEY|Mod1Mask, XK_Tab, shiftviewclients, { .i = -1 } }, - { MODKEY|Mod1Mask, XK_backslash, shiftviewclients, { .i = +1 } }, - #endif // SHIFTVIEW_CLIENTS_PATCH - #if SHIFTBOTH_PATCH - { MODKEY|ControlMask, XK_Left, shiftboth, { .i = -1 } }, // note keybinding conflict with focusadjacenttag tagandviewtoleft - { MODKEY|ControlMask, XK_Right, shiftboth, { .i = +1 } }, // note keybinding conflict with focusadjacenttag tagandviewtoright - #endif // SHIFTBOTH_PATCH - #if SHIFTSWAPTAGS_PATCH && SWAPTAGS_PATCH - { MODKEY|Mod1Mask|ShiftMask, XK_Left, shiftswaptags, { .i = -1 } }, - { MODKEY|Mod1Mask|ShiftMask, XK_Right, shiftswaptags, { .i = +1 } }, - #endif // SHIFTSWAPTAGS_PATCH - #if BAR_WINTITLEACTIONS_PATCH - { MODKEY|ControlMask, XK_z, showhideclient, {0} }, - #endif // BAR_WINTITLEACTIONS_PATCH - { MODKEY|ShiftMask, XK_c, killclient, {0} }, - { MODKEY, XK_q, killclient, {0} }, - #if KILLUNSEL_PATCH - { MODKEY|ShiftMask, XK_x, killunsel, {0} }, - #endif // KILLUNSEL_PATCH - #if SELFRESTART_PATCH - { MODKEY|ShiftMask, XK_r, self_restart, {0} }, - #endif // SELFRESTART_PATCH - { MODKEY|ShiftMask, XK_q, quit, {0} }, - #if RESTARTSIG_PATCH - { MODKEY|ControlMask|ShiftMask, XK_q, quit, {1} }, - #endif // RESTARTSIG_PATCH - #if FOCUSURGENT_PATCH - { MODKEY, XK_u, focusurgent, {0} }, - #endif // FOCUSURGENT_PATCH - #if BAR_HOLDBAR_PATCH - { 0, HOLDKEY, holdbar, {0} }, - #endif // BAR_HOLDBAR_PATCH - #if WINVIEW_PATCH - { MODKEY, XK_o, winview, {0} }, - #endif // WINVIEW_PATCH - #if XRDB_PATCH && !BAR_VTCOLORS_PATCH - { MODKEY|ShiftMask, XK_F5, xrdb, {.v = NULL } }, - #endif // XRDB_PATCH - { MODKEY, XK_t, setlayout, {.v = &layouts[0]} }, - { MODKEY, XK_f, setlayout, {.v = &layouts[1]} }, - { MODKEY, XK_m, setlayout, {.v = &layouts[2]} }, - #if COLUMNS_LAYOUT - { MODKEY, XK_c, setlayout, {.v = &layouts[3]} }, - #endif // COLUMNS_LAYOUT - #if FLEXTILE_DELUXE_LAYOUT - { MODKEY|ControlMask, XK_t, rotatelayoutaxis, {.i = +1 } }, /* flextile, 1 = layout axis */ - { MODKEY|ControlMask, XK_Tab, rotatelayoutaxis, {.i = +2 } }, /* flextile, 2 = master axis */ - { MODKEY|ControlMask|ShiftMask, XK_Tab, rotatelayoutaxis, {.i = +3 } }, /* flextile, 3 = stack axis */ - { MODKEY|ControlMask|Mod1Mask, XK_Tab, rotatelayoutaxis, {.i = +4 } }, /* flextile, 4 = secondary stack axis */ - { MODKEY|Mod5Mask, XK_t, rotatelayoutaxis, {.i = -1 } }, /* flextile, 1 = layout axis */ - { MODKEY|Mod5Mask, XK_Tab, rotatelayoutaxis, {.i = -2 } }, /* flextile, 2 = master axis */ - { MODKEY|Mod5Mask|ShiftMask, XK_Tab, rotatelayoutaxis, {.i = -3 } }, /* flextile, 3 = stack axis */ - { MODKEY|Mod5Mask|Mod1Mask, XK_Tab, rotatelayoutaxis, {.i = -4 } }, /* flextile, 4 = secondary stack axis */ - { MODKEY|ControlMask, XK_Return, mirrorlayout, {0} }, /* flextile, flip master and stack areas */ - #endif // FLEXTILE_DELUXE_LAYOUT - { MODKEY, XK_space, spawn, {.v = rofidruncmd}}, - { MODKEY|ShiftMask, XK_space, togglefloating, {0} }, - #if MAXIMIZE_PATCH - { MODKEY|ControlMask|ShiftMask, XK_h, togglehorizontalmax, {0} }, - { MODKEY|ControlMask|ShiftMask, XK_l, togglehorizontalmax, {0} }, - { MODKEY|ControlMask|ShiftMask, XK_j, toggleverticalmax, {0} }, - { MODKEY|ControlMask|ShiftMask, XK_k, toggleverticalmax, {0} }, - { MODKEY|ControlMask, XK_m, togglemax, {0} }, - #endif // MAXIMIZE_PATCH - #if NO_MOD_BUTTONS_PATCH - { MODKEY|ShiftMask, XK_Escape, togglenomodbuttons, {0} }, - #endif // NO_MOD_BUTTONS_PATCH - #if RENAMED_SCRATCHPADS_PATCH - { MODKEY, XK_grave, togglescratch, {.v = scratchpadcmd } }, - { MODKEY|ControlMask, XK_grave, setscratch, {.v = scratchpadcmd } }, - { MODKEY|ShiftMask, XK_grave, removescratch, {.v = scratchpadcmd } }, - #elif SCRATCHPADS_PATCH - { MODKEY, XK_grave, togglescratch, {.ui = 0 } }, - { MODKEY|ControlMask, XK_grave, setscratch, {.ui = 0 } }, - { MODKEY|ShiftMask, XK_grave, removescratch, {.ui = 0 } }, - #endif // SCRATCHPADS_PATCH | RENAMED_SCRATCHPADS_PATCH - #if UNFLOATVISIBLE_PATCH - { MODKEY|Mod1Mask, XK_space, unfloatvisible, {0} }, - { MODKEY|ShiftMask, XK_t, unfloatvisible, {.v = &layouts[0]} }, - #endif // UNFLOATVISIBLE_PATCH - #if TOGGLEFULLSCREEN_PATCH - { MODKEY, XK_y, togglefullscreen, {0} }, - #endif // TOGGLEFULLSCREEN_PATCH - #if !FAKEFULLSCREEN_PATCH && FAKEFULLSCREEN_CLIENT_PATCH - { MODKEY|ShiftMask, XK_y, togglefakefullscreen, {0} }, - #endif // FAKEFULLSCREEN_CLIENT_PATCH - #if FULLSCREEN_PATCH - { MODKEY|ShiftMask, XK_f, fullscreen, {0} }, - #endif // FULLSCREEN_PATCH - #if STICKY_PATCH - { MODKEY|ShiftMask, XK_s, togglesticky, {0} }, - #endif // STICKY_PATCH - #if SCRATCHPAD_ALT_1_PATCH - { MODKEY, XK_minus, scratchpad_show, {0} }, - { MODKEY|ShiftMask, XK_minus, scratchpad_hide, {0} }, - { MODKEY, XK_equal, scratchpad_remove, {0} }, - #elif SCRATCHPADS_PATCH && !RENAMED_SCRATCHPADS_PATCH - { MODKEY, XK_0, view, {.ui = ~SPTAGMASK } }, - { MODKEY|ShiftMask, XK_0, tag, {.ui = ~SPTAGMASK } }, - #else - { MODKEY, XK_0, view, {.ui = ~0 } }, - { MODKEY|ShiftMask, XK_0, tag, {.ui = ~0 } }, - #endif // SCRATCHPAD_ALT_1_PATCH - { MODKEY, XK_comma, focusmon, {.i = -1 } }, - { MODKEY, XK_period, focusmon, {.i = +1 } }, - { MODKEY|ShiftMask, XK_comma, tagmon, {.i = -1 } }, - { MODKEY|ShiftMask, XK_period, tagmon, {.i = +1 } }, - #if FOCUSADJACENTTAG_PATCH - { MODKEY, XK_Left, viewtoleft, {0} }, // note keybinding conflict with focusdir - { MODKEY, XK_Right, viewtoright, {0} }, // note keybinding conflict with focusdir - { MODKEY|ShiftMask, XK_Left, tagtoleft, {0} }, // note keybinding conflict with shifttag - { MODKEY|ShiftMask, XK_Right, tagtoright, {0} }, // note keybinding conflict with shifttag - { MODKEY|ControlMask, XK_Left, tagandviewtoleft, {0} }, - { MODKEY|ControlMask, XK_Right, tagandviewtoright, {0} }, - #endif // FOCUSADJACENTTAG_PATCH - #if TAGALL_PATCH - { MODKEY|ShiftMask, XK_F1, tagall, {.v = "F1"} }, - { MODKEY|ShiftMask, XK_F2, tagall, {.v = "F2"} }, - { MODKEY|ShiftMask, XK_F3, tagall, {.v = "F3"} }, - { MODKEY|ShiftMask, XK_F4, tagall, {.v = "F4"} }, - { MODKEY|ShiftMask, XK_F5, tagall, {.v = "F5"} }, - { MODKEY|ShiftMask, XK_F6, tagall, {.v = "F6"} }, - { MODKEY|ShiftMask, XK_F7, tagall, {.v = "F7"} }, - { MODKEY|ShiftMask, XK_F8, tagall, {.v = "F8"} }, - { MODKEY|ShiftMask, XK_F9, tagall, {.v = "F9"} }, - { MODKEY|ControlMask, XK_F1, tagall, {.v = "1"} }, - { MODKEY|ControlMask, XK_F2, tagall, {.v = "2"} }, - { MODKEY|ControlMask, XK_F3, tagall, {.v = "3"} }, - { MODKEY|ControlMask, XK_F4, tagall, {.v = "4"} }, - { MODKEY|ControlMask, XK_F5, tagall, {.v = "5"} }, - { MODKEY|ControlMask, XK_F6, tagall, {.v = "6"} }, - { MODKEY|ControlMask, XK_F7, tagall, {.v = "7"} }, - { MODKEY|ControlMask, XK_F8, tagall, {.v = "8"} }, - { MODKEY|ControlMask, XK_F9, tagall, {.v = "9"} }, - #endif // TAGALL_PATCH - #if TAGALLMON_PATCH - { MODKEY|Mod1Mask|ShiftMask, XK_comma, tagallmon, {.i = +1 } }, - { MODKEY|Mod1Mask|ShiftMask, XK_period, tagallmon, {.i = -1 } }, - #endif // TAGALLMON_PATCH - #if TAGSWAPMON_PATCH - { MODKEY|Mod1Mask|ControlMask, XK_comma, tagswapmon, {.i = +1 } }, - { MODKEY|Mod1Mask|ControlMask, XK_period, tagswapmon, {.i = -1 } }, - #endif // TAGSWAPMON_PATCH - #if BAR_ALTERNATIVE_TAGS_PATCH - { MODKEY, XK_n, togglealttag, {0} }, - #endif // BAR_ALTERNATIVE_TAGS_PATCH - #if NAMETAG_PATCH - { MODKEY|ShiftMask, XK_n, nametag, {0} }, - #endif // NAMETAG_PATCH - #if BAR_TAGGRID_PATCH - { MODKEY|ControlMask, XK_Up, switchtag, { .ui = SWITCHTAG_UP | SWITCHTAG_VIEW } }, - { MODKEY|ControlMask, XK_Down, switchtag, { .ui = SWITCHTAG_DOWN | SWITCHTAG_VIEW } }, - { MODKEY|ControlMask, XK_Right, switchtag, { .ui = SWITCHTAG_RIGHT | SWITCHTAG_VIEW } }, - { MODKEY|ControlMask, XK_Left, switchtag, { .ui = SWITCHTAG_LEFT | SWITCHTAG_VIEW } }, - { MODKEY|Mod1Mask, XK_Up, switchtag, { .ui = SWITCHTAG_UP | SWITCHTAG_TAG | SWITCHTAG_VIEW } }, - { MODKEY|Mod1Mask, XK_Down, switchtag, { .ui = SWITCHTAG_DOWN | SWITCHTAG_TAG | SWITCHTAG_VIEW } }, - { MODKEY|Mod1Mask, XK_Right, switchtag, { .ui = SWITCHTAG_RIGHT | SWITCHTAG_TAG | SWITCHTAG_VIEW } }, - { MODKEY|Mod1Mask, XK_Left, switchtag, { .ui = SWITCHTAG_LEFT | SWITCHTAG_TAG | SWITCHTAG_VIEW } }, - #endif // BAR_TAGGRID_PATCH - #if MOVEPLACE_PATCH - { MODKEY, XK_KP_7, moveplace, {.ui = WIN_NW }}, /* XK_KP_Home, */ - { MODKEY, XK_KP_8, moveplace, {.ui = WIN_N }}, /* XK_KP_Up, */ - { MODKEY, XK_KP_9, moveplace, {.ui = WIN_NE }}, /* XK_KP_Prior, */ - { MODKEY, XK_KP_4, moveplace, {.ui = WIN_W }}, /* XK_KP_Left, */ - { MODKEY, XK_KP_5, moveplace, {.ui = WIN_C }}, /* XK_KP_Begin, */ - { MODKEY, XK_KP_6, moveplace, {.ui = WIN_E }}, /* XK_KP_Right, */ - { MODKEY, XK_KP_1, moveplace, {.ui = WIN_SW }}, /* XK_KP_End, */ - { MODKEY, XK_KP_2, moveplace, {.ui = WIN_S }}, /* XK_KP_Down, */ - { MODKEY, XK_KP_3, moveplace, {.ui = WIN_SE }}, /* XK_KP_Next, */ - #endif // MOVEPLACE_PATCH - #if EXRESIZE_PATCH - { MODKEY, XK_KP_7, explace, {.ui = EX_NW }}, /* XK_KP_Home, */ - { MODKEY, XK_KP_8, explace, {.ui = EX_N }}, /* XK_KP_Up, */ - { MODKEY, XK_KP_9, explace, {.ui = EX_NE }}, /* XK_KP_Prior, */ - { MODKEY, XK_KP_4, explace, {.ui = EX_W }}, /* XK_KP_Left, */ - { MODKEY, XK_KP_5, explace, {.ui = EX_C }}, /* XK_KP_Begin, */ - { MODKEY, XK_KP_6, explace, {.ui = EX_E }}, /* XK_KP_Right, */ - { MODKEY, XK_KP_1, explace, {.ui = EX_SW }}, /* XK_KP_End, */ - { MODKEY, XK_KP_2, explace, {.ui = EX_S }}, /* XK_KP_Down, */ - { MODKEY, XK_KP_3, explace, {.ui = EX_SE }}, /* XK_KP_Next, */ - - { MODKEY|ShiftMask, XK_KP_8, exresize, {.v = (int []){ 0, 25 }}}, /* XK_KP_Up, */ - { MODKEY|ShiftMask, XK_KP_2, exresize, {.v = (int []){ 0, -25 }}}, /* XK_KP_Down, */ - { MODKEY|ShiftMask, XK_KP_6, exresize, {.v = (int []){ 25, 0 }}}, /* XK_KP_Right, */ - { MODKEY|ShiftMask, XK_KP_4, exresize, {.v = (int []){ -25, 0 }}}, /* XK_KP_Left, */ - { MODKEY|ShiftMask, XK_KP_5, exresize, {.v = (int []){ 25, 25 }}}, /* XK_KP_Begin, */ - { MODKEY|ShiftMask|ControlMask, XK_KP_5, exresize, {.v = (int []){ -25, -25 }}}, /* XK_KP_Begin, */ - - { MODKEY|ControlMask, XK_KP_6, togglehorizontalexpand, {.i = +1} }, /* XK_KP_Right, */ - { MODKEY|ControlMask, XK_KP_3, togglehorizontalexpand, {.i = 0} }, /* XK_KP_Next, */ - { MODKEY|ControlMask, XK_KP_4, togglehorizontalexpand, {.i = -1} }, /* XK_KP_Left, */ - { MODKEY|ControlMask, XK_KP_8, toggleverticalexpand, {.i = +1} }, /* XK_KP_Up, */ - { MODKEY|ControlMask, XK_KP_1, toggleverticalexpand, {.i = 0} }, /* XK_KP_End, */ - { MODKEY|ControlMask, XK_KP_2, toggleverticalexpand, {.i = -1} }, /* XK_KP_Down, */ - { MODKEY|ControlMask, XK_KP_9, togglemaximize, {.i = -1} }, /* XK_KP_Prior, */ - { MODKEY|ControlMask, XK_KP_7, togglemaximize, {.i = +1} }, /* XK_KP_Home, */ - { MODKEY|ControlMask, XK_KP_5, togglemaximize, {.i = 0} }, /* XK_KP_Begin, */ - #endif // EXRESIZE_PATCH - #if FLOATPOS_PATCH - /* Note that due to key limitations the below example kybindings are defined with a Mod3Mask, - * which is not always readily available. Refer to the patch wiki for more details. */ - /* Client position is limited to monitor window area */ - { Mod3Mask, XK_u, floatpos, {.v = "-26x -26y" } }, // ↖ - { Mod3Mask, XK_i, floatpos, {.v = " 0x -26y" } }, // ↑ - { Mod3Mask, XK_o, floatpos, {.v = " 26x -26y" } }, // ↗ - { Mod3Mask, XK_j, floatpos, {.v = "-26x 0y" } }, // ← - { Mod3Mask, XK_l, floatpos, {.v = " 26x 0y" } }, // → - { Mod3Mask, XK_m, floatpos, {.v = "-26x 26y" } }, // ↙ - { Mod3Mask, XK_comma, floatpos, {.v = " 0x 26y" } }, // ↓ - { Mod3Mask, XK_period, floatpos, {.v = " 26x 26y" } }, // ↘ - /* Absolute positioning (allows moving windows between monitors) */ - { Mod3Mask|ControlMask, XK_u, floatpos, {.v = "-26a -26a" } }, // ↖ - { Mod3Mask|ControlMask, XK_i, floatpos, {.v = " 0a -26a" } }, // ↑ - { Mod3Mask|ControlMask, XK_o, floatpos, {.v = " 26a -26a" } }, // ↗ - { Mod3Mask|ControlMask, XK_j, floatpos, {.v = "-26a 0a" } }, // ← - { Mod3Mask|ControlMask, XK_l, floatpos, {.v = " 26a 0a" } }, // → - { Mod3Mask|ControlMask, XK_m, floatpos, {.v = "-26a 26a" } }, // ↙ - { Mod3Mask|ControlMask, XK_comma, floatpos, {.v = " 0a 26a" } }, // ↓ - { Mod3Mask|ControlMask, XK_period, floatpos, {.v = " 26a 26a" } }, // ↘ - /* Resize client, client center position is fixed which means that client expands in all directions */ - { Mod3Mask|ShiftMask, XK_u, floatpos, {.v = "-26w -26h" } }, // ↖ - { Mod3Mask|ShiftMask, XK_i, floatpos, {.v = " 0w -26h" } }, // ↑ - { Mod3Mask|ShiftMask, XK_o, floatpos, {.v = " 26w -26h" } }, // ↗ - { Mod3Mask|ShiftMask, XK_j, floatpos, {.v = "-26w 0h" } }, // ← - { Mod3Mask|ShiftMask, XK_k, floatpos, {.v = "800W 800H" } }, // · - { Mod3Mask|ShiftMask, XK_l, floatpos, {.v = " 26w 0h" } }, // → - { Mod3Mask|ShiftMask, XK_m, floatpos, {.v = "-26w 26h" } }, // ↙ - { Mod3Mask|ShiftMask, XK_comma, floatpos, {.v = " 0w 26h" } }, // ↓ - { Mod3Mask|ShiftMask, XK_period, floatpos, {.v = " 26w 26h" } }, // ↘ - /* Client is positioned in a floating grid, movement is relative to client's current position */ - { Mod3Mask|Mod1Mask, XK_u, floatpos, {.v = "-1p -1p" } }, // ↖ - { Mod3Mask|Mod1Mask, XK_i, floatpos, {.v = " 0p -1p" } }, // ↑ - { Mod3Mask|Mod1Mask, XK_o, floatpos, {.v = " 1p -1p" } }, // ↗ - { Mod3Mask|Mod1Mask, XK_j, floatpos, {.v = "-1p 0p" } }, // ← - { Mod3Mask|Mod1Mask, XK_k, floatpos, {.v = " 0p 0p" } }, // · - { Mod3Mask|Mod1Mask, XK_l, floatpos, {.v = " 1p 0p" } }, // → - { Mod3Mask|Mod1Mask, XK_m, floatpos, {.v = "-1p 1p" } }, // ↙ - { Mod3Mask|Mod1Mask, XK_comma, floatpos, {.v = " 0p 1p" } }, // ↓ - { Mod3Mask|Mod1Mask, XK_period, floatpos, {.v = " 1p 1p" } }, // ↘ - #endif // FLOATPOS_PATCH - #if SETBORDERPX_PATCH - { MODKEY|ControlMask, XK_minus, setborderpx, {.i = -1 } }, - { MODKEY|ControlMask, XK_plus, setborderpx, {.i = +1 } }, - { MODKEY|ControlMask, XK_numbersign, setborderpx, {.i = 0 } }, - #endif // SETBORDERPX_PATCH - #if CYCLELAYOUTS_PATCH - { MODKEY|ControlMask, XK_comma, cyclelayout, {.i = -1 } }, - { MODKEY|ControlMask, XK_period, cyclelayout, {.i = +1 } }, - #endif // CYCLELAYOUTS_PATCH - #if MPDCONTROL_PATCH - { MODKEY, XK_F1, mpdchange, {.i = -1} }, - { MODKEY, XK_F2, mpdchange, {.i = +1} }, - { MODKEY, XK_Escape, mpdcontrol, {0} }, - #endif // MPDCONTROL_PATCH - TAGKEYS( XK_1, 0) - TAGKEYS( XK_2, 1) - TAGKEYS( XK_3, 2) - TAGKEYS( XK_4, 3) - TAGKEYS( XK_5, 4) - TAGKEYS( XK_6, 5) - TAGKEYS( XK_7, 6) - TAGKEYS( XK_8, 7) - TAGKEYS( XK_9, 8) -}; - -#if KEYMODES_PATCH -static const Key cmdkeys[] = { - /* modifier keys function argument */ - { 0, XK_Escape, clearcmd, {0} }, - { ControlMask, XK_c, clearcmd, {0} }, - { 0, XK_i, setkeymode, {.ui = INSERTMODE} }, -}; - -static const Command commands[] = { - /* modifier (4 keys) keysyms (4 keys) function argument */ - { {ControlMask, ShiftMask, 0, 0}, {XK_w, XK_h, 0, 0}, setlayout, {.v = &layouts[0]} }, - { {ControlMask, 0, 0, 0}, {XK_w, XK_o, 0, 0}, setlayout, {.v = &layouts[2]} }, - { {ControlMask, ShiftMask, 0, 0}, {XK_w, XK_o, 0, 0}, onlyclient, {0} }, - { {ControlMask, 0, 0, 0}, {XK_w, XK_v, 0, 0}, setlayout, {.v = &layouts[0]} }, - { {ControlMask, 0, 0, 0}, {XK_w, XK_less, 0, 0}, setmfact, {.f = -0.05} }, - { {ControlMask, ShiftMask, 0, 0}, {XK_w, XK_less, 0, 0}, setmfact, {.f = +0.05} }, - { {ControlMask, ShiftMask, 0, 0}, {XK_w, XK_0, 0, 0}, setmfact, {.f = +1.50} }, - { {ShiftMask, 0, 0, 0}, {XK_period, XK_e, 0, 0}, spawn, {.v = dmenucmd} }, - { {ShiftMask, 0, 0, 0}, {XK_period, XK_o, 0, 0}, spawn, {.v = dmenucmd} }, - { {ShiftMask, 0, 0, 0}, {XK_period, XK_q, XK_Return, 0}, quit, {0} }, - { {ShiftMask, 0, 0, 0}, {XK_period, XK_b, XK_d, XK_Return}, killclient, {0} }, - { {ShiftMask, 0, 0, 0}, {XK_period, XK_b, XK_n, XK_Return}, focusstack, {.i = +1} }, - { {ShiftMask, 0, ShiftMask, 0}, {XK_period, XK_b, XK_n, XK_Return}, focusstack, {.i = -1} }, -}; -#endif // KEYMODES_PATCH - -/* button definitions */ -#if STATUSBUTTON_PATCH -/* click can be ClkButton, ClkTagBar, ClkLtSymbol, ClkStatusText, ClkWinTitle, ClkClientWin, or ClkRootWin */ -#else -/* click can be ClkTagBar, ClkLtSymbol, ClkStatusText, ClkWinTitle, ClkClientWin, or ClkRootWin */ -#endif // -static const Button buttons[] = { - /* click event mask button function argument */ - #if BAR_STATUSBUTTON_PATCH - { ClkButton, 0, Button1, spawn, {.v = dmenucmd } }, - #endif // BAR_STATUSBUTTON_PATCH - { ClkLtSymbol, 0, Button1, setlayout, {0} }, - #if BAR_LAYOUTMENU_PATCH - { ClkLtSymbol, 0, Button3, layoutmenu, {0} }, - #else - { ClkLtSymbol, 0, Button3, setlayout, {.v = &layouts[2]} }, - #endif // BAR_LAYOUTMENU_PATCH - #if BAR_WINTITLEACTIONS_PATCH - { ClkWinTitle, 0, Button1, togglewin, {0} }, - { ClkWinTitle, 0, Button3, showhideclient, {0} }, - #endif // BAR_WINTITLEACTIONS_PATCH - { ClkWinTitle, 0, Button2, zoom, {0} }, - #if BAR_STATUSCMD_PATCH && BAR_DWMBLOCKS_PATCH - { ClkStatusText, 0, Button1, sigstatusbar, {.i = 1 } }, - { ClkStatusText, 0, Button2, sigstatusbar, {.i = 2 } }, - { ClkStatusText, 0, Button3, sigstatusbar, {.i = 3 } }, - #elif BAR_STATUSCMD_PATCH - { ClkStatusText, 0, Button1, spawn, {.v = statuscmd } }, - { ClkStatusText, 0, Button2, spawn, {.v = statuscmd } }, - { ClkStatusText, 0, Button3, spawn, {.v = statuscmd } }, - #else - { ClkStatusText, 0, Button2, spawn, {.v = termcmd } }, - #endif // BAR_STATUSCMD_PATCH - #if PLACEMOUSE_PATCH - /* placemouse options, choose which feels more natural: - * 0 - tiled position is relative to mouse cursor - * 1 - tiled postiion is relative to window center - * 2 - mouse pointer warps to window center - * - * The moveorplace uses movemouse or placemouse depending on the floating state - * of the selected client. Set up individual keybindings for the two if you want - * to control these separately (i.e. to retain the feature to move a tiled window - * into a floating position). - */ - { ClkClientWin, MODKEY, Button1, moveorplace, {.i = 1} }, - #else - { ClkClientWin, MODKEY, Button1, movemouse, {0} }, - #endif // PLACEMOUSE_PATCH - { ClkClientWin, MODKEY, Button2, togglefloating, {0} }, - { ClkClientWin, MODKEY, Button3, resizemouse, {0} }, - #if TAPRESIZE_PATCH - { ClkClientWin, MODKEY, Button4, resizemousescroll, {.v = &scrollargs[0]} }, - { ClkClientWin, MODKEY, Button5, resizemousescroll, {.v = &scrollargs[1]} }, - { ClkClientWin, MODKEY, Button6, resizemousescroll, {.v = &scrollargs[2]} }, - { ClkClientWin, MODKEY, Button7, resizemousescroll, {.v = &scrollargs[3]} }, - #endif // TAPRESIZE_PATCH - #if DRAGCFACT_PATCH && CFACTS_PATCH - { ClkClientWin, MODKEY|ShiftMask, Button3, dragcfact, {0} }, - #endif // DRAGCFACT_PATCH - #if DRAGMFACT_PATCH - { ClkClientWin, MODKEY|ShiftMask, Button1, dragmfact, {0} }, - #endif // DRAGMFACT_PATCH - { ClkTagBar, 0, Button1, view, {0} }, - { ClkTagBar, 0, Button3, toggleview, {0} }, - { ClkTagBar, MODKEY, Button1, tag, {0} }, - { ClkTagBar, MODKEY, Button3, toggletag, {0} }, - #if TAB_PATCH - { ClkTabBar, 0, Button1, focuswin, {0} }, - #endif // TAB_PATCH -}; - -#if DWMC_PATCH -/* signal definitions */ -/* signum must be greater than 0 */ -/* trigger signals using `xsetroot -name "fsignal: [ ]"` */ -static const Signal signals[] = { - /* signum function */ - { "focusstack", focusstack }, - { "setmfact", setmfact }, - { "togglebar", togglebar }, - { "incnmaster", incnmaster }, - { "togglefloating", togglefloating }, - { "focusmon", focusmon }, - #if STACKER_PATCH - { "pushstack", pushstack }, - #endif // STACKER_PATCH - #if FLOATPOS_PATCH - { "floatpos", floatpos }, - #endif // FLOATPOS_PATCH - #if FOCUSURGENT_PATCH - { "focusurgent", focusurgent }, - #endif // FOCUSURGENT_PATCH - #if FOCUSADJACENTTAG_PATCH - { "viewtoleft", viewtoleft }, - { "viewtoright", viewtoright }, - { "tagtoleft", tagtoleft }, - { "tagtoright", tagtoright}, - { "tagandviewtoleft", tagandviewtoleft }, - { "tagandviewtoright", tagandviewtoright }, - #endif // FOCUSADJACENTTAG_PATCH - #if SWAPFOCUS_PATCH && PERTAG_PATCH - { "swapfocus", swapfocus }, - #endif // SWAPFOCUS_PATCH - #if SWITCHCOL_PATCH - { "switchcol", switchcol }, - #endif // SWITCHCOL_PATCH - #if ROTATESTACK_PATCH - { "rotatestack", rotatestack }, - #endif // ROTATESTACK_PATCH - #if INPLACEROTATE_PATCH - { "inplacerotate", inplacerotate }, - #endif // INPLACEROTATE_PATCH - #if PUSH_PATCH || PUSH_NO_MASTER_PATCH - { "pushdown", pushdown }, - { "pushup", pushup }, - #endif // PUSH_PATCH / PUSH_NO_MASTER_PATCH - #if FLEXTILE_DELUXE_LAYOUT - { "incnstack", incnstack }, - { "rotatelayoutaxis", rotatelayoutaxis }, - { "setlayoutaxisex", setlayoutaxisex }, - { "mirrorlayout", mirrorlayout }, - #endif // FLEXTILE_DELUXE_LAYOUT - #if CFACTS_PATCH - { "setcfact", setcfact }, - #endif // CFACTS_PATCH - #if MOVEPLACE_PATCH - { "moveplace", moveplace }, - #endif // MOVEPLACE_PATCH - #if NAMETAG_PATCH - { "nametag", nametag }, - #endif // NAMETAG_PATCH - #if EXRESIZE_PATCH - { "explace", explace }, - { "togglehorizontalexpand", togglehorizontalexpand }, - { "toggleverticalexpand", toggleverticalexpand }, - { "togglemaximize", togglemaximize }, - #endif // EXRESIZE_PATCH - #if KEYMODES_PATCH - { "setkeymode", setkeymode }, - #endif // KEYMODES_PATCH - #if TRANSFER_PATCH - { "transfer", transfer }, - #endif // TRANSFER_PATCH - #if TRANSFER_ALL_PATCH - { "transferall", transferall }, - #endif // TRANSFER_ALL_PATCH - { "tagmon", tagmon }, - { "zoom", zoom }, - #if VANITYGAPS_PATCH - { "incrgaps", incrgaps }, - { "incrigaps", incrigaps }, - { "incrogaps", incrogaps }, - { "incrihgaps", incrihgaps }, - { "incrivgaps", incrivgaps }, - { "incrohgaps", incrohgaps }, - { "incrovgaps", incrovgaps }, - { "togglegaps", togglegaps }, - { "defaultgaps", defaultgaps }, - { "setgaps", setgapsex }, - #endif // VANITYGAPS_PATCH - { "view", view }, - { "viewall", viewallex }, - { "viewex", viewex }, - { "toggleview", toggleview }, - #if BAR_WINTITLEACTIONS_PATCH - { "showhideclient", showhideclient }, - #endif // BAR_WINTITLEACTIONS_PATCH - #if SHIFTBOTH_PATCH - { "shiftboth", shiftboth }, - #endif // SHIFTBOTH_PATCH - #if SHIFTTAG_PATCH - { "shifttag", shifttag }, - #endif // SHIFTTAG_PATCH - #if SHIFTTAGCLIENTS_PATCH - { "shifttagclients", shifttagclients }, - #endif // SHIFTTAGCLIENTS_PATCH - #if SHIFTVIEW_PATCH - { "shiftview", shiftview }, - #endif // SHIFTVIEW_PATCH - #if SHIFTVIEW_CLIENTS_PATCH - { "shiftviewclients", shiftviewclients }, - #endif // SHIFTVIEW_CLIENTS_PATCH - #if SHIFTSWAPTAGS_PATCH && SWAPTAGS_PATCH - { "shiftswaptags", shiftswaptags }, - #endif // SHIFTSWAPTAGS_PATCH - #if SELFRESTART_PATCH - { "self_restart", self_restart }, - #endif // SELFRESTART_PATCH - #if BAR_TAGGRID_PATCH - { "switchtag", switchtag }, - #endif // BAR_TAGGRID_PATCH - #if STICKY_PATCH - { "togglesticky", togglesticky }, - #endif // STICKY_PATCH - #if SETBORDERPX_PATCH - { "setborderpx", setborderpx }, - #endif // SETBORDERPX_PATCH - #if CYCLELAYOUTS_PATCH - { "cyclelayout", cyclelayout }, - #endif // CYCLELAYOUTS_PATCH - #if MPDCONTROL_PATCH - { "mpdchange", mpdchange }, - { "mpdcontrol", mpdcontrol }, - #endif // MPDCONTROL_PATCH - { "toggleviewex", toggleviewex }, - { "tag", tag }, - { "tagall", tagallex }, - { "tagex", tagex }, - { "toggletag", toggletag }, - { "toggletagex", toggletagex }, - #if TAGALLMON_PATCH - { "tagallmon", tagallmon }, - #endif // TAGALLMON_PATCH - #if TAGSWAPMON_PATCH - { "tagswapmon", tagswapmon}, - #endif // TAGSWAPMON_PATCH - #if BAR_ALTERNATIVE_TAGS_PATCH - { "togglealttag", togglealttag }, - #endif // BAR_ALTERNATIVE_TAGS_PATCH - #if TOGGLEFULLSCREEN_PATCH - { "togglefullscreen", togglefullscreen }, - #endif // TOGGLEFULLSCREEN_PATCH - #if !FAKEFULLSCREEN_PATCH && FAKEFULLSCREEN_CLIENT_PATCH - { "togglefakefullscreen", togglefakefullscreen }, - #endif // FAKEFULLSCREEN_CLIENT_PATCH - #if FULLSCREEN_PATCH - { "fullscreen", fullscreen }, - #endif // FULLSCREEN_PATCH - #if MAXIMIZE_PATCH - { "togglehorizontalmax", togglehorizontalmax }, - { "toggleverticalmax", toggleverticalmax }, - { "togglemax", togglemax }, - #endif // MAXIMIZE_PATCH - #if SCRATCHPADS_PATCH && !RENAMED_SCRATCHPADS_PATCH - { "togglescratch", togglescratch }, - #endif // SCRATCHPADS_PATCH - #if UNFLOATVISIBLE_PATCH - { "unfloatvisible", unfloatvisible }, - #endif // UNFLOATVISIBLE_PATCH - { "killclient", killclient }, - #if WINVIEW_PATCH - { "winview", winview }, - #endif // WINVIEW_PATCH - #if XRDB_PATCH && !BAR_VTCOLORS_PATCH - { "xrdb", xrdb }, - #endif // XRDB_PATCH - #if TAGOTHERMONITOR_PATCH - { "tagnextmonex", tagnextmonex }, - { "tagprevmonex", tagprevmonex }, - #endif // TAGOTHERMONITOR_PATCH - { "quit", quit }, - { "setlayout", setlayout }, - { "setlayoutex", setlayoutex }, -}; -#elif FSIGNAL_PATCH -/* signal definitions */ -/* signum must be greater than 0 */ -/* trigger signals using `xsetroot -name "fsignal:"` */ -static Signal signals[] = { - /* signum function argument */ - { 1, setlayout, {.v = 0} }, -}; -#endif // DWMC_PATCH - -#if IPC_PATCH -static const char *ipcsockpath = "/tmp/dwm.sock"; -static IPCCommand ipccommands[] = { - IPCCOMMAND( focusmon, 1, {ARG_TYPE_SINT} ), - IPCCOMMAND( focusstack, 1, {ARG_TYPE_SINT} ), - IPCCOMMAND( incnmaster, 1, {ARG_TYPE_SINT} ), - IPCCOMMAND( killclient, 1, {ARG_TYPE_SINT} ), - IPCCOMMAND( quit, 1, {ARG_TYPE_NONE} ), - IPCCOMMAND( setlayoutsafe, 1, {ARG_TYPE_PTR} ), - IPCCOMMAND( setmfact, 1, {ARG_TYPE_FLOAT} ), - IPCCOMMAND( setstatus, 1, {ARG_TYPE_STR} ), - IPCCOMMAND( tag, 1, {ARG_TYPE_UINT} ), - IPCCOMMAND( tagmon, 1, {ARG_TYPE_UINT} ), - IPCCOMMAND( togglebar, 1, {ARG_TYPE_NONE} ), - IPCCOMMAND( togglefloating, 1, {ARG_TYPE_NONE} ), - IPCCOMMAND( toggletag, 1, {ARG_TYPE_UINT} ), - IPCCOMMAND( toggleview, 1, {ARG_TYPE_UINT} ), - IPCCOMMAND( view, 1, {ARG_TYPE_UINT} ), - IPCCOMMAND( zoom, 1, {ARG_TYPE_NONE} ), - #if BAR_ALTERNATIVE_TAGS_PATCH - IPCCOMMAND( togglealttag, 1, {ARG_TYPE_NONE} ), - #endif // BAR_ALTERNATIVE_TAGS_PATCH - #if BAR_TAGGRID_PATCH - IPCCOMMAND( switchtag, 1, {ARG_TYPE_UINT} ), - #endif // BAR_TAGGRID_PATCH - #if CFACTS_PATCH - IPCCOMMAND( setcfact, 1, {ARG_TYPE_FLOAT} ), - #endif // CFACTS_PATCH - #if CYCLELAYOUTS_PATCH - IPCCOMMAND( cyclelayout, 1, {ARG_TYPE_SINT} ), - #endif // CYCLELAYOUTS_PATCH - #if EXRESIZE_PATCH - IPCCOMMAND( explace, 1, {ARG_TYPE_UINT} ), - IPCCOMMAND( togglehorizontalexpand, 1, {ARG_TYPE_SINT} ), - IPCCOMMAND( toggleverticalexpand, 1, {ARG_TYPE_SINT} ), - IPCCOMMAND( togglemaximize, 1, {ARG_TYPE_SINT} ), - #endif // EXRESIZE_PATCH - #if !FAKEFULLSCREEN_PATCH && FAKEFULLSCREEN_CLIENT_PATCH - IPCCOMMAND( togglefakefullscreen, 1, {ARG_TYPE_NONE} ), - #endif // FAKEFULLSCREEN_CLIENT_PATCH - #if FLOATPOS_PATCH - IPCCOMMAND( floatpos, 1, {ARG_TYPE_STR} ), - #endif // FLOATPOS_PATCH - #if FULLSCREEN_PATCH - IPCCOMMAND( fullscreen, 1, {ARG_TYPE_NONE} ), - #endif // FULLSCREEN_PATCH - #if FLEXTILE_DELUXE_LAYOUT - IPCCOMMAND( incnstack, 1, {ARG_TYPE_SINT} ), - IPCCOMMAND( rotatelayoutaxis, 1, {ARG_TYPE_SINT} ), - IPCCOMMAND( setlayoutaxisex, 1, {ARG_TYPE_SINT} ), - IPCCOMMAND( mirrorlayout, 1, {ARG_TYPE_NONE} ), - #endif // FLEXTILE_DELUXE_LAYOUT - #if FOCUSURGENT_PATCH - IPCCOMMAND( focusurgent, 1, {ARG_TYPE_NONE} ), - #endif // FOCUSURGENT_PATCH - #if FOCUSADJACENTTAG_PATCH - IPCCOMMAND( viewtoleft, 1, {ARG_TYPE_NONE} ), - IPCCOMMAND( viewtoright, 1, {ARG_TYPE_NONE} ), - IPCCOMMAND( tagtoleft, 1, {ARG_TYPE_NONE} ), - IPCCOMMAND( tagtoright, 1, {ARG_TYPE_NONE} ), - IPCCOMMAND( tagandviewtoleft, 1, {ARG_TYPE_NONE} ), - IPCCOMMAND( tagandviewtoright, 1, {ARG_TYPE_NONE} ), - #endif // FOCUSADJACENTTAG_PATCH - #if INPLACEROTATE_PATCH - IPCCOMMAND( inplacerotate, 1, {ARG_TYPE_SINT} ), - #endif // INPLACEROTATE_PATCH - #if KEYMODES_PATCH - IPCCOMMAND( setkeymode, 1, {ARG_TYPE_UINT} ), - #endif // KEYMODES_PATCH - #if MAXIMIZE_PATCH - IPCCOMMAND( togglehorizontalmax, 1, {ARG_TYPE_NONE} ), - IPCCOMMAND( toggleverticalmax, 1, {ARG_TYPE_NONE} ), - IPCCOMMAND( togglemax, 1, {ARG_TYPE_NONE} ), - #endif // MAXIMIZE_PATCH - #if MPDCONTROL_PATCH - IPCCOMMAND( mpdchange, 1, {ARG_TYPE_SINT} ), - IPCCOMMAND( mpdcontrol, 1, {ARG_TYPE_NONE} ), - #endif // MPDCONTROL_PATCH - #if MOVEPLACE_PATCH - IPCCOMMAND( moveplace, 1, {ARG_TYPE_UINT} ), - #endif // MOVEPLACE_PATCH - #if MOVERESIZE_PATCH - IPCCOMMAND( moveresize, 1, {ARG_TYPE_STR} ), - #endif // MOVERESIZE_PATCH - #if NAMETAG_PATCH - IPCCOMMAND( nametag, 1, {ARG_TYPE_NONE} ), - #endif // NAMETAG_PATCH - #if RIODRAW_PATCH - IPCCOMMAND( rioresize, 1, {ARG_TYPE_NONE} ), - #endif // RIODRAW_PATCH - #if PUSH_PATCH || PUSH_NO_MASTER_PATCH - IPCCOMMAND( pushdown, 1, {ARG_TYPE_NONE} ), - IPCCOMMAND( pushup, 1, {ARG_TYPE_NONE} ), - #endif // PUSH_PATCH / PUSH_NO_MASTER_PATCH - #if ROTATESTACK_PATCH - IPCCOMMAND( rotatestack, 1, {ARG_TYPE_SINT} ), - #endif // ROTATESTACK_PATCH - #if SCRATCHPADS_PATCH && !RENAMED_SCRATCHPADS_PATCH - IPCCOMMAND( togglescratch, 1, {ARG_TYPE_UINT} ), - #endif // SCRATCHPADS_PATCH - #if SELFRESTART_PATCH - IPCCOMMAND( self_restart, 1, {ARG_TYPE_NONE} ), - #endif // SELFRESTART_PATCH - #if SETBORDERPX_PATCH - IPCCOMMAND( setborderpx, 1, {ARG_TYPE_SINT} ), - #endif // SETBORDERPX_PATCH - #if BAR_WINTITLEACTIONS_PATCH - IPCCOMMAND( showhideclient, 1, {ARG_TYPE_NONE} ), - #endif // BAR_WINTITLEACTIONS_PATCH - #if SHIFTBOTH_PATCH - IPCCOMMAND( shiftboth, 1, {ARG_TYPE_SINT} ), - #endif // SHIFTBOTH_PATCH - #if SHIFTTAG_PATCH - IPCCOMMAND( shifttag, 1, {ARG_TYPE_SINT} ), - #endif // SHIFTTAG_PATCH - #if SHIFTTAGCLIENTS_PATCH - IPCCOMMAND( shifttagclients, 1, {ARG_TYPE_SINT} ), - #endif // SHIFTVIEWCLIENTS_PATCH - #if SHIFTVIEW_PATCH - IPCCOMMAND( shiftview, 1, {ARG_TYPE_SINT} ), - #endif // SHIFTVIEW_PATCH - #if SHIFTVIEW_CLIENTS_PATCH - IPCCOMMAND( shiftviewclients, 1, {ARG_TYPE_SINT} ), - #endif // SHIFTVIEW_CLIENTS_PATCH - #if SHIFTSWAPTAGS_PATCH && SWAPTAGS_PATCH - IPCCOMMAND( shiftswaptags, 1, {ARG_TYPE_SINT} ), - #endif // SHIFTSWAPTAGS_PATCH - #if STACKER_PATCH - IPCCOMMAND( pushstack, 1, {ARG_TYPE_SINT} ), - #endif // STACKER_PATCH - #if STICKY_PATCH - IPCCOMMAND( togglesticky, 1, {ARG_TYPE_NONE} ), - #endif // STICKY_PATCH - #if SWAPFOCUS_PATCH && PERTAG_PATCH - IPCCOMMAND( swapfocus, 1, {ARG_TYPE_SINT} ), - #endif // SWAPFOCUS_PATCH - #if SWITCHCOL_PATCH - IPCCOMMAND( switchcol, 1, {ARG_TYPE_NONE} ), - #endif // SWITCHCOL_PATCH - #if TAGALLMON_PATCH - IPCCOMMAND( tagallmon, 1, {ARG_TYPE_SINT} ), - #endif // TAGALLMON_PATCH - #if TAGOTHERMONITOR_PATCH - IPCCOMMAND( tagnextmonex, 1, {ARG_TYPE_UINT} ), - IPCCOMMAND( tagprevmonex, 1, {ARG_TYPE_UINT} ), - #endif // TAGOTHERMONITOR_PATCH - #if TAGSWAPMON_PATCH - IPCCOMMAND( tagswapmon, 1, {ARG_TYPE_SINT} ), - #endif // TAGSWAPMON_PATCH - #if TOGGLEFULLSCREEN_PATCH - IPCCOMMAND( togglefullscreen, 1, {ARG_TYPE_NONE} ), - #endif // TOGGLEFULLSCREEN_PATCH - #if TRANSFER_PATCH - IPCCOMMAND( transfer, 1, {ARG_TYPE_NONE} ), - #endif // TRANSFER_PATCH - #if TRANSFER_ALL_PATCH - IPCCOMMAND( transferall, 1, {ARG_TYPE_NONE} ), - #endif // TRANSFER_ALL_PATCH - #if UNFLOATVISIBLE_PATCH - IPCCOMMAND( unfloatvisible, 1, {ARG_TYPE_NONE} ), - #endif // UNFLOATVISIBLE_PATCH - #if VANITYGAPS_PATCH - IPCCOMMAND( incrgaps, 1, {ARG_TYPE_SINT} ), - IPCCOMMAND( incrigaps, 1, {ARG_TYPE_SINT} ), - IPCCOMMAND( incrogaps, 1, {ARG_TYPE_SINT} ), - IPCCOMMAND( incrihgaps, 1, {ARG_TYPE_SINT} ), - IPCCOMMAND( incrivgaps, 1, {ARG_TYPE_SINT} ), - IPCCOMMAND( incrohgaps, 1, {ARG_TYPE_SINT} ), - IPCCOMMAND( incrovgaps, 1, {ARG_TYPE_SINT} ), - IPCCOMMAND( togglegaps, 1, {ARG_TYPE_NONE} ), - IPCCOMMAND( defaultgaps, 1, {ARG_TYPE_NONE} ), - IPCCOMMAND( setgapsex, 1, {ARG_TYPE_SINT} ), - #endif // VANITYGAPS_PATCH - #if WINVIEW_PATCH - IPCCOMMAND( winview, 1, {ARG_TYPE_NONE} ), - #endif // WINVIEW_PATCH - #if XRDB_PATCH && !BAR_VTCOLORS_PATCH - IPCCOMMAND( xrdb, 1, {ARG_TYPE_NONE} ), - #endif // XRDB_PATCH -}; -#endif // IPC_PATCH diff --git a/dwm/.dwm.old/config.mk b/dwm/.dwm.old/config.mk deleted file mode 100644 index be145d2..0000000 --- a/dwm/.dwm.old/config.mk +++ /dev/null @@ -1,73 +0,0 @@ -# dwm version -VERSION = 6.4 - -# Customize below to fit your system - -# paths -PREFIX = /usr/local -MANPREFIX = ${PREFIX}/share/man - -X11INC = /usr/X11R6/include -X11LIB = /usr/X11R6/lib - -# FreeBSD (uncomment) -#X11INC = /usr/local/include -#X11LIB = /usr/local/lib - -# Xinerama, comment if you don't want it -XINERAMALIBS = -lXinerama -XINERAMAFLAGS = -DXINERAMA - -# freetype -FREETYPELIBS = -lfontconfig -lXft -FREETYPEINC = /usr/include/freetype2 -# FreeBSD (uncomment) -#FREETYPEINC = /usr/local/include/freetype2 -# OpenBSD (uncomment) -#FREETYPEINC = ${X11INC}/freetype2 -# OpenBSD - Uncomment this for the swallow patch / SWALLOW_PATCH -#KVMLIB = -lkvm - -# 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 -#MPDCLIENT = -lmpdclient - -# Uncomment for the pango patch / BAR_PANGO_PATCH -#PANGOINC = `pkg-config --cflags xft pango pangoxft` -#PANGOLIB = `pkg-config --libs xft pango pangoxft` - -# Uncomment for the ipc patch / IPC_PATCH -#YAJLLIBS = -lyajl -#YAJLINC = -I/usr/include/yajl - -# Uncomment this for the rounded corners patch / ROUNDED_CORNERS_PATCH -#XEXTLIB = -lXext - -# Uncomment this for the swallow patch / SWALLOW_PATCH -#XCBLIBS = -lX11-xcb -lxcb -lxcb-res - -# This is needed for the winicon and tagpreview patches / BAR_WINICON_PATCH / BAR_TAGPREVIEW_PATCH -#IMLIB2LIBS = -lImlib2 - -# Uncomment for the bidi patch -#BDINC = -I/usr/include/fribidi -#BDLIBS = -lfribidi - -# includes and libs -INCS = -I${X11INC} -I${FREETYPEINC} ${YAJLINC} ${PANGOINC} ${BDINC} -LIBS = -L${X11LIB} -lX11 ${XINERAMALIBS} ${FREETYPELIBS} ${XRENDER} ${MPDCLIENT} ${XEXTLIB} ${XCBLIBS} ${KVMLIB} ${PANGOLIB} ${YAJLLIBS} ${IMLIB2LIBS} $(BDLIBS) - -# flags -CPPFLAGS = -D_DEFAULT_SOURCE -D_BSD_SOURCE -D__XSI_VISIBLE=1 -D_POSIX_C_SOURCE=200809L -DVERSION=\"${VERSION}\" ${XINERAMAFLAGS} -#CFLAGS = -g -std=c99 -pedantic -Wall -O0 ${INCS} ${CPPFLAGS} -CFLAGS = -std=c99 -pedantic -Wall -Wno-unused-function -Wno-deprecated-declarations -Os ${INCS} ${CPPFLAGS} -LDFLAGS = ${LIBS} - -# Solaris -#CFLAGS = -fast ${INCS} -DVERSION=\"${VERSION}\" -#LDFLAGS = ${LIBS} - -# compiler and linker -CC = cc diff --git a/dwm/.dwm.old/drw.c b/dwm/.dwm.old/drw.c deleted file mode 100644 index 2e74b20..0000000 --- a/dwm/.dwm.old/drw.c +++ /dev/null @@ -1,745 +0,0 @@ -/* See LICENSE file for copyright and license details. */ -#include -#include -#include -#include -#include - -#include "patches.h" -#include "drw.h" -#include "util.h" - -#if BIDI_PATCH -#include - -static char fribidi_text[BUFSIZ] = ""; - -static void -apply_fribidi(const char *str) -{ - FriBidiStrIndex len = strlen(str); - FriBidiChar logical[BUFSIZ]; - FriBidiChar visual[BUFSIZ]; - FriBidiParType base = FRIBIDI_PAR_ON; - FriBidiCharSet charset; - - fribidi_text[0] = 0; - if (len > 0) { - charset = fribidi_parse_charset("UTF-8"); - len = fribidi_charset_to_unicode(charset, str, len, logical); - fribidi_log2vis(logical, len, &base, visual, NULL, NULL, NULL); - len = fribidi_unicode_to_charset(charset, visual, len, fribidi_text); - } -} -#endif - -#if !BAR_PANGO_PATCH -#define UTF_INVALID 0xFFFD -#define UTF_SIZ 4 - -static const unsigned char utfbyte[UTF_SIZ + 1] = {0x80, 0, 0xC0, 0xE0, 0xF0}; -static const unsigned char utfmask[UTF_SIZ + 1] = {0xC0, 0x80, 0xE0, 0xF0, 0xF8}; -static const long utfmin[UTF_SIZ + 1] = { 0, 0, 0x80, 0x800, 0x10000}; -static const long utfmax[UTF_SIZ + 1] = {0x10FFFF, 0x7F, 0x7FF, 0xFFFF, 0x10FFFF}; -#endif // BAR_PANGO_PATCH - -#if BAR_POWERLINE_TAGS_PATCH || BAR_POWERLINE_STATUS_PATCH -Clr transcheme[3]; -#endif // BAR_POWERLINE_TAGS_PATCH | BAR_POWERLINE_STATUS_PATCH - -#if !BAR_PANGO_PATCH -static long -utf8decodebyte(const char c, size_t *i) -{ - for (*i = 0; *i < (UTF_SIZ + 1); ++(*i)) - if (((unsigned char)c & utfmask[*i]) == utfbyte[*i]) - return (unsigned char)c & ~utfmask[*i]; - return 0; -} - -static size_t -utf8validate(long *u, size_t i) -{ - if (!BETWEEN(*u, utfmin[i], utfmax[i]) || BETWEEN(*u, 0xD800, 0xDFFF)) - *u = UTF_INVALID; - for (i = 1; *u > utfmax[i]; ++i) - ; - return i; -} - -static size_t -utf8decode(const char *c, long *u, size_t clen) -{ - size_t i, j, len, type; - long udecoded; - - *u = UTF_INVALID; - if (!clen) - return 0; - udecoded = utf8decodebyte(c[0], &len); - if (!BETWEEN(len, 1, UTF_SIZ)) - return 1; - for (i = 1, j = 1; i < clen && j < len; ++i, ++j) { - udecoded = (udecoded << 6) | utf8decodebyte(c[i], &type); - if (type) - return j; - } - if (j < len) - return 0; - *u = udecoded; - utf8validate(u, len); - - return len; -} -#endif // BAR_PANGO_PATCH - -Drw * -#if BAR_ALPHA_PATCH -drw_create(Display *dpy, int screen, Window root, unsigned int w, unsigned int h, Visual *visual, unsigned int depth, Colormap cmap) -#else -drw_create(Display *dpy, int screen, Window root, unsigned int w, unsigned int h) -#endif // BAR_ALPHA_PATCH -{ - Drw *drw = ecalloc(1, sizeof(Drw)); - - drw->dpy = dpy; - drw->screen = screen; - drw->root = root; - drw->w = w; - drw->h = h; - - #if BAR_ALPHA_PATCH - drw->visual = visual; - 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); - - return drw; -} - -void -drw_resize(Drw *drw, unsigned int w, unsigned int h) -{ - if (!drw) - return; - - 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); - #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); - free(drw); -} - -#if BAR_PANGO_PATCH -/* This function is an implementation detail. Library users should use - * drw_font_create instead. - */ -static Fnt * -xfont_create(Drw *drw, const char *fontname) -{ - Fnt *font; - PangoFontMap *fontmap; - PangoContext *context; - PangoFontDescription *desc; - PangoFontMetrics *metrics; - - if (!fontname) { - die("no font specified."); - } - - font = ecalloc(1, sizeof(Fnt)); - font->dpy = drw->dpy; - - fontmap = pango_xft_get_font_map(drw->dpy, drw->screen); - context = pango_font_map_create_context(fontmap); - desc = pango_font_description_from_string(fontname); - font->layout = pango_layout_new(context); - pango_layout_set_font_description(font->layout, desc); - - metrics = pango_context_get_metrics(context, desc, pango_language_from_string ("en-us")); - font->h = pango_font_metrics_get_height(metrics) / PANGO_SCALE; - - pango_font_metrics_unref(metrics); - g_object_unref(context); - - return font; -} -#else -/* This function is an implementation detail. Library users should use - * drw_fontset_create instead. - */ -static Fnt * -xfont_create(Drw *drw, const char *fontname, FcPattern *fontpattern) -{ - Fnt *font; - XftFont *xfont = NULL; - FcPattern *pattern = NULL; - - if (fontname) { - /* Using the pattern found at font->xfont->pattern does not yield the - * same substitution results as using the pattern returned by - * FcNameParse; using the latter results in the desired fallback - * behaviour whereas the former just results in missing-character - * rectangles being drawn, at least with some fonts. */ - if (!(xfont = XftFontOpenName(drw->dpy, drw->screen, fontname))) { - fprintf(stderr, "error, cannot load font from name: '%s'\n", fontname); - return NULL; - } - if (!(pattern = FcNameParse((FcChar8 *) fontname))) { - fprintf(stderr, "error, cannot parse font name to pattern: '%s'\n", fontname); - XftFontClose(drw->dpy, xfont); - return NULL; - } - } else if (fontpattern) { - if (!(xfont = XftFontOpenPattern(drw->dpy, fontpattern))) { - fprintf(stderr, "error, cannot load font from pattern.\n"); - return NULL; - } - } else { - die("no font specified."); - } - - #if BAR_NO_COLOR_EMOJI_PATCH - /* Do not allow using color fonts. This is a workaround for a BadLength - * error from Xft with color glyphs. Modelled on the Xterm workaround. See - * https://bugzilla.redhat.com/show_bug.cgi?id=1498269 - * https://lists.suckless.org/dev/1701/30932.html - * https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=916349 - * and lots more all over the internet. - */ - FcBool iscol; - if (FcPatternGetBool(xfont->pattern, FC_COLOR, 0, &iscol) == FcResultMatch && iscol) { - XftFontClose(drw->dpy, xfont); - return NULL; - } - #endif // BAR_NO_COLOR_EMOJI_PATCH - - font = ecalloc(1, sizeof(Fnt)); - font->xfont = xfont; - font->pattern = pattern; - font->h = xfont->ascent + xfont->descent; - font->dpy = drw->dpy; - - return font; -} -#endif // BAR_PANGO_PATCH - -static void -xfont_free(Fnt *font) -{ - if (!font) - return; - #if BAR_PANGO_PATCH - if (font->layout) - g_object_unref(font->layout); - #else - if (font->pattern) - FcPatternDestroy(font->pattern); - XftFontClose(font->dpy, font->xfont); - #endif // BAR_PANGO_PATCH - free(font); -} - -#if BAR_PANGO_PATCH -Fnt* -drw_font_create(Drw* drw, const char font[]) -{ - Fnt *fnt = NULL; - - if (!drw || !font) - return NULL; - - fnt = xfont_create(drw, font); - - return (drw->fonts = fnt); -} -#else -Fnt* -drw_fontset_create(Drw* drw, const char *fonts[], size_t fontcount) -{ - Fnt *cur, *ret = NULL; - size_t i; - - if (!drw || !fonts) - return NULL; - - for (i = 1; i <= fontcount; i++) { - if ((cur = xfont_create(drw, fonts[fontcount - i], NULL))) { - cur->next = ret; - ret = cur; - } - } - return (drw->fonts = ret); -} -#endif // BAR_PANGO_PATCH - -void -drw_fontset_free(Fnt *font) -{ - if (font) { - #if !BAR_PANGO_PATCH - drw_fontset_free(font->next); - #endif // BAR_PANGO_PATCH - xfont_free(font); - } -} - -void -drw_clr_create( - Drw *drw, - Clr *dest, - const char *clrname - #if BAR_ALPHA_PATCH - , unsigned int alpha - #endif // BAR_ALPHA_PATCH -) { - if (!drw || !dest || !clrname) - return; - - #if BAR_ALPHA_PATCH - if (!XftColorAllocName(drw->dpy, drw->visual, drw->cmap, - clrname, dest)) - die("error, cannot allocate color '%s'", clrname); - - dest->pixel = (dest->pixel & 0x00ffffffU) | (alpha << 24); - #else - if (!XftColorAllocName(drw->dpy, DefaultVisual(drw->dpy, drw->screen), - DefaultColormap(drw->dpy, drw->screen), - clrname, dest)) - die("error, cannot allocate color '%s'", clrname); - - #if NO_TRANSPARENT_BORDERS_PATCH - dest->pixel |= 0xff << 24; - #endif // NO_TRANSPARENT_BORDERS_PATCH - #endif // BAR_ALPHA_PATCH -} - -/* Wrapper to create color schemes. The caller has to call free(3) on the - * returned color scheme when done using it. */ -Clr * -drw_scm_create( - Drw *drw, - char *clrnames[], - #if BAR_ALPHA_PATCH - const unsigned int alphas[], - #endif // BAR_ALPHA_PATCH - size_t clrcount -) { - size_t i; - Clr *ret; - - /* need at least two colors for a scheme */ - if (!drw || !clrnames || clrcount < 2 || !(ret = ecalloc(clrcount, sizeof(XftColor)))) - return NULL; - - for (i = 0; i < clrcount; i++) - #if BAR_ALPHA_PATCH - drw_clr_create(drw, &ret[i], clrnames[i], alphas[i]); - #else - drw_clr_create(drw, &ret[i], clrnames[i]); - #endif // BAR_ALPHA_PATCH - return ret; -} - -#if !BAR_PANGO_PATCH -void -drw_setfontset(Drw *drw, Fnt *set) -{ - if (drw) - drw->fonts = set; -} -#endif // BAR_PANGO_PATCH - -void -drw_setscheme(Drw *drw, Clr *scm) -{ - if (drw) - drw->scheme = scm; -} - -#if BAR_POWERLINE_TAGS_PATCH || BAR_POWERLINE_STATUS_PATCH -void -drw_settrans(Drw *drw, Clr *psc, Clr *nsc) -{ - if (drw) { - transcheme[0] = psc[ColBg]; transcheme[1] = nsc[ColBg]; transcheme[2] = psc[ColBorder]; - drw->scheme = transcheme; - } -} -#endif // BAR_POWERLINE_TAGS_PATCH | BAR_POWERLINE_STATUS_PATCH - -void -drw_rect(Drw *drw, int x, int y, unsigned int w, unsigned int h, int filled, int invert) -{ - if (!drw || !drw->scheme) - return; - XSetForeground(drw->dpy, drw->gc, invert ? drw->scheme[ColBg].pixel : drw->scheme[ColFg].pixel); - if (filled) - XFillRectangle(drw->dpy, drw->drawable, drw->gc, x, y, w, h); - else - XDrawRectangle(drw->dpy, drw->drawable, drw->gc, x, y, w - 1, h - 1); -} - -#if BIDI_PATCH -int -_drw_text(Drw *drw, int x, int y, unsigned int w, unsigned int h, unsigned int lpad, const char *text, int invert, Bool markup) -#else -int -drw_text(Drw *drw, int x, int y, unsigned int w, unsigned int h, unsigned int lpad, const char *text, int invert, Bool markup) -#endif // BIDI_PATCH -{ -#if BAR_PANGO_PATCH - char buf[1024]; - int ty; - unsigned int ew; - XftDraw *d = NULL; - size_t i, len; - int render = x || y || w || h; - - if (!drw || (render && !drw->scheme) || !text || !drw->fonts) - return 0; - - if (!render) { - w = ~w; - } else { - XSetForeground(drw->dpy, drw->gc, drw->scheme[invert ? ColFg : ColBg].pixel); - XFillRectangle(drw->dpy, drw->drawable, drw->gc, x, y, w, h); - #if BAR_ALPHA_PATCH - d = XftDrawCreate(drw->dpy, drw->drawable, drw->visual, drw->cmap); - #else - d = XftDrawCreate(drw->dpy, drw->drawable, - DefaultVisual(drw->dpy, drw->screen), - DefaultColormap(drw->dpy, drw->screen)); - #endif // BAR_ALPHA_PATCH - x += lpad; - w -= lpad; - } - - len = strlen(text); - - if (len) { - drw_font_getexts(drw->fonts, text, len, &ew, NULL, markup); - /* shorten text if necessary */ - for (len = MIN(len, sizeof(buf) - 1); len && ew > w; len--) - drw_font_getexts(drw->fonts, text, len, &ew, NULL, markup); - - if (len) { - memcpy(buf, text, len); - buf[len] = '\0'; - if (len < strlen(text)) - for (i = len; i && i > len - 3; buf[--i] = '.') - ; /* NOP */ - - if (render) { - ty = y + (h - drw->fonts->h) / 2; - if (markup) - pango_layout_set_markup(drw->fonts->layout, buf, len); - else - pango_layout_set_text(drw->fonts->layout, buf, len); - pango_xft_render_layout(d, &drw->scheme[invert ? ColBg : ColFg], - drw->fonts->layout, x * PANGO_SCALE, ty * PANGO_SCALE); - if (markup) /* clear markup attributes */ - pango_layout_set_attributes(drw->fonts->layout, NULL); - } - x += ew; - w -= ew; - } - } - if (d) - XftDrawDestroy(d); - - return x + (render ? w : 0); -#else - char buf[1024]; - int ty; - unsigned int ew; - XftDraw *d = NULL; - Fnt *usedfont, *curfont, *nextfont; - size_t i, len; - int utf8strlen, utf8charlen, render = x || y || w || h; - long utf8codepoint = 0; - const char *utf8str; - FcCharSet *fccharset; - FcPattern *fcpattern; - FcPattern *match; - XftResult result; - int charexists = 0; - - if (!drw || (render && !drw->scheme) || !text || !drw->fonts) - return 0; - - if (!render) { - w = ~w; - } else { - XSetForeground(drw->dpy, drw->gc, drw->scheme[invert ? ColFg : ColBg].pixel); - XFillRectangle(drw->dpy, drw->drawable, drw->gc, x, y, w, h); - #if BAR_ALPHA_PATCH - d = XftDrawCreate(drw->dpy, drw->drawable, drw->visual, drw->cmap); - #else - d = XftDrawCreate(drw->dpy, drw->drawable, - DefaultVisual(drw->dpy, drw->screen), - DefaultColormap(drw->dpy, drw->screen)); - #endif // BAR_ALPHA_PATCH - x += lpad; - w -= lpad; - } - - usedfont = drw->fonts; - while (1) { - utf8strlen = 0; - utf8str = text; - nextfont = NULL; - while (*text) { - utf8charlen = utf8decode(text, &utf8codepoint, UTF_SIZ); - for (curfont = drw->fonts; curfont; curfont = curfont->next) { - charexists = charexists || XftCharExists(drw->dpy, curfont->xfont, utf8codepoint); - if (charexists) { - if (curfont == usedfont) { - utf8strlen += utf8charlen; - text += utf8charlen; - } else { - nextfont = curfont; - } - break; - } - } - - if (!charexists || nextfont) - break; - else - charexists = 0; - } - - if (utf8strlen) { - drw_font_getexts(usedfont, utf8str, utf8strlen, &ew, NULL); - /* shorten text if necessary */ - 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); - buf[len] = '\0'; - if (len < utf8strlen) - for (i = len; i && i > len - 3; buf[--i] = '.') - ; /* NOP */ - - if (render) { - ty = y + (h - usedfont->h) / 2 + usedfont->xfont->ascent; - XftDrawStringUtf8(d, &drw->scheme[invert ? ColBg : ColFg], - usedfont->xfont, x, ty, (XftChar8 *)buf, len); - } - x += ew; - w -= ew; - } - } - - if (!*text) { - break; - } else if (nextfont) { - charexists = 0; - usedfont = nextfont; - } else { - /* Regardless of whether or not a fallback font is found, the - * character must be drawn. */ - charexists = 1; - - fccharset = FcCharSetCreate(); - FcCharSetAddChar(fccharset, utf8codepoint); - - if (!drw->fonts->pattern) { - /* Refer to the comment in xfont_create for more information. */ - die("the first font in the cache must be loaded from a font string."); - } - - fcpattern = FcPatternDuplicate(drw->fonts->pattern); - FcPatternAddCharSet(fcpattern, FC_CHARSET, fccharset); - FcPatternAddBool(fcpattern, FC_SCALABLE, FcTrue); - #if BAR_NO_COLOR_EMOJI_PATCH - FcPatternAddBool(fcpattern, FC_COLOR, FcFalse); - #endif // BAR_NO_COLOR_EMOJI_PATCH - - FcConfigSubstitute(NULL, fcpattern, FcMatchPattern); - FcDefaultSubstitute(fcpattern); - match = XftFontMatch(drw->dpy, drw->screen, fcpattern, &result); - - FcCharSetDestroy(fccharset); - FcPatternDestroy(fcpattern); - - if (match) { - usedfont = xfont_create(drw, NULL, match); - if (usedfont && XftCharExists(drw->dpy, usedfont->xfont, utf8codepoint)) { - for (curfont = drw->fonts; curfont->next; curfont = curfont->next) - ; /* NOP */ - curfont->next = usedfont; - } else { - xfont_free(usedfont); - usedfont = drw->fonts; - } - } - } - } - if (d) - XftDrawDestroy(d); - - return x + (render ? w : 0); -#endif // BAR_PANGO_PATCH -} - -#if BIDI_PATCH -int -drw_text(Drw *drw, int x, int y, unsigned int w, unsigned int h, unsigned int lpad, const char *text, int invert, Bool markup) -{ - apply_fribidi(text); - return _drw_text(drw, x, y, w, h, lpad, fribidi_text, invert, markup); -} -#endif // BIDI_PATCH - -#if BAR_POWERLINE_TAGS_PATCH || BAR_POWERLINE_STATUS_PATCH -void -drw_arrow(Drw *drw, int x, int y, unsigned int w, unsigned int h, int direction, int slash) -{ - if (!drw || !drw->scheme) - return; - - /* direction=1 draws right arrow */ - x = direction ? x : x + w; - w = direction ? w : -w; - /* slash=1 draws slash instead of arrow */ - unsigned int hh = slash ? (direction ? 0 : h) : h/2; - - XPoint points[] = { - {x , y }, - {x + w, y + hh }, - {x , y + h }, - }; - - XPoint bg[] = { - {x , y }, - {x + w, y }, - {x + w, y + h}, - {x , y + h}, - }; - - XSetForeground(drw->dpy, drw->gc, drw->scheme[ColBg].pixel); - XFillPolygon(drw->dpy, drw->drawable, drw->gc, bg, 4, Convex, CoordModeOrigin); - XSetForeground(drw->dpy, drw->gc, drw->scheme[ColFg].pixel); - XFillPolygon(drw->dpy, drw->drawable, drw->gc, points, 3, Nonconvex, CoordModeOrigin); -} -#endif // BAR_POWERLINE_TAGS_PATCH | BAR_POWERLINE_STATUS_PATCH - -void -drw_map(Drw *drw, Window win, int x, int y, unsigned int w, unsigned int h) -{ - if (!drw) - return; - - XCopyArea(drw->dpy, drw->drawable, win, drw->gc, x, y, w, h, x, y); - XSync(drw->dpy, False); -} - -unsigned int -drw_fontset_getwidth(Drw *drw, const char *text, Bool markup) -{ - if (!drw || !drw->fonts || !text) - return 0; - return drw_text(drw, 0, 0, 0, 0, 0, text, 0, markup); -} - -#if BAR_PANGO_PATCH -void -drw_font_getexts(Fnt *font, const char *text, unsigned int len, unsigned int *w, unsigned int *h, Bool markup) -{ - if (!font || !text) - return; - - PangoRectangle r; - if (markup) - pango_layout_set_markup(font->layout, text, len); - else - pango_layout_set_text(font->layout, text, len); - pango_layout_get_extents(font->layout, 0, &r); - if (markup) /* clear markup attributes */ - pango_layout_set_attributes(font->layout, NULL); - if (w) - *w = r.width / PANGO_SCALE; - if (h) - *h = font->h; -} -#else -void -drw_font_getexts(Fnt *font, const char *text, unsigned int len, unsigned int *w, unsigned int *h) -{ - XGlyphInfo ext; - - if (!font || !text) - return; - - XftTextExtentsUtf8(font->dpy, font->xfont, (XftChar8 *)text, len, &ext); - if (w) - *w = ext.xOff; - if (h) - *h = font->h; -} -#endif // BAR_PANGO_PATCH - -Cur * -drw_cur_create(Drw *drw, int shape) -{ - Cur *cur; - - if (!drw || !(cur = ecalloc(1, sizeof(Cur)))) - return NULL; - - cur->cursor = XCreateFontCursor(drw->dpy, shape); - - return cur; -} - -void -drw_cur_free(Drw *drw, Cur *cursor) -{ - if (!cursor) - return; - - XFreeCursor(drw->dpy, cursor->cursor); - free(cursor); -} - diff --git a/dwm/.dwm.old/drw.h b/dwm/.dwm.old/drw.h deleted file mode 100644 index ec24e02..0000000 --- a/dwm/.dwm.old/drw.h +++ /dev/null @@ -1,106 +0,0 @@ -/* See LICENSE file for copyright and license details. */ - -#if BAR_PANGO_PATCH -#include -#include -#endif // BAR_PANGO_PATCH - -typedef struct { - Cursor cursor; -} Cur; - -typedef struct Fnt { - Display *dpy; - unsigned int h; - #if BAR_PANGO_PATCH - PangoLayout *layout; - #else - XftFont *xfont; - FcPattern *pattern; - struct Fnt *next; - #endif // BAR_PANGO_PATCH -} Fnt; - -enum { ColFg, ColBg, ColBorder, ColFloat, ColCount }; /* Clr scheme index */ -typedef XftColor Clr; - -typedef struct { - unsigned int w, h; - Display *dpy; - int screen; - Window root; - #if BAR_ALPHA_PATCH - Visual *visual; - unsigned int depth; - Colormap cmap; - #endif // BAR_ALPHA_PATCH - Drawable drawable; - #if BAR_WINICON_PATCH - Picture picture; - #endif // BAR_WINICON_PATCH - GC gc; - Clr *scheme; - Fnt *fonts; -} Drw; - -/* Drawable abstraction */ -#if BAR_ALPHA_PATCH -Drw *drw_create(Display *dpy, int screen, Window win, unsigned int w, unsigned int h, Visual *visual, unsigned int depth, Colormap cmap); -#else -Drw *drw_create(Display *dpy, int screen, Window win, unsigned int w, unsigned int h); -#endif // BAR_ALPHA_PATCH -void drw_resize(Drw *drw, unsigned int w, unsigned int h); -void drw_free(Drw *drw); - -/* Fnt abstraction */ -#if BAR_PANGO_PATCH -Fnt *drw_font_create(Drw* drw, const char font[]); -void drw_font_getexts(Fnt *font, const char *text, unsigned int len, unsigned int *w, unsigned int *h, Bool markup); -#else -Fnt *drw_fontset_create(Drw* drw, const char *fonts[], size_t fontcount); -void drw_font_getexts(Fnt *font, const char *text, unsigned int len, unsigned int *w, unsigned int *h); -#endif // BAR_PANGO_PATCH -void drw_fontset_free(Fnt* set); -unsigned int drw_fontset_getwidth(Drw *drw, const char *text, Bool markup); - -/* Colorscheme abstraction */ -void drw_clr_create( - Drw *drw, - Clr *dest, - const char *clrname - #if BAR_ALPHA_PATCH - , unsigned int alpha - #endif // BAR_ALPHA_PATCH -); -Clr *drw_scm_create( - Drw *drw, - char *clrnames[], - #if BAR_ALPHA_PATCH - const unsigned int alphas[], - #endif // BAR_ALPHA_PATCH - size_t clrcount -); - -/* Cursor abstraction */ -Cur *drw_cur_create(Drw *drw, int shape); -void drw_cur_free(Drw *drw, Cur *cursor); - -/* Drawing context manipulation */ -#if !BAR_PANGO_PATCH -void drw_setfontset(Drw *drw, Fnt *set); -#endif // BAR_PANGO_PATCH -void drw_setscheme(Drw *drw, Clr *scm); -#if BAR_POWERLINE_TAGS_PATCH || BAR_POWERLINE_STATUS_PATCH -void drw_settrans(Drw *drw, Clr *psc, Clr *nsc); -#endif // BAR_POWERLINE_TAGS_PATCH | BAR_POWERLINE_STATUS_PATCH - -/* Drawing functions */ -void drw_rect(Drw *drw, int x, int y, unsigned int w, unsigned int h, int filled, int invert); -int drw_text(Drw *drw, int x, int y, unsigned int w, unsigned int h, unsigned int lpad, const char *text, int invert, Bool markup); -#if BAR_POWERLINE_TAGS_PATCH || BAR_POWERLINE_STATUS_PATCH -void drw_arrow(Drw *drw, int x, int y, unsigned int w, unsigned int h, int direction, int slash); -#endif // BAR_POWERLINE_TAGS_PATCH | BAR_POWERLINE_STATUS_PATCH - -/* Map functions */ -void drw_map(Drw *drw, Window win, int x, int y, unsigned int w, unsigned int h); - diff --git a/dwm/.dwm.old/dwm.1 b/dwm/.dwm.old/dwm.1 deleted file mode 100644 index ddc8321..0000000 --- a/dwm/.dwm.old/dwm.1 +++ /dev/null @@ -1,176 +0,0 @@ -.TH DWM 1 dwm\-VERSION -.SH NAME -dwm \- dynamic window manager -.SH SYNOPSIS -.B dwm -.RB [ \-v ] -.SH DESCRIPTION -dwm is a dynamic window manager for X. It manages windows in tiled, monocle -and floating layouts. Either layout can be applied dynamically, optimising the -environment for the application in use and the task performed. -.P -In tiled layouts windows are managed in a master and stacking area. The master -area on the left contains one window by default, and the stacking area on the -right contains all other windows. The number of master area windows can be -adjusted from zero to an arbitrary number. In monocle layout all windows are -maximised to the screen size. In floating layout windows can be resized and -moved freely. Dialog windows are always managed floating, regardless of the -layout applied. -.P -Windows are grouped by tags. Each window can be tagged with one or multiple -tags. Selecting certain tags displays all windows with these tags. -.P -Each screen contains a small status bar which displays all available tags, the -layout, the title of the focused window, and the text read from the root window -name property, if the screen is focused. A floating window is indicated with an -empty square and a maximised floating window is indicated with a filled square -before the windows title. The selected tags are indicated with a different -color. The tags of the focused window are indicated with a filled square in the -top left corner. The tags which are applied to one or more windows are -indicated with an empty square in the top left corner. -.P -dwm draws a small border around windows to indicate the focus state. -.SH OPTIONS -.TP -.B \-v -prints version information to stderr, then exits. -.SH USAGE -.SS Status bar -.TP -.B X root window name -is read and displayed in the status text area. It can be set with the -.BR xsetroot (1) -command. -.TP -.B Button1 -click on a tag label to display all windows with that tag, click on the layout -label toggles between tiled and floating layout. -.TP -.B Button3 -click on a tag label adds/removes all windows with that tag to/from the view. -.TP -.B Mod1\-Button1 -click on a tag label applies that tag to the focused window. -.TP -.B Mod1\-Button3 -click on a tag label adds/removes that tag to/from the focused window. -.SS Keyboard commands -.TP -.B Mod1\-Shift\-Return -Start -.BR st(1). -.TP -.B Mod1\-p -Spawn -.BR dmenu(1) -for launching other programs. -.TP -.B Mod1\-, -Focus previous screen, if any. -.TP -.B Mod1\-. -Focus next screen, if any. -.TP -.B Mod1\-Shift\-, -Send focused window to previous screen, if any. -.TP -.B Mod1\-Shift\-. -Send focused window to next screen, if any. -.TP -.B Mod1\-b -Toggles bar on and off. -.TP -.B Mod1\-t -Sets tiled layout. -.TP -.B Mod1\-f -Sets floating layout. -.TP -.B Mod1\-m -Sets monocle layout. -.TP -.B Mod1\-space -Toggles between current and previous layout. -.TP -.B Mod1\-j -Focus next window. -.TP -.B Mod1\-k -Focus previous window. -.TP -.B Mod1\-i -Increase number of windows in master area. -.TP -.B Mod1\-d -Decrease number of windows in master area. -.TP -.B Mod1\-l -Increase master area size. -.TP -.B Mod1\-h -Decrease master area size. -.TP -.B Mod1\-Return -Zooms/cycles focused window to/from master area (tiled layouts only). -.TP -.B Mod1\-Shift\-c -Close focused window. -.TP -.B Mod1\-Shift\-space -Toggle focused window between tiled and floating state. -.TP -.B Mod1\-Tab -Toggles to the previously selected tags. -.TP -.B Mod1\-Shift\-[1..n] -Apply nth tag to focused window. -.TP -.B Mod1\-Shift\-0 -Apply all tags to focused window. -.TP -.B Mod1\-Control\-Shift\-[1..n] -Add/remove nth tag to/from focused window. -.TP -.B Mod1\-[1..n] -View all windows with nth tag. -.TP -.B Mod1\-0 -View all windows with any tag. -.TP -.B Mod1\-Control\-[1..n] -Add/remove all windows with nth tag to/from the view. -.TP -.B Mod1\-Shift\-q -Quit dwm. -.SS Mouse commands -.TP -.B Mod1\-Button1 -Move focused window while dragging. Tiled windows will be toggled to the floating state. -.TP -.B Mod1\-Button2 -Toggles focused window between floating and tiled state. -.TP -.B Mod1\-Button3 -Resize focused window while dragging. Tiled windows will be toggled to the floating state. -.SH CUSTOMIZATION -dwm is customized by creating a custom config.h and (re)compiling the source -code. This keeps it fast, secure and simple. -.SH SEE ALSO -.BR dmenu (1), -.BR st (1) -.SH ISSUES -Java applications which use the XToolkit/XAWT backend may draw grey windows -only. The XToolkit/XAWT backend breaks ICCCM-compliance in recent JDK 1.5 and early -JDK 1.6 versions, because it assumes a reparenting window manager. Possible workarounds -are using JDK 1.4 (which doesn't contain the XToolkit/XAWT backend) or setting the -environment variable -.BR AWT_TOOLKIT=MToolkit -(to use the older Motif backend instead) or running -.B xprop -root -f _NET_WM_NAME 32a -set _NET_WM_NAME LG3D -or -.B wmname LG3D -(to pretend that a non-reparenting window manager is running that the -XToolkit/XAWT backend can recognize) or when using OpenJDK setting the environment variable -.BR _JAVA_AWT_WM_NONREPARENTING=1 . -.SH BUGS -Send all bug reports with a patch to hackers@suckless.org. diff --git a/dwm/.dwm.old/dwm.c b/dwm/.dwm.old/dwm.c deleted file mode 100644 index 3d3eef0..0000000 --- a/dwm/.dwm.old/dwm.c +++ /dev/null @@ -1,5210 +0,0 @@ -/* See LICENSE file for copyright and license details. - * - * dynamic window manager is designed like any other X client as well. It is - * driven through handling X events. In contrast to other X clients, a window - * manager selects for SubstructureRedirectMask on the root window, to receive - * events about window (dis-)appearance. Only one X connection at a time is - * allowed to select for this event mask. - * - * The event handlers of dwm are organized in an array which is accessed - * whenever a new event has been fetched. This allows event dispatching - * in O(1) time. - * - * Each child of the root window is called a client, except windows which have - * set the override_redirect flag. Clients are organized in a linked client - * list on each monitor, the focus history is remembered through a stack list - * on each monitor. Each client contains a bit array to indicate the tags of a - * client. - * - * Keys and tagging rules are organized as arrays and defined in config.h. - * - * To understand everything else, start reading main(). - */ -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#ifdef XINERAMA -#include -#endif /* XINERAMA */ -#include - -#include "patches.h" -#include "drw.h" -#include "util.h" - -#if BAR_FLEXWINTITLE_PATCH -#ifndef FLEXTILE_DELUXE_LAYOUT -#define FLEXTILE_DELUXE_LAYOUT 1 -#endif -#endif - -#if BAR_PANGO_PATCH -#include -#endif // BAR_PANGO_PATCH - -#if RESTARTSIG_PATCH -#include -#endif // RESTARTSIG_PATCH - -#if XKB_PATCH -#include -#endif // XKB_PATCH - -#if SPAWNCMD_PATCH -#include -#include -#include -#define SPAWN_CWD_DELIM " []{}()<>\"':" -#endif // SPAWNCMD_PATCH - -/* macros */ -#define Button6 6 -#define Button7 7 -#define Button8 8 -#define Button9 9 -#define NUMTAGS 9 -#define NUMVIEWHIST NUMTAGS -#define BARRULES 20 -#if TAB_PATCH -#define MAXTABS 50 -#endif // TAB_PATCH -#define BUTTONMASK (ButtonPressMask|ButtonReleaseMask) -#define CLEANMASK(mask) (mask & ~(numlockmask|LockMask) & (ShiftMask|ControlMask|Mod1Mask|Mod2Mask|Mod3Mask|Mod4Mask|Mod5Mask)) -#if BAR_ANYBAR_PATCH -#define INTERSECT(x,y,w,h,m) (MAX(0, MIN((x)+(w),(m)->mx+(m)->mw) - MAX((x),(m)->mx)) \ - * MAX(0, MIN((y)+(h),(m)->my+(m)->mh) - MAX((y),(m)->my))) -#else -#define INTERSECT(x,y,w,h,m) (MAX(0, MIN((x)+(w),(m)->wx+(m)->ww) - MAX((x),(m)->wx)) \ - * MAX(0, MIN((y)+(h),(m)->wy+(m)->wh) - MAX((y),(m)->wy))) -#endif // BAR_ANYBAR_PATCH -#if ATTACHASIDE_PATCH && STICKY_PATCH -#define ISVISIBLEONTAG(C, T) ((C->tags & T) || C->issticky) -#define ISVISIBLE(C) ISVISIBLEONTAG(C, C->mon->tagset[C->mon->seltags]) -#elif ATTACHASIDE_PATCH -#define ISVISIBLEONTAG(C, T) ((C->tags & T)) -#define ISVISIBLE(C) ISVISIBLEONTAG(C, C->mon->tagset[C->mon->seltags]) -#elif STICKY_PATCH -#define ISVISIBLE(C) ((C->tags & C->mon->tagset[C->mon->seltags]) || C->issticky) -#else -#define ISVISIBLE(C) ((C->tags & C->mon->tagset[C->mon->seltags])) -#endif // ATTACHASIDE_PATCH -#define LENGTH(X) (sizeof X / sizeof X[0]) -#define MOUSEMASK (BUTTONMASK|PointerMotionMask) -#define WIDTH(X) ((X)->w + 2 * (X)->bw) -#define HEIGHT(X) ((X)->h + 2 * (X)->bw) -#define WTYPE "_NET_WM_WINDOW_TYPE_" -#if SCRATCHPADS_PATCH && !RENAMED_SCRATCHPADS_PATCH -#define TOTALTAGS (NUMTAGS + LENGTH(scratchpads)) -#define TAGMASK ((1 << TOTALTAGS) - 1) -#define SPTAG(i) ((1 << NUMTAGS) << (i)) -#define SPTAGMASK (((1 << LENGTH(scratchpads))-1) << NUMTAGS) -#else -#define TAGMASK ((1 << NUMTAGS) - 1) -#endif // SCRATCHPADS_PATCH -#define TEXTWM(X) (drw_fontset_getwidth(drw, (X), True) + lrpad) -#define TEXTW(X) (drw_fontset_getwidth(drw, (X), False) + lrpad) -#define HIDDEN(C) ((getstate(C->win) == IconicState)) - -/* enums */ -enum { - #if RESIZEPOINT_PATCH || RESIZECORNERS_PATCH - CurResizeBR, - CurResizeBL, - CurResizeTR, - CurResizeTL, - #endif // RESIZEPOINT_PATCH | RESIZECORNERS_PATCH - #if DRAGMFACT_PATCH - CurResizeHorzArrow, - CurResizeVertArrow, - #endif // DRAGMFACT_PATCH - #if DRAGCFACT_PATCH - CurIronCross, - #endif // DRAGCFACT_PATCH - CurNormal, - CurResize, - CurMove, - CurLast -}; /* cursor */ - -enum { - SchemeNorm, - SchemeSel, - SchemeTitleNorm, - SchemeTitleSel, - SchemeTagsNorm, - SchemeTagsSel, - SchemeHidNorm, - SchemeHidSel, - SchemeUrg, - #if RENAMED_SCRATCHPADS_PATCH - SchemeScratchSel, - SchemeScratchNorm, - #endif // RENAMED_SCRATCHPADS_PATCH - #if BAR_FLEXWINTITLE_PATCH - SchemeFlexActTTB, - SchemeFlexActLTR, - SchemeFlexActMONO, - SchemeFlexActGRID, - SchemeFlexActGRD1, - SchemeFlexActGRD2, - SchemeFlexActGRDM, - SchemeFlexActHGRD, - SchemeFlexActDWDL, - SchemeFlexActSPRL, - SchemeFlexInaTTB, - SchemeFlexInaLTR, - SchemeFlexInaMONO, - SchemeFlexInaGRID, - SchemeFlexInaGRD1, - SchemeFlexInaGRD2, - SchemeFlexInaGRDM, - SchemeFlexInaHGRD, - SchemeFlexInaDWDL, - SchemeFlexInaSPRL, - SchemeFlexSelTTB, - SchemeFlexSelLTR, - SchemeFlexSelMONO, - SchemeFlexSelGRID, - SchemeFlexSelGRD1, - SchemeFlexSelGRD2, - SchemeFlexSelGRDM, - SchemeFlexSelHGRD, - SchemeFlexSelDWDL, - SchemeFlexSelSPRL, - SchemeFlexActFloat, - SchemeFlexInaFloat, - SchemeFlexSelFloat, - #endif // BAR_FLEXWINTITLE_PATCH -}; /* color schemes */ - -enum { - NetSupported, NetWMName, NetWMState, NetWMCheck, - NetWMFullscreen, NetActiveWindow, NetWMWindowType, - #if BAR_WINICON_PATCH - NetWMIcon, - #endif // BAR_WINICON_PATCH - #if BAR_SYSTRAY_PATCH - NetSystemTray, NetSystemTrayOP, NetSystemTrayOrientation, - NetSystemTrayVisual, NetWMWindowTypeDock, NetSystemTrayOrientationHorz, - #endif // BAR_SYSTRAY_PATCH - #if BAR_EWMHTAGS_PATCH - NetDesktopNames, NetDesktopViewport, NetNumberOfDesktops, NetCurrentDesktop, - #endif // BAR_EWMHTAGS_PATCH - NetClientList, - #if NET_CLIENT_LIST_STACKING_PATCH - NetClientListStacking, - #endif // NET_CLIENT_LIST_STACKING_PATCH - NetLast -}; /* EWMH atoms */ - -enum { - WMProtocols, - WMDelete, - WMState, - WMTakeFocus, - #if WINDOWROLERULE_PATCH - WMWindowRole, - #endif // WINDOWROLERULE_PATCH - WMLast -}; /* default atoms */ - -#if SEAMLESS_RESTART_PATCH -enum { - ClientFields, - ClientTags, - ClientLast -}; /* dwm client atoms */ -#endif // SEAMLESS_RESTART_PATCH - -enum { - #if BAR_STATUSBUTTON_PATCH - ClkButton, - #endif // BAR_STATUSBUTTON_PATCH - #if TAB_PATCH - ClkTabBar, - #endif // TAB_PATCH - ClkTagBar, - ClkLtSymbol, - ClkStatusText, - ClkWinTitle, - ClkClientWin, - ClkRootWin, - #if XKB_PATCH - ClkXKB, - #endif // XKB_PATCH - ClkLast -}; /* clicks */ - -enum { - BAR_ALIGN_LEFT, - BAR_ALIGN_CENTER, - BAR_ALIGN_RIGHT, - BAR_ALIGN_LEFT_LEFT, - BAR_ALIGN_LEFT_RIGHT, - BAR_ALIGN_LEFT_CENTER, - BAR_ALIGN_NONE, - BAR_ALIGN_RIGHT_LEFT, - BAR_ALIGN_RIGHT_RIGHT, - BAR_ALIGN_RIGHT_CENTER, - BAR_ALIGN_LAST -}; /* bar alignment */ - -#if IPC_PATCH -typedef struct TagState TagState; -struct TagState { - int selected; - int occupied; - int urgent; -}; - -typedef struct ClientState ClientState; -struct ClientState { - int isfixed, isfloating, isurgent, neverfocus, oldstate, isfullscreen; -}; -#endif // IPC_PATCH - -typedef union { - #if IPC_PATCH - long i; - unsigned long ui; - #else - int i; - unsigned int ui; - #endif // IPC_PATCH - float f; - const void *v; -} Arg; - -typedef struct Monitor Monitor; -typedef struct Bar Bar; -struct Bar { - Window win; - Monitor *mon; - Bar *next; - int idx; - int showbar; - int topbar; - int external; - int borderpx; - int borderscheme; - int bx, by, bw, bh; /* bar geometry */ - int w[BARRULES]; // width, array length == barrules, then use r index for lookup purposes - int x[BARRULES]; // x position, array length == ^ -}; - -typedef struct { - int x; - int y; - int h; - int w; -} BarArg; - -typedef struct { - int monitor; - int bar; - int alignment; // see bar alignment enum - int (*widthfunc)(Bar *bar, BarArg *a); - int (*drawfunc)(Bar *bar, BarArg *a); - int (*clickfunc)(Bar *bar, Arg *arg, BarArg *a); - int (*hoverfunc)(Bar *bar, BarArg *a, XMotionEvent *ev); - char *name; // for debugging - int x, w; // position, width for internal use -} BarRule; - -typedef struct { - unsigned int click; - unsigned int mask; - unsigned int button; - void (*func)(const Arg *arg); - const Arg arg; -} Button; - -#if XKB_PATCH -typedef struct XkbInfo XkbInfo; -struct XkbInfo { - XkbInfo *next; - XkbInfo *prev; - int group; - Window w; -}; -#endif // XKB_PATCH - -typedef struct Client Client; -struct Client { - char name[256]; - float mina, maxa; - #if CFACTS_PATCH - float cfact; - #endif // CFACTS_PATCH - int x, y, w, h; - #if SAVEFLOATS_PATCH || EXRESIZE_PATCH - int sfx, sfy, sfw, sfh; /* stored float geometry, used on mode revert */ - #endif // SAVEFLOATS_PATCH / EXRESIZE_PATCH - #if SEAMLESS_RESTART_PATCH - unsigned int idx; - #endif // SEAMLESS_RESTART_PATCH - int oldx, oldy, oldw, oldh; - int basew, baseh, incw, inch, maxw, maxh, minw, minh, hintsvalid; - int bw, oldbw; - unsigned int tags; - #if SWITCHTAG_PATCH - unsigned int switchtag; - #endif // SWITCHTAG_PATCH - int isfixed, isfloating, isurgent, neverfocus, oldstate, isfullscreen; - #if !FAKEFULLSCREEN_PATCH && FAKEFULLSCREEN_CLIENT_PATCH - int fakefullscreen; - #endif // FAKEFULLSCREEN_CLIENT_PATCH - #if EXRESIZE_PATCH - unsigned char expandmask; - int expandx1, expandy1, expandx2, expandy2; - #if !MAXIMIZE_PATCH - int wasfloating; - #endif // MAXIMIZE_PATCH - #endif // EXRESIZE_PATCH - #if MAXIMIZE_PATCH - int ismax, wasfloating; - #endif // MAXIMIZE_PATCH - #if AUTORESIZE_PATCH - int needresize; - #endif // AUTORESIZE_PATCH - #if CENTER_PATCH - int iscentered; - #endif // CENTER_PATCH - #if ISPERMANENT_PATCH - int ispermanent; - #endif // ISPERMANENT_PATCH - #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; - #endif // SWALLOW_PATCH - #if STEAM_PATCH - int issteam; - #endif // STEAM_PATCH - #if STICKY_PATCH - int issticky; - #endif // STICKY_PATCH - Client *next; - Client *snext; - #if SWALLOW_PATCH - Client *swallowing; - #endif // SWALLOW_PATCH - Monitor *mon; - Window win; - #if IPC_PATCH - ClientState prevstate; - #endif // IPC_PATCH - #if RENAMED_SCRATCHPADS_PATCH - char scratchkey; - #endif // RENAMED_SCRATCHPADS_PATCH - #if XKB_PATCH - XkbInfo *xkb; - #endif // XKB_PATCH - #if BAR_WINICON_PATCH - unsigned int icw, ich; - Picture icon; - #endif // BAR_WINICON_PATCH -}; - -typedef struct { - unsigned int mod; - KeySym keysym; - void (*func)(const Arg *); - const Arg arg; -} Key; - -#if FLEXTILE_DELUXE_LAYOUT -typedef struct { - int nmaster; - int nstack; - int layout; - int masteraxis; // master stack area - int stack1axis; // primary stack area - int stack2axis; // secondary stack area, e.g. centered master - void (*symbolfunc)(Monitor *, unsigned int); -} LayoutPreset; -#endif // FLEXTILE_DELUXE_LAYOUT - -typedef struct { - const char *symbol; - void (*arrange)(Monitor *); - #if FLEXTILE_DELUXE_LAYOUT - LayoutPreset preset; - #endif // FLEXTILE_DELUXE_LAYOUT -} Layout; - -#if INSETS_PATCH -typedef struct { - int x; - int y; - int w; - int h; -} Inset; -#endif // INSETS_PATCH - -#if PERTAG_PATCH -typedef struct Pertag Pertag; -#endif // PERTAG_PATCH -struct Monitor { - char ltsymbol[16]; - float mfact; - #if FLEXTILE_DELUXE_LAYOUT - int ltaxis[4]; - int nstack; - #endif // FLEXTILE_DELUXE_LAYOUT - int nmaster; - int num; - int mx, my, mw, mh; /* screen size */ - int wx, wy, ww, wh; /* window area */ - #if TAB_PATCH - int ty; /* tab bar geometry */ - #endif // TAB_PATCH - #if VANITYGAPS_PATCH - int gappih; /* horizontal gap between windows */ - int gappiv; /* vertical gap between windows */ - int gappoh; /* horizontal outer gaps */ - int gappov; /* vertical outer gaps */ - #endif // VANITYGAPS_PATCH - #if SETBORDERPX_PATCH - unsigned int borderpx; - #endif // SETBORDERPX_PATCH - unsigned int seltags; - unsigned int sellt; - #if VIEW_HISTORY_PATCH - unsigned int tagset[NUMVIEWHIST]; - #else - unsigned int tagset[2]; - #endif // VIEW_HISTORY_PATCH - int showbar; - #if TAB_PATCH - int showtab; - int toptab; - Window tabwin; - int ntabs; - int tab_widths[MAXTABS]; - #endif // TAB_PATCH - Client *clients; - Client *sel; - Client *stack; - Monitor *next; - Bar *bar; - const Layout *lt[2]; - #if BAR_ALTERNATIVE_TAGS_PATCH - unsigned int alttag; - #endif // BAR_ALTERNATIVE_TAGS_PATCH - #if PERTAG_PATCH - Pertag *pertag; - #endif // PERTAG_PATCH - #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; - Client *lastsel; - const Layout *lastlt; - #endif // IPC_PATCH - #if BAR_TAGPREVIEW_PATCH - Window tagwin; - int previewshow; - Pixmap tagmap[NUMTAGS]; - #endif // BAR_TAGPREVIEW_PATCH -}; - -typedef struct { - const char *class; - #if WINDOWROLERULE_PATCH - const char *role; - #endif // WINDOWROLERULE_PATCH - const char *instance; - const char *title; - const char *wintype; - unsigned int tags; - #if SWITCHTAG_PATCH - int switchtag; - #endif // SWITCHTAG_PATCH - #if CENTER_PATCH - int iscentered; - #endif // CENTER_PATCH - int isfloating; - #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 - #if SWALLOW_PATCH - int isterminal; - int noswallow; - #endif // SWALLOW_PATCH - #if FLOATPOS_PATCH - const char *floatpos; - #endif // FLOATPOS_PATCH - int monitor; - #if RENAMED_SCRATCHPADS_PATCH - const char scratchkey; - #endif // RENAMED_SCRATCHPADS_PATCH - #if XKB_PATCH - int xkb_layout; - #endif // XKB_PATCH -} Rule; - -#if XKB_PATCH -#define RULE(...) { .monitor = -1, .xkb_layout = -1, __VA_ARGS__ }, -#else -#define RULE(...) { .monitor = -1, __VA_ARGS__ }, -#endif // XKB_PATCH - -/* Cross patch compatibility rule macro helper macros */ -#define FLOATING , .isfloating = 1 -#if CENTER_PATCH -#define CENTERED , .iscentered = 1 -#else -#define CENTERED -#endif // CENTER_PATCH -#if ISPERMANENT_PATCH -#define PERMANENT , .ispermanent = 1 -#else -#define PERMANENT -#endif // ISPERMANENT_PATCH -#if SELECTIVEFAKEFULLSCREEN_PATCH && FAKEFULLSCREEN_CLIENT_PATCH && !FAKEFULLSCREEN_PATCH -#define FAKEFULLSCREEN , .isfakefullscreen = 1 -#else -#define FAKEFULLSCREEN -#endif // SELECTIVEFAKEFULLSCREEN_PATCH -#if SWALLOW_PATCH -#define NOSWALLOW , .noswallow = 1 -#define TERMINAL , .isterminal = 1 -#else -#define NOSWALLOW -#define TERMINAL -#endif // SWALLOW_PATCH -#if SWITCHTAG_PATCH -#define SWITCHTAG , .switchtag = 1 -#else -#define SWITCHTAG -#endif // SWITCHTAG_PATCH - -#if MONITOR_RULES_PATCH -typedef struct { - int monitor; - #if PERTAG_PATCH - int tag; - #endif // PERTAG_PATCH - int layout; - float mfact; - int nmaster; - int showbar; - int topbar; -} MonitorRule; -#endif // MONITOR_RULES_PATCH - -/* function declarations */ -static void applyrules(Client *c); -static int applysizehints(Client *c, int *x, int *y, int *w, int *h, int interact); -static void arrange(Monitor *m); -static void arrangemon(Monitor *m); -static void attach(Client *c); -static void attachstack(Client *c); -static void buttonpress(XEvent *e); -static void checkotherwm(void); -static void cleanup(void); -static void cleanupmon(Monitor *mon); -static void clientmessage(XEvent *e); -static void configure(Client *c); -static void configurenotify(XEvent *e); -static void configurerequest(XEvent *e); -static Monitor *createmon(void); -static void destroynotify(XEvent *e); -static void detach(Client *c); -static void detachstack(Client *c); -static Monitor *dirtomon(int dir); -static void drawbar(Monitor *m); -static void drawbars(void); -static void drawbarwin(Bar *bar); -#if !FOCUSONCLICK_PATCH -static void enternotify(XEvent *e); -#endif // FOCUSONCLICK_PATCH -static void expose(XEvent *e); -static void focus(Client *c); -static void focusin(XEvent *e); -static void focusmon(const Arg *arg); -#if !STACKER_PATCH -static void focusstack(const Arg *arg); -#endif // STACKER_PATCH -static Atom getatomprop(Client *c, Atom prop, Atom req); -static int getrootptr(int *x, int *y); -static long getstate(Window w); -static int gettextprop(Window w, Atom atom, char *text, unsigned int size); -static void grabbuttons(Client *c, int focused); -#if KEYMODES_PATCH -static void grabdefkeys(void); -#else -static void grabkeys(void); -#endif // KEYMODES_PATCH -static void incnmaster(const Arg *arg); -#if KEYMODES_PATCH -static void keydefpress(XEvent *e); -#else -static void keypress(XEvent *e); -#endif // KEYMODES_PATCH -static void killclient(const Arg *arg); -static void manage(Window w, XWindowAttributes *wa); -static void mappingnotify(XEvent *e); -static void maprequest(XEvent *e); -#if !FOCUSONCLICK_PATCH -static void motionnotify(XEvent *e); -#endif // FOCUSONCLICK_PATCH -static void movemouse(const Arg *arg); -static Client *nexttiled(Client *c); -#if !ZOOMSWAP_PATCH || TAGINTOSTACK_ALLMASTER_PATCH || TAGINTOSTACK_ONEMASTER_PATCH -static void pop(Client *c); -#endif // !ZOOMSWAP_PATCH / TAGINTOSTACK_ALLMASTER_PATCH / TAGINTOSTACK_ONEMASTER_PATCH -static void propertynotify(XEvent *e); -static void quit(const Arg *arg); -static Monitor *recttomon(int x, int y, int w, int h); -static void resize(Client *c, int x, int y, int w, int h, int interact); -static void resizeclient(Client *c, int x, int y, int w, int h); -static void resizemouse(const Arg *arg); -static void restack(Monitor *m); -static void run(void); -static void scan(void); -#if BAR_SYSTRAY_PATCH -static int sendevent(Window w, Atom proto, int m, long d0, long d1, long d2, long d3, long d4); -#else -static int sendevent(Client *c, Atom proto); -#endif // BAR_SYSTRAY_PATCH -static void sendmon(Client *c, Monitor *m); -static void setclientstate(Client *c, long state); -static void setfocus(Client *c); -static void setfullscreen(Client *c, int fullscreen); -static void setlayout(const Arg *arg); -static void setmfact(const Arg *arg); -static void setup(void); -static void seturgent(Client *c, int urg); -#if COOL_AUTOSTART_PATCH -static void sigchld(int unused); -#endif // COOL_AUTOSTART_PATCH -static void showhide(Client *c); -static void spawn(const Arg *arg); -#if RIODRAW_PATCH -static pid_t spawncmd(const Arg *arg); -#endif // RIODRAW_PATCH -static void tag(const Arg *arg); -static void tagmon(const Arg *arg); -static void togglebar(const Arg *arg); -static void togglefloating(const Arg *arg); -static void toggletag(const Arg *arg); -static void toggleview(const Arg *arg); -static void unfocus(Client *c, int setfocus, Client *nextfocus); -static void unmanage(Client *c, int destroyed); -static void unmapnotify(XEvent *e); -static void updatebarpos(Monitor *m); -static void updatebars(void); -static void updateclientlist(void); -static int updategeom(void); -static void updatenumlockmask(void); -static void updatesizehints(Client *c); -static void updatestatus(void); -static void updatetitle(Client *c); -static void updatewmhints(Client *c); -static void view(const Arg *arg); -static Client *wintoclient(Window w); -static Monitor *wintomon(Window w); -static int xerror(Display *dpy, XErrorEvent *ee); -static int xerrordummy(Display *dpy, XErrorEvent *ee); -static int xerrorstart(Display *dpy, XErrorEvent *ee); -static void zoom(const Arg *arg); - -/* bar functions */ - -#include "patch/include.h" - -/* variables */ -static const char broken[] = "broken"; -#if BAR_PANGO_PATCH || BAR_STATUS2D_PATCH && !BAR_STATUSCOLORS_PATCH -static char stext[1024]; -#else -static char stext[512]; -#endif // BAR_PANGO_PATCH | BAR_STATUS2D_PATCH -#if BAR_EXTRASTATUS_PATCH || BAR_STATUSCMD_PATCH -#if BAR_STATUS2D_PATCH -static char rawstext[1024]; -#else -static char rawstext[512]; -#endif // BAR_STATUS2D_PATCH -#endif // BAR_EXTRASTATUS_PATCH | BAR_STATUSCMD_PATCH -#if BAR_EXTRASTATUS_PATCH -#if BAR_STATUS2D_PATCH && !BAR_STATUSCOLORS_PATCH -static char estext[1024]; -#else -static char estext[512]; -#endif // BAR_STATUS2D_PATCH -#if BAR_STATUSCMD_PATCH -static char rawestext[1024]; -#endif // BAR_STATUS2D_PATCH | BAR_STATUSCMD_PATCH -#endif // BAR_EXTRASTATUS_PATCH - -#if XKB_PATCH -static int xkbEventType = 0; -#endif // XKB_PATCH -static int screen; -static int sw, sh; /* X display screen geometry width, height */ -static int bh; /* bar geometry */ -static int lrpad; /* sum of left and right padding for text */ -/* Some clients (e.g. alacritty) helpfully send configure requests with a new size or position - * when they detect that they have been moved to another monitor. This can cause visual glitches - * when moving (or resizing) client windows from one monitor to another. This variable is used - * internally to ignore such configure requests while movemouse or resizemouse are being used. */ -static int ignoreconfigurerequests = 0; -#if WARP_PATCH -static int force_warp = 0; // force warp in some situations, e.g. killclient -static int ignore_warp = 0; // force skip warp in some situations, e.g. dragmfact, dragcfact -#endif // WARP_PATCH -static int (*xerrorxlib)(Display *, XErrorEvent *); -static unsigned int numlockmask = 0; -#if RIODRAW_PATCH -static int riodimensions[4] = { -1, -1, -1, -1 }; -static pid_t riopid = 0; -#endif // RIODRAW_PATCH -static void (*handler[LASTEvent]) (XEvent *) = { - [ButtonPress] = buttonpress, - #if COMBO_PATCH || BAR_HOLDBAR_PATCH - [ButtonRelease] = keyrelease, - #endif // COMBO_PATCH / BAR_HOLDBAR_PATCH - [ClientMessage] = clientmessage, - [ConfigureRequest] = configurerequest, - [ConfigureNotify] = configurenotify, - [DestroyNotify] = destroynotify, - #if !FOCUSONCLICK_PATCH - [EnterNotify] = enternotify, - #endif // FOCUSONCLICK_PATCH - [Expose] = expose, - [FocusIn] = focusin, - [KeyPress] = keypress, - #if COMBO_PATCH || BAR_HOLDBAR_PATCH - [KeyRelease] = keyrelease, - #endif // COMBO_PATCH / BAR_HOLDBAR_PATCH - [MappingNotify] = mappingnotify, - [MapRequest] = maprequest, - #if !FOCUSONCLICK_PATCH - [MotionNotify] = motionnotify, - #endif // FOCUSONCLICK_PATCH - [PropertyNotify] = propertynotify, - #if BAR_SYSTRAY_PATCH - [ResizeRequest] = resizerequest, - #endif // BAR_SYSTRAY_PATCH - [UnmapNotify] = unmapnotify -}; -static Atom wmatom[WMLast], netatom[NetLast]; -#if BAR_SYSTRAY_PATCH -static Atom xatom[XLast]; -#endif // BAR_SYSTRAY_PATCH -#if SEAMLESS_RESTART_PATCH -static Atom clientatom[ClientLast]; -#endif // SEAMLESS_RESTART_PATCH -#if ON_EMPTY_KEYS_PATCH -static int isempty = 0; -#endif // ON_EMPTY_KEYS_PATCH -#if RESTARTSIG_PATCH -static volatile sig_atomic_t running = 1; -#else -static int running = 1; -#endif // RESTARTSIG_PATCH -static Cur *cursor[CurLast]; -static Clr **scheme; -static Display *dpy; -static Drw *drw; -static Monitor *mons, *selmon; -static Window root, wmcheckwin; - -/* configuration, allows nested code to access above variables */ -#include "config.h" - -#include "patch/include.c" - -/* compile-time check if all tags fit into an unsigned int bit array. */ -#if SCRATCHPAD_ALT_1_PATCH -struct NumTags { char limitexceeded[NUMTAGS > 30 ? -1 : 1]; }; -#else -struct NumTags { char limitexceeded[NUMTAGS > 31 ? -1 : 1]; }; -#endif // SCRATCHPAD_ALT_1_PATCH - -/* function implementations */ -void -applyrules(Client *c) -{ - const char *class, *instance; - Atom wintype; - #if WINDOWROLERULE_PATCH - char role[64]; - #endif // WINDOWROLERULE_PATCH - unsigned int i; - #if SWITCHTAG_PATCH - unsigned int newtagset; - #endif // SWITCHTAG_PATCH - const Rule *r; - Monitor *m; - XClassHint ch = { NULL, NULL }; - - /* rule matching */ - #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; - #if RENAMED_SCRATCHPADS_PATCH - c->scratchkey = 0; - #endif // RENAMED_SCRATCHPADS_PATCH - 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], XA_ATOM); - #if WINDOWROLERULE_PATCH - gettextprop(c->win, wmatom[WMWindowRole], role, sizeof(role)); - #endif // WINDOWROLERULE_PATCH - - #if STEAM_PATCH - if (strstr(class, "Steam") || strstr(class, "steam_app_")) - c->issteam = 1; - #endif // STEAM_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)) - #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))) - { - #if CENTER_PATCH - c->iscentered = r->iscentered; - #endif // CENTER_PATCH - #if ISPERMANENT_PATCH - c->ispermanent = r->ispermanent; - #endif // ISPERMANENT_PATCH - #if SELECTIVEFAKEFULLSCREEN_PATCH && FAKEFULLSCREEN_CLIENT_PATCH && !FAKEFULLSCREEN_PATCH - c->fakefullscreen = r->isfakefullscreen; - #endif // SELECTIVEFAKEFULLSCREEN_PATCH - #if SWALLOW_PATCH - 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 RENAMED_SCRATCHPADS_PATCH - c->scratchkey = r->scratchkey; - #elif SCRATCHPADS_PATCH - if ((r->tags & SPTAGMASK) && r->isfloating) { - c->x = c->mon->wx + (c->mon->ww / 2 - WIDTH(c) / 2); - c->y = c->mon->wy + (c->mon->wh / 2 - HEIGHT(c) / 2); - } - #endif // SCRATCHPADS_PATCH - for (m = mons; m && m->num != r->monitor; m = m->next); - if (m) - c->mon = m; - #if FLOATPOS_PATCH - if (c->isfloating && r->floatpos) { - #if CENTER_PATCH - c->iscentered = 0; - #endif // CENTER_PATCH - setfloatpos(c, r->floatpos); - } - #endif // FLOATPOS_PATCH - - #if SWITCHTAG_PATCH - #if SWALLOW_PATCH - if (r->switchtag && ( - c->noswallow > 0 || - !termforwin(c) || - !(c->isfloating && swallowfloating && c->noswallow < 0))) - #else - if (r->switchtag) - #endif // SWALLOW_PATCH - { - selmon = c->mon; - if (r->switchtag == 2 || r->switchtag == 4) - newtagset = c->mon->tagset[c->mon->seltags] ^ c->tags; - else - newtagset = c->tags; - - /* Switch to the client's tag, but only if that tag is not already shown */ - if (newtagset && !(c->tags & c->mon->tagset[c->mon->seltags])) { - if (r->switchtag == 3 || r->switchtag == 4) - c->switchtag = c->mon->tagset[c->mon->seltags]; - if (r->switchtag == 1 || r->switchtag == 3) { - #if PERTAG_PATCH - pertagview(&((Arg) { .ui = newtagset })); - arrange(c->mon); - #else - 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 - } - } - } - #endif // SWITCHTAG_PATCH - #if XKB_PATCH - if (r->xkb_layout > -1) - c->xkb->group = r->xkb_layout; - #endif // XKB_PATCH - #if ONLY_ONE_RULE_MATCH_PATCH - break; - #endif // ONLY_ONE_RULE_MATCH_PATCH - } - } - if (ch.res_class) - XFree(ch.res_class); - if (ch.res_name) - XFree(ch.res_name); - #if EMPTYVIEW_PATCH - if (c->tags & TAGMASK) c->tags = c->tags & TAGMASK; - #if SCRATCHPADS_PATCH && !RENAMED_SCRATCHPADS_PATCH - else if (c->mon->tagset[c->mon->seltags]) c->tags = c->mon->tagset[c->mon->seltags] & ~SPTAGMASK; - #elif SCRATCHPAD_ALT_1_PATCH - else if (c->tags != SCRATCHPAD_MASK && c->mon->tagset[c->mon->seltags]) c->tags = c->mon->tagset[c->mon->seltags]; - #else - else if (c->mon->tagset[c->mon->seltags]) c->tags = c->mon->tagset[c->mon->seltags]; - #endif // SCRATCHPADS_PATCH - else c->tags = 1; - #elif SCRATCHPADS_PATCH && !RENAMED_SCRATCHPADS_PATCH - c->tags = c->tags & TAGMASK ? c->tags & TAGMASK : (c->mon->tagset[c->mon->seltags] & ~SPTAGMASK); - #elif SCRATCHPAD_ALT_1_PATCH - if (c->tags != SCRATCHPAD_MASK) - c->tags = c->tags & TAGMASK ? c->tags & TAGMASK : c->mon->tagset[c->mon->seltags]; - #else - c->tags = c->tags & TAGMASK ? c->tags & TAGMASK : c->mon->tagset[c->mon->seltags]; - #endif // EMPTYVIEW_PATCH -} - -int -applysizehints(Client *c, int *x, int *y, int *w, int *h, int interact) -{ - int baseismin; - Monitor *m = c->mon; - - /* set minimum possible */ - *w = MAX(1, *w); - *h = MAX(1, *h); - if (interact) { - if (*x > sw) - *x = sw - WIDTH(c); - if (*y > sh) - *y = sh - HEIGHT(c); - if (*x + *w + 2 * c->bw < 0) - *x = 0; - if (*y + *h + 2 * c->bw < 0) - *y = 0; - } else { - if (*x >= m->wx + m->ww) - *x = m->wx + m->ww - WIDTH(c); - if (*y >= m->wy + m->wh) - *y = m->wy + m->wh - HEIGHT(c); - if (*x + *w + 2 * c->bw <= m->wx) - *x = m->wx; - if (*y + *h + 2 * c->bw <= m->wy) - *y = m->wy; - } - if (*h < bh) - *h = bh; - 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 */ - *w -= c->basew; - *h -= c->baseh; - } - /* adjust for aspect limits */ - if (c->mina > 0 && c->maxa > 0) { - if (c->maxa < (float)*w / *h) - *w = *h * c->maxa + 0.5; - else if (c->mina < (float)*h / *w) - *h = *w * c->mina + 0.5; - } - if (baseismin) { /* increment calculation requires this */ - *w -= c->basew; - *h -= c->baseh; - } - /* adjust for increment value */ - if (c->incw) - *w -= *w % c->incw; - if (c->inch) - *h -= *h % c->inch; - /* restore base dimensions */ - *w = MAX(*w + c->basew, c->minw); - *h = MAX(*h + c->baseh, c->minh); - if (c->maxw) - *w = MIN(*w, c->maxw); - if (c->maxh) - *h = MIN(*h, c->maxh); - } - return *x != c->x || *y != c->y || *w != c->w || *h != c->h; -} - -void -arrange(Monitor *m) -{ - if (m) - showhide(m->stack); - else for (m = mons; m; m = m->next) - showhide(m->stack); - if (m) { - arrangemon(m); - restack(m); - } else for (m = mons; m; m = m->next) - arrangemon(m); -} - -void -arrangemon(Monitor *m) -{ - #if TAB_PATCH - updatebarpos(m); - XMoveResizeWindow(dpy, m->tabwin, m->wx, m->ty, m->ww, th); - #endif // TAB_PATCH - strncpy(m->ltsymbol, m->lt[m->sellt]->symbol, sizeof m->ltsymbol); - if (m->lt[m->sellt]->arrange) - m->lt[m->sellt]->arrange(m); -} - -void -attach(Client *c) -{ - c->next = c->mon->clients; - c->mon->clients = c; -} - -void -attachstack(Client *c) -{ - c->snext = c->mon->stack; - c->mon->stack = c; -} - -void -buttonpress(XEvent *e) -{ - int click, i, r; - #if TAB_PATCH - int x; - #endif // TAB_PATCH - Arg arg = {0}; - Client *c; - Monitor *m; - Bar *bar; - XButtonPressedEvent *ev = &e->xbutton; - const BarRule *br; - BarArg carg = { 0, 0, 0, 0 }; - click = ClkRootWin; - - #if BAR_STATUSCMD_PATCH && !BAR_DWMBLOCKS_PATCH - *lastbutton = '0' + ev->button; - #endif // BAR_STATUSCMD_PATCH | BAR_DWMBLOCKS_PATCH - - /* focus monitor if necessary */ - if ((m = wintomon(ev->window)) && m != selmon - #if FOCUSONCLICK_PATCH - && (focusonwheel || (ev->button != Button4 && ev->button != Button5)) - #endif // FOCUSONCLICK_PATCH - ) { - unfocus(selmon->sel, 1, NULL); - selmon = m; - focus(NULL); - } - - for (bar = selmon->bar; bar; bar = bar->next) { - if (ev->window == bar->win) { - for (r = 0; r < LENGTH(barrules); r++) { - 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->num) - continue; - if (bar->x[r] <= ev->x && ev->x <= bar->x[r] + bar->w[r]) { - carg.x = ev->x - bar->x[r]; - carg.y = ev->y - bar->borderpx; - carg.w = bar->w[r]; - carg.h = bar->bh - 2 * bar->borderpx; - click = br->clickfunc(bar, &arg, &carg); - if (click < 0) - return; - break; - } - } - break; - } - } - - #if TAB_PATCH - if (ev->window == selmon->tabwin) { - for (i = 0, x = 0, c = selmon->clients; c; c = c->next) { - if (!ISVISIBLE(c) || HIDDEN(c)) - continue; - x += selmon->tab_widths[i]; - if (ev->x > x) - ++i; - else - break; - if (i >= m->ntabs) - break; - } - if (c) { - click = ClkTabBar; - arg.ui = i; - } - } - #endif // TAB_PATCH - - if (click == ClkRootWin && (c = wintoclient(ev->window))) { - #if FOCUSONCLICK_PATCH - if (focusonwheel || (ev->button != Button4 && ev->button != Button5)) - focus(c); - #else - focus(c); - restack(selmon); - #endif // FOCUSONCLICK_PATCH - XAllowEvents(dpy, ReplayPointer, CurrentTime); - click = ClkClientWin; - } - - for (i = 0; i < LENGTH(buttons); i++) { - if (click == buttons[i].click && buttons[i].func && buttons[i].button == ev->button - && CLEANMASK(buttons[i].mask) == CLEANMASK(ev->state)) { - buttons[i].func( - ( - click == ClkTagBar - #if TAB_PATCH - || click == ClkTabBar - #endif // TAB_PATCH - #if BAR_WINTITLEACTIONS_PATCH - || click == ClkWinTitle - #endif // BAR_WINTITLEACTIONS_PATCH - ) && buttons[i].arg.i == 0 ? &arg : &buttons[i].arg - ); - } - } -} - -void -checkotherwm(void) -{ - xerrorxlib = XSetErrorHandler(xerrorstart); - /* this causes an error if some other window manager is running */ - XSelectInput(dpy, DefaultRootWindow(dpy), SubstructureRedirectMask); - XSync(dpy, False); - XSetErrorHandler(xerror); - XSync(dpy, False); -} - -void -cleanup(void) -{ - Monitor *m; - Layout foo = { "", NULL }; - size_t i; - - #if ALT_TAB_PATCH - alttabend(); - #endif // ALT_TAB_PATCH - - #if SEAMLESS_RESTART_PATCH - for (m = mons; m; m = m->next) - persistmonitorstate(m); - #endif // SEAMLESS_RESTART_PATCH - - #if COOL_AUTOSTART_PATCH - /* kill child processes */ - for (i = 0; i < autostart_len; i++) { - if (0 < autostart_pids[i]) { - kill(autostart_pids[i], SIGTERM); - waitpid(autostart_pids[i], NULL, 0); - } - } - #endif // COOL_AUTOSTART_PATCH - - selmon->lt[selmon->sellt] = &foo; - for (m = mons; m; m = m->next) - while (m->stack) - unmanage(m->stack, 0); - XUngrabKey(dpy, AnyKey, AnyModifier, root); - while (mons) - cleanupmon(mons); - #if BAR_SYSTRAY_PATCH - if (showsystray && systray) { - while (systray->icons) - removesystrayicon(systray->icons); - if (systray->win) { - XUnmapWindow(dpy, systray->win); - XDestroyWindow(dpy, systray->win); - } - free(systray); - } - #endif // BAR_SYSTRAY_PATCH - for (i = 0; i < CurLast; i++) - drw_cur_free(drw, cursor[i]); - #if BAR_STATUS2D_PATCH && !BAR_STATUSCOLORS_PATCH - for (i = 0; i < LENGTH(colors) + 1; i++) - #else - for (i = 0; i < LENGTH(colors); i++) - #endif // BAR_STATUS2D_PATCH - free(scheme[i]); - free(scheme); - XDestroyWindow(dpy, wmcheckwin); - drw_free(drw); - XSync(dpy, False); - XSetInputFocus(dpy, PointerRoot, RevertToPointerRoot, CurrentTime); - XDeleteProperty(dpy, root, netatom[NetActiveWindow]); - - #if IPC_PATCH - ipc_cleanup(); - - if (close(epoll_fd) < 0) - fprintf(stderr, "Failed to close epoll file descriptor\n"); - #endif // IPC_PATCH -} - -void -cleanupmon(Monitor *mon) -{ - Monitor *m; - Bar *bar; - - if (mon == mons) - mons = mons->next; - else { - for (m = mons; m && m->next != mon; m = m->next); - m->next = mon->next; - } - for (bar = mon->bar; bar; bar = mon->bar) { - if (!bar->external) { - XUnmapWindow(dpy, bar->win); - XDestroyWindow(dpy, bar->win); - } - mon->bar = bar->next; - #if BAR_SYSTRAY_PATCH - if (systray && bar == systray->bar) - systray->bar = NULL; - #endif // BAR_SYSTRAY_PATCH - free(bar); - } - #if TAB_PATCH - XUnmapWindow(dpy, mon->tabwin); - XDestroyWindow(dpy, mon->tabwin); - #endif // TAB_PATCH - #if PERTAG_PATCH - free(mon->pertag); - #endif // PERTAG_PATCH - #if BAR_TAGPREVIEW_PATCH - for (size_t i = 0; i < NUMTAGS; i++) - if (mon->tagmap[i]) - XFreePixmap(dpy, mon->tagmap[i]); - XUnmapWindow(dpy, mon->tagwin); - XDestroyWindow(dpy, mon->tagwin); - #endif // BAR_TAGPREVIEW_PATCH - free(mon); -} - -void -clientmessage(XEvent *e) -{ - #if BAR_SYSTRAY_PATCH - XWindowAttributes wa; - XSetWindowAttributes swa; - #endif // BAR_SYSTRAY_PATCH - XClientMessageEvent *cme = &e->xclient; - Client *c = wintoclient(cme->window); - #if FOCUSONNETACTIVE_PATCH - unsigned int i; - #endif // FOCUSONNETACTIVE_PATCH - - #if BAR_SYSTRAY_PATCH - if (showsystray && systray && cme->window == systray->win && cme->message_type == netatom[NetSystemTrayOP]) { - /* add systray icons */ - if (cme->data.l[1] == SYSTEM_TRAY_REQUEST_DOCK) { - if (!(c = (Client *)calloc(1, sizeof(Client)))) - die("fatal: could not malloc() %u bytes\n", sizeof(Client)); - if (!(c->win = cme->data.l[2])) { - free(c); - return; - } - - c->mon = selmon; - c->next = systray->icons; - systray->icons = c; - XGetWindowAttributes(dpy, c->win, &wa); - c->x = c->oldx = c->y = c->oldy = 0; - c->w = c->oldw = wa.width; - c->h = c->oldh = wa.height; - c->oldbw = wa.border_width; - c->bw = 0; - c->isfloating = True; - /* reuse tags field as mapped status */ - c->tags = 1; - updatesizehints(c); - updatesystrayicongeom(c, wa.width, wa.height); - XAddToSaveSet(dpy, c->win); - XSelectInput(dpy, c->win, StructureNotifyMask | PropertyChangeMask | ResizeRedirectMask); - XClassHint ch = {"dwmsystray", "dwmsystray"}; - XSetClassHint(dpy, c->win, &ch); - XReparentWindow(dpy, c->win, systray->win, 0, 0); - /* use parents background color */ - swa.background_pixel = scheme[SchemeNorm][ColBg].pixel; - XChangeWindowAttributes(dpy, c->win, CWBackPixel, &swa); - sendevent(c->win, netatom[Xembed], StructureNotifyMask, CurrentTime, XEMBED_EMBEDDED_NOTIFY, 0 , systray->win, XEMBED_EMBEDDED_VERSION); - XSync(dpy, False); - setclientstate(c, NormalState); - } - return; - } - #endif // BAR_SYSTRAY_PATCH - - if (!c) - return; - if (cme->message_type == netatom[NetWMState]) { - if (cme->data.l[1] == netatom[NetWMFullscreen] - || cme->data.l[2] == netatom[NetWMFullscreen]) { - #if FAKEFULLSCREEN_CLIENT_PATCH && !FAKEFULLSCREEN_PATCH - if (c->fakefullscreen == 2 && c->isfullscreen) - c->fakefullscreen = 3; - #endif // FAKEFULLSCREEN_CLIENT_PATCH - setfullscreen(c, (cme->data.l[0] == 1 /* _NET_WM_STATE_ADD */ - || (cme->data.l[0] == 2 /* _NET_WM_STATE_TOGGLE */ - #if !FAKEFULLSCREEN_PATCH - && !c->isfullscreen - #endif // !FAKEFULLSCREEN_PATCH - ))); - } - } else if (cme->message_type == netatom[NetActiveWindow]) { - #if FOCUSONNETACTIVE_PATCH - if (c->tags & c->mon->tagset[c->mon->seltags]) - focus(c); - else { - for (i = 0; i < NUMTAGS && !((1 << i) & c->tags); i++); - if (i < NUMTAGS) { - if (c != selmon->sel) - unfocus(selmon->sel, 0, NULL); - selmon = c->mon; - if (((1 << i) & TAGMASK) != selmon->tagset[selmon->seltags]) - view(&((Arg) { .ui = 1 << i })); - focus(c); - restack(selmon); - } - } - #else - if (c != selmon->sel && !c->isurgent) - seturgent(c, 1); - #endif // FOCUSONNETACTIVE_PATCH - } -} - -void -configure(Client *c) -{ - XConfigureEvent ce; - - ce.type = ConfigureNotify; - ce.display = dpy; - ce.event = c->win; - ce.window = c->win; - ce.x = c->x; - ce.y = c->y; - ce.width = c->w; - ce.height = c->h; - ce.border_width = c->bw; - ce.above = None; - ce.override_redirect = False; - XSendEvent(dpy, c->win, False, StructureNotifyMask, (XEvent *)&ce); -} - -void -configurenotify(XEvent *e) -{ - Monitor *m; - Bar *bar; - #if !FAKEFULLSCREEN_PATCH - Client *c; - #endif // !FAKEFULLSCREEN_PATCH - XConfigureEvent *ev = &e->xconfigure; - int dirty; - /* TODO: updategeom handling sucks, needs to be simplified */ - if (ev->window == root) { - dirty = (sw != ev->width || sh != ev->height); - sw = ev->width; - sh = ev->height; - if (updategeom() || dirty) { - drw_resize(drw, sw, sh); - updatebars(); - for (m = mons; m; m = m->next) { - #if !FAKEFULLSCREEN_PATCH - for (c = m->clients; c; c = c->next) - #if FAKEFULLSCREEN_CLIENT_PATCH - if (c->isfullscreen && c->fakefullscreen != 1) - #else - if (c->isfullscreen) - #endif // FAKEFULLSCREEN_CLIENT_PATCH - resizeclient(c, m->mx, m->my, m->mw, m->mh); - #endif // !FAKEFULLSCREEN_PATCH - for (bar = m->bar; bar; bar = bar->next) - XMoveResizeWindow(dpy, bar->win, bar->bx, bar->by, bar->bw, bar->bh); - #if BAR_TAGPREVIEW_PATCH - createpreview(m); - #endif // BAR_TAGPREVIEW_PATCH - } - focus(NULL); - arrange(NULL); - } - } -} - -void -configurerequest(XEvent *e) -{ - Client *c; - Monitor *m; - #if BAR_ANYBAR_PATCH - Bar *bar; - #endif // BAR_ANYBAR_PATCH - XConfigureRequestEvent *ev = &e->xconfigurerequest; - XWindowChanges wc; - - if (ignoreconfigurerequests) - return; - - if ((c = wintoclient(ev->window))) { - if (ev->value_mask & CWBorderWidth) - c->bw = ev->border_width; - else if (c->isfloating || !selmon->lt[selmon->sellt]->arrange) { - m = c->mon; - #if STEAM_PATCH - if (!c->issteam) { - if (ev->value_mask & CWX) { - c->oldx = c->x; - c->x = m->mx + ev->x; - } - if (ev->value_mask & CWY) { - c->oldy = c->y; - c->y = m->my + ev->y; - } - } - #else - if (ev->value_mask & CWX) { - c->oldx = c->x; - c->x = m->mx + ev->x; - } - if (ev->value_mask & CWY) { - c->oldy = c->y; - c->y = m->my + ev->y; - } - #endif // STEAM_PATCH - if (ev->value_mask & CWWidth) { - c->oldw = c->w; - c->w = ev->width; - } - if (ev->value_mask & CWHeight) { - c->oldh = c->h; - c->h = ev->height; - } - if ((c->x + c->w) > m->mx + m->mw && c->isfloating) - c->x = m->mx + (m->mw / 2 - WIDTH(c) / 2); /* center in x direction */ - if ((c->y + c->h) > m->my + m->mh && c->isfloating) - c->y = m->my + (m->mh / 2 - HEIGHT(c) / 2); /* center in y direction */ - if ((ev->value_mask & (CWX|CWY)) && !(ev->value_mask & (CWWidth|CWHeight))) - configure(c); - if (ISVISIBLE(c)) - XMoveResizeWindow(dpy, c->win, c->x, c->y, c->w, c->h); - #if AUTORESIZE_PATCH - else - c->needresize = 1; - #endif // AUTORESIZE_PATCH - } else - configure(c); - } else { - wc.x = ev->x; - wc.y = ev->y; - #if BAR_ANYBAR_PATCH - m = wintomon(ev->window); - for (bar = m->bar; bar; bar = bar->next) { - if (bar->win == ev->window) { - wc.y = bar->by; - wc.x = bar->bx; - } - } - #endif // BAR_ANYBAR_PATCH - wc.width = ev->width; - wc.height = ev->height; - wc.border_width = ev->border_width; - wc.sibling = ev->above; - wc.stack_mode = ev->detail; - XConfigureWindow(dpy, ev->window, ev->value_mask, &wc); - } - XSync(dpy, False); -} - -Monitor * -createmon(void) -{ - Monitor *m, *mon; - int i, n, mi, max_bars = 2, istopbar = topbar; - #if MONITOR_RULES_PATCH - int layout; - #endif // MONITOR_RULES_PATCH - - const BarRule *br; - Bar *bar; - #if MONITOR_RULES_PATCH - int j; - const MonitorRule *mr; - #endif // MONITOR_RULES_PATCH - - m = ecalloc(1, sizeof(Monitor)); - #if !EMPTYVIEW_PATCH - #if VIEW_HISTORY_PATCH - for (i = 0; i < LENGTH(m->tagset); i++) - m->tagset[i] = 1; - #else - m->tagset[0] = m->tagset[1] = 1; - #endif // VIEW_HISTORY_PATCH - #endif // EMPTYVIEW_PATCH - m->mfact = mfact; - m->nmaster = nmaster; - #if FLEXTILE_DELUXE_LAYOUT - m->nstack = nstack; - #endif // FLEXTILE_DELUXE_LAYOUT - m->showbar = showbar; - #if TAB_PATCH - m->showtab = showtab; - m->toptab = toptab; - m->ntabs = 0; - #endif // TAB_PATCH - #if SETBORDERPX_PATCH - m->borderpx = borderpx; - #endif // SETBORDERPX_PATCH - #if VANITYGAPS_PATCH - m->gappih = gappih; - m->gappiv = gappiv; - m->gappoh = gappoh; - m->gappov = gappov; - #endif // VANITYGAPS_PATCH - for (mi = 0, mon = mons; mon; mon = mon->next, mi++); // monitor index - m->num = mi; - #if MONITOR_RULES_PATCH - for (j = 0; j < LENGTH(monrules); j++) { - mr = &monrules[j]; - if ((mr->monitor == -1 || mr->monitor == m->num) - #if PERTAG_PATCH - && (mr->tag <= 0 || (m->tagset[0] & (1 << (mr->tag - 1)))) - #endif // PERTAG_PATCH - ) { - layout = MAX(mr->layout, 0); - layout = MIN(layout, LENGTH(layouts) - 1); - m->lt[0] = &layouts[layout]; - m->lt[1] = &layouts[1 % LENGTH(layouts)]; - strncpy(m->ltsymbol, layouts[layout].symbol, sizeof m->ltsymbol); - - if (mr->mfact > -1) - m->mfact = mr->mfact; - if (mr->nmaster > -1) - m->nmaster = mr->nmaster; - if (mr->showbar > -1) - m->showbar = mr->showbar; - if (mr->topbar > -1) - istopbar = mr->topbar; - break; - } - } - #else - m->lt[0] = &layouts[0]; - m->lt[1] = &layouts[1 % LENGTH(layouts)]; - strncpy(m->ltsymbol, layouts[0].symbol, sizeof m->ltsymbol); - #endif // MONITOR_RULES_PATCH - - /* 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 == m->num) - n = MAX(br->bar, n); - } - - m->bar = NULL; - for (i = 0; i <= n && i < max_bars; i++) { - bar = ecalloc(1, sizeof(Bar)); - bar->mon = m; - bar->idx = i; - bar->next = m->bar; - bar->topbar = istopbar; - m->bar = bar; - istopbar = !istopbar; - bar->showbar = 1; - bar->external = 0; - #if BAR_BORDER_PATCH - bar->borderpx = borderpx; - #else - bar->borderpx = 0; - #endif // BAR_BORDER_PATCH - bar->bh = bh + bar->borderpx * 2; - bar->borderscheme = SchemeNorm; - } - - #if FLEXTILE_DELUXE_LAYOUT - m->ltaxis[LAYOUT] = m->lt[0]->preset.layout; - m->ltaxis[MASTER] = m->lt[0]->preset.masteraxis; - m->ltaxis[STACK] = m->lt[0]->preset.stack1axis; - m->ltaxis[STACK2] = m->lt[0]->preset.stack2axis; - #endif // FLEXTILE_DELUXE_LAYOUT - - #if PERTAG_PATCH - if (!(m->pertag = (Pertag *)calloc(1, sizeof(Pertag)))) - die("fatal: could not malloc() %u bytes\n", sizeof(Pertag)); - m->pertag->curtag = 1; - for (i = 0; i <= NUMTAGS; i++) { - #if FLEXTILE_DELUXE_LAYOUT - m->pertag->nstacks[i] = m->nstack; - #endif // FLEXTILE_DELUXE_LAYOUT - - #if !MONITOR_RULES_PATCH - /* init nmaster */ - m->pertag->nmasters[i] = m->nmaster; - - /* init mfacts */ - m->pertag->mfacts[i] = m->mfact; - - #if PERTAGBAR_PATCH - /* init showbar */ - m->pertag->showbars[i] = m->showbar; - #endif // PERTAGBAR_PATCH - #endif // MONITOR_RULES_PATCH - - #if ZOOMSWAP_PATCH - m->pertag->prevzooms[i] = NULL; - #endif // ZOOMSWAP_PATCH - - /* init layouts */ - #if MONITOR_RULES_PATCH - for (j = 0; j < LENGTH(monrules); j++) { - mr = &monrules[j]; - 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]; - m->pertag->ltidxs[i][1] = m->lt[0]; - m->pertag->nmasters[i] = (mr->nmaster > -1 ? mr->nmaster : m->nmaster); - m->pertag->mfacts[i] = (mr->mfact > -1 ? mr->mfact : m->mfact); - #if PERTAGBAR_PATCH - m->pertag->showbars[i] = (mr->showbar > -1 ? mr->showbar : m->showbar); - #endif // PERTAGBAR_PATCH - #if FLEXTILE_DELUXE_LAYOUT - m->pertag->ltaxis[i][LAYOUT] = m->pertag->ltidxs[i][0]->preset.layout; - m->pertag->ltaxis[i][MASTER] = m->pertag->ltidxs[i][0]->preset.masteraxis; - m->pertag->ltaxis[i][STACK] = m->pertag->ltidxs[i][0]->preset.stack1axis; - m->pertag->ltaxis[i][STACK2] = m->pertag->ltidxs[i][0]->preset.stack2axis; - #endif // FLEXTILE_DELUXE_LAYOUT - break; - } - } - #else - m->pertag->ltidxs[i][0] = m->lt[0]; - m->pertag->ltidxs[i][1] = m->lt[1]; - #if FLEXTILE_DELUXE_LAYOUT - /* init flextile axes */ - m->pertag->ltaxis[i][LAYOUT] = m->ltaxis[LAYOUT]; - m->pertag->ltaxis[i][MASTER] = m->ltaxis[MASTER]; - m->pertag->ltaxis[i][STACK] = m->ltaxis[STACK]; - m->pertag->ltaxis[i][STACK2] = m->ltaxis[STACK2]; - #endif // FLEXTILE_DELUXE_LAYOUT - #endif // MONITOR_RULES_PATCH - m->pertag->sellts[i] = m->sellt; - - #if PERTAG_VANITYGAPS_PATCH && VANITYGAPS_PATCH - m->pertag->enablegaps[i] = 1; - m->pertag->gaps[i] = - ((gappoh & 0xFF) << 0) | ((gappov & 0xFF) << 8) | ((gappih & 0xFF) << 16) | ((gappiv & 0xFF) << 24); - #endif // PERTAG_VANITYGAPS_PATCH | VANITYGAPS_PATCH - } - #endif // PERTAG_PATCH - - #if SEAMLESS_RESTART_PATCH - restoremonitorstate(m); - #endif // SEAMLESS_RESTART_PATCH - - #if INSETS_PATCH - m->inset = default_inset; - #endif // INSETS_PATCH - return m; -} - -void -destroynotify(XEvent *e) -{ - Client *c; - #if BAR_ANYBAR_PATCH - Monitor *m; - Bar *bar; - #endif // BAR_ANYBAR_PATCH - XDestroyWindowEvent *ev = &e->xdestroywindow; - - if ((c = wintoclient(ev->window))) - unmanage(c, 1); - #if SWALLOW_PATCH - else if ((c = swallowingclient(ev->window))) - unmanage(c->swallowing, 1); - #endif // SWALLOW_PATCH - #if BAR_SYSTRAY_PATCH - else if (showsystray && (c = wintosystrayicon(ev->window))) { - removesystrayicon(c); - drawbarwin(systray->bar); - } - #endif // BAR_SYSTRAY_PATCH - #if BAR_ANYBAR_PATCH - else { - m = wintomon(ev->window); - for (bar = m->bar; bar; bar = bar->next) { - if (bar->win == ev->window) { - unmanagealtbar(ev->window); - break; - } - } - } - #endif // BAR_ANYBAR_PATCH -} - -void -detach(Client *c) -{ - Client **tc; - #if SEAMLESS_RESTART_PATCH - c->idx = 0; - #endif // SEAMLESS_RESTART_PATCH - - for (tc = &c->mon->clients; *tc && *tc != c; tc = &(*tc)->next); - *tc = c->next; - c->next = NULL; -} - -void -detachstack(Client *c) -{ - Client **tc, *t; - - for (tc = &c->mon->stack; *tc && *tc != c; tc = &(*tc)->snext); - *tc = c->snext; - - if (c == c->mon->sel) { - for (t = c->mon->stack; t && !ISVISIBLE(t); t = t->snext); - c->mon->sel = t; - } - c->snext = NULL; -} - -Monitor * -dirtomon(int dir) -{ - Monitor *m = NULL; - - if (dir > 0) { - if (!(m = selmon->next)) - m = mons; - } else if (selmon == mons) - for (m = mons; m->next; m = m->next); - else - for (m = mons; m->next != selmon; m = m->next); - return m; -} - -void -drawbar(Monitor *m) -{ - Bar *bar; - - #if !BAR_FLEXWINTITLE_PATCH - if (m->showbar) - #endif // BAR_FLEXWINTITLE_PATCH - for (bar = m->bar; bar; bar = bar->next) - drawbarwin(bar); -} - -void -drawbars(void) -{ - Monitor *m; - for (m = mons; m; m = m->next) - drawbar(m); -} - -void -drawbarwin(Bar *bar) -{ - if (!bar || !bar->win || bar->external) - return; - int r, w, total_drawn = 0; - int rx, lx, rw, lw; // bar size, split between left and right if a center module is added - const BarRule *br; - - if (bar->borderpx) { - XSetForeground(drw->dpy, drw->gc, scheme[bar->borderscheme][ColBorder].pixel); - XFillRectangle(drw->dpy, drw->drawable, drw->gc, 0, 0, bar->bw, bar->bh); - } - - BarArg warg = { 0 }; - BarArg darg = { 0 }; - warg.h = bar->bh - 2 * bar->borderpx; - - rw = lw = bar->bw - 2 * bar->borderpx; - rx = lx = bar->borderpx; - - drw_setscheme(drw, scheme[SchemeNorm]); - drw_rect(drw, lx, bar->borderpx, lw, bar->bh - 2 * bar->borderpx, 1, 1); - for (r = 0; r < LENGTH(barrules); r++) { - 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->num) - continue; - drw_setscheme(drw, scheme[SchemeNorm]); - warg.w = (br->alignment < BAR_ALIGN_RIGHT_LEFT ? lw : rw); - - w = br->widthfunc(bar, &warg); - w = MIN(warg.w, w); - - if (lw <= 0) { // if left is exhausted then switch to right side, and vice versa - lw = rw; - lx = rx; - } else if (rw <= 0) { - rw = lw; - rx = lx; - } - - switch(br->alignment) { - default: - case BAR_ALIGN_NONE: - case BAR_ALIGN_LEFT_LEFT: - case BAR_ALIGN_LEFT: - bar->x[r] = lx; - if (lx == rx) { - rx += w; - rw -= w; - } - lx += w; - lw -= w; - break; - case BAR_ALIGN_LEFT_RIGHT: - case BAR_ALIGN_RIGHT: - bar->x[r] = lx + lw - w; - if (lx == rx) - rw -= w; - lw -= w; - break; - case BAR_ALIGN_LEFT_CENTER: - case BAR_ALIGN_CENTER: - bar->x[r] = lx + lw / 2 - w / 2; - if (lx == rx) { - rw = rx + rw - bar->x[r] - w; - rx = bar->x[r] + w; - } - lw = bar->x[r] - lx; - break; - case BAR_ALIGN_RIGHT_LEFT: - bar->x[r] = rx; - if (lx == rx) { - lx += w; - lw -= w; - } - rx += w; - rw -= w; - break; - case BAR_ALIGN_RIGHT_RIGHT: - bar->x[r] = rx + rw - w; - if (lx == rx) - lw -= w; - rw -= w; - break; - case BAR_ALIGN_RIGHT_CENTER: - bar->x[r] = rx + rw / 2 - w / 2; - if (lx == rx) { - lw = lx + lw - bar->x[r] + w; - lx = bar->x[r] + w; - } - rw = bar->x[r] - rx; - break; - } - bar->w[r] = w; - darg.x = bar->x[r]; - darg.y = bar->borderpx; - darg.h = bar->bh - 2 * bar->borderpx; - darg.w = bar->w[r]; - if (br->drawfunc) - total_drawn += br->drawfunc(bar, &darg); - } - - if (total_drawn == 0 && bar->showbar) { - bar->showbar = 0; - updatebarpos(bar->mon); - XMoveResizeWindow(dpy, bar->win, bar->bx, bar->by, bar->bw, bar->bh); - arrange(bar->mon); - } - else if (total_drawn > 0 && !bar->showbar) { - bar->showbar = 1; - updatebarpos(bar->mon); - XMoveResizeWindow(dpy, bar->win, bar->bx, bar->by, bar->bw, bar->bh); - drw_map(drw, bar->win, 0, 0, bar->bw, bar->bh); - arrange(bar->mon); - } else - drw_map(drw, bar->win, 0, 0, bar->bw, bar->bh); -} - -#if !FOCUSONCLICK_PATCH -void -enternotify(XEvent *e) -{ - Client *c; - #if LOSEFULLSCREEN_PATCH - Client *sel; - #endif // LOSEFULLSCREEN_PATCH - Monitor *m; - XCrossingEvent *ev = &e->xcrossing; - - if ((ev->mode != NotifyNormal || ev->detail == NotifyInferior) && ev->window != root) - return; - c = wintoclient(ev->window); - m = c ? c->mon : wintomon(ev->window); - if (m != selmon) { - #if LOSEFULLSCREEN_PATCH - sel = selmon->sel; - selmon = m; - unfocus(sel, 1, c); - #else - unfocus(selmon->sel, 1, c); - selmon = m; - #endif // LOSEFULLSCREEN_PATCH - } else if (!c || c == selmon->sel) - return; - focus(c); -} -#endif // FOCUSONCLICK_PATCH - -void -expose(XEvent *e) -{ - Monitor *m; - XExposeEvent *ev = &e->xexpose; - - if (ev->count == 0 && (m = wintomon(ev->window))) { - drawbar(m); - #if TAB_PATCH - drawtabs(); - #endif // TAB_PATCH - } -} - -void -focus(Client *c) -{ - if (!c || !ISVISIBLE(c)) - for (c = selmon->stack; c && !ISVISIBLE(c); c = c->snext); - if (selmon->sel && selmon->sel != c) - unfocus(selmon->sel, 0, c); - if (c) { - if (c->mon != selmon) - selmon = c->mon; - if (c->isurgent) - seturgent(c, 0); - detachstack(c); - attachstack(c); - grabbuttons(c, 1); - #if !BAR_FLEXWINTITLE_PATCH - #if RENAMED_SCRATCHPADS_PATCH - if (c->scratchkey != 0 && c->isfloating) - XSetWindowBorder(dpy, c->win, scheme[SchemeScratchSel][ColFloat].pixel); - else if (c->scratchkey != 0) - XSetWindowBorder(dpy, c->win, scheme[SchemeScratchSel][ColBorder].pixel); - else if (c->isfloating) - XSetWindowBorder(dpy, c->win, scheme[SchemeSel][ColFloat].pixel); - else - XSetWindowBorder(dpy, c->win, scheme[SchemeSel][ColBorder].pixel); - #else - if (c->isfloating) - XSetWindowBorder(dpy, c->win, scheme[SchemeSel][ColFloat].pixel); - else - XSetWindowBorder(dpy, c->win, scheme[SchemeSel][ColBorder].pixel); - #endif // RENAMED_SCRATCHPADS_PATCH - #endif // BAR_FLEXWINTITLE_PATCH - setfocus(c); - } else { - #if NODMENU_PATCH - XSetInputFocus(dpy, selmon->bar && selmon->bar->win ? selmon->bar->win : root, RevertToPointerRoot, CurrentTime); - #else - XSetInputFocus(dpy, root, RevertToPointerRoot, CurrentTime); - #endif // NODMENU_PATCH - XDeleteProperty(dpy, root, netatom[NetActiveWindow]); - } - selmon->sel = c; - drawbars(); - - #if ON_EMPTY_KEYS_PATCH - if ((isempty && selmon->sel) || (!isempty && !selmon->sel)) { - isempty = !isempty; - grabkeys(); - } - #endif // ON_EMPTY_KEYS_PATCH -} - -/* there are some broken focus acquiring clients needing extra handling */ -void -focusin(XEvent *e) -{ - XFocusChangeEvent *ev = &e->xfocus; - - if (selmon->sel && ev->window != selmon->sel->win) - setfocus(selmon->sel); -} - -void -focusmon(const Arg *arg) -{ - Monitor *m; - #if LOSEFULLSCREEN_PATCH - Client *sel; - #endif // LOSEFULLSCREEN_PATCH - - if (!mons->next) - return; - if ((m = dirtomon(arg->i)) == selmon) - return; - #if LOSEFULLSCREEN_PATCH - sel = selmon->sel; - selmon = m; - unfocus(sel, 0, NULL); - #else - unfocus(selmon->sel, 0, NULL); - selmon = m; - #endif // LOSEFULLSCREEN_PATCH - focus(NULL); - #if WARP_PATCH - warp(selmon->sel); - #endif // WARP_PATCH -} - -#if !STACKER_PATCH -void -focusstack(const Arg *arg) -{ - Client *c = NULL, *i; - - #if LOSEFULLSCREEN_PATCH - if (!selmon->sel) - return; - #elif FAKEFULLSCREEN_CLIENT_PATCH && !FAKEFULLSCREEN_PATCH - if (!selmon->sel || (selmon->sel->isfullscreen && !selmon->sel->fakefullscreen)) - return; - #else - if (!selmon->sel || (selmon->sel->isfullscreen && lockfullscreen)) - return; - #endif // LOSEFULLSCREEN_PATCH - #if BAR_WINTITLEACTIONS_PATCH - if (arg->i > 0) { - for (c = selmon->sel->next; c && (!ISVISIBLE(c) || (arg->i == 1 && HIDDEN(c))); c = c->next); - if (!c) - for (c = selmon->clients; c && (!ISVISIBLE(c) || (arg->i == 1 && HIDDEN(c))); c = c->next); - } else { - for (i = selmon->clients; i != selmon->sel; i = i->next) - if (ISVISIBLE(i) && !(arg->i == -1 && HIDDEN(i))) - c = i; - if (!c) - for (; i; i = i->next) - if (ISVISIBLE(i) && !(arg->i == -1 && HIDDEN(i))) - c = i; - } - #else - if (arg->i > 0) { - for (c = selmon->sel->next; c && !ISVISIBLE(c); c = c->next); - if (!c) - for (c = selmon->clients; c && !ISVISIBLE(c); c = c->next); - } else { - for (i = selmon->clients; i != selmon->sel; i = i->next) - if (ISVISIBLE(i)) - c = i; - if (!c) - for (; i; i = i->next) - if (ISVISIBLE(i)) - c = i; - } - #endif // BAR_WINTITLEACTIONS_PATCH - if (c) { - focus(c); - restack(selmon); - } -} -#endif // STACKER_PATCH - -Atom -getatomprop(Client *c, Atom prop, Atom req) -{ - int di; - unsigned long dl; - unsigned char *p = NULL; - Atom da, atom = None; - - #if BAR_SYSTRAY_PATCH - if (prop == xatom[XembedInfo]) - req = xatom[XembedInfo]; - #endif // BAR_SYSTRAY_PATCH - - /* FIXME getatomprop should return the number of items and a pointer to - * the stored data instead of this workaround */ - if (XGetWindowProperty(dpy, c->win, prop, 0L, sizeof atom, False, req, - &da, &di, &dl, &dl, &p) == Success && p) { - atom = *(Atom *)p; - #if BAR_SYSTRAY_PATCH - if (da == xatom[XembedInfo] && dl == 2) - atom = ((Atom *)p)[1]; - #endif // BAR_SYSTRAY_PATCH - XFree(p); - } - return atom; -} - -int -getrootptr(int *x, int *y) -{ - int di; - unsigned int dui; - Window dummy; - - return XQueryPointer(dpy, root, &dummy, &dummy, x, y, &di, &di, &dui); -} - -long -getstate(Window w) -{ - int format; - long result = -1; - unsigned char *p = NULL; - unsigned long n, extra; - Atom real; - - if (XGetWindowProperty(dpy, w, wmatom[WMState], 0L, 2L, False, wmatom[WMState], - &real, &format, &n, &extra, (unsigned char **)&p) != Success) - return -1; - if (n != 0) - result = *p; - XFree(p); - return result; -} - -int -gettextprop(Window w, Atom atom, char *text, unsigned int size) -{ - char **list = NULL; - int n; - XTextProperty name; - - if (!text || size == 0) - return 0; - text[0] = '\0'; - if (!XGetTextProperty(dpy, w, &name, atom) || !name.nitems) - return 0; - if (name.encoding == XA_STRING) { - strncpy(text, (char *)name.value, size - 1); - } else if (XmbTextPropertyToTextList(dpy, &name, &list, &n) >= Success && n > 0 && *list) { - strncpy(text, *list, size - 1); - XFreeStringList(list); - } - text[size - 1] = '\0'; - XFree(name.value); - return 1; -} - -void -grabbuttons(Client *c, int focused) -{ - updatenumlockmask(); - { - unsigned int i, j; - unsigned int modifiers[] = { 0, LockMask, numlockmask, numlockmask|LockMask }; - XUngrabButton(dpy, AnyButton, AnyModifier, c->win); - if (!focused) - XGrabButton(dpy, AnyButton, AnyModifier, c->win, False, - BUTTONMASK, GrabModeSync, GrabModeSync, None, None); - for (i = 0; i < LENGTH(buttons); i++) - if (buttons[i].click == ClkClientWin - #if NO_MOD_BUTTONS_PATCH - && (nomodbuttons || buttons[i].mask != 0) - #endif // NO_MOD_BUTTONS_PATCH - ) - for (j = 0; j < LENGTH(modifiers); j++) - XGrabButton(dpy, buttons[i].button, - buttons[i].mask | modifiers[j], - c->win, False, BUTTONMASK, - GrabModeAsync, GrabModeSync, None, None); - } -} - -void -#if KEYMODES_PATCH -grabdefkeys(void) -#else -grabkeys(void) -#endif // KEYMODES_PATCH -{ - updatenumlockmask(); - { - unsigned int i, j, k; - unsigned int modifiers[] = { 0, LockMask, numlockmask, numlockmask|LockMask }; - int start, end, skip; - KeySym *syms; - - XUngrabKey(dpy, AnyKey, AnyModifier, root); - XDisplayKeycodes(dpy, &start, &end); - syms = XGetKeyboardMapping(dpy, start, end - start + 1, &skip); - if (!syms) - return; - for (k = start; k <= end; k++) - for (i = 0; i < LENGTH(keys); i++) - /* skip modifier codes, we do that ourselves */ - if (keys[i].keysym == syms[(k - start) * skip]) - for (j = 0; j < LENGTH(modifiers); j++) - XGrabKey(dpy, k, - keys[i].mod | modifiers[j], - root, True, - GrabModeAsync, GrabModeAsync); - #if ON_EMPTY_KEYS_PATCH - if (!selmon->sel) - for (k = start; k <= end; k++) - for (i = 0; i < LENGTH(on_empty_keys); i++) - /* skip modifier codes, we do that ourselves */ - if (on_empty_keys[i].keysym == syms[(k - start) * skip]) - for (j = 0; j < LENGTH(modifiers); j++) - XGrabKey(dpy, k, - on_empty_keys[i].mod | modifiers[j], - root, True, - GrabModeAsync, GrabModeAsync); - #endif // ON_EMPTY_KEYS_PATCH - XFree(syms); - } -} - -void -incnmaster(const Arg *arg) -{ - #if PERTAG_PATCH - selmon->nmaster = selmon->pertag->nmasters[selmon->pertag->curtag] = MAX(selmon->nmaster + arg->i, 0); - #else - selmon->nmaster = MAX(selmon->nmaster + arg->i, 0); - #endif // PERTAG_PATCH - arrange(selmon); -} - -#ifdef XINERAMA -static int -isuniquegeom(XineramaScreenInfo *unique, size_t n, XineramaScreenInfo *info) -{ - while (n--) - if (unique[n].x_org == info->x_org && unique[n].y_org == info->y_org - && unique[n].width == info->width && unique[n].height == info->height) - return 0; - return 1; -} -#endif /* XINERAMA */ - -void -#if KEYMODES_PATCH -keydefpress(XEvent *e) -#else -keypress(XEvent *e) -#endif // KEYMODES_PATCH -{ - unsigned int i; - int keysyms_return; - KeySym* keysym; - XKeyEvent *ev; - - ev = &e->xkey; - keysym = XGetKeyboardMapping(dpy, (KeyCode)ev->keycode, 1, &keysyms_return); - for (i = 0; i < LENGTH(keys); i++) - if (*keysym == keys[i].keysym - && CLEANMASK(keys[i].mod) == CLEANMASK(ev->state) - && keys[i].func) - keys[i].func(&(keys[i].arg)); - #if ON_EMPTY_KEYS_PATCH - if (!selmon->sel) - for (i = 0; i < LENGTH(on_empty_keys); i++) - if (*keysym == on_empty_keys[i].keysym - && CLEANMASK(on_empty_keys[i].mod) == CLEANMASK(ev->state) - && on_empty_keys[i].func) - on_empty_keys[i].func(&(on_empty_keys[i].arg)); - #endif // ON_EMPTY_KEYS_PATCH - XFree(keysym); -} - -void -killclient(const Arg *arg) -{ - #if ISPERMANENT_PATCH - if (!selmon->sel || selmon->sel->ispermanent) - #else - if (!selmon->sel) - #endif // ISPERMANENT_PATCH - return; - #if BAR_SYSTRAY_PATCH - if (!sendevent(selmon->sel->win, wmatom[WMDelete], NoEventMask, wmatom[WMDelete], CurrentTime, 0, 0, 0)) - #else - if (!sendevent(selmon->sel, wmatom[WMDelete])) - #endif // BAR_SYSTRAY_PATCH - { - XGrabServer(dpy); - XSetErrorHandler(xerrordummy); - XSetCloseDownMode(dpy, DestroyAll); - XKillClient(dpy, selmon->sel->win); - XSync(dpy, False); - XSetErrorHandler(xerror); - XUngrabServer(dpy); - #if WARP_PATCH - force_warp = 1; - #endif // WARP_PATCH - } - #if SWAPFOCUS_PATCH && PERTAG_PATCH - selmon->pertag->prevclient[selmon->pertag->curtag] = NULL; - #endif // SWAPFOCUS_PATCH -} - -void -manage(Window w, XWindowAttributes *wa) -{ - Client *c, *t = NULL; - #if SWALLOW_PATCH - Client *term = NULL; - #endif // SWALLOW_PATCH - #if SEAMLESS_RESTART_PATCH - int settings_restored; - #endif // SEAMLESS_RESTART_PATCH - Window trans = None; - XWindowChanges wc; - - c = ecalloc(1, sizeof(Client)); - c->win = w; - #if SWALLOW_PATCH - c->pid = winpid(w); - #endif // SWALLOW_PATCH - /* geometry */ - #if SAVEFLOATS_PATCH || EXRESIZE_PATCH - c->sfx = c->sfy = c->sfw = c->sfh = -9999; - #endif // SAVEFLOATS_PATCH | EXRESIZE_PATCH - c->x = c->oldx = wa->x; - c->y = c->oldy = wa->y; - c->w = c->oldw = wa->width; - c->h = c->oldh = wa->height; - c->oldbw = wa->border_width; - #if CFACTS_PATCH - c->cfact = 1.0; - #endif // CFACTS_PATCH - #if SEAMLESS_RESTART_PATCH - settings_restored = restoreclientstate(c); - #endif // SEAMLESS_RESTART_PATCH - #if BAR_WINICON_PATCH - updateicon(c); - #endif // BAR_WINICON_PATCH - updatetitle(c); - - #if XKB_PATCH - /* Setting current xkb state must be before applyrules */ - if (!(c->xkb = findxkb(c->win))) - c->xkb = createxkb(c->win); - #endif // XKB_PATCH - - if (XGetTransientForHint(dpy, w, &trans) && (t = wintoclient(trans))) { - c->mon = t->mon; - c->tags = t->tags; - #if SETBORDERPX_PATCH - c->bw = c->mon->borderpx; - #else - c->bw = borderpx; - #endif // SETBORDERPX_PATCH - #if CENTER_TRANSIENT_WINDOWS_BY_PARENT_PATCH - c->x = t->x + WIDTH(t) / 2 - WIDTH(c) / 2; - c->y = t->y + HEIGHT(t) / 2 - HEIGHT(c) / 2; - #elif CENTER_PATCH && CENTER_TRANSIENT_WINDOWS_PATCH - c->iscentered = 1; - #elif CENTER_TRANSIENT_WINDOWS_PATCH - c->x = c->mon->wx + (c->mon->ww - WIDTH(c)) / 2; - c->y = c->mon->wy + (c->mon->wh - HEIGHT(c)) / 2; - #elif CENTER_PATCH - if (c->x == c->mon->wx && c->y == c->mon->wy) - c->iscentered = 1; - #endif // CENTER_TRANSIENT_WINDOWS_PATCH | CENTER_TRANSIENT_WINDOWS_BY_PARENT_PATCH | CENTER_PATCH - } else { - #if SEAMLESS_RESTART_PATCH - if (!settings_restored) - c->mon = selmon; - #else - c->mon = selmon; - #endif // SEAMLESS_RESTART_PATCH - #if CENTER_PATCH - if (c->x == c->mon->wx && c->y == c->mon->wy) - c->iscentered = 1; - #endif // CENTER_PATCH - #if SETBORDERPX_PATCH - c->bw = c->mon->borderpx; - #else - c->bw = borderpx; - #endif // SETBORDERPX_PATCH - #if SEAMLESS_RESTART_PATCH - if (!settings_restored) - applyrules(c); - #else - applyrules(c); - #endif // SEAMLESS_RESTART_PATCH - #if SWALLOW_PATCH - term = termforwin(c); - if (term) - c->mon = term->mon; - #endif // SWALLOW_PATCH - } - - if (c->x + WIDTH(c) > c->mon->wx + c->mon->ww) - c->x = c->mon->wx + c->mon->ww - WIDTH(c); - if (c->y + HEIGHT(c) > c->mon->wy + c->mon->wh) - c->y = c->mon->wy + c->mon->wh - HEIGHT(c); - c->x = MAX(c->x, c->mon->wx); - c->y = MAX(c->y, c->mon->wy); - - wc.border_width = c->bw; - XConfigureWindow(dpy, w, CWBorderWidth, &wc); - #if !BAR_FLEXWINTITLE_PATCH - if (c->isfloating) - XSetWindowBorder(dpy, w, scheme[SchemeNorm][ColFloat].pixel); - else - XSetWindowBorder(dpy, w, scheme[SchemeNorm][ColBorder].pixel); - #endif // BAR_FLEXWINTITLE_PATCH - configure(c); /* propagates border_width, if size doesn't change */ - updatesizehints(c); - updatewmhints(c); - #if DECORATION_HINTS_PATCH - updatemotifhints(c); - #endif // DECORATION_HINTS_PATCH - - #if CENTER_PATCH && SAVEFLOATS_PATCH || CENTER_PATCH && EXRESIZE_PATCH - if (c->iscentered) { - c->sfx = c->x = c->mon->wx + (c->mon->ww - WIDTH(c)) / 2; - c->sfy = c->y = c->mon->wy + (c->mon->wh - HEIGHT(c)) / 2; - } - #elif CENTER_PATCH - if (c->iscentered) { - c->x = c->mon->wx + (c->mon->ww - WIDTH(c)) / 2; - c->y = c->mon->wy + (c->mon->wh - HEIGHT(c)) / 2; - } - #elif ALWAYSCENTER_PATCH && SAVEFLOATS_PATCH || ALWAYSCENTER_PATCH && EXRESIZE_PATCH - c->sfx = c->x = c->mon->wx + (c->mon->ww - WIDTH(c)) / 2; - c->sfy = c->y = c->mon->wy + (c->mon->wh - HEIGHT(c)) / 2; - #elif ALWAYSCENTER_PATCH - c->x = c->mon->wx + (c->mon->ww - WIDTH(c)) / 2; - c->y = c->mon->wy + (c->mon->wh - HEIGHT(c)) / 2; - #endif // CENTER_PATCH / ALWAYSCENTER_PATCH / SAVEFLOATS_PATCH - #if SAVEFLOATS_PATCH || EXRESIZE_PATCH - if (c->sfw == -9999) { - c->sfw = c->w; - c->sfh = c->h; - } - #endif // SAVEFLOATS_PATCH / EXRESIZE_PATCH - - if (getatomprop(c, netatom[NetWMState], XA_ATOM) == netatom[NetWMFullscreen]) - setfullscreen(c, 1); - - XSelectInput(dpy, w, EnterWindowMask|FocusChangeMask|PropertyChangeMask|StructureNotifyMask); - grabbuttons(c, 0); - #if MAXIMIZE_PATCH - c->wasfloating = 0; - c->ismax = 0; - #elif EXRESIZE_PATCH - c->wasfloating = 0; - #endif // MAXIMIZE_PATCH / EXRESIZE_PATCH - - if (!c->isfloating) - c->isfloating = c->oldstate = trans != None || c->isfixed; - if (c->isfloating) { - XRaiseWindow(dpy, c->win); - XSetWindowBorder(dpy, w, scheme[SchemeNorm][ColFloat].pixel); - } - #if ATTACHABOVE_PATCH || ATTACHASIDE_PATCH || ATTACHBELOW_PATCH || ATTACHBOTTOM_PATCH || SEAMLESS_RESTART_PATCH - attachx(c); - #else - attach(c); - #endif - attachstack(c); - XChangeProperty(dpy, root, netatom[NetClientList], XA_WINDOW, 32, PropModeAppend, - (unsigned char *) &(c->win), 1); - #if NET_CLIENT_LIST_STACKING_PATCH - XChangeProperty(dpy, root, netatom[NetClientListStacking], XA_WINDOW, 32, PropModePrepend, - (unsigned char *) &(c->win), 1); - #endif // NET_CLIENT_LIST_STACKING_PATCH - XMoveResizeWindow(dpy, c->win, c->x + 2 * sw, c->y, c->w, c->h); /* some windows require this */ - - #if BAR_WINTITLEACTIONS_PATCH - if (!HIDDEN(c)) - setclientstate(c, NormalState); - #else - setclientstate(c, NormalState); - #endif // BAR_WINTITLEACTIONS_PATCH - if (c->mon == selmon) - unfocus(selmon->sel, 0, c); - c->mon->sel = c; - #if SWALLOW_PATCH - if (!(term && swallow(term, c))) { - #if RIODRAW_PATCH - if (riopid && (!riodraw_matchpid || isdescprocess(riopid, c->pid))) { - if (riodimensions[3] != -1) - rioposition(c, riodimensions[0], riodimensions[1], riodimensions[2], riodimensions[3]); - else { - killclient(&((Arg) { .v = c })); - return; - } - } - #endif // RIODRAW_PATCH - arrange(c->mon); - #if BAR_WINTITLEACTIONS_PATCH - if (!HIDDEN(c)) - XMapWindow(dpy, c->win); - #else - XMapWindow(dpy, c->win); - #endif // BAR_WINTITLEACTIONS_PATCH - } - #else - #if RIODRAW_PATCH - if (riopid) { - if (riodimensions[3] != -1) - rioposition(c, riodimensions[0], riodimensions[1], riodimensions[2], riodimensions[3]); - else { - killclient(&((Arg) { .v = c })); - return; - } - } - #endif // RIODRAW_PATCH - arrange(c->mon); - #if BAR_WINTITLEACTIONS_PATCH - if (!HIDDEN(c)) - XMapWindow(dpy, c->win); - #else - XMapWindow(dpy, c->win); - #endif // BAR_WINTITLEACTIONS_PATCH - #endif // SWALLOW_PATCH - focus(NULL); - - #if BAR_EWMHTAGS_PATCH - setfloatinghint(c); - #endif // BAR_EWMHTAGS_PATCH -} - -void -mappingnotify(XEvent *e) -{ - XMappingEvent *ev = &e->xmapping; - - XRefreshKeyboardMapping(ev); - if (ev->request == MappingKeyboard) - grabkeys(); -} - -void -maprequest(XEvent *e) -{ - static XWindowAttributes wa; - XMapRequestEvent *ev = &e->xmaprequest; - - #if BAR_SYSTRAY_PATCH - Client *i; - if (showsystray && systray && (i = wintosystrayicon(ev->window))) { - sendevent(i->win, netatom[Xembed], StructureNotifyMask, CurrentTime, XEMBED_WINDOW_ACTIVATE, 0, systray->win, XEMBED_EMBEDDED_VERSION); - drawbarwin(systray->bar); - } - #endif // BAR_SYSTRAY_PATCH - - if (!XGetWindowAttributes(dpy, ev->window, &wa) || wa.override_redirect) - return; - #if BAR_ANYBAR_PATCH - if (wmclasscontains(ev->window, altbarclass, "")) - managealtbar(ev->window, &wa); - else - #endif // BAR_ANYBAR_PATCH - if (!wintoclient(ev->window)) - manage(ev->window, &wa); -} - -#if !FOCUSONCLICK_PATCH -void -motionnotify(XEvent *e) -{ - static Monitor *mon = NULL; - Monitor *m; - Bar *bar; - #if LOSEFULLSCREEN_PATCH - Client *sel; - #endif // LOSEFULLSCREEN_PATCH - XMotionEvent *ev = &e->xmotion; - - if ((bar = wintobar(ev->window))) { - barhover(e, bar); - return; - } - - #if BAR_TAGPREVIEW_PATCH - if (selmon->previewshow != 0) - hidetagpreview(selmon); - #endif // BAR_TAGPREVIEW_PATCH - - if (ev->window != root) - return; - if ((m = recttomon(ev->x_root, ev->y_root, 1, 1)) != mon && mon) { - #if LOSEFULLSCREEN_PATCH - sel = selmon->sel; - selmon = m; - unfocus(sel, 1, NULL); - #else - unfocus(selmon->sel, 1, NULL); - selmon = m; - #endif // LOSEFULLSCREEN_PATCH - focus(NULL); - } - mon = m; -} -#endif // FOCUSONCLICK_PATCH - -void -movemouse(const Arg *arg) -{ - int x, y, ocx, ocy, nx, ny; - Client *c; - Monitor *m; - XEvent ev; - Time lasttime = 0; - - if (!(c = selmon->sel)) - return; - #if !FAKEFULLSCREEN_PATCH - #if FAKEFULLSCREEN_CLIENT_PATCH && !FAKEFULLSCREEN_PATCH - if (c->isfullscreen && c->fakefullscreen != 1) /* no support moving fullscreen windows by mouse */ - return; - #else - if (c->isfullscreen) /* no support moving fullscreen windows by mouse */ - return; - #endif // FAKEFULLSCREEN_CLIENT_PATCH - #endif // FAKEFULLSCREEN_PATCH - restack(selmon); - nx = ocx = c->x; - ny = ocy = c->y; - if (XGrabPointer(dpy, root, False, MOUSEMASK, GrabModeAsync, GrabModeAsync, - None, cursor[CurMove]->cursor, CurrentTime) != GrabSuccess) - return; - if (!getrootptr(&x, &y)) - return; - ignoreconfigurerequests = 1; - do { - XMaskEvent(dpy, MOUSEMASK|ExposureMask|SubstructureRedirectMask, &ev); - switch(ev.type) { - case ConfigureRequest: - case Expose: - case MapRequest: - handler[ev.type](&ev); - break; - case MotionNotify: - if ((ev.xmotion.time - lasttime) <= (1000 / 60)) - continue; - lasttime = ev.xmotion.time; - - nx = ocx + (ev.xmotion.x - x); - ny = ocy + (ev.xmotion.y - y); - if (abs(selmon->wx - nx) < snap) - nx = selmon->wx; - else if (abs((selmon->wx + selmon->ww) - (nx + WIDTH(c))) < snap) - nx = selmon->wx + selmon->ww - WIDTH(c); - if (abs(selmon->wy - ny) < snap) - ny = selmon->wy; - else if (abs((selmon->wy + selmon->wh) - (ny + HEIGHT(c))) < snap) - ny = selmon->wy + selmon->wh - HEIGHT(c); - if (!c->isfloating && selmon->lt[selmon->sellt]->arrange - && (abs(nx - c->x) > snap || abs(ny - c->y) > snap)) { - #if SAVEFLOATS_PATCH || EXRESIZE_PATCH - c->sfx = -9999; // disable savefloats when using movemouse - #endif // SAVEFLOATS_PATCH | EXRESIZE_PATCH - togglefloating(NULL); - } - if (!selmon->lt[selmon->sellt]->arrange || c->isfloating) { - resize(c, nx, ny, c->w, c->h, 1); - } - break; - } - } while (ev.type != ButtonRelease); - - XUngrabPointer(dpy, CurrentTime); - if ((m = recttomon(c->x, c->y, c->w, c->h)) != selmon) { - #if SCRATCHPADS_PATCH && !RENAMED_SCRATCHPADS_PATCH - if (c->tags & SPTAGMASK) { - c->mon->tagset[c->mon->seltags] ^= (c->tags & SPTAGMASK); - m->tagset[m->seltags] |= (c->tags & SPTAGMASK); - } - #endif // SCRATCHPADS_PATCH - sendmon(c, m); - selmon = m; - focus(NULL); - } - #if SAVEFLOATS_PATCH || EXRESIZE_PATCH - /* save last known float coordinates */ - if (!selmon->lt[selmon->sellt]->arrange || c->isfloating) { - c->sfx = nx; - c->sfy = ny; - } - #endif // SAVEFLOATS_PATCH / EXRESIZE_PATCH - ignoreconfigurerequests = 0; -} - -Client * -nexttiled(Client *c) -{ - #if BAR_WINTITLEACTIONS_PATCH - for (; c && (c->isfloating || !ISVISIBLE(c) || HIDDEN(c)); c = c->next); - #else - for (; c && (c->isfloating || !ISVISIBLE(c)); c = c->next); - #endif // BAR_WINTITLEACTIONS_PATCH - return c; -} - -#if !ZOOMSWAP_PATCH || TAGINTOSTACK_ALLMASTER_PATCH || TAGINTOSTACK_ONEMASTER_PATCH -void -pop(Client *c) -{ - detach(c); - attach(c); - focus(c); - arrange(c->mon); -} -#endif // !ZOOMSWAP_PATCH / TAGINTOSTACK_ALLMASTER_PATCH / TAGINTOSTACK_ONEMASTER_PATCH - -void -propertynotify(XEvent *e) -{ - Client *c; - Window trans; - XPropertyEvent *ev = &e->xproperty; - - #if BAR_SYSTRAY_PATCH - if (showsystray && (c = wintosystrayicon(ev->window))) { - if (ev->atom == XA_WM_NORMAL_HINTS) { - updatesizehints(c); - updatesystrayicongeom(c, c->w, c->h); - } - else - updatesystrayiconstate(c, ev); - drawbarwin(systray->bar); - } - #endif // BAR_SYSTRAY_PATCH - - if ((ev->window == root) && (ev->atom == XA_WM_NAME)) { - #if DWMC_PATCH || FSIGNAL_PATCH - if (!fake_signal()) - updatestatus(); - #else - updatestatus(); - #endif // DWMC_PATCH / FSIGNAL_PATCH - } else if (ev->state == PropertyDelete) { - return; /* ignore */ - } else if ((c = wintoclient(ev->window))) { - switch(ev->atom) { - default: break; - case XA_WM_TRANSIENT_FOR: - if (!c->isfloating && (XGetTransientForHint(dpy, c->win, &trans)) && - (c->isfloating = (wintoclient(trans)) != NULL)) - arrange(c->mon); - break; - case XA_WM_NORMAL_HINTS: - c->hintsvalid = 0; - break; - case XA_WM_HINTS: - updatewmhints(c); - if (c->isurgent) - drawbars(); - #if TAB_PATCH - drawtabs(); - #endif // TAB_PATCH - break; - } - if (ev->atom == XA_WM_NAME || ev->atom == netatom[NetWMName]) { - updatetitle(c); - if (c == c->mon->sel) - drawbar(c->mon); - #if TAB_PATCH - drawtab(c->mon); - #endif // TAB_PATCH - } - #if DECORATION_HINTS_PATCH - if (ev->atom == motifatom) - updatemotifhints(c); - #endif // DECORATION_HINTS_PATCH - #if BAR_WINICON_PATCH - else if (ev->atom == netatom[NetWMIcon]) { - updateicon(c); - if (c == c->mon->sel) - drawbar(c->mon); - } - #endif // BAR_WINICON_PATCH - } -} - -void -quit(const Arg *arg) -{ - #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 -} - -Monitor * -recttomon(int x, int y, int w, int h) -{ - Monitor *m, *r = selmon; - int a, area = 0; - - for (m = mons; m; m = m->next) - if ((a = INTERSECT(x, y, w, h, m)) > area) { - area = a; - r = m; - } - return r; -} - -void -resize(Client *c, int x, int y, int w, int h, int interact) -{ - if (applysizehints(c, &x, &y, &w, &h, interact)) - resizeclient(c, x, y, w, h); -} - -void -resizeclient(Client *c, int x, int y, int w, int h) -{ - XWindowChanges wc; - - c->oldx = c->x; c->x = wc.x = x; - c->oldy = c->y; c->y = wc.y = y; - c->oldw = c->w; c->w = wc.width = w; - c->oldh = c->h; c->h = wc.height = h; - #if EXRESIZE_PATCH - c->expandmask = 0; - #endif // EXRESIZE_PATCH - wc.border_width = c->bw; - #if ROUNDED_CORNERS_PATCH - drawroundedcorners(c); - #endif // ROUNDED_CORNERS_PATCH - #if NOBORDER_PATCH - if (((nexttiled(c->mon->clients) == c && !nexttiled(c->next)) - #if MONOCLE_LAYOUT - || &monocle == c->mon->lt[c->mon->sellt]->arrange - #endif // MONOCLE_LAYOUT - #if DECK_LAYOUT - || (&deck == c->mon->lt[c->mon->sellt]->arrange && - c->mon->nmaster == 0) - #endif // DECK_LAYOUT - #if FLEXTILE_DELUXE_LAYOUT - || (&flextile == c->mon->lt[c->mon->sellt]->arrange && ( - (c->mon->ltaxis[LAYOUT] == NO_SPLIT && - c->mon->ltaxis[MASTER] == MONOCLE) || - (c->mon->ltaxis[STACK] == MONOCLE && - c->mon->nmaster == 0))) - #endif //FLEXTILE_DELUXE_LAYOUT - ) - #if FAKEFULLSCREEN_CLIENT_PATCH && !FAKEFULLSCREEN_PATCH - && (c->fakefullscreen == 1 || !c->isfullscreen) - #else - && !c->isfullscreen - #endif // FAKEFULLSCREEN_CLIENT_PATCH - && !c->isfloating - && c->mon->lt[c->mon->sellt]->arrange) { - c->w = wc.width += c->bw * 2; - c->h = wc.height += c->bw * 2; - wc.border_width = 0; - } - #endif // NOBORDER_PATCH - XConfigureWindow(dpy, c->win, CWX|CWY|CWWidth|CWHeight|CWBorderWidth, &wc); - configure(c); - XSync(dpy, False); -} - -void -resizemouse(const Arg *arg) -{ - int ocx, ocy, nw, nh, nx, ny; - #if RESIZEPOINT_PATCH || RESIZECORNERS_PATCH - int opx, opy, och, ocw; - int horizcorner, vertcorner; - unsigned int dui; - Window dummy; - #endif // RESIZEPOINT_PATCH | RESIZECORNERS_PATCH - Client *c; - Monitor *m; - XEvent ev; - Time lasttime = 0; - - if (!(c = selmon->sel)) - return; - #if !FAKEFULLSCREEN_PATCH - #if FAKEFULLSCREEN_CLIENT_PATCH - if (c->isfullscreen && c->fakefullscreen != 1) /* no support resizing fullscreen windows by mouse */ - return; - #else - if (c->isfullscreen) /* no support resizing fullscreen windows by mouse */ - return; - #endif // FAKEFULLSCREEN_CLIENT_PATCH - #endif // !FAKEFULLSCREEN_PATCH - restack(selmon); - nx = ocx = c->x; - ny = ocy = c->y; - nh = c->h; - nw = c->w; - #if RESIZEPOINT_PATCH - och = c->h; - ocw = c->w; - #elif RESIZECORNERS_PATCH - och = c->y + c->h; - ocw = c->x + c->w; - #endif // RESIZEPOINT_PATCH | RESIZECORNERS_PATCH - #if RESIZEPOINT_PATCH || RESIZECORNERS_PATCH - if (!XQueryPointer(dpy, c->win, &dummy, &dummy, &opx, &opy, &nx, &ny, &dui)) - return; - horizcorner = nx < c->w / 2; - vertcorner = ny < c->h / 2; - if (XGrabPointer(dpy, root, False, MOUSEMASK, GrabModeAsync, GrabModeAsync, - None, cursor[horizcorner | (vertcorner << 1)]->cursor, CurrentTime) != GrabSuccess) - return; - #if RESIZECORNERS_PATCH - XWarpPointer (dpy, None, c->win, 0, 0, 0, 0, - horizcorner ? (-c->bw) : (c->w + c->bw - 1), - vertcorner ? (-c->bw) : (c->h + c->bw - 1)); - #endif // RESIZECORNERS_PATCH - #else - if (XGrabPointer(dpy, root, False, MOUSEMASK, GrabModeAsync, GrabModeAsync, - None, cursor[CurResize]->cursor, CurrentTime) != GrabSuccess) - return; - XWarpPointer(dpy, None, c->win, 0, 0, 0, 0, c->w + c->bw - 1, c->h + c->bw - 1); - #endif // RESIZEPOINT_PATCH | RESIZECORNERS_PATCH - ignoreconfigurerequests = 1; - do { - XMaskEvent(dpy, MOUSEMASK|ExposureMask|SubstructureRedirectMask, &ev); - switch(ev.type) { - case ConfigureRequest: - case Expose: - case MapRequest: - handler[ev.type](&ev); - break; - case MotionNotify: - if ((ev.xmotion.time - lasttime) <= (1000 / 60)) - continue; - lasttime = ev.xmotion.time; - - #if RESIZEPOINT_PATCH - nx = horizcorner ? (ocx + ev.xmotion.x - opx) : c->x; - ny = vertcorner ? (ocy + ev.xmotion.y - opy) : c->y; - nw = MAX(horizcorner ? (ocx + ocw - nx) : (ocw + (ev.xmotion.x - opx)), 1); - nh = MAX(vertcorner ? (ocy + och - ny) : (och + (ev.xmotion.y - opy)), 1); - #elif RESIZECORNERS_PATCH - nx = horizcorner ? ev.xmotion.x : c->x; - ny = vertcorner ? ev.xmotion.y : c->y; - nw = MAX(horizcorner ? (ocw - nx) : (ev.xmotion.x - ocx - 2 * c->bw + 1), 1); - nh = MAX(vertcorner ? (och - ny) : (ev.xmotion.y - ocy - 2 * c->bw + 1), 1); - #else - nw = MAX(ev.xmotion.x - ocx - 2 * c->bw + 1, 1); - nh = MAX(ev.xmotion.y - ocy - 2 * c->bw + 1, 1); - #endif // RESIZEPOINT_PATCH | RESIZECORNERS_PATCH - if (c->mon->wx + nw >= selmon->wx && c->mon->wx + nw <= selmon->wx + selmon->ww - && c->mon->wy + nh >= selmon->wy && c->mon->wy + nh <= selmon->wy + selmon->wh) - { - if (!c->isfloating && selmon->lt[selmon->sellt]->arrange - && (abs(nw - c->w) > snap || abs(nh - c->h) > snap)) { - #if SAVEFLOATS_PATCH || EXRESIZE_PATCH - c->sfx = -9999; // disable savefloats when using resizemouse - #endif // SAVEFLOATS_PATCH | EXRESIZE_PATCH - togglefloating(NULL); - } - } - if (!selmon->lt[selmon->sellt]->arrange || c->isfloating) { - resize(c, nx, ny, nw, nh, 1); - } - break; - } - } while (ev.type != ButtonRelease); - - #if !RESIZEPOINT_PATCH - #if RESIZECORNERS_PATCH - XWarpPointer(dpy, None, c->win, 0, 0, 0, 0, - horizcorner ? (-c->bw) : (c->w + c->bw - 1), - vertcorner ? (-c->bw) : (c->h + c->bw - 1)); - #else - XWarpPointer(dpy, None, c->win, 0, 0, 0, 0, c->w + c->bw - 1, c->h + c->bw - 1); - #endif // RESIZECORNERS_PATCH - #endif // RESIZEPOINT_PATCH - XUngrabPointer(dpy, CurrentTime); - while (XCheckMaskEvent(dpy, EnterWindowMask, &ev)); - if ((m = recttomon(c->x, c->y, c->w, c->h)) != selmon) { - #if SCRATCHPADS_PATCH && !RENAMED_SCRATCHPADS_PATCH - if (c->tags & SPTAGMASK) { - c->mon->tagset[c->mon->seltags] ^= (c->tags & SPTAGMASK); - m->tagset[m->seltags] |= (c->tags & SPTAGMASK); - } - #endif // SCRATCHPADS_PATCH - sendmon(c, m); - selmon = m; - focus(NULL); - } - #if SAVEFLOATS_PATCH || EXRESIZE_PATCH - /* save last known float dimensions */ - if (!selmon->lt[selmon->sellt]->arrange || c->isfloating) { - c->sfx = nx; - c->sfy = ny; - c->sfw = nw; - c->sfh = nh; - } - #endif // SAVEFLOATS_PATCH | EXRESIZE_PATCH - ignoreconfigurerequests = 0; -} - -void -restack(Monitor *m) -{ - Client *c, *f = NULL; - XEvent ev; - XWindowChanges wc; - #if WARP_PATCH && FLEXTILE_DELUXE_LAYOUT - int n; - #endif // WARP_PATCH - - drawbar(m); - #if TAB_PATCH - drawtab(m); - #endif // TAB_PATCH - if (!m->sel) - return; - if (m->sel->isfloating || !m->lt[m->sellt]->arrange) - XRaiseWindow(dpy, m->sel->win); - if (m->lt[m->sellt]->arrange) { - wc.stack_mode = Below; - 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) && c != f) { - XConfigureWindow(dpy, c->win, CWSibling|CWStackMode, &wc); - wc.sibling = c->win; - } - } - XSync(dpy, False); - while (XCheckMaskEvent(dpy, EnterWindowMask, &ev)); - #if WARP_PATCH && FLEXTILE_DELUXE_LAYOUT || WARP_PATCH && MONOCLE_LAYOUT - #if FLEXTILE_DELUXE_LAYOUT - for (n = 0, c = nexttiled(m->clients); c; c = nexttiled(c->next), n++); - #endif // FLEXTILE_DELUXE_LAYOUT - if (m == selmon && (m->tagset[m->seltags] & m->sel->tags) && ( - #if MONOCLE_LAYOUT && FLEXTILE_DELUXE_LAYOUT - (m->lt[m->sellt]->arrange != &monocle - && !(m->ltaxis[MASTER] == MONOCLE && (abs(m->ltaxis[LAYOUT] == NO_SPLIT || !m->nmaster || n <= m->nmaster)))) - #elif MONOCLE_LAYOUT - m->lt[m->sellt]->arrange != &monocle - #else - !(m->ltaxis[MASTER] == MONOCLE && (abs(m->ltaxis[LAYOUT] == NO_SPLIT || !m->nmaster || n <= m->nmaster))) - #endif // FLEXTILE_DELUXE_LAYOUT - || m->sel->isfloating) - ) - warp(m->sel); - #endif // WARP_PATCH -} - -#if IPC_PATCH -void -run(void) -{ - int event_count = 0; - const int MAX_EVENTS = 10; - struct epoll_event events[MAX_EVENTS]; - - XSync(dpy, False); - - /* main event loop */ - while (running) { - event_count = epoll_wait(epoll_fd, events, MAX_EVENTS, -1); - - for (int i = 0; i < event_count; i++) { - int event_fd = events[i].data.fd; - DEBUG("Got event from fd %d\n", event_fd); - - if (event_fd == dpy_fd) { - // -1 means EPOLLHUP - if (handlexevent(events + i) == -1) - return; - } else if (event_fd == ipc_get_sock_fd()) { - ipc_handle_socket_epoll_event(events + i); - } else if (ipc_is_client_registered(event_fd)) { - if (ipc_handle_client_epoll_event(events + i, mons, &lastselmon, selmon, - NUMTAGS, layouts, LENGTH(layouts)) < 0) { - fprintf(stderr, "Error handling IPC event on fd %d\n", event_fd); - } - } else { - fprintf(stderr, "Got event from unknown fd %d, ptr %p, u32 %d, u64 %lu", - event_fd, events[i].data.ptr, events[i].data.u32, - events[i].data.u64); - fprintf(stderr, " with events %d\n", events[i].events); - return; - } - } - } -} -#elif RESTARTSIG_PATCH -void -run(void) -{ - XEvent ev; - XSync(dpy, False); - /* main event loop */ - while (running) { - struct pollfd pfd = { - .fd = ConnectionNumber(dpy), - .events = POLLIN, - }; - int pending = XPending(dpy) > 0 || poll(&pfd, 1, -1) > 0; - - if (!running) - break; - if (!pending) - continue; - - XNextEvent(dpy, &ev); - if (handler[ev.type]) - handler[ev.type](&ev); /* call handler */ - } -} -#else -void -run(void) -{ - XEvent ev; - /* main event loop */ - XSync(dpy, False); - while (running && !XNextEvent(dpy, &ev)) { - - #if XKB_PATCH - /* Unfortunately the xkbEventType is not constant hence it can't be part of the - * normal event handler below */ - if (ev.type == xkbEventType) { - xkbeventnotify(&ev); - continue; - } - #endif // XKB_PATCH - - if (handler[ev.type]) - handler[ev.type](&ev); /* call handler */ - } -} -#endif // IPC_PATCH | RESTARTSIG_PATCH - -void -scan(void) -{ - #if SWALLOW_PATCH - scanner = 1; - char swin[256]; - #endif // SWALLOW_PATCH - unsigned int i, num; - Window d1, d2, *wins = NULL; - XWindowAttributes wa; - - if (XQueryTree(dpy, root, &d1, &d2, &wins, &num)) { - for (i = 0; i < num; i++) { - if (!XGetWindowAttributes(dpy, wins[i], &wa) - || wa.override_redirect || XGetTransientForHint(dpy, wins[i], &d1)) - continue; - #if BAR_ANYBAR_PATCH - if (wmclasscontains(wins[i], altbarclass, "")) - managealtbar(wins[i], &wa); - else - #endif // BAR_ANYBAR_PATCH - if (wa.map_state == IsViewable || getstate(wins[i]) == IconicState) - manage(wins[i], &wa); - #if SWALLOW_PATCH - else if (gettextprop(wins[i], netatom[NetClientList], swin, sizeof swin)) - manage(wins[i], &wa); - #endif // SWALLOW_PATCH - } - for (i = 0; i < num; i++) { /* now the transients */ - if (!XGetWindowAttributes(dpy, wins[i], &wa)) - continue; - if (XGetTransientForHint(dpy, wins[i], &d1) - && (wa.map_state == IsViewable || getstate(wins[i]) == IconicState)) - manage(wins[i], &wa); - } - XFree(wins); - } - #if SWALLOW_PATCH - scanner = 0; - #endif // SWALLOW_PATCH -} - -void -sendmon(Client *c, Monitor *m) -{ - #if EXRESIZE_PATCH - Monitor *oldm = selmon; - #endif // EXRESIZE_PATCH - if (c->mon == m) - return; - #if SENDMON_KEEPFOCUS_PATCH && !EXRESIZE_PATCH - int hadfocus = (c == selmon->sel); - #endif // SENDMON_KEEPFOCUS_PATCH - unfocus(c, 1, NULL); - detach(c); - detachstack(c); - #if SENDMON_KEEPFOCUS_PATCH && !EXRESIZE_PATCH - arrange(c->mon); - #endif // SENDMON_KEEPFOCUS_PATCH - c->mon = m; - #if SCRATCHPADS_PATCH && !RENAMED_SCRATCHPADS_PATCH - if (!(c->tags & SPTAGMASK)) - #endif // SCRATCHPADS_PATCH - #if EMPTYVIEW_PATCH - c->tags = (m->tagset[m->seltags] ? m->tagset[m->seltags] : 1); - #else - c->tags = m->tagset[m->seltags]; /* assign tags of target monitor */ - #endif // EMPTYVIEW_PATCH - #if ATTACHABOVE_PATCH || ATTACHASIDE_PATCH || ATTACHBELOW_PATCH || ATTACHBOTTOM_PATCH - attachx(c); - #else - attach(c); - #endif - attachstack(c); - #if EXRESIZE_PATCH - if (oldm != m) - arrange(oldm); - arrange(m); - focus(c); - restack(m); - #elif SENDMON_KEEPFOCUS_PATCH - arrange(m); - if (hadfocus) { - focus(c); - restack(m); - } else - focus(NULL); - #else - focus(NULL); - arrange(NULL); - #endif // EXRESIZE_PATCH / SENDMON_KEEPFOCUS_PATCH - #if SWITCHTAG_PATCH - if (c->switchtag) - c->switchtag = 0; - #endif // SWITCHTAG_PATCH -} - -void -setclientstate(Client *c, long state) -{ - long data[] = { state, None }; - - XChangeProperty(dpy, c->win, wmatom[WMState], wmatom[WMState], 32, - PropModeReplace, (unsigned char *)data, 2); -} - -int -#if BAR_SYSTRAY_PATCH -sendevent(Window w, Atom proto, int mask, long d0, long d1, long d2, long d3, long d4) -#else -sendevent(Client *c, Atom proto) -#endif // BAR_SYSTRAY_PATCH -{ - int n; - Atom *protocols; - #if BAR_SYSTRAY_PATCH - Atom mt; - #endif // BAR_SYSTRAY_PATCH - int exists = 0; - XEvent ev; - - #if BAR_SYSTRAY_PATCH - if (proto == wmatom[WMTakeFocus] || proto == wmatom[WMDelete]) { - mt = wmatom[WMProtocols]; - if (XGetWMProtocols(dpy, w, &protocols, &n)) { - while (!exists && n--) - exists = protocols[n] == proto; - XFree(protocols); - } - } else { - exists = True; - mt = proto; - } - #else - if (XGetWMProtocols(dpy, c->win, &protocols, &n)) { - while (!exists && n--) - exists = protocols[n] == proto; - XFree(protocols); - } - #endif // BAR_SYSTRAY_PATCH - - if (exists) { - #if BAR_SYSTRAY_PATCH - ev.type = ClientMessage; - ev.xclient.window = w; - ev.xclient.message_type = mt; - ev.xclient.format = 32; - ev.xclient.data.l[0] = d0; - ev.xclient.data.l[1] = d1; - ev.xclient.data.l[2] = d2; - ev.xclient.data.l[3] = d3; - ev.xclient.data.l[4] = d4; - XSendEvent(dpy, w, False, mask, &ev); - #else - ev.type = ClientMessage; - ev.xclient.window = c->win; - ev.xclient.message_type = wmatom[WMProtocols]; - ev.xclient.format = 32; - ev.xclient.data.l[0] = proto; - ev.xclient.data.l[1] = CurrentTime; - XSendEvent(dpy, c->win, False, NoEventMask, &ev); - #endif // BAR_SYSTRAY_PATCH - } - return exists; -} - -void -setfocus(Client *c) -{ - if (!c->neverfocus) { - XSetInputFocus(dpy, c->win, RevertToPointerRoot, CurrentTime); - XChangeProperty(dpy, root, netatom[NetActiveWindow], - XA_WINDOW, 32, PropModeReplace, - (unsigned char *) &(c->win), 1); - #if XKB_PATCH - XkbLockGroup(dpy, XkbUseCoreKbd, c->xkb->group); - #endif // XKB_PATCH - } - #if BAR_SYSTRAY_PATCH - sendevent(c->win, wmatom[WMTakeFocus], NoEventMask, wmatom[WMTakeFocus], CurrentTime, 0, 0, 0); - #else - sendevent(c, wmatom[WMTakeFocus]); - #endif // BAR_SYSTRAY_PATCH -} - -#if FAKEFULLSCREEN_CLIENT_PATCH && !FAKEFULLSCREEN_PATCH -void -setfullscreen(Client *c, int fullscreen) -{ - XEvent ev; - int savestate = 0, restorestate = 0; - - if ((c->fakefullscreen == 0 && fullscreen && !c->isfullscreen) // normal fullscreen - || (c->fakefullscreen == 2 && fullscreen)) // fake fullscreen --> actual fullscreen - savestate = 1; // go actual fullscreen - else if ((c->fakefullscreen == 0 && !fullscreen && c->isfullscreen) // normal fullscreen exit - || (c->fakefullscreen >= 2 && !fullscreen)) // fullscreen exit --> fake fullscreen - restorestate = 1; // go back into tiled - - /* If leaving fullscreen and the window was previously fake fullscreen (2), then restore - * that while staying in fullscreen. The exception to this is if we are in said state, but - * the client itself disables fullscreen (3) then we let the client go out of fullscreen - * while keeping fake fullscreen enabled (as otherwise there will be a mismatch between the - * client and the window manager's perception of the client's fullscreen state). */ - if (c->fakefullscreen == 2 && !fullscreen && c->isfullscreen) { - c->fakefullscreen = 1; - c->isfullscreen = 1; - fullscreen = 1; - } else if (c->fakefullscreen == 3) // client exiting actual fullscreen - c->fakefullscreen = 1; - - if (fullscreen != c->isfullscreen) { // only send property change if necessary - if (fullscreen) - XChangeProperty(dpy, c->win, netatom[NetWMState], XA_ATOM, 32, - PropModeReplace, (unsigned char*)&netatom[NetWMFullscreen], 1); - else - XChangeProperty(dpy, c->win, netatom[NetWMState], XA_ATOM, 32, - PropModeReplace, (unsigned char*)0, 0); - } - - c->isfullscreen = fullscreen; - - /* Some clients, e.g. firefox, will send a client message informing the window manager - * that it is going into fullscreen after receiving the above signal. This has the side - * effect of this function (setfullscreen) sometimes being called twice when toggling - * fullscreen on and off via the window manager as opposed to the application itself. - * To protect against obscure issues where the client settings are stored or restored - * when they are not supposed to we add an additional bit-lock on the old state so that - * settings can only be stored and restored in that precise order. */ - if (savestate && !(c->oldstate & (1 << 1))) { - c->oldbw = c->bw; - c->oldstate = c->isfloating | (1 << 1); - c->bw = 0; - c->isfloating = 1; - resizeclient(c, c->mon->mx, c->mon->my, c->mon->mw, c->mon->mh); - XRaiseWindow(dpy, c->win); - } else if (restorestate && (c->oldstate & (1 << 1))) { - c->bw = c->oldbw; - c->isfloating = c->oldstate = c->oldstate & 1; - c->x = c->oldx; - c->y = c->oldy; - c->w = c->oldw; - c->h = c->oldh; - resizeclient(c, c->x, c->y, c->w, c->h); - restack(c->mon); - } else - resizeclient(c, c->x, c->y, c->w, c->h); - - /* Exception: if the client was in actual fullscreen and we exit out to fake fullscreen - * mode, then the focus would sometimes drift to whichever window is under the mouse cursor - * at the time. To avoid this we ask X for all EnterNotify events and just ignore them. - */ - if (!c->isfullscreen) - while (XCheckMaskEvent(dpy, EnterWindowMask, &ev)); -} -#else -void -setfullscreen(Client *c, int fullscreen) -{ - if (fullscreen && !c->isfullscreen) { - XChangeProperty(dpy, c->win, netatom[NetWMState], XA_ATOM, 32, - PropModeReplace, (unsigned char*)&netatom[NetWMFullscreen], 1); - c->isfullscreen = 1; - #if !FAKEFULLSCREEN_PATCH - c->oldbw = c->bw; - c->oldstate = c->isfloating; - c->bw = 0; - c->isfloating = 1; - resizeclient(c, c->mon->mx, c->mon->my, c->mon->mw, c->mon->mh); - XRaiseWindow(dpy, c->win); - #endif // !FAKEFULLSCREEN_PATCH - } else if (!fullscreen && c->isfullscreen){ - XChangeProperty(dpy, c->win, netatom[NetWMState], XA_ATOM, 32, - PropModeReplace, (unsigned char*)0, 0); - c->isfullscreen = 0; - #if !FAKEFULLSCREEN_PATCH - c->bw = c->oldbw; - c->isfloating = c->oldstate; - c->x = c->oldx; - c->y = c->oldy; - c->w = c->oldw; - c->h = c->oldh; - resizeclient(c, c->x, c->y, c->w, c->h); - arrange(c->mon); - #endif // !FAKEFULLSCREEN_PATCH - } - #if FAKEFULLSCREEN_PATCH - resizeclient(c, c->x, c->y, c->w, c->h); - #endif // FAKEFULLSCREEN_PATCH -} -#endif // FAKEFULLSCREEN_CLIENT_PATCH - -void -setlayout(const Arg *arg) -{ - #if !TOGGLELAYOUT_PATCH - if (!arg || !arg->v || arg->v != selmon->lt[selmon->sellt]) { - #endif // TOGGLELAYOUT_PATCH - #if PERTAG_PATCH - selmon->pertag->sellts[selmon->pertag->curtag] ^= 1; - selmon->sellt = selmon->pertag->sellts[selmon->pertag->curtag]; - #else - selmon->sellt ^= 1; - #endif // PERTAG_PATCH - #if EXRESIZE_PATCH - if (!selmon->lt[selmon->sellt]->arrange) { - for (Client *c = selmon->clients ; c ; c = c->next) { - if (!c->isfloating) { - /*restore last known float dimensions*/ - resize(c, selmon->mx + c->sfx, selmon->my + c->sfy, - c->sfw, c->sfh, False); - } - } - } - #endif // EXRESIZE_PATCH - #if !TOGGLELAYOUT_PATCH - } - #endif // TOGGLELAYOUT_PATCH - #if TOGGLELAYOUT_PATCH - if (arg && arg->v && arg->v != selmon->lt[selmon->sellt ^ 1]) - #else - if (arg && arg->v) - #endif // TOGGLELAYOUT_PATCH - #if PERTAG_PATCH - selmon->pertag->ltidxs[selmon->pertag->curtag][selmon->sellt] = (Layout *)arg->v; - selmon->lt[selmon->sellt] = selmon->pertag->ltidxs[selmon->pertag->curtag][selmon->sellt]; - #else - selmon->lt[selmon->sellt] = (Layout *)arg->v; - #endif // PERTAG_PATCH - - #if FLEXTILE_DELUXE_LAYOUT - if (selmon->lt[selmon->sellt]->preset.nmaster && selmon->lt[selmon->sellt]->preset.nmaster != -1) - selmon->nmaster = selmon->lt[selmon->sellt]->preset.nmaster; - if (selmon->lt[selmon->sellt]->preset.nstack && selmon->lt[selmon->sellt]->preset.nstack != -1) - selmon->nstack = selmon->lt[selmon->sellt]->preset.nstack; - - selmon->ltaxis[LAYOUT] = selmon->lt[selmon->sellt]->preset.layout; - selmon->ltaxis[MASTER] = selmon->lt[selmon->sellt]->preset.masteraxis; - selmon->ltaxis[STACK] = selmon->lt[selmon->sellt]->preset.stack1axis; - selmon->ltaxis[STACK2] = selmon->lt[selmon->sellt]->preset.stack2axis; - - #if PERTAG_PATCH - selmon->pertag->ltaxis[selmon->pertag->curtag][LAYOUT] = selmon->ltaxis[LAYOUT]; - selmon->pertag->ltaxis[selmon->pertag->curtag][MASTER] = selmon->ltaxis[MASTER]; - selmon->pertag->ltaxis[selmon->pertag->curtag][STACK] = selmon->ltaxis[STACK]; - selmon->pertag->ltaxis[selmon->pertag->curtag][STACK2] = selmon->ltaxis[STACK2]; - #endif // PERTAG_PATCH - #endif // FLEXTILE_DELUXE_LAYOUT - strncpy(selmon->ltsymbol, selmon->lt[selmon->sellt]->symbol, sizeof selmon->ltsymbol); - if (selmon->sel) - arrange(selmon); - else - drawbar(selmon); -} - -/* arg > 1.0 will set mfact absolutely */ -void -setmfact(const Arg *arg) -{ - float f; - - if (!arg || !selmon->lt[selmon->sellt]->arrange) - return; - f = arg->f < 1.0 ? arg->f + selmon->mfact : arg->f - 1.0; - if (f < 0.05 || f > 0.95) - return; - #if PERTAG_PATCH - selmon->mfact = selmon->pertag->mfacts[selmon->pertag->curtag] = f; - #else - selmon->mfact = f; - #endif // PERTAG_PATCH - arrange(selmon); -} - -void -setup(void) -{ - int i; - XSetWindowAttributes wa; - #if XKB_PATCH - XkbStateRec xkbstate; - #endif // XKB_PATCH - Atom utf8string; - #if COOL_AUTOSTART_PATCH - /* clean up any zombies immediately */ - sigchld(0); - #else - struct sigaction sa; - - /* do not transform children into zombies when they terminate */ - sigemptyset(&sa.sa_mask); - sa.sa_flags = SA_NOCLDSTOP | SA_NOCLDWAIT | SA_RESTART; - sa.sa_handler = SIG_IGN; - sigaction(SIGCHLD, &sa, NULL); - - /* clean up any zombies (inherited from .xinitrc etc) immediately */ - while (waitpid(-1, NULL, WNOHANG) > 0); - #endif // COOL_AUTOSTART_PATCH - - #if RESTARTSIG_PATCH - signal(SIGHUP, sighup); - 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); - sh = DisplayHeight(dpy, screen); - root = RootWindow(dpy, screen); - #if BAR_ALPHA_PATCH - xinitvisual(); - drw = drw_create(dpy, screen, root, sw, sh, visual, depth, cmap); - #else - drw = drw_create(dpy, screen, root, sw, sh); - #endif // BAR_ALPHA_PATCH - #if BAR_PANGO_PATCH - if (!drw_font_create(drw, font)) - #else - if (!drw_fontset_create(drw, fonts, LENGTH(fonts))) - #endif // BAR_PANGO_PATCH - die("no fonts could be loaded."); - #if BAR_STATUSPADDING_PATCH - lrpad = drw->fonts->h + horizpadbar; - bh = drw->fonts->h + vertpadbar; - #else - lrpad = drw->fonts->h; - #if BAR_HEIGHT_PATCH - bh = bar_height ? bar_height : drw->fonts->h + 2; - #else - bh = drw->fonts->h + 2; - #endif // BAR_HEIGHT_PATCH - #endif // BAR_STATUSPADDING_PATCH - #if TAB_PATCH - th = bh; - #endif // TAB_PATCH - updategeom(); - /* init atoms */ - utf8string = XInternAtom(dpy, "UTF8_STRING", False); - wmatom[WMProtocols] = XInternAtom(dpy, "WM_PROTOCOLS", False); - wmatom[WMDelete] = XInternAtom(dpy, "WM_DELETE_WINDOW", False); - wmatom[WMState] = XInternAtom(dpy, "WM_STATE", False); - wmatom[WMTakeFocus] = XInternAtom(dpy, "WM_TAKE_FOCUS", False); - #if WINDOWROLERULE_PATCH - wmatom[WMWindowRole] = XInternAtom(dpy, "WM_WINDOW_ROLE", False); - #endif // WINDOWROLERULE_PATCH - #if SEAMLESS_RESTART_PATCH - clientatom[ClientFields] = XInternAtom(dpy, "_DWM_CLIENT_FIELDS", False); - clientatom[ClientTags] = XInternAtom(dpy, "_DWM_CLIENT_TAGS", False); - #endif // SEAMLESS_RESTART_PATCH - netatom[NetActiveWindow] = XInternAtom(dpy, "_NET_ACTIVE_WINDOW", False); - netatom[NetSupported] = XInternAtom(dpy, "_NET_SUPPORTED", False); - #if BAR_SYSTRAY_PATCH - netatom[NetSystemTray] = XInternAtom(dpy, "_NET_SYSTEM_TRAY_S0", False); - netatom[NetSystemTrayOP] = XInternAtom(dpy, "_NET_SYSTEM_TRAY_OPCODE", False); - netatom[NetSystemTrayOrientation] = XInternAtom(dpy, "_NET_SYSTEM_TRAY_ORIENTATION", False); - netatom[NetSystemTrayOrientationHorz] = XInternAtom(dpy, "_NET_SYSTEM_TRAY_ORIENTATION_HORZ", False); - netatom[NetSystemTrayVisual] = XInternAtom(dpy, "_NET_SYSTEM_TRAY_VISUAL", False); - netatom[NetWMWindowTypeDock] = XInternAtom(dpy, "_NET_WM_WINDOW_TYPE_DOCK", False); - xatom[Manager] = XInternAtom(dpy, "MANAGER", False); - xatom[Xembed] = XInternAtom(dpy, "_XEMBED", False); - xatom[XembedInfo] = XInternAtom(dpy, "_XEMBED_INFO", False); - #endif // BAR_SYSTRAY_PATCH - #if BAR_EWMHTAGS_PATCH - netatom[NetDesktopViewport] = XInternAtom(dpy, "_NET_DESKTOP_VIEWPORT", False); - netatom[NetNumberOfDesktops] = XInternAtom(dpy, "_NET_NUMBER_OF_DESKTOPS", False); - netatom[NetCurrentDesktop] = XInternAtom(dpy, "_NET_CURRENT_DESKTOP", False); - netatom[NetDesktopNames] = XInternAtom(dpy, "_NET_DESKTOP_NAMES", False); - #endif // BAR_EWMHTAGS_PATCH - #if BAR_WINICON_PATCH - netatom[NetWMIcon] = XInternAtom(dpy, "_NET_WM_ICON", False); - #endif // BAR_WINICON_PATCH - netatom[NetWMName] = XInternAtom(dpy, "_NET_WM_NAME", False); - netatom[NetWMState] = XInternAtom(dpy, "_NET_WM_STATE", False); - netatom[NetWMCheck] = XInternAtom(dpy, "_NET_SUPPORTING_WM_CHECK", False); - netatom[NetWMFullscreen] = XInternAtom(dpy, "_NET_WM_STATE_FULLSCREEN", False); - netatom[NetWMWindowType] = XInternAtom(dpy, "_NET_WM_WINDOW_TYPE", False); - netatom[NetClientList] = XInternAtom(dpy, "_NET_CLIENT_LIST", False); - #if NET_CLIENT_LIST_STACKING_PATCH - netatom[NetClientListStacking] = XInternAtom(dpy, "_NET_CLIENT_LIST_STACKING", False); - #endif // NET_CLIENT_LIST_STACKING_PATCH - #if DECORATION_HINTS_PATCH - motifatom = XInternAtom(dpy, "_MOTIF_WM_HINTS", False); - #endif // DECORATION_HINTS_PATCH - /* init cursors */ - cursor[CurNormal] = drw_cur_create(drw, XC_left_ptr); - cursor[CurResize] = drw_cur_create(drw, XC_sizing); - #if RESIZEPOINT_PATCH || RESIZECORNERS_PATCH - cursor[CurResizeBR] = drw_cur_create(drw, XC_bottom_right_corner); - cursor[CurResizeBL] = drw_cur_create(drw, XC_bottom_left_corner); - cursor[CurResizeTR] = drw_cur_create(drw, XC_top_right_corner); - cursor[CurResizeTL] = drw_cur_create(drw, XC_top_left_corner); - #endif // RESIZEPOINT_PATCH | RESIZECORNERS_PATCH - #if DRAGMFACT_PATCH - cursor[CurResizeHorzArrow] = drw_cur_create(drw, XC_sb_h_double_arrow); - cursor[CurResizeVertArrow] = drw_cur_create(drw, XC_sb_v_double_arrow); - #endif // DRAGMFACT_PATCH - #if DRAGCFACT_PATCH - cursor[CurIronCross] = drw_cur_create(drw, XC_iron_cross); - #endif // DRAGCFACT_PATCH - cursor[CurMove] = drw_cur_create(drw, XC_fleur); - /* init appearance */ - #if BAR_VTCOLORS_PATCH - get_vt_colors(); - if (get_luminance(colors[SchemeTagsNorm][ColBg]) > 50) { - strcpy(colors[SchemeTitleNorm][ColBg], title_bg_light); - strcpy(colors[SchemeTitleSel][ColBg], title_bg_light); - } else { - strcpy(colors[SchemeTitleNorm][ColBg], title_bg_dark); - strcpy(colors[SchemeTitleSel][ColBg], title_bg_dark); - } - #endif // BAR_VTCOLORS_PATCH - #if BAR_STATUS2D_PATCH && !BAR_STATUSCOLORS_PATCH - scheme = ecalloc(LENGTH(colors) + 1, sizeof(Clr *)); - #if BAR_ALPHA_PATCH - scheme[LENGTH(colors)] = drw_scm_create(drw, colors[0], alphas[0], ColCount); - #else - scheme[LENGTH(colors)] = drw_scm_create(drw, colors[0], ColCount); - #endif // BAR_ALPHA_PATCH - #else - scheme = ecalloc(LENGTH(colors), sizeof(Clr *)); - #endif // BAR_STATUS2D_PATCH - for (i = 0; i < LENGTH(colors); i++) - #if BAR_ALPHA_PATCH - scheme[i] = drw_scm_create(drw, colors[i], alphas[i], ColCount); - #else - scheme[i] = drw_scm_create(drw, colors[i], ColCount); - #endif // BAR_ALPHA_PATCH - #if BAR_POWERLINE_STATUS_PATCH - statusscheme = ecalloc(LENGTH(statuscolors), sizeof(Clr *)); - for (i = 0; i < LENGTH(statuscolors); i++) - #if BAR_ALPHA_PATCH - statusscheme[i] = drw_scm_create(drw, statuscolors[i], alphas[0], ColCount); - #else - statusscheme[i] = drw_scm_create(drw, statuscolors[i], ColCount); - #endif // BAR_ALPHA_PATCH - #endif // BAR_POWERLINE_STATUS_PATCH - - updatebars(); - updatestatus(); - - /* supporting window for NetWMCheck */ - wmcheckwin = XCreateSimpleWindow(dpy, root, 0, 0, 1, 1, 0, 0, 0); - XChangeProperty(dpy, wmcheckwin, netatom[NetWMCheck], XA_WINDOW, 32, - PropModeReplace, (unsigned char *) &wmcheckwin, 1); - #if LG3D_PATCH - XChangeProperty(dpy, wmcheckwin, netatom[NetWMName], utf8string, 8, - PropModeReplace, (unsigned char *) "LG3D", 4); - #else - XChangeProperty(dpy, wmcheckwin, netatom[NetWMName], utf8string, 8, - PropModeReplace, (unsigned char *) "dwm", 3); - #endif // LG3D_PATCH - XChangeProperty(dpy, root, netatom[NetWMCheck], XA_WINDOW, 32, - PropModeReplace, (unsigned char *) &wmcheckwin, 1); - /* EWMH support per view */ - XChangeProperty(dpy, root, netatom[NetSupported], XA_ATOM, 32, - PropModeReplace, (unsigned char *) netatom, NetLast); - #if BAR_EWMHTAGS_PATCH - setnumdesktops(); - setcurrentdesktop(); - setdesktopnames(); - setviewport(); - #endif // BAR_EWMHTAGS_PATCH - XDeleteProperty(dpy, root, netatom[NetClientList]); - #if NET_CLIENT_LIST_STACKING_PATCH - XDeleteProperty(dpy, root, netatom[NetClientListStacking]); - #endif // NET_CLIENT_LIST_STACKING_PATCH - /* select events */ - wa.cursor = cursor[CurNormal]->cursor; - wa.event_mask = SubstructureRedirectMask|SubstructureNotifyMask - |ButtonPressMask|PointerMotionMask|EnterWindowMask - |LeaveWindowMask|StructureNotifyMask|PropertyChangeMask; - XChangeWindowAttributes(dpy, root, CWEventMask|CWCursor, &wa); - XSelectInput(dpy, root, wa.event_mask); - - #if XKB_PATCH - /* get xkb extension info, events and current state */ - if (!XkbQueryExtension(dpy, NULL, &xkbEventType, NULL, NULL, NULL)) - fputs("warning: can not query xkb extension\n", stderr); - XkbSelectEventDetails(dpy, XkbUseCoreKbd, XkbStateNotify, - XkbAllStateComponentsMask, XkbGroupStateMask); - XkbGetState(dpy, XkbUseCoreKbd, &xkbstate); - xkbGlobal.group = xkbstate.locked_group; - #endif // XKB_PATCH - - grabkeys(); - focus(NULL); - #if IPC_PATCH - setupepoll(); - #endif // IPC_PATCH - #if BAR_ANYBAR_PATCH - if (usealtbar) - spawnbar(); - #endif // BAR_ANYBAR_PATCH -} - - -void -seturgent(Client *c, int urg) -{ - XWMHints *wmh; - - c->isurgent = urg; - if (!(wmh = XGetWMHints(dpy, c->win))) - return; - wmh->flags = urg ? (wmh->flags | XUrgencyHint) : (wmh->flags & ~XUrgencyHint); - XSetWMHints(dpy, c->win, wmh); - XFree(wmh); -} - -void -showhide(Client *c) -{ - if (!c) - return; - if (ISVISIBLE(c)) { - #if !RENAMED_SCRATCHPADS_PATCH - #if SCRATCHPADS_PATCH && SCRATCHPADS_KEEP_POSITION_AND_SIZE_PATCH - if ( - (c->tags & SPTAGMASK) && - c->isfloating && - ( - c->x < c->mon->mx || - c->x > c->mon->mx + c->mon->mw || - c->y < c->mon->my || - c->y > c->mon->my + c->mon->mh - ) - ) { - c->x = c->mon->wx + (c->mon->ww / 2 - WIDTH(c) / 2); - c->y = c->mon->wy + (c->mon->wh / 2 - HEIGHT(c) / 2); - } - #elif SCRATCHPADS_PATCH - if ((c->tags & SPTAGMASK) && c->isfloating) { - c->x = c->mon->wx + (c->mon->ww / 2 - WIDTH(c) / 2); - c->y = c->mon->wy + (c->mon->wh / 2 - HEIGHT(c) / 2); - } - #endif // SCRATCHPADS_KEEP_POSITION_AND_SIZE_PATCH | SCRATCHPADS_PATCH - #endif // RENAMED_SCRATCHPADS_PATCH - /* show clients top down */ - #if SAVEFLOATS_PATCH || EXRESIZE_PATCH - if (!c->mon->lt[c->mon->sellt]->arrange && c->sfx != -9999 && !c->isfullscreen) { - XMoveResizeWindow(dpy, c->win, c->sfx, c->sfy, c->sfw, c->sfh); - resize(c, c->sfx, c->sfy, c->sfw, c->sfh, 0); - showhide(c->snext); - return; - } - #endif // SAVEFLOATS_PATCH / EXRESIZE_PATCH - #if AUTORESIZE_PATCH - if (c->needresize) { - c->needresize = 0; - XMoveResizeWindow(dpy, c->win, c->x, c->y, c->w, c->h); - } else { - XMoveWindow(dpy, c->win, c->x, c->y); - } - #else - XMoveWindow(dpy, c->win, c->x, c->y); - #endif // AUTORESIZE_PATCH - if ((!c->mon->lt[c->mon->sellt]->arrange || c->isfloating) - #if !FAKEFULLSCREEN_PATCH - && !c->isfullscreen - #endif // !FAKEFULLSCREEN_PATCH - ) - resize(c, c->x, c->y, c->w, c->h, 0); - showhide(c->snext); - } else { - #if RENAMED_SCRATCHPADS_PATCH && RENAMED_SCRATCHPADS_AUTO_HIDE_PATCH - /* optional: auto-hide scratchpads when moving to other tags */ - if (c->scratchkey != 0 && !(c->tags & c->mon->tagset[c->mon->seltags])) - c->tags = 0; - #endif // RENAMED_SCRATCHPADS_AUTO_HIDE_PATCH - /* hide clients bottom up */ - showhide(c->snext); - XMoveWindow(dpy, c->win, WIDTH(c) * -2, c->y); - } -} - -#if COOL_AUTOSTART_PATCH -void -sigchld(int unused) -{ - pid_t pid; - - if (signal(SIGCHLD, sigchld) == SIG_ERR) - die("can't install SIGCHLD handler:"); - - while (0 < (pid = waitpid(-1, NULL, WNOHANG))) { - pid_t *p, *lim; - - if (!(p = autostart_pids)) - continue; - lim = &p[autostart_len]; - - for (; p < lim; p++) { - if (*p == pid) { - *p = -1; - break; - } - } - } -} -#endif // COOL_AUTOSTART_PATCH - -#if RIODRAW_PATCH -void -spawn(const Arg *arg) -{ - spawncmd(arg); -} - -pid_t -spawncmd(const Arg *arg) -#else -void -spawn(const Arg *arg) -#endif // RIODRAW_PATCH -{ - #if RIODRAW_PATCH - pid_t pid; - #endif // RIODRAW_PATCH - #if !NODMENU_PATCH - if (arg->v == dmenucmd) - dmenumon[0] = '0' + selmon->num; - #endif // NODMENU_PATCH - - #if RIODRAW_PATCH - if ((pid = fork()) == 0) - #else - if (fork() == 0) - #endif // RIODRAW_PATCH - { - if (dpy) - close(ConnectionNumber(dpy)); - - #if BAR_STATUSCMD_PATCH && !BAR_DWMBLOCKS_PATCH - if (arg->v == statuscmd) { - for (int i = 0; i < LENGTH(statuscmds); i++) { - if (statuscmdn == statuscmds[i].id) { - statuscmd[2] = statuscmds[i].cmd; - setenv("BUTTON", lastbutton, 1); - break; - } - } - if (!statuscmd[2]) - exit(EXIT_SUCCESS); - } - #endif // BAR_STATUSCMD_PATCH | BAR_DWMBLOCKS_PATCH - #if SPAWNCMD_PATCH - if (selmon->sel) { - const char* const home = getenv("HOME"); - assert(home && strchr(home, '/')); - const size_t homelen = strlen(home); - char *cwd, *pathbuf = NULL; - struct stat statbuf; - - cwd = strtok(selmon->sel->name, SPAWN_CWD_DELIM); - /* NOTE: strtok() alters selmon->sel->name in-place, - * but that does not matter because we are going to - * exec() below anyway; nothing else will use it */ - while (cwd) { - if (*cwd == '~') { /* replace ~ with $HOME */ - if (!(pathbuf = malloc(homelen + strlen(cwd)))) /* ~ counts for NULL term */ - die("fatal: could not malloc() %u bytes\n", homelen + strlen(cwd)); - strcpy(strcpy(pathbuf, home) + homelen, cwd + 1); - cwd = pathbuf; - } - - if (strchr(cwd, '/') && !stat(cwd, &statbuf)) { - if (!S_ISDIR(statbuf.st_mode)) - cwd = dirname(cwd); - - if (!chdir(cwd)) - break; - } - - cwd = strtok(NULL, SPAWN_CWD_DELIM); - } - - free(pathbuf); - } - #endif // SPAWNCMD_PATCH - setsid(); - execvp(((char **)arg->v)[0], (char **)arg->v); - die("dwm: execvp '%s' failed:", ((char **)arg->v)[0]); - } - #if RIODRAW_PATCH - return pid; - #endif // RIODRAW_PATCH -} - -void -tag(const Arg *arg) -{ - #if SWAPFOCUS_PATCH && PERTAG_PATCH - unsigned int tagmask, tagindex; - #endif // SWAPFOCUS_PATCH - - if (selmon->sel && arg->ui & TAGMASK) { - selmon->sel->tags = arg->ui & TAGMASK; - #if SWITCHTAG_PATCH - if (selmon->sel->switchtag) - selmon->sel->switchtag = 0; - #endif // SWITCHTAG_PATCH - focus(NULL); - #if SWAPFOCUS_PATCH && PERTAG_PATCH - selmon->pertag->prevclient[selmon->pertag->curtag] = NULL; - for (tagmask = arg->ui & TAGMASK, tagindex = 1; tagmask!=0; tagmask >>= 1, tagindex++) - if (tagmask & 1) - selmon->pertag->prevclient[tagindex] = NULL; - #endif // SWAPFOCUS_PATCH - arrange(selmon); - #if VIEWONTAG_PATCH - if ((arg->ui & TAGMASK) != selmon->tagset[selmon->seltags]) - view(arg); - #endif // VIEWONTAG_PATCH - } -} - -void -tagmon(const Arg *arg) -{ - Client *c = selmon->sel; - Monitor *dest; - #if SEAMLESS_RESTART_PATCH && SAVEFLOATS_PATCH - int restored; - #endif // SEAMLESS_RESTART_PATCH | SAVEFLOATS_PATCH - if (!c || !mons->next) - return; - dest = dirtomon(arg->i); - #if SEAMLESS_RESTART_PATCH && SAVEFLOATS_PATCH - savewindowfloatposition(c, c->mon); - restored = restorewindowfloatposition(c, dest); - if (restored && (!dest->lt[dest->sellt]->arrange || c->isfloating)) { - XMoveResizeWindow(dpy, c->win, c->sfx, c->sfy, c->sfw, c->sfh); - resize(c, c->sfx, c->sfy, c->sfw, c->sfh, 1); - } - #endif // SEAMLESS_RESTART_PATCH | SAVEFLOATS_PATCH - #if TAGMONFIXFS_PATCH - if (c->isfullscreen) { - c->isfullscreen = 0; - sendmon(c, dest); - c->isfullscreen = 1; - #if !FAKEFULLSCREEN_PATCH && FAKEFULLSCREEN_CLIENT_PATCH - if (c->fakefullscreen != 1) { - resizeclient(c, c->mon->mx, c->mon->my, c->mon->mw, c->mon->mh); - XRaiseWindow(dpy, c->win); - } - #elif !FAKEFULLSCREEN_PATCH - resizeclient(c, c->mon->mx, c->mon->my, c->mon->mw, c->mon->mh); - XRaiseWindow(dpy, c->win); - #endif // FAKEFULLSCREEN_CLIENT_PATCH - } else - sendmon(c, dest); - #else - sendmon(c, dest); - #endif // TAGMONFIXFS_PATCH -} - -void -togglebar(const Arg *arg) -{ - Bar *bar; - #if BAR_HOLDBAR_PATCH && PERTAG_PATCH && PERTAGBAR_PATCH - selmon->showbar = selmon->pertag->showbars[selmon->pertag->curtag] = (selmon->showbar == 2 ? 1 : !selmon->showbar); - #elif BAR_HOLDBAR_PATCH - selmon->showbar = (selmon->showbar == 2 ? 1 : !selmon->showbar); - #elif PERTAG_PATCH && PERTAGBAR_PATCH - selmon->showbar = selmon->pertag->showbars[selmon->pertag->curtag] = !selmon->showbar; - #else - selmon->showbar = !selmon->showbar; - #endif // BAR_HOLDBAR_PATCH | PERTAG_PATCH - 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); -} - -void -togglefloating(const Arg *arg) -{ - Client *c = selmon->sel; - if (arg && arg->v) - c = (Client*)arg->v; - if (!c) - return; - #if !FAKEFULLSCREEN_PATCH - #if FAKEFULLSCREEN_CLIENT_PATCH - if (c->isfullscreen && c->fakefullscreen != 1) /* no support for fullscreen windows */ - return; - #else - if (c->isfullscreen) /* no support for fullscreen windows */ - return; - #endif // FAKEFULLSCREEN_CLIENT_PATCH - #endif // !FAKEFULLSCREEN_PATCH - c->isfloating = !c->isfloating || c->isfixed; - #if !BAR_FLEXWINTITLE_PATCH - if (c->isfloating) - XSetWindowBorder(dpy, c->win, scheme[SchemeSel][ColFloat].pixel); - else - XSetWindowBorder(dpy, c->win, scheme[SchemeSel][ColBorder].pixel); - #endif // BAR_FLEXWINTITLE_PATCH - if (c->isfloating) { - #if SAVEFLOATS_PATCH || EXRESIZE_PATCH - if (c->sfx != -9999) { - /* restore last known float dimensions */ - resize(c, c->sfx, c->sfy, c->sfw, c->sfh, 0); - } else - #endif // SAVEFLOATS_PATCH // EXRESIZE_PATCH - resize(c, c->x, c->y, c->w, c->h, 0); - #if SAVEFLOATS_PATCH || EXRESIZE_PATCH - } else { - /* save last known float dimensions */ - c->sfx = c->x; - c->sfy = c->y; - c->sfw = c->w; - c->sfh = c->h; - #endif // SAVEFLOATS_PATCH / EXRESIZE_PATCH - } - arrange(c->mon); - - #if BAR_EWMHTAGS_PATCH - setfloatinghint(c); - #endif // BAR_EWMHTAGS_PATCH -} - -void -toggletag(const Arg *arg) -{ - unsigned int newtags; - #if SWAPFOCUS_PATCH && PERTAG_PATCH - unsigned int tagmask, tagindex; - #endif // SWAPFOCUS_PATCH - - if (!selmon->sel) - return; - newtags = selmon->sel->tags ^ (arg->ui & TAGMASK); - if (newtags) { - selmon->sel->tags = newtags; - focus(NULL); - #if SWAPFOCUS_PATCH && PERTAG_PATCH - for (tagmask = arg->ui & TAGMASK, tagindex = 1; tagmask!=0; tagmask >>= 1, tagindex++) - if (tagmask & 1) - selmon->pertag->prevclient[tagindex] = NULL; - #endif // SWAPFOCUS_PATCH - arrange(selmon); - } - #if BAR_EWMHTAGS_PATCH - updatecurrentdesktop(); - #endif // BAR_EWMHTAGS_PATCH -} - -void -toggleview(const Arg *arg) -{ - 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 - - #if TAGINTOSTACK_ALLMASTER_PATCH - Client *const selected = selmon->sel; - - // clients in the master area should be the same after we add a new tag - Client **const masters = calloc(selmon->nmaster, sizeof(Client *)); - if (!masters) { - die("fatal: could not calloc() %u bytes \n", selmon->nmaster * sizeof(Client *)); - } - // collect (from last to first) references to all clients in the master area - Client *c; - size_t j; - for (c = nexttiled(selmon->clients), j = 0; c && j < selmon->nmaster; c = nexttiled(c->next), ++j) - masters[selmon->nmaster - (j + 1)] = c; - // put the master clients at the front of the list - // > go from the 'last' master to the 'first' - for (j = 0; j < selmon->nmaster; ++j) - if (masters[j]) - pop(masters[j]); - free(masters); - - // we also want to be sure not to mutate the focus - focus(selected); - #elif TAGINTOSTACK_ONEMASTER_PATCH - // the first visible client should be the same after we add a new tag - // we also want to be sure not to mutate the focus - Client *const c = nexttiled(selmon->clients); - if (c) { - Client * const selected = selmon->sel; - pop(c); - focus(selected); - } - #endif // TAGINTOSTACK_ALLMASTER_PATCH / TAGINTOSTACK_ONEMASTER_PATCH - - #if !EMPTYVIEW_PATCH - if (newtagset) { - #endif // EMPTYVIEW_PATCH - #if BAR_TAGPREVIEW_PATCH - tagpreviewswitchtag(); - #endif // BAR_TAGPREVIEW_PATCH - selmon->tagset[selmon->seltags] = newtagset; - - #if PERTAG_PATCH - #if SCRATCHPADS_PATCH && !RENAMED_SCRATCHPADS_PATCH - if (newtagset == ~SPTAGMASK) - #else - if (newtagset == ~0) - #endif // SCRATCHPADS_PATCH - { - selmon->pertag->curtag = 0; - } - /* test if the user did not select the same tag */ - if (!(newtagset & 1 << (selmon->pertag->curtag - 1))) { - for (i = 0; !(newtagset & 1 << i); i++) ; - selmon->pertag->curtag = i + 1; - } - - /* apply settings for this view */ - selmon->nmaster = selmon->pertag->nmasters[selmon->pertag->curtag]; - selmon->mfact = selmon->pertag->mfacts[selmon->pertag->curtag]; - selmon->sellt = selmon->pertag->sellts[selmon->pertag->curtag]; - selmon->lt[selmon->sellt] = selmon->pertag->ltidxs[selmon->pertag->curtag][selmon->sellt]; - selmon->lt[selmon->sellt^1] = selmon->pertag->ltidxs[selmon->pertag->curtag][selmon->sellt^1]; - #if PERTAGBAR_PATCH - if (selmon->showbar != selmon->pertag->showbars[selmon->pertag->curtag]) - 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 -} - -void -unfocus(Client *c, int setfocus, Client *nextfocus) -{ - if (!c) - return; - #if SWAPFOCUS_PATCH && PERTAG_PATCH - selmon->pertag->prevclient[selmon->pertag->curtag] = c; - #endif // SWAPFOCUS_PATCH - #if LOSEFULLSCREEN_PATCH - if (c->isfullscreen && ISVISIBLE(c) && c->mon == selmon && nextfocus && !nextfocus->isfloating) - #if FAKEFULLSCREEN_CLIENT_PATCH - if (c->fakefullscreen != 1) - setfullscreen(c, 0); - #else - setfullscreen(c, 0); - #endif // #if FAKEFULLSCREEN_CLIENT_PATCH - #endif // LOSEFULLSCREEN_PATCH - grabbuttons(c, 0); - #if !BAR_FLEXWINTITLE_PATCH - #if RENAMED_SCRATCHPADS_PATCH - if (c->scratchkey != 0 && c->isfloating) - XSetWindowBorder(dpy, c->win, scheme[SchemeScratchNorm][ColFloat].pixel); - else if (c->scratchkey != 0) - XSetWindowBorder(dpy, c->win, scheme[SchemeScratchNorm][ColBorder].pixel); - else if (c->isfloating) - XSetWindowBorder(dpy, c->win, scheme[SchemeNorm][ColFloat].pixel); - else - XSetWindowBorder(dpy, c->win, scheme[SchemeNorm][ColBorder].pixel); - #else - if (c->isfloating) - XSetWindowBorder(dpy, c->win, scheme[SchemeNorm][ColFloat].pixel); - else - XSetWindowBorder(dpy, c->win, scheme[SchemeNorm][ColBorder].pixel); - #endif // RENAMED_SCRATCHPADS_PATCH - #endif // BAR_FLEXWINTITLE_PATCH - if (setfocus) { - XSetInputFocus(dpy, root, RevertToPointerRoot, CurrentTime); - XDeleteProperty(dpy, root, netatom[NetActiveWindow]); - } -} - -void -unmanage(Client *c, int destroyed) -{ - Monitor *m; - #if SWITCHTAG_PATCH - unsigned int switchtag = c->switchtag; - #endif // SWITCHTAG_PATCH - XWindowChanges wc; - #if XKB_PATCH - XkbInfo *xkb; - #endif // XKB_PATCH - - #if ZOOMSWAP_PATCH - /* Make sure to clear any previous zoom references to the client being removed. */ - #if PERTAG_PATCH - int i; - for (m = mons; m; m = m->next) { - for (i = 0; i <= NUMTAGS; i++) { - if (m->pertag->prevzooms[i] == c) { - m->pertag->prevzooms[i] = NULL; - } - } - } - #else - if (c == prevzoom) - prevzoom = NULL; - #endif // PERTAG_PATCH - #endif // ZOOMSWAP_PATCH - m = c->mon; - - #if SWALLOW_PATCH - if (c->swallowing) { - unswallow(c); - return; - } - - Client *s = swallowingclient(c->win); - if (s) { - free(s->swallowing); - s->swallowing = NULL; - arrange(m); - focus(NULL); - return; - } - #endif // SWALLOW_PATCH - - detach(c); - detachstack(c); - #if BAR_WINICON_PATCH - freeicon(c); - #endif // BAR_WINICON_PATCH - if (!destroyed) { - wc.border_width = c->oldbw; - XGrabServer(dpy); /* avoid race conditions */ - XSetErrorHandler(xerrordummy); - XSelectInput(dpy, c->win, NoEventMask); - XConfigureWindow(dpy, c->win, CWBorderWidth, &wc); /* restore border */ - XUngrabButton(dpy, AnyButton, AnyModifier, c->win); - setclientstate(c, WithdrawnState); - XSync(dpy, False); - XSetErrorHandler(xerror); - XUngrabServer(dpy); - } - #if XKB_PATCH - else { - xkb = findxkb(c->win); - if (xkb != NULL) { - if (xkb->prev) - xkb->prev->next = xkb->next; - if (xkb->next) - xkb->next->prev = xkb->prev; - free(xkb); - } - } - #endif // XKB_PATCH - - #if SCRATCHPAD_ALT_1_PATCH - if (scratchpad_last_showed == c) - scratchpad_last_showed = NULL; - #endif // SCRATCHPAD_ALT_1_PATCH - - free(c); - #if SWALLOW_PATCH - if (s) - return; - #endif // SWALLOW_PATCH - focus(NULL); - updateclientlist(); - arrange(m); - #if SWITCHTAG_PATCH - if (switchtag && ((switchtag & TAGMASK) != selmon->tagset[selmon->seltags])) - view(&((Arg) { .ui = switchtag })); - #endif // SWITCHTAG_PATCH -} - -void -unmapnotify(XEvent *e) -{ - Client *c; - #if BAR_ANYBAR_PATCH - Monitor *m; - Bar *bar; - #endif // BAR_ANYBAR_PATCH - XUnmapEvent *ev = &e->xunmap; - - if ((c = wintoclient(ev->window))) { - if (ev->send_event) - setclientstate(c, WithdrawnState); - else - unmanage(c, 0); - #if BAR_SYSTRAY_PATCH - } else if (showsystray && (c = wintosystrayicon(ev->window))) { - /* KLUDGE! sometimes icons occasionally unmap their windows, but do - * _not_ destroy them. We map those windows back */ - XMapRaised(dpy, c->win); - removesystrayicon(c); - drawbarwin(systray->bar); - #endif // BAR_SYSTRAY_PATCH - } - #if BAR_ANYBAR_PATCH - else { - m = wintomon(ev->window); - for (bar = m->bar; bar; bar = bar->next) { - if (bar->win == ev->window) { - unmanagealtbar(ev->window); - break; - } - } - } - #endif // BAR_ANYBAR_PATCH -} - -void -updatebars(void) -{ - Bar *bar; - Monitor *m; - XSetWindowAttributes wa = { - .override_redirect = True, - #if BAR_ALPHA_PATCH - .background_pixel = 0, - .border_pixel = 0, - .colormap = cmap, - #else - .background_pixmap = ParentRelative, - #endif // BAR_ALPHA_PATCH - #if BAR_TAGPREVIEW_PATCH - .event_mask = ButtonPressMask|ExposureMask|PointerMotionMask - #else - .event_mask = ButtonPressMask|ExposureMask - #endif // BAR_TAGPREVIEW_PATCH - }; - XClassHint ch = {"dwm", "dwm"}; - for (m = mons; m; m = m->next) { - for (bar = m->bar; bar; bar = bar->next) { - if (bar->external) - continue; - if (!bar->win) { - #if BAR_ALPHA_PATCH - bar->win = XCreateWindow(dpy, root, bar->bx, bar->by, bar->bw, bar->bh, 0, depth, - InputOutput, visual, - CWOverrideRedirect|CWBackPixel|CWBorderPixel|CWColormap|CWEventMask, &wa); - #else - bar->win = XCreateWindow(dpy, root, bar->bx, bar->by, bar->bw, bar->bh, 0, DefaultDepth(dpy, screen), - CopyFromParent, DefaultVisual(dpy, screen), - CWOverrideRedirect|CWBackPixmap|CWEventMask, &wa); - #endif // BAR_ALPHA_PATCH - XDefineCursor(dpy, bar->win, cursor[CurNormal]->cursor); - XMapRaised(dpy, bar->win); - XSetClassHint(dpy, bar->win, &ch); - } - } - #if TAB_PATCH - if (!m->tabwin) { - #if BAR_ALPHA_PATCH - m->tabwin = XCreateWindow(dpy, root, m->wx, m->ty, m->ww, th, 0, depth, - InputOutput, visual, - CWOverrideRedirect|CWBackPixel|CWBorderPixel|CWColormap|CWEventMask, &wa); - #else - m->tabwin = XCreateWindow(dpy, root, m->wx, m->ty, m->ww, th, 0, DefaultDepth(dpy, screen), - CopyFromParent, DefaultVisual(dpy, screen), - CWOverrideRedirect|CWBackPixmap|CWEventMask, &wa); - #endif // BAR_ALPHA_PATCH - XDefineCursor(dpy, m->tabwin, cursor[CurNormal]->cursor); - XMapRaised(dpy, m->tabwin); - } - #endif // TAB_PATCH - } -} - -void -updatebarpos(Monitor *m) -{ - #if TAB_PATCH - Client *c; - int nvis = 0; - #endif // TAB_PATCH - - m->wx = m->mx; - m->wy = m->my; - m->ww = m->mw; - m->wh = m->mh; - Bar *bar; - int y_pad = 0; - int x_pad = 0; - #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 - Inset inset = m->inset; - m->wx += inset.x; - m->wy += inset.y; - m->ww -= inset.w + inset.x; - m->wh -= inset.h + inset.y; - #endif // INSETS_PATCH - - for (bar = m->bar; bar; bar = bar->next) { - bar->bx = m->wx + x_pad; - #if BAR_ANYBAR_PATCH && !BAR_ANYBAR_MANAGE_WIDTH_PATCH - if (bar->external) - continue; - #endif // BAR_ANYBAR_PATCH | BAR_ANYBAR_MANAGE_WIDTH_PATCH - bar->bw = m->ww - 2 * x_pad; - } - - for (bar = m->bar; bar; bar = bar->next) - if (!m->showbar || !bar->showbar) - bar->by = -bar->bh - y_pad; - - #if TAB_PATCH - for (c = m->clients; c; c = c->next) { - if (ISVISIBLE(c) && !HIDDEN(c)) - ++nvis; - } - - if (m->showtab == showtab_always - || ((m->showtab == showtab_auto) && (nvis > 1) && (m->lt[m->sellt]->arrange == monocle))) { - m->wh -= th; - m->ty = m->toptab ? m->wy : m->wy + m->wh; - if (m->toptab) - m->wy += th; - } else { - m->ty = -th; - } - #endif // TAB_PATCH - - if (!m->showbar) - return; - for (bar = m->bar; bar; bar = bar->next) { - if (!bar->showbar) - continue; - if (bar->topbar) - m->wy = m->wy + bar->bh + y_pad; - m->wh -= y_pad + bar->bh; - bar->by = (bar->topbar ? m->wy - bar->bh : m->wy + m->wh); - } -} - -void -updateclientlist() -{ - Client *c; - Monitor *m; - - XDeleteProperty(dpy, root, netatom[NetClientList]); - for (m = mons; m; m = m->next) - for (c = m->clients; c; c = c->next) - XChangeProperty(dpy, root, netatom[NetClientList], - XA_WINDOW, 32, PropModeAppend, - (unsigned char *) &(c->win), 1); - - #if NET_CLIENT_LIST_STACKING_PATCH - XDeleteProperty(dpy, root, netatom[NetClientListStacking]); - for (m = mons; m; m = m->next) - for (c = m->stack; c; c = c->snext) - XChangeProperty(dpy, root, netatom[NetClientListStacking], - XA_WINDOW, 32, PropModeAppend, - (unsigned char *) &(c->win), 1); - #endif // NET_CLIENT_LIST_STACKING_PATCH -} - -int -updategeom(void) -{ - int dirty = 0; - -#ifdef XINERAMA - if (XineramaIsActive(dpy)) { - int i, j, n, nn; - Client *c; - Monitor *m; - XineramaScreenInfo *info = XineramaQueryScreens(dpy, &nn); - XineramaScreenInfo *unique = NULL; - - for (n = 0, m = mons; m; m = m->next, n++); - /* only consider unique geometries as separate screens */ - unique = ecalloc(nn, sizeof(XineramaScreenInfo)); - for (i = 0, j = 0; i < nn; i++) - if (isuniquegeom(unique, j, &info[i])) - memcpy(&unique[j++], &info[i], sizeof(XineramaScreenInfo)); - XFree(info); - nn = j; - #if SORTSCREENS_PATCH - sortscreens(unique, nn); - #endif // SORTSCREENS_PATCH - /* 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); - } - free(unique); - } else -#endif /* XINERAMA */ - { /* default monitor setup */ - if (!mons) - mons = createmon(); - if (mons->mw != sw || mons->mh != sh) { - dirty = 1; - mons->mw = mons->ww = sw; - mons->mh = mons->wh = sh; - updatebarpos(mons); - } - } - if (dirty) { - selmon = mons; - selmon = wintomon(root); - } - return dirty; -} - -void -updatenumlockmask(void) -{ - unsigned int i, j; - XModifierKeymap *modmap; - - numlockmask = 0; - modmap = XGetModifierMapping(dpy); - for (i = 0; i < 8; i++) - for (j = 0; j < modmap->max_keypermod; j++) - if (modmap->modifiermap[i * modmap->max_keypermod + j] - == XKeysymToKeycode(dpy, XK_Num_Lock)) - numlockmask = (1 << i); - XFreeModifiermap(modmap); -} - -void -updatesizehints(Client *c) -{ - long msize; - XSizeHints size; - - if (!XGetWMNormalHints(dpy, c->win, &size, &msize)) - /* size is uninitialized, ensure that size.flags aren't used */ - #if SIZEHINTS_PATCH || SIZEHINTS_RULED_PATCH || SIZEHINTS_ISFREESIZE_PATCH - size.flags = 0; - #else - size.flags = PSize; - #endif // SIZEHINTS_PATCH | SIZEHINTS_RULED_PATCH | SIZEHINTS_ISFREESIZE_PATCH - if (size.flags & PBaseSize) { - c->basew = size.base_width; - c->baseh = size.base_height; - } else if (size.flags & PMinSize) { - c->basew = size.min_width; - c->baseh = size.min_height; - } else - c->basew = c->baseh = 0; - if (size.flags & PResizeInc) { - c->incw = size.width_inc; - c->inch = size.height_inc; - } else - c->incw = c->inch = 0; - if (size.flags & PMaxSize) { - c->maxw = size.max_width; - c->maxh = size.max_height; - } else - c->maxw = c->maxh = 0; - if (size.flags & PMinSize) { - c->minw = size.min_width; - c->minh = size.min_height; - } else if (size.flags & PBaseSize) { - c->minw = size.base_width; - c->minh = size.base_height; - } else - c->minw = c->minh = 0; - if (size.flags & PAspect) { - c->mina = (float)size.min_aspect.y / size.min_aspect.x; - c->maxa = (float)size.max_aspect.x / size.max_aspect.y; - } else - c->maxa = c->mina = 0.0; - #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; - } - #if SIZEHINTS_RULED_PATCH - checkfloatingrules(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 -updatestatus(void) -{ - Monitor *m; - #if BAR_EXTRASTATUS_PATCH - if (!gettextprop(root, XA_WM_NAME, rawstext, sizeof(rawstext))) { - strcpy(stext, "dwm-"VERSION); - estext[0] = '\0'; - } else { - char *e = strchr(rawstext, statussep); - if (e) { - *e = '\0'; e++; - #if BAR_STATUSCMD_PATCH - strncpy(rawestext, e, sizeof(estext) - 1); - copyvalidchars(estext, rawestext); - #else - strncpy(estext, e, sizeof(estext) - 1); - #endif // BAR_STATUSCMD_PATCH - } else { - estext[0] = '\0'; - } - #if BAR_STATUSCMD_PATCH - copyvalidchars(stext, rawstext); - #else - strncpy(stext, rawstext, sizeof(stext) - 1); - #endif // BAR_STATUSCMD_PATCH - } - #elif BAR_STATUSCMD_PATCH - if (!gettextprop(root, XA_WM_NAME, rawstext, sizeof(rawstext))) - strcpy(stext, "dwm-"VERSION); - else - copyvalidchars(stext, rawstext); - #else - if (!gettextprop(root, XA_WM_NAME, stext, sizeof(stext))) - strcpy(stext, "dwm-"VERSION); - #endif // BAR_EXTRASTATUS_PATCH | BAR_STATUSCMD_PATCH - for (m = mons; m; m = m->next) - drawbar(m); -} - -void -updatetitle(Client *c) -{ - #if IPC_PATCH - char oldname[sizeof(c->name)]; - strcpy(oldname, c->name); - #endif // IPC_PATCH - - if (!gettextprop(c->win, netatom[NetWMName], c->name, sizeof c->name)) - gettextprop(c->win, XA_WM_NAME, c->name, sizeof c->name); - if (c->name[0] == '\0') /* hack to mark broken clients */ - strcpy(c->name, broken); - - #if IPC_PATCH - for (Monitor *m = mons; m; m = m->next) { - if (m->sel == c && strcmp(oldname, c->name) != 0) - ipc_focused_title_change_event(m->num, c->win, oldname, c->name); - } - #endif // IPC_PATCH -} - -void -updatewmhints(Client *c) -{ - XWMHints *wmh; - - if ((wmh = XGetWMHints(dpy, c->win))) { - if (c == selmon->sel && wmh->flags & XUrgencyHint) { - wmh->flags &= ~XUrgencyHint; - XSetWMHints(dpy, c->win, wmh); - } else - c->isurgent = (wmh->flags & XUrgencyHint) ? 1 : 0; - if (c->isurgent) { - if (c->isfloating) - XSetWindowBorder(dpy, c->win, scheme[SchemeUrg][ColFloat].pixel); - else - XSetWindowBorder(dpy, c->win, scheme[SchemeUrg][ColBorder].pixel); - } - if (wmh->flags & InputHint) - c->neverfocus = !wmh->input; - else - c->neverfocus = 0; - XFree(wmh); - } -} - -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 - if ((arg->ui & TAGMASK) == selmon->tagset[selmon->seltags]) - #endif // EMPTYVIEW_PATCH - { - #if TOGGLETAG_PATCH - view(&((Arg) { .ui = 0 })); - #endif // TOGGLETAG_PATCH - return; - } - #if BAR_TAGPREVIEW_PATCH - tagpreviewswitchtag(); - #endif // BAR_TAGPREVIEW_PATCH - #if VIEW_HISTORY_PATCH - if (!arg->ui) { - selmon->seltags += 1; - if (selmon->seltags == LENGTH(selmon->tagset)) - selmon->seltags = 0; - } else { - if (selmon->seltags == 0) - selmon->seltags = LENGTH(selmon->tagset) - 1; - else - selmon->seltags -= 1; - } - #else - selmon->seltags ^= 1; /* toggle sel tagset */ - #endif // VIEW_HISTORY_PATCH - if (arg->ui & TAGMASK) - selmon->tagset[selmon->seltags] = arg->ui & TAGMASK; - #if PERTAG_PATCH - pertagview(arg); - #endif // PERTAG_PATCH - #if TAGSYNC_PATCH - } - selmon = origselmon; - #endif // TAGSYNC_PATCH - focus(NULL); - #if TAGSYNC_PATCH - arrange(NULL); - #else - arrange(selmon); - #endif // TAGSYNC_PATCH - #if BAR_EWMHTAGS_PATCH - updatecurrentdesktop(); - #endif // BAR_EWMHTAGS_PATCH -} - -Client * -wintoclient(Window w) -{ - Client *c; - Monitor *m; - - for (m = mons; m; m = m->next) - for (c = m->clients; c; c = c->next) - if (c->win == w) - return c; - return NULL; -} - -Monitor * -wintomon(Window w) -{ - int x, y; - Client *c; - Monitor *m; - Bar *bar; - - if (w == root && getrootptr(&x, &y)) - return recttomon(x, y, 1, 1); - for (m = mons; m; m = m->next) - for (bar = m->bar; bar; bar = bar->next) - if (w == bar->win) - return m; - if ((c = wintoclient(w))) - return c->mon; - return selmon; -} - -/* There's no way to check accesses to destroyed windows, thus those cases are - * ignored (especially on UnmapNotify's). Other types of errors call Xlibs - * default error handler, which may call exit. */ -int -xerror(Display *dpy, XErrorEvent *ee) -{ - if (ee->error_code == BadWindow - || (ee->request_code == X_SetInputFocus && ee->error_code == BadMatch) - || (ee->request_code == X_PolyText8 && ee->error_code == BadDrawable) - || (ee->request_code == X_PolyFillRectangle && ee->error_code == BadDrawable) - || (ee->request_code == X_PolySegment && ee->error_code == BadDrawable) - || (ee->request_code == X_ConfigureWindow && ee->error_code == BadMatch) - || (ee->request_code == X_GrabButton && ee->error_code == BadAccess) - || (ee->request_code == X_GrabKey && ee->error_code == BadAccess) - || (ee->request_code == X_CopyArea && ee->error_code == BadDrawable)) - return 0; - fprintf(stderr, "dwm: fatal error: request code=%d, error code=%d\n", - ee->request_code, ee->error_code); - return xerrorxlib(dpy, ee); /* may call exit */ -} - -int -xerrordummy(Display *dpy, XErrorEvent *ee) -{ - return 0; -} - -/* Startup Error handler to check if another window manager - * is already running. */ -int -xerrorstart(Display *dpy, XErrorEvent *ee) -{ - die("dwm: another window manager is already running"); - return -1; -} - -void -zoom(const Arg *arg) -{ - Client *c = selmon->sel; - if (arg && arg->v) - c = (Client*)arg->v; - if (!c) - return; - #if ZOOMSWAP_PATCH - Client *at = NULL, *cold, *cprevious = NULL, *p; - #endif // ZOOMSWAP_PATCH - - #if ZOOMFLOATING_PATCH - if (c && c->isfloating) - togglefloating(&((Arg) { .v = c })); - #endif // ZOOMFLOATING_PATCH - - #if SWAPFOCUS_PATCH && PERTAG_PATCH - c->mon->pertag->prevclient[c->mon->pertag->curtag] = nexttiled(c->mon->clients); - #endif // SWAPFOCUS_PATCH - - if (!c->mon->lt[c->mon->sellt]->arrange || !c || c->isfloating) - return; - - #if ZOOMSWAP_PATCH - if (c == nexttiled(c->mon->clients)) { - #if PERTAG_PATCH - p = c->mon->pertag->prevzooms[c->mon->pertag->curtag]; - #else - p = prevzoom; - #endif // PERTAG_PATCH - at = findbefore(p); - if (at) - cprevious = nexttiled(at->next); - if (!cprevious || cprevious != p) { - #if PERTAG_PATCH - c->mon->pertag->prevzooms[c->mon->pertag->curtag] = NULL; - #else - prevzoom = NULL; - #endif // PERTAG_PATCH - #if SWAPFOCUS_PATCH && PERTAG_PATCH - if (!c || !(c = c->mon->pertag->prevclient[c->mon->pertag->curtag] = nexttiled(c->next))) - #else - if (!c || !(c = nexttiled(c->next))) - #endif // SWAPFOCUS_PATCH - return; - } else - #if SWAPFOCUS_PATCH && PERTAG_PATCH - c = c->mon->pertag->prevclient[c->mon->pertag->curtag] = cprevious; - #else - c = cprevious; - #endif // SWAPFOCUS_PATCH - } - - cold = nexttiled(c->mon->clients); - if (c != cold && !at) - at = findbefore(c); - detach(c); - attach(c); - /* swap windows instead of pushing the previous one down */ - if (c != cold && at) { - #if PERTAG_PATCH - c->mon->pertag->prevzooms[c->mon->pertag->curtag] = cold; - #else - prevzoom = cold; - #endif // PERTAG_PATCH - if (cold && at != cold) { - detach(cold); - cold->next = at->next; - at->next = cold; - } - } - focus(c); - arrange(c->mon); - #elif SWAPFOCUS_PATCH && PERTAG_PATCH - if (c == nexttiled(c->mon->clients) && !(c = c->mon->pertag->prevclient[c->mon->pertag->curtag] = nexttiled(c->next))) - return; - pop(c); - #else - if (c == nexttiled(selmon->clients) && !(c = nexttiled(c->next))) - return; - pop(c); - #endif // ZOOMSWAP_PATCH -} - -int -main(int argc, char *argv[]) -{ - #if CMDCUSTOMIZE_PATCH - for (int i=1;isel && m->sel->snext) { - alttabn++; - if (alttabn >= ntabs) - alttabn = 0; /* reset alttabn */ - - focus(altsnext[alttabn]); - restack(m); - } - - /* redraw tab */ - XRaiseWindow(dpy, alttabwin); - drawtab(ntabs, 0, m); -} - -void -alttabend() -{ - Monitor *m = selmon; - Client *buff; - int i; - - if (!isalt) - return; - - /* Move all clients between first and choosen position, - * one down in stack and put choosen client to the first position - * so they remain in right order for the next time that alt-tab is used - */ - if (ntabs > 1) { - if (alttabn != 0) { /* if user picked original client do nothing */ - buff = altsnext[alttabn]; - if (alttabn > 1) - for (i = alttabn; i > 0; i--) - altsnext[i] = altsnext[i - 1]; - else /* swap them if there are just 2 clients */ - altsnext[alttabn] = altsnext[0]; - altsnext[0] = buff; - } - - /* restack clients */ - for (i = ntabs - 1; i >= 0; i--) { - focus(altsnext[i]); - restack(m); - } - - free(altsnext); /* free list of clients */ - } - - /* destroy the window */ - isalt = 0; - ntabs = 0; - XUnmapWindow(dpy, alttabwin); - XDestroyWindow(dpy, alttabwin); -} - -void -drawtab(int nwins, int first, Monitor *m) -{ - Client *c; - int i, h; - int y = 0; - int px = m->mx; - int py = m->my; - - if (first) { - XSetWindowAttributes wa = { - .override_redirect = True, - #if BAR_ALPHA_PATCH - .background_pixel = 0, - .border_pixel = 0, - .colormap = cmap, - #else - .background_pixmap = ParentRelative, - #endif // BAR_ALPHA_PATCH - .event_mask = ButtonPressMask|ExposureMask - }; - - /* decide position of tabwin */ - if (tabposx == 1) - px = m->mx + (m->mw / 2) - (maxwtab / 2); - else if (tabposx == 2) - px = m->mx + m->mw - maxwtab; - - if (tabposy == 1) - py = m->my + (m->mh / 2) - (maxhtab / 2); - else if (tabposy == 2) - py = m->my + m->mh - maxhtab; - - h = maxhtab; - - #if BAR_ALPHA_PATCH - alttabwin = XCreateWindow(dpy, root, px, py, maxwtab, maxhtab, 2, depth, - InputOutput, visual, - CWOverrideRedirect|CWBackPixel|CWBorderPixel|CWColormap|CWEventMask, &wa); - #else - alttabwin = XCreateWindow(dpy, root, px, py, maxwtab, maxhtab, 2, DefaultDepth(dpy, screen), - CopyFromParent, DefaultVisual(dpy, screen), - CWOverrideRedirect|CWBackPixmap|CWEventMask, &wa); - #endif // BAR_ALPHA_PATCH - - XDefineCursor(dpy, alttabwin, cursor[CurNormal]->cursor); - XMapRaised(dpy, alttabwin); - } - - h = maxhtab / ntabs; - for (i = 0; i < ntabs; i++) { /* draw all clients into tabwin */ - c = altsnext[i]; - if (!ISVISIBLE(c)) - continue; - if (HIDDEN(c)) - continue; - - drw_setscheme(drw, scheme[c == m->sel ? SchemeSel : SchemeNorm]); - drw_text(drw, 0, y, maxwtab, h, 0, c->name, 0, 0); - y += h; - } - - drw_setscheme(drw, scheme[SchemeNorm]); - drw_map(drw, alttabwin, 0, 0, maxwtab, maxhtab); -} - -void -alttabstart(const Arg *arg) -{ - Client *c; - Monitor *m = selmon; - int grabbed; - int i; - - altsnext = NULL; - if (alttabwin) - alttabend(); - - if (isalt == 1) { - alttabend(); - return; - } - - isalt = 1; - alttabn = 0; - ntabs = 0; - - for (c = m->clients; c; c = c->next) { - if (!ISVISIBLE(c)) - continue; - if (HIDDEN(c)) - continue; - - ++ntabs; - } - - if (!ntabs) { - alttabend(); - return; - } - - altsnext = (Client **) malloc(ntabs * sizeof(Client *)); - - for (i = 0, c = m->stack; c; c = c->snext) { - if (!ISVISIBLE(c)) - continue; - if (HIDDEN(c)) - continue; - - altsnext[i] = c; - i++; - } - - drawtab(ntabs, 1, m); - - struct timespec ts = { .tv_sec = 0, .tv_nsec = 1000000 }; - - /* grab keyboard (take all input from keyboard) */ - grabbed = 1; - for (i = 0; i < 1000; i++) { - if (XGrabKeyboard(dpy, root, True, GrabModeAsync, GrabModeAsync, CurrentTime) == GrabSuccess) - break; - nanosleep(&ts, NULL); - if (i == 1000 - 1) - grabbed = 0; - } - - XEvent event; - alttab(); - - if (grabbed == 0) { - alttabend(); - return; - } - - while (grabbed) { - XNextEvent(dpy, &event); - if (event.type == KeyPress || event.type == KeyRelease) { - if (event.type == KeyRelease && event.xkey.keycode == tabmodkey) /* if mod key is released break cycle */ - break; - - if (event.type == KeyPress) { - if (event.xkey.keycode == tabcyclekey) { /* if tab is pressed move to the next window */ - alttab(); - } - } - } - } - - c = m->sel; - alttabend(); - - XUngrabKeyboard(dpy, CurrentTime); - focus(c); - restack(m); -} diff --git a/dwm/.dwm.old/patch/alttab.h b/dwm/.dwm.old/patch/alttab.h deleted file mode 100644 index 2951d04..0000000 --- a/dwm/.dwm.old/patch/alttab.h +++ /dev/null @@ -1,5 +0,0 @@ -#include - -static void drawtab(int nwins, int first, Monitor *m); -static void alttabstart(const Arg *arg); -static void alttabend(); diff --git a/dwm/.dwm.old/patch/aspectresize.c b/dwm/.dwm.old/patch/aspectresize.c deleted file mode 100644 index cdd5afd..0000000 --- a/dwm/.dwm.old/patch/aspectresize.c +++ /dev/null @@ -1,25 +0,0 @@ -void -aspectresize(const Arg *arg) -{ - /* only floating windows can be moved */ - Client *c; - c = selmon->sel; - float ratio; - int w, h,nw, nh; - - if (!c || !arg) - return; - if (selmon->lt[selmon->sellt]->arrange && !c->isfloating) - return; - - ratio = (float)c->w / (float)c->h; - h = arg->i; - w = (int)(ratio * h); - - nw = c->w + w; - nh = c->h + h; - - XRaiseWindow(dpy, c->win); - resize(c, c->x, c->y, nw, nh, True); -} - diff --git a/dwm/.dwm.old/patch/aspectresize.h b/dwm/.dwm.old/patch/aspectresize.h deleted file mode 100644 index 4ac7cbb..0000000 --- a/dwm/.dwm.old/patch/aspectresize.h +++ /dev/null @@ -1,2 +0,0 @@ -static void aspectresize(const Arg *arg); - diff --git a/dwm/.dwm.old/patch/attachx.c b/dwm/.dwm.old/patch/attachx.c deleted file mode 100644 index 0ce908a..0000000 --- a/dwm/.dwm.old/patch/attachx.c +++ /dev/null @@ -1,59 +0,0 @@ -void -attachx(Client *c) -{ - #if ATTACHABOVE_PATCH || ATTACHASIDE_PATCH || ATTACHBOTTOM_PATCH || SEAMLESS_RESTART_PATCH - Client *at; - #endif // ATTACHABOVE_PATCH | ATTACHASIDE_PATCH | ATTACHBOTTOM_PATCH | SEAMLESS_RESTART_PATCH - - #if SEAMLESS_RESTART_PATCH - if (c->idx > 0) { /* then the client has a designated position in the client list */ - for (at = c->mon->clients; at; at = at->next) { - if (c->idx < at->idx) { - c->next = at; - c->mon->clients = c; - return; - } else if (at->idx <= c->idx && (!at->next || c->idx <= at->next->idx)) { - c->next = at->next; - at->next = c; - return; - } - } - } - #endif // SEAMLESS_RESTART_PATCH - - #if ATTACHABOVE_PATCH - if (!(c->mon->sel == NULL || c->mon->sel == c->mon->clients || c->mon->sel->isfloating)) { - for (at = c->mon->clients; at->next != c->mon->sel; at = at->next); - c->next = at->next; - at->next = c; - return; - } - #elif ATTACHASIDE_PATCH - unsigned int n; - for (at = c->mon->clients, n = 0; at; at = at->next) - if (!at->isfloating && ISVISIBLEONTAG(at, c->tags)) - if (++n >= c->mon->nmaster) - break; - - if (at && c->mon->nmaster) { - c->next = at->next; - at->next = c; - return; - } - #elif ATTACHBELOW_PATCH - if (!(c->mon->sel == NULL || c->mon->sel == c || c->mon->sel->isfloating)) { - c->next = c->mon->sel->next; - c->mon->sel->next = c; - return; - } - #elif ATTACHBOTTOM_PATCH - for (at = c->mon->clients; at && at->next; at = at->next); - if (at) { - at->next = c; - c->next = NULL; - return; - } - #endif - attach(c); // master (default) -} - diff --git a/dwm/.dwm.old/patch/attachx.h b/dwm/.dwm.old/patch/attachx.h deleted file mode 100644 index e522d27..0000000 --- a/dwm/.dwm.old/patch/attachx.h +++ /dev/null @@ -1,2 +0,0 @@ -static void attachx(Client *c); - diff --git a/dwm/.dwm.old/patch/autostart.c b/dwm/.dwm.old/patch/autostart.c deleted file mode 100644 index 6053f1f..0000000 --- a/dwm/.dwm.old/patch/autostart.c +++ /dev/null @@ -1,76 +0,0 @@ -void -runautostart(void) -{ - char *pathpfx; - char *path; - char *xdgdatahome; - char *home; - struct stat sb; - - if ((home = getenv("HOME")) == NULL) - /* this is almost impossible */ - return; - - /* if $XDG_DATA_HOME is set and not empty, use $XDG_DATA_HOME/dwm, - * otherwise use ~/.local/share/dwm as autostart script directory - */ - xdgdatahome = getenv("XDG_DATA_HOME"); - if (xdgdatahome != NULL && *xdgdatahome != '\0') { - /* space for path segments, separators and nul */ - pathpfx = ecalloc(1, strlen(xdgdatahome) + strlen(dwmdir) + 2); - - if (sprintf(pathpfx, "%s/%s", xdgdatahome, dwmdir) <= 0) { - free(pathpfx); - return; - } - } else { - /* space for path segments, separators and nul */ - pathpfx = ecalloc(1, strlen(home) + strlen(localshare) - + strlen(dwmdir) + 3); - - if (sprintf(pathpfx, "%s/%s/%s", home, localshare, dwmdir) < 0) { - free(pathpfx); - return; - } - } - - /* check if the autostart script directory exists */ - if (! (stat(pathpfx, &sb) == 0 && S_ISDIR(sb.st_mode))) { - /* the XDG conformant path does not exist or is no directory - * so we try ~/.dwm instead - */ - char *pathpfx_new = realloc(pathpfx, strlen(home) + strlen(dwmdir) + 3); - if(pathpfx_new == NULL) { - free(pathpfx); - return; - } - pathpfx = pathpfx_new; - - if (sprintf(pathpfx, "%s/.%s", home, dwmdir) <= 0) { - free(pathpfx); - return; - } - } - - /* try the blocking script first */ - path = ecalloc(1, strlen(pathpfx) + strlen(autostartblocksh) + 2); - if (sprintf(path, "%s/%s", pathpfx, autostartblocksh) <= 0) { - free(path); - free(pathpfx); - } - - if (access(path, X_OK) == 0) - system(path); - - /* now the non-blocking script */ - if (sprintf(path, "%s/%s", pathpfx, autostartsh) <= 0) { - free(path); - free(pathpfx); - } - - if (access(path, X_OK) == 0) - system(strcat(path, " &")); - - free(pathpfx); - free(path); -} diff --git a/dwm/.dwm.old/patch/autostart.h b/dwm/.dwm.old/patch/autostart.h deleted file mode 100644 index db29377..0000000 --- a/dwm/.dwm.old/patch/autostart.h +++ /dev/null @@ -1,2 +0,0 @@ -static void runautostart(void); - diff --git a/dwm/.dwm.old/patch/bar.c b/dwm/.dwm.old/patch/bar.c deleted file mode 100644 index 65e1a69..0000000 --- a/dwm/.dwm.old/patch/bar.c +++ /dev/null @@ -1,39 +0,0 @@ -void -barhover(XEvent *e, Bar *bar) -{ - const BarRule *br; - Monitor *m = bar->mon; - XMotionEvent *ev = &e->xmotion; - BarArg barg = { 0, 0, 0, 0 }; - int r; - - for (r = 0; r < LENGTH(barrules); r++) { - br = &barrules[r]; - if (br->bar != bar->idx || (br->monitor == 'A' && m != selmon) || br->hoverfunc == NULL) - continue; - 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]) - continue; - - barg.x = ev->x - bar->x[r]; - barg.y = ev->y - bar->borderpx; - barg.w = bar->w[r]; - barg.h = bar->bh - 2 * bar->borderpx; - - br->hoverfunc(bar, &barg, ev); - break; - } -} - -Bar * -wintobar(Window win) -{ - Monitor *m; - Bar *bar; - for (m = mons; m; m = m->next) - for (bar = m->bar; bar; bar = bar->next) - if (bar->win == win) - return bar; - return NULL; -} diff --git a/dwm/.dwm.old/patch/bar.h b/dwm/.dwm.old/patch/bar.h deleted file mode 100644 index 3e006dc..0000000 --- a/dwm/.dwm.old/patch/bar.h +++ /dev/null @@ -1,2 +0,0 @@ -static void barhover(XEvent *e, Bar *bar); -static Bar *wintobar(Window win); diff --git a/dwm/.dwm.old/patch/bar_alpha.c b/dwm/.dwm.old/patch/bar_alpha.c deleted file mode 100644 index 465f6f2..0000000 --- a/dwm/.dwm.old/patch/bar_alpha.c +++ /dev/null @@ -1,43 +0,0 @@ - -static int useargb = 0; -static Visual *visual; -static int depth; -static Colormap cmap; - -void -xinitvisual() -{ - XVisualInfo *infos; - XRenderPictFormat *fmt; - int nitems; - int i; - - XVisualInfo tpl = { - .screen = screen, - .depth = 32, - .class = TrueColor - }; - long masks = VisualScreenMask | VisualDepthMask | VisualClassMask; - - infos = XGetVisualInfo(dpy, masks, &tpl, &nitems); - visual = NULL; - for (i = 0; i < nitems; i ++) { - fmt = XRenderFindVisualFormat(dpy, infos[i].visual); - if (fmt->type == PictTypeDirect && fmt->direct.alphaMask) { - visual = infos[i].visual; - depth = infos[i].depth; - cmap = XCreateColormap(dpy, root, visual, AllocNone); - useargb = 1; - break; - } - } - - XFree(infos); - - if (!visual) { - visual = DefaultVisual(dpy, screen); - depth = DefaultDepth(dpy, screen); - cmap = DefaultColormap(dpy, screen); - } -} - diff --git a/dwm/.dwm.old/patch/bar_alpha.h b/dwm/.dwm.old/patch/bar_alpha.h deleted file mode 100644 index 1c2a012..0000000 --- a/dwm/.dwm.old/patch/bar_alpha.h +++ /dev/null @@ -1,4 +0,0 @@ -#define OPAQUE 0xffU - -static void xinitvisual(); - diff --git a/dwm/.dwm.old/patch/bar_alternativetags.c b/dwm/.dwm.old/patch/bar_alternativetags.c deleted file mode 100644 index bc800f2..0000000 --- a/dwm/.dwm.old/patch/bar_alternativetags.c +++ /dev/null @@ -1,7 +0,0 @@ -void -togglealttag() -{ - selmon->alttag = !selmon->alttag; - drawbar(selmon); -} - diff --git a/dwm/.dwm.old/patch/bar_alternativetags.h b/dwm/.dwm.old/patch/bar_alternativetags.h deleted file mode 100644 index 0f7a25a..0000000 --- a/dwm/.dwm.old/patch/bar_alternativetags.h +++ /dev/null @@ -1,2 +0,0 @@ -static void togglealttag(); - diff --git a/dwm/.dwm.old/patch/bar_anybar.c b/dwm/.dwm.old/patch/bar_anybar.c deleted file mode 100644 index d9bdb27..0000000 --- a/dwm/.dwm.old/patch/bar_anybar.c +++ /dev/null @@ -1,94 +0,0 @@ -void -managealtbar(Window win, XWindowAttributes *wa) -{ - Monitor *m; - Bar *bar; - int i = 0; - if (!(m = recttomon(wa->x, wa->y, wa->width, wa->height))) - return; - for (bar = m->bar; bar && bar->win && bar->next; bar = bar->next); // find last bar - if (!bar) { - bar = m->bar = ecalloc(1, sizeof(Bar)); - bar->topbar = topbar; - } else if (bar && bar->win) { - i = bar->idx + 1; - bar->next = ecalloc(1, sizeof(Bar)); - #if BAR_ANYBAR_TOP_AND_BOTTOM_BARS_PATCH - bar->next->topbar = !bar->topbar; - #else - bar->next->topbar = topbar; - #endif // BAR_ANYBAR_TOP_AND_BOTTOM_BARS_PATCH - bar = bar->next; - } - bar->external = 1; - bar->showbar = 1; - bar->mon = m; - bar->idx = i; - bar->borderpx = 0; - bar->win = win; - bar->bw = wa->width; - bar->bh = wa->height; - updatebarpos(m); - arrange(m); - XSelectInput(dpy, win, EnterWindowMask|FocusChangeMask|PropertyChangeMask|StructureNotifyMask); - XMapWindow(dpy, win); - XMoveResizeWindow(dpy, bar->win, bar->bx, bar->by, bar->bw, bar->bh); - arrange(selmon); - XChangeProperty(dpy, root, netatom[NetClientList], XA_WINDOW, 32, PropModeAppend, - (unsigned char *) &win, 1); -} - -void -spawnbar() -{ - if (*altbarcmd) - system(altbarcmd); -} - -void -unmanagealtbar(Window w) -{ - Monitor *m = wintomon(w); - Bar *bar, *next, *prev = NULL; - - if (!m) - return; - - for (bar = m->bar; bar && bar->win; bar = next) { - next = bar->next; - if (bar->win == w) { - if (prev) - prev->next = next; - else - m->bar = next; - free(bar); - break; - } - prev = bar; - } - updatebarpos(m); - arrange(m); -} - -int -wmclasscontains(Window win, const char *class, const char *name) -{ - XClassHint ch = { NULL, NULL }; - int res = 1; - - if (XGetClassHint(dpy, win, &ch)) { - if (ch.res_name && strstr(ch.res_name, name) == NULL) - res = 0; - if (ch.res_class && strstr(ch.res_class, class) == NULL) - res = 0; - } else - res = 0; - - if (ch.res_class) - XFree(ch.res_class); - if (ch.res_name) - XFree(ch.res_name); - - return res; -} - diff --git a/dwm/.dwm.old/patch/bar_anybar.h b/dwm/.dwm.old/patch/bar_anybar.h deleted file mode 100644 index 980f5e2..0000000 --- a/dwm/.dwm.old/patch/bar_anybar.h +++ /dev/null @@ -1,5 +0,0 @@ -static void managealtbar(Window win, XWindowAttributes *wa); -static void spawnbar(); -static void unmanagealtbar(Window w); -static int wmclasscontains(Window win, const char *class, const char *name); - diff --git a/dwm/.dwm.old/patch/bar_awesomebar.c b/dwm/.dwm.old/patch/bar_awesomebar.c deleted file mode 100644 index c6fe8f1..0000000 --- a/dwm/.dwm.old/patch/bar_awesomebar.c +++ /dev/null @@ -1,123 +0,0 @@ -int -width_awesomebar(Bar *bar, BarArg *a) -{ - return a->w; -} - -int -draw_awesomebar(Bar *bar, BarArg *a) -{ - 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 - int x = a->x + lrpad / 2, w = a->w - lrpad / 2; - #elif BAR_TITLE_RIGHT_PAD_PATCH - int x = a->x, w = a->w - lrpad / 2; - #else - int x = a->x, w = a->w; - #endif // BAR_TITLE_LEFT_PAD_PATCH | BAR_TITLE_RIGHT_PAD_PATCH - - Client *c; - for (c = bar->mon->clients; c; c = c->next) - if (ISVISIBLE(c)) - n++; - - if (n > 0) { - remainder = w % n; - tabw = w / n; - for (i = 0, c = bar->mon->clients; c; c = c->next, i++) { - if (!ISVISIBLE(c)) - continue; - if (bar->mon->sel == c && HIDDEN(c)) - scm = SchemeHidSel; - else if (HIDDEN(c)) - scm = SchemeHidNorm; - else if (bar->mon->sel == c) - scm = SchemeTitleSel; - else - scm = SchemeTitleNorm; - - 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) - 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 - 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); - } - } - return n; -} - -int -click_awesomebar(Bar *bar, Arg *arg, BarArg *a) -{ - int x = 0, n = 0; - Client *c; - - for (c = bar->mon->clients; c; c = c->next) - if (ISVISIBLE(c)) - n++; - - c = bar->mon->clients; - - do { - if (!c || !ISVISIBLE(c)) - continue; - else - x += (1.0 / (double)n) * a->w; - } while (c && a->x > x && (c = c->next)); - - if (c) { - arg->v = c; - return ClkWinTitle; - } - return -1; -} - diff --git a/dwm/.dwm.old/patch/bar_awesomebar.h b/dwm/.dwm.old/patch/bar_awesomebar.h deleted file mode 100644 index 5ea51f6..0000000 --- a/dwm/.dwm.old/patch/bar_awesomebar.h +++ /dev/null @@ -1,4 +0,0 @@ -static int width_awesomebar(Bar *bar, BarArg *a); -static int draw_awesomebar(Bar *bar, BarArg *a); -static int click_awesomebar(Bar *bar, Arg *arg, BarArg *a); - diff --git a/dwm/.dwm.old/patch/bar_dwmblocks.c b/dwm/.dwm.old/patch/bar_dwmblocks.c deleted file mode 100644 index fe7880b..0000000 --- a/dwm/.dwm.old/patch/bar_dwmblocks.c +++ /dev/null @@ -1,51 +0,0 @@ -static int statussig; -pid_t statuspid = -1; - -pid_t -getstatusbarpid() -{ - char buf[32], *str = buf, *c; - FILE *fp; - - if (statuspid > 0) { - snprintf(buf, sizeof(buf), "/proc/%u/cmdline", statuspid); - if ((fp = fopen(buf, "r"))) { - fgets(buf, sizeof(buf), fp); - while ((c = strchr(str, '/'))) - str = c + 1; - fclose(fp); - if (!strcmp(str, STATUSBAR)) - return statuspid; - } - } - if (!(fp = popen("pgrep -o "STATUSBAR, "r"))) - return -1; - fgets(buf, sizeof(buf), fp); - pclose(fp); - return strtol(buf, NULL, 10); -} - -void -sigstatusbar(const Arg *arg) -{ - union sigval sv; - - if (!statussig) - return; - if ((statuspid = getstatusbarpid()) <= 0) - return; - - #if BAR_DWMBLOCKS_SIGUSR1_PATCH - sv.sival_int = (statussig << 8) | arg->i; - if (sigqueue(statuspid, SIGUSR1, sv) == -1) { - if (errno == ESRCH) { - if (!getstatusbarpid()) - sigqueue(statuspid, SIGUSR1, sv); - } - } - #else - sv.sival_int = arg->i; - sigqueue(statuspid, SIGRTMIN+statussig, sv); - #endif // BAR_DWMBLOCKS_SIGUSR1_PATCH -} - diff --git a/dwm/.dwm.old/patch/bar_dwmblocks.h b/dwm/.dwm.old/patch/bar_dwmblocks.h deleted file mode 100644 index 4db9467..0000000 --- a/dwm/.dwm.old/patch/bar_dwmblocks.h +++ /dev/null @@ -1,3 +0,0 @@ -static int getstatusbarpid(); -static void sigstatusbar(const Arg *arg); - diff --git a/dwm/.dwm.old/patch/bar_ewmhtags.c b/dwm/.dwm.old/patch/bar_ewmhtags.c deleted file mode 100644 index 46ee5e4..0000000 --- a/dwm/.dwm.old/patch/bar_ewmhtags.c +++ /dev/null @@ -1,52 +0,0 @@ -void -setcurrentdesktop(void) -{ - long data[] = { 0 }; - XChangeProperty(dpy, root, netatom[NetCurrentDesktop], XA_CARDINAL, 32, PropModeReplace, (unsigned char *)data, 1); -} - -void -setdesktopnames(void) -{ - int i; - XTextProperty text; - char *tags[NUMTAGS]; - for (i = 0; i < NUMTAGS; i++) - tags[i] = tagicon(selmon, i); - Xutf8TextListToTextProperty(dpy, tags, NUMTAGS, XUTF8StringStyle, &text); - XSetTextProperty(dpy, root, &text, netatom[NetDesktopNames]); -} - -void -setfloatinghint(Client *c) -{ - Atom target = XInternAtom(dpy, "_IS_FLOATING", 0); - unsigned int floating[1] = {c->isfloating}; - XChangeProperty(dpy, c->win, target, XA_CARDINAL, 32, PropModeReplace, (unsigned char *)floating, 1); -} - -void -setnumdesktops(void) -{ - long data[] = { NUMTAGS }; - XChangeProperty(dpy, root, netatom[NetNumberOfDesktops], XA_CARDINAL, 32, PropModeReplace, (unsigned char *)data, 1); -} - -void -setviewport(void) -{ - long data[] = { 0, 0 }; - XChangeProperty(dpy, root, netatom[NetDesktopViewport], XA_CARDINAL, 32, PropModeReplace, (unsigned char *)data, 2); -} - -void -updatecurrentdesktop(void) -{ - long rawdata[] = { selmon->tagset[selmon->seltags] }; - int i = 0; - while (*rawdata >> (i + 1)) { - i++; - } - long data[] = { i }; - XChangeProperty(dpy, root, netatom[NetCurrentDesktop], XA_CARDINAL, 32, PropModeReplace, (unsigned char *)data, 1); -} diff --git a/dwm/.dwm.old/patch/bar_ewmhtags.h b/dwm/.dwm.old/patch/bar_ewmhtags.h deleted file mode 100644 index 4d6a74b..0000000 --- a/dwm/.dwm.old/patch/bar_ewmhtags.h +++ /dev/null @@ -1,7 +0,0 @@ -static void setcurrentdesktop(void); -static void setdesktopnames(void); -static void setfloatinghint(Client *c); -static void setnumdesktops(void); -static void setviewport(void); -static void updatecurrentdesktop(void); - diff --git a/dwm/.dwm.old/patch/bar_fancybar.c b/dwm/.dwm.old/patch/bar_fancybar.c deleted file mode 100644 index 40a1883..0000000 --- a/dwm/.dwm.old/patch/bar_fancybar.c +++ /dev/null @@ -1,103 +0,0 @@ -int -width_fancybar(Bar *bar, BarArg *a) -{ - return a->w; -} - -int -draw_fancybar(Bar *bar, BarArg *a) -{ - 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; - - #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 - int x = a->x + lrpad / 2, w = a->w - lrpad / 2; - #elif BAR_TITLE_RIGHT_PAD_PATCH - int x = a->x, w = a->w - lrpad / 2; - #else - int x = a->x, w = a->w; - #endif // BAR_TITLE_LEFT_PAD_PATCH | BAR_TITLE_RIGHT_PAD_PATCH - - for (c = m->clients; c; c = c->next) { - if (ISVISIBLE(c)) - n++; - } - - if (n > 0) { - tabw = TEXTW(m->sel->name); - #if BAR_WINICON_PATCH - if (m->sel->icon) - tabw += m->sel->icw + ICONSPACING; - #endif // BAR_WINICON_PATCH - 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; - tabw = TEXTW(c->name); - #if BAR_WINICON_PATCH - if (c->icon) - tabw += c->icw + ICONSPACING; - #endif // BAR_WINICON_PATCH - if (tabw < mw) - ew += (mw - tabw); - else - i++; - } - - if (i > 0) - mw += ew / i; - - for (c = m->clients; c; c = c->next) { - if (!ISVISIBLE(c)) - continue; - 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]); - - XSetForeground(drw->dpy, drw->gc, drw->scheme[ColBg].pixel); - XFillRectangle(drw->dpy, drw->drawable, drw->gc, tx, a->y, tw, a->h); - - 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; - } - #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; -} - -int -click_fancybar(Bar *bar, Arg *arg, BarArg *a) -{ - return ClkWinTitle; -} - diff --git a/dwm/.dwm.old/patch/bar_fancybar.h b/dwm/.dwm.old/patch/bar_fancybar.h deleted file mode 100644 index 473cca3..0000000 --- a/dwm/.dwm.old/patch/bar_fancybar.h +++ /dev/null @@ -1,4 +0,0 @@ -static int width_fancybar(Bar *bar, BarArg *a); -static int draw_fancybar(Bar *bar, BarArg *a); -static int click_fancybar(Bar *bar, Arg *arg, BarArg *a); - diff --git a/dwm/.dwm.old/patch/bar_flexwintitle.c b/dwm/.dwm.old/patch/bar_flexwintitle.c deleted file mode 100644 index c8cd4b6..0000000 --- a/dwm/.dwm.old/patch/bar_flexwintitle.c +++ /dev/null @@ -1,482 +0,0 @@ -/* Flexwintitle properties, you can override these in your config.h if you want. */ -#ifndef FLEXWINTITLE_BORDERS -#define FLEXWINTITLE_BORDERS 1 // 0 = off, 1 = on -#endif -#ifndef FLEXWINTITLE_SHOWFLOATING -#define FLEXWINTITLE_SHOWFLOATING 0 // whether to show titles for floating windows, hidden clients are always shown -#endif -#ifndef FLEXWINTITLE_MASTERWEIGHT -#define FLEXWINTITLE_MASTERWEIGHT 9 // master weight compared to stack, hidden and floating window titles -#endif -#ifndef FLEXWINTITLE_STACKWEIGHT -#define FLEXWINTITLE_STACKWEIGHT 3 // stack weight compared to master, hidden and floating window titles -#endif -#ifndef FLEXWINTITLE_HIDDENWEIGHT -#define FLEXWINTITLE_HIDDENWEIGHT 1 // hidden window title weight -#endif -#ifndef FLEXWINTITLE_FLOATWEIGHT -#define FLEXWINTITLE_FLOATWEIGHT 1 // floating window title weight, set to 0 to not show floating windows -#endif - -#define SCHEMEFOR(c) getschemefor(m, c, groupactive == c) - -enum { GRP_NOSELECTION, GRP_MASTER, GRP_STACK1, GRP_STACK2, GRP_FLOAT, GRP_HIDDEN }; - -int -width_flexwintitle(Bar *bar, BarArg *a) -{ - return a->w; -} - -int -draw_flexwintitle(Bar *bar, BarArg *a) -{ - drw_rect(drw, a->x, a->y, a->w, a->h, 1, 1); - return flextitlecalculate(bar->mon, a->x, a->w, -1, flextitledraw, NULL, a); -} - -int -click_flexwintitle(Bar *bar, Arg *arg, BarArg *a) -{ - flextitlecalculate(bar->mon, 0, a->w, a->x, flextitleclick, arg, a); - return ClkWinTitle; -} - -Client * -flextitledrawarea(Monitor *m, Client *c, int x, int r, int w, int max_clients, int scheme, int draw_tiled, int draw_hidden, int draw_floating, - int passx, void(*tabfn)(Monitor *, Client *, int, int, int, int, Arg *arg, BarArg *barg), Arg *arg, BarArg *barg) -{ - int i; - for (i = 0; c && i < max_clients; c = c->next) { - if ( - ISVISIBLE(c) && - ( - (draw_tiled && !c->isfloating && !HIDDEN(c)) || - (draw_floating && c->isfloating && !HIDDEN(c)) || - (draw_hidden && HIDDEN(c)) - ) - ) { - tabfn(m, c, passx, x, w + (i < r ? 1 : 0), scheme, arg, barg); - x += w + (i < r ? 1 : 0); - i++; - } - } - return c; -} - -int -getschemefor(Monitor *m, int group, int activegroup) -{ - switch (group) { - case GRP_NOSELECTION: - case GRP_MASTER: - case GRP_STACK1: - case GRP_STACK2: - #if BSTACK_LAYOUT - if (m->lt[m->sellt]->arrange == &bstack) - return (activegroup ? SchemeFlexActLTR : SchemeFlexInaLTR); - #endif // BSTACK_LAYOUT - #if BSTACKHORIZ_LAYOUT - if (m->lt[m->sellt]->arrange == &bstackhoriz) { - if (group == GRP_MASTER) - return (activegroup ? SchemeFlexActLTR : SchemeFlexInaLTR); - else - return (activegroup ? SchemeFlexActTTB : SchemeFlexInaTTB); - } - #endif // BSTACKHORIZ_LAYOUT - #if CENTEREDMASTER_LAYOUT - if (m->lt[m->sellt]->arrange == ¢eredmaster) - return (activegroup ? SchemeFlexActTTB : SchemeFlexInaTTB); - #endif // CENTEREDMASTER_LAYOUT - #if CENTEREDFLOATINGMASTER_LAYOUT - if (m->lt[m->sellt]->arrange == ¢eredfloatingmaster) - return (activegroup ? SchemeFlexActLTR : SchemeFlexInaLTR); - #endif // CENTEREDFLOATINGMASTER_LAYOUT - #if COLUMNS_LAYOUT - if (m->lt[m->sellt]->arrange == &col) { - if (group == GRP_MASTER) - return (activegroup ? SchemeFlexActLTR : SchemeFlexInaLTR); - else - return (activegroup ? SchemeFlexActTTB : SchemeFlexInaTTB); - } - #endif // COLUMNS_LAYOUT - #if DECK_LAYOUT - if (m->lt[m->sellt]->arrange == &deck) { - if (group == GRP_MASTER) - return (activegroup ? SchemeFlexActTTB : SchemeFlexInaTTB); - else - return (activegroup ? SchemeFlexActMONO : SchemeFlexInaMONO); - } - #endif // DECK_LAYOUT - #if FIBONACCI_DWINDLE_LAYOUT - if (m->lt[m->sellt]->arrange == &dwindle) - return (activegroup ? SchemeFlexActDWDL : SchemeFlexInaDWDL); - #endif // FIBONACCI_DWINDLE_LAYOUT - #if FIBONACCI_SPIRAL_LAYOUT - if (m->lt[m->sellt]->arrange == &spiral) - return (activegroup ? SchemeFlexActSPRL : SchemeFlexInaSPRL); - #endif // FIBONACCI_SPIRAL_LAYOUT - #if FLEXTILE_DELUXE_LAYOUT - if (m->lt[m->sellt]->arrange == &flextile) - return (activegroup ? SchemeFlexActTTB + m->ltaxis[group] : SchemeFlexInaTTB + m->ltaxis[group]); - #endif // FLEXTILE_DELUXE_LAYOUT - #if GAPPLESSGRID_LAYOUT - if (m->lt[m->sellt]->arrange == &gaplessgrid) - return (activegroup ? SchemeFlexActGRID : SchemeFlexInaGRID); - #endif // GAPPLESSGRID_LAYOUT - #if GRIDMODE_LAYOUT - if (m->lt[m->sellt]->arrange == &grid) - return (activegroup ? SchemeFlexActGRDM : SchemeFlexInaGRDM); - #endif // GRIDMODE_LAYOUT - #if HORIZGRID_LAYOUT - if (m->lt[m->sellt]->arrange == &horizgrid) - return (activegroup ? SchemeFlexActHGRD : SchemeFlexInaHGRD); - #endif // HORIZGRID_LAYOUT - #if NROWGRID_LAYOUT - if (m->lt[m->sellt]->arrange == &nrowgrid) - return (activegroup ? SchemeFlexActGRD1 : SchemeFlexInaGRD1); - #endif // NROWGRID_LAYOUT - #if TILE_LAYOUT - if (m->lt[m->sellt]->arrange == &tile) - return (activegroup ? SchemeFlexActTTB : SchemeFlexInaTTB); - #endif // TILE_LAYOUT - #if MONOCLE_LAYOUT - if (m->lt[m->sellt]->arrange == &monocle) - return (activegroup ? SchemeFlexActMONO : SchemeFlexInaMONO); - #endif // MONOCLE_LAYOUT - return SchemeTitleNorm; - case GRP_HIDDEN: - return SchemeHidNorm; - case GRP_FLOAT: - return (activegroup ? SchemeFlexActFloat : SchemeFlexInaFloat); - } - return SchemeTitleNorm; -} - -int -getselschemefor(int scheme) -{ - if (scheme == SchemeFlexActFloat || scheme == SchemeFlexInaFloat) - return SchemeFlexSelFloat; - if (scheme >= SchemeFlexInaTTB) - return scheme + SchemeFlexInaTTB - SchemeFlexActTTB; - if (scheme >= SchemeFlexActTTB) - return scheme + SchemeFlexSelTTB - SchemeFlexActTTB; - return SchemeTitleSel; -} - -void -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; - 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 = ( - #if RENAMED_SCRATCHPADS_PATCH - c->scratchkey != 0 && c == selmon->sel - ? SchemeScratchSel - : c->scratchkey != 0 - ? SchemeScratchNorm - : - #endif // RENAMED_SCRATCHPADS_PATCH - c == selmon->sel && HIDDEN(c) - ? SchemeHidSel - : HIDDEN(c) - ? SchemeHidNorm - : c == selmon->sel - ? getselschemefor(tabscheme) - : c->isurgent - ? SchemeUrg - : tabscheme - ); - - drw_setscheme(drw, scheme[clientscheme]); - XSetWindowBorder(dpy, c->win, scheme[clientscheme][ColBorder].pixel); - - 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 - 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(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, 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) - nviewtags++; - if ((c->tags >> i) & 1) - nclienttags++; - } - - if (TAGSINDICATOR == 2 || nclienttags > 1 || nviewtags > 1) - drawindicator(m, c, 1, x, a->y, w, a->h, 0, 0, 0, INDICATOR_RIGHT_TAGS); -} - -#ifndef HIDDEN -#define HIDDEN(C) 0 -#endif - -void -flextitleclick(Monitor *m, Client *c, int passx, int x, int w, int unused, Arg *arg, BarArg *barg) -{ - if (passx >= x && passx <= x + w) - arg->v = c; -} - -int -flextitlecalculate( - Monitor *m, int offx, int tabw, int passx, - void(*tabfn)(Monitor *, Client *, int, int, int, int, Arg *arg, BarArg *barg), - Arg *arg, BarArg *barg -) { - Client *c; - int n, center = 0, mirror = 0, fixed = 0; // layout configuration - int clientsnmaster = 0, clientsnstack = 0, clientsnfloating = 0, clientsnhidden = 0; - int i, w, r, num = 0, den, fulllayout = 0; - int clientsnstack2 = 0; - int groupactive = 0; - int selidx = 0; - int dualstack = 0; - int rw, rr; - - int mas_x = offx, st1_x = offx, st2_x = offx, hid_x = offx, flt_x = offx; - int mas_w, st1_w, st2_w, hid_w; - - for (i = 0, c = m->clients; c; c = c->next) { - if (!ISVISIBLE(c)) - continue; - if (HIDDEN(c)) { - if (FLEXWINTITLE_HIDDENWEIGHT) - clientsnhidden++; - continue; - } - - if (c->isfloating) { - if (FLEXWINTITLE_FLOATWEIGHT) - clientsnfloating++; - continue; - } - - if (m->sel == c) - selidx = i; - - if (i < m->nmaster) - clientsnmaster++; - #if FLEXTILE_DELUXE_LAYOUT - else if (m->nstack) { - if (clientsnstack < m->nstack) - clientsnstack++; - else - clientsnstack2++; - } - #endif // FLEXTILE_DELUXE_LAYOUT - else if ((i - m->nmaster) % 2) - clientsnstack2++; - else - clientsnstack++; - i++; - } - - if (!m->sel) - groupactive = GRP_NOSELECTION; - else if (HIDDEN(m->sel)) - groupactive = GRP_HIDDEN; - else if (m->sel->isfloating) - groupactive = GRP_FLOAT; - else if (selidx < clientsnmaster) - groupactive = GRP_MASTER; - else if (selidx < clientsnmaster + clientsnstack) - groupactive = GRP_STACK1; - else if (selidx < clientsnmaster + clientsnstack + clientsnstack2) - groupactive = GRP_STACK2; - - n = clientsnmaster + clientsnstack + clientsnstack2 + clientsnfloating + clientsnhidden; - if (n == 0) - return 0; - #if FLEXTILE_DELUXE_LAYOUT - else if (m->lt[m->sellt]->arrange == &flextile) { - int layout = m->ltaxis[LAYOUT]; - if (layout < 0) { - mirror = 1; - layout *= -1; - } - if (layout > FLOATING_MASTER) { - layout -= FLOATING_MASTER; - fixed = 1; - } - - if (layout == SPLIT_HORIZONTAL_DUAL_STACK || layout == SPLIT_HORIZONTAL_DUAL_STACK_FIXED) - dualstack = 1; - else if (layout == SPLIT_CENTERED_VERTICAL && (fixed || n - m->nmaster > 1)) - center = 1; - else if (layout == FLOATING_MASTER) - center = 1; - else if (layout == SPLIT_CENTERED_HORIZONTAL) { - if (fixed || n - m->nmaster > 1) - center = 1; - } - } - #endif // FLEXTILE_DELUXE_LAYOUT - #if CENTEREDMASTER_LAYOUT - else if (m->lt[m->sellt]->arrange == ¢eredmaster && (fixed || n - m->nmaster > 1)) - center = 1; - #endif // CENTEREDMASTER_LAYOUT - #if CENTEREDFLOATINGMASTER_LAYOUT - else if (m->lt[m->sellt]->arrange == ¢eredfloatingmaster) - center = 1; - #endif // CENTEREDFLOATINGMASTER_LAYOUT - - /* Certain layouts have no master / stack areas */ - if (!m->lt[m->sellt]->arrange // floating layout - || (!n || (!fixed && m->nmaster && n <= m->nmaster)) // no master - #if MONOCLE_LAYOUT - || m->lt[m->sellt]->arrange == &monocle - #endif // MONOCLE_LAYOUT - #if GRIDMODE_LAYOUT - || m->lt[m->sellt]->arrange == &grid - #endif // GRIDMODE_LAYOUT - #if HORIZGRID_LAYOUT - || m->lt[m->sellt]->arrange == &horizgrid - #endif // HORIZGRID_LAYOUT - #if GAPPLESSGRID_LAYOUT - || m->lt[m->sellt]->arrange == &gaplessgrid - #endif // GAPPLESSGRID_LAYOUT - #if NROWGRID_LAYOUT - || m->lt[m->sellt]->arrange == &nrowgrid - #endif // NROWGRID_LAYOUT - #if FLEXTILE_DELUXE_LAYOUT - || (m->lt[m->sellt]->arrange == &flextile && m->ltaxis[LAYOUT] == NO_SPLIT) - #endif // FLEXTILE_DELUXE_LAYOUT - ) - fulllayout = 1; - - num = tabw; - c = m->clients; - - /* floating mode */ - if ((fulllayout && FLEXWINTITLE_FLOATWEIGHT > 0) || clientsnmaster + clientsnstack == 0 || !m->lt[m->sellt]->arrange) { - den = clientsnmaster + clientsnstack + clientsnstack2 + clientsnfloating + clientsnhidden; - w = num / den; - r = num % den; // rest - c = flextitledrawarea(m, c, mas_x, r, w, den, !m->lt[m->sellt]->arrange ? SchemeFlexActFloat : SCHEMEFOR(GRP_MASTER), 1, FLEXWINTITLE_HIDDENWEIGHT, FLEXWINTITLE_FLOATWEIGHT, passx, tabfn, arg, barg); // floating - /* no master and stack mode, e.g. monocole, grid layouts, fibonacci */ - } else if (fulllayout) { - den = clientsnmaster + clientsnstack + clientsnstack2 + clientsnhidden; - w = num / den; - r = num % den; // rest - c = flextitledrawarea(m, c, mas_x, r, w, den, SCHEMEFOR(GRP_MASTER), 1, FLEXWINTITLE_HIDDENWEIGHT, 0, passx, tabfn, arg, barg); // full - /* tiled mode */ - } else { - den = clientsnmaster * FLEXWINTITLE_MASTERWEIGHT + (clientsnstack + clientsnstack2) * FLEXWINTITLE_STACKWEIGHT + clientsnfloating * FLEXWINTITLE_FLOATWEIGHT + clientsnhidden * FLEXWINTITLE_HIDDENWEIGHT; - w = num / den; // weight width per client - r = num % den; // weight rest width - rw = r / n; // rest incr per client - rr = r % n; // rest rest - #if FLEXTILE_DELUXE_LAYOUT - if ((!center && !dualstack) || (center && n <= m->nmaster + (m->nstack ? m->nstack : 1))) - #else - if ((!center && !dualstack) || (center && n <= m->nmaster + 1)) - #endif // FLEXTILE_DELUXE_LAYOUT - { - clientsnstack += clientsnstack2; - clientsnstack2 = 0; - if (groupactive == GRP_STACK2) - groupactive = GRP_STACK1; - } - - mas_w = clientsnmaster * rw + w * clientsnmaster * FLEXWINTITLE_MASTERWEIGHT + (rr > 0 ? MIN(rr, clientsnmaster) : 0); - rr -= clientsnmaster; - st1_w = clientsnstack * (rw + w * FLEXWINTITLE_STACKWEIGHT) + (rr > 0 ? MIN(rr, clientsnstack) : 0); - rr -= clientsnstack; - st2_w = clientsnstack2 * (rw + w * FLEXWINTITLE_STACKWEIGHT) + (rr > 0 ? MIN(rr, clientsnstack2) : 0); - rr -= clientsnstack2; - hid_w = clientsnhidden * (rw + w * FLEXWINTITLE_HIDDENWEIGHT) + (rr > 0 ? MIN(rr, clientsnhidden) : 0); - rr -= clientsnhidden; - rr = r % n; - - if (mirror) { - if (center && clientsnstack2) { - mas_x = st1_x + st1_w; - st2_x = mas_x + mas_w; - hid_x = st2_x + st2_w; - } else { - if (clientsnstack2) { - st2_x = st1_x + st1_w; - mas_x = st2_x + st2_w; - } else - mas_x = st1_x + st1_w; - hid_x = mas_x + mas_w; - } - } else { - if (center && clientsnstack2) { - mas_x = st2_x + st2_w; - st1_x = mas_x + mas_w; - hid_x = st1_x + st1_w; - } else { - st1_x = mas_x + mas_w; - if (clientsnstack2) { - st2_x = st1_x + st1_w; - hid_x = st2_x + st2_w; - } else - hid_x = st1_x + st1_w; - } - } - - flt_x = hid_x + hid_w; - c = flextitledrawarea(m, c, mas_x, rr, w * FLEXWINTITLE_MASTERWEIGHT + rw, clientsnmaster, SCHEMEFOR(GRP_MASTER), 1, 0, 0, passx, tabfn, arg, barg); // master - rr -= clientsnmaster; - c = flextitledrawarea(m, c, st1_x, rr, w * FLEXWINTITLE_STACKWEIGHT + rw, clientsnstack, SCHEMEFOR(GRP_STACK1), 1, 0, 0, passx, tabfn, arg, barg); // stack1 - rr -= clientsnstack; - if (clientsnstack2) { - c = flextitledrawarea(m, c, st2_x, rr, w * FLEXWINTITLE_STACKWEIGHT + rw, clientsnstack2, SCHEMEFOR(GRP_STACK2), 1, 0, 0, passx, tabfn, arg, barg); // stack2 - rr -= clientsnstack2; - } - c = flextitledrawarea(m, m->clients, hid_x, rr, w * FLEXWINTITLE_HIDDENWEIGHT + rw, clientsnhidden, SCHEMEFOR(GRP_HIDDEN), 0, 1, 0, passx, tabfn, arg, barg); // hidden - rr -= clientsnhidden; - c = flextitledrawarea(m, m->clients, flt_x, rr, w * FLEXWINTITLE_FLOATWEIGHT + rw, clientsnfloating, SCHEMEFOR(GRP_FLOAT), 0, 0, 1, passx, tabfn, arg, barg); // floating - } - return 1; -} - diff --git a/dwm/.dwm.old/patch/bar_flexwintitle.h b/dwm/.dwm.old/patch/bar_flexwintitle.h deleted file mode 100644 index f4c6612..0000000 --- a/dwm/.dwm.old/patch/bar_flexwintitle.h +++ /dev/null @@ -1,11 +0,0 @@ -static int width_flexwintitle(Bar *bar, BarArg *a); -static int draw_flexwintitle(Bar *bar, BarArg *a); -static int click_flexwintitle(Bar *bar, Arg *arg, BarArg *a); - -static void flextitledraw(Monitor *m, Client *c, int unused, int x, int w, int groupactive, Arg *arg, BarArg *barg); -static void flextitleclick(Monitor *m, Client *c, int passx, int x, int w, int unused, Arg *arg, BarArg *barg); -static int flextitlecalculate(Monitor *m, int offx, int w, int passx, void(*tabfn)(Monitor *, Client *, int, int, int, int, Arg *arg, BarArg *barg), Arg *arg, BarArg *barg); -static int getschemefor(Monitor *m, int group, int activegroup); -static int getselschemefor(int scheme); -static Client *flextitledrawarea(Monitor *m, Client *c, int x, int r, int w, int max_clients, int tabscheme, int draw_tiled, int draw_hidden, int draw_floating, int passx, void(*tabfn)(Monitor *, Client *, int, int, int, int, Arg *arg, BarArg *barg), Arg *arg, BarArg *barg); - diff --git a/dwm/.dwm.old/patch/bar_holdbar.c b/dwm/.dwm.old/patch/bar_holdbar.c deleted file mode 100644 index 7597a38..0000000 --- a/dwm/.dwm.old/patch/bar_holdbar.c +++ /dev/null @@ -1,43 +0,0 @@ -void -holdbar(const Arg *arg) -{ - if (selmon->showbar) - return; - Bar *bar; - selmon->showbar = 2; - 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 -keyrelease(XEvent *e) -{ - Bar *bar; - if (XEventsQueued(dpy, QueuedAfterReading)) { - XEvent ne; - XPeekEvent(dpy, &ne); - - if (ne.type == KeyPress && ne.xkey.time == e->xkey.time && - ne.xkey.keycode == e->xkey.keycode) { - XNextEvent(dpy, &ne); - return; - } - } - if (e->xkey.keycode == XKeysymToKeycode(dpy, HOLDKEY) && selmon->showbar == 2) { - selmon->showbar = 0; - 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 - combo = 0; - #endif // COMBO_PATCH -} - diff --git a/dwm/.dwm.old/patch/bar_holdbar.h b/dwm/.dwm.old/patch/bar_holdbar.h deleted file mode 100644 index bcde089..0000000 --- a/dwm/.dwm.old/patch/bar_holdbar.h +++ /dev/null @@ -1,3 +0,0 @@ -static void keyrelease(XEvent *e); -static void holdbar(const Arg *arg); - diff --git a/dwm/.dwm.old/patch/bar_indicators.c b/dwm/.dwm.old/patch/bar_indicators.c deleted file mode 100644 index 62326bc..0000000 --- a/dwm/.dwm.old/patch/bar_indicators.c +++ /dev/null @@ -1,111 +0,0 @@ -/* Indicator properties, you can override these in your config.h if you want. */ -#ifndef TAGSINDICATOR -#define TAGSINDICATOR 1 // 0 = off, 1 = on if >1 client/view tag, 2 = always on -#endif -#ifndef TAGSPX -#define TAGSPX 5 // # pixels for tag grid boxes -#endif -#ifndef TAGSROWS -#define TAGSROWS 3 // # rows in tag grid (9 tags, e.g. 3x3) -#endif - -void -drawindicator(Monitor *m, Client *c, unsigned int occ, int x, int y, int w, int h, unsigned int tag, int filled, int invert, int type) -{ - int i, boxw, boxs, indn = 0; - if (!(occ & 1 << tag) || type == INDICATOR_NONE) - return; - - boxs = drw->fonts->h / 9; - boxw = drw->fonts->h / 6 + 2; - if (filled == -1) - filled = m == selmon && m->sel && m->sel->tags & 1 << tag; - - switch (type) { - default: - case INDICATOR_TOP_LEFT_SQUARE: - drw_rect(drw, x + boxs, y + boxs, boxw, boxw, filled, invert); - break; - case INDICATOR_TOP_LEFT_LARGER_SQUARE: - drw_rect(drw, x + boxs + 2, y + boxs+1, boxw+1, boxw+1, filled, invert); - break; - case INDICATOR_TOP_BAR: - drw_rect(drw, x + boxw, y, w - ( 2 * boxw + 1), boxw/2, filled, invert); - break; - case INDICATOR_TOP_BAR_SLIM: - drw_rect(drw, x + boxw, y, w - ( 2 * boxw + 1), 1, 0, invert); - break; - case INDICATOR_BOTTOM_BAR: - drw_rect(drw, x + boxw, y + h - boxw/2, w - ( 2 * boxw + 1), boxw/2, filled, invert); - break; - case INDICATOR_BOTTOM_BAR_SLIM: - drw_rect(drw, x + boxw, y + h - 1, w - ( 2 * boxw + 1), 1, 0, invert); - break; - case INDICATOR_BOX: - drw_rect(drw, x + boxw, y, w - 2 * boxw, h, 0, invert); - break; - case INDICATOR_BOX_WIDER: - drw_rect(drw, x + boxw/2, y, w - boxw, h, 0, invert); - break; - case INDICATOR_BOX_FULL: - drw_rect(drw, x, y, w - 2, h, 0, invert); - break; - case INDICATOR_CLIENT_DOTS: - for (c = m->clients; c; c = c->next) { - if (c->tags & (1 << tag)) { - drw_rect(drw, x, 1 + (indn * 2), m->sel == c ? 6 : 1, 1, 1, invert); - indn++; - } - if (h <= 1 + (indn * 2)) { - indn = 0; - x += 2; - } - } - break; - case INDICATOR_RIGHT_TAGS: - if (!c) - break; - for (i = 0; i < NUMTAGS; i++) { - drw_rect(drw, - ( x + w - 2 - ((NUMTAGS / TAGSROWS) * TAGSPX) - - (i % (NUMTAGS/TAGSROWS)) + ((i % (NUMTAGS / TAGSROWS)) * TAGSPX) - ), - ( y + 2 + ((i / (NUMTAGS/TAGSROWS)) * TAGSPX) - - ((i / (NUMTAGS/TAGSROWS))) - ), - TAGSPX, TAGSPX, (c->tags >> i) & 1, 0 - ); - } - break; - case INDICATOR_PLUS_AND_LARGER_SQUARE: - boxs += 2; - boxw += 2; - /* falls through */ - case INDICATOR_PLUS_AND_SQUARE: - drw_rect(drw, x + boxs, y + boxs, boxw % 2 ? boxw : boxw + 1, boxw % 2 ? boxw : boxw + 1, filled, invert); - /* falls through */ - case INDICATOR_PLUS: - if (!(boxw % 2)) - boxw += 1; - drw_rect(drw, x + boxs + boxw / 2, y + boxs, 1, boxw, filled, invert); // | - drw_rect(drw, x + boxs, y + boxs + boxw / 2, boxw + 1, 1, filled, invert); // ‒ - break; - } -} - -void -drawstateindicator(Monitor *m, Client *c, unsigned int occ, int x, int y, int w, int h, unsigned int tag, int filled, int invert) -{ - #if FAKEFULLSCREEN_CLIENT_PATCH && !FAKEFULLSCREEN_PATCH - if (c->fakefullscreen && c->isfloating) - drawindicator(m, c, occ, x, y, w, h, tag, filled, invert, floatfakefsindicatortype); - else if (c->fakefullscreen) - drawindicator(m, c, occ, x, y, w, h, tag, filled, invert, fakefsindicatortype); - else - #endif // FAKEFULLSCREEN_CLIENT_PATCH - if (c->isfloating) - drawindicator(m, c, occ, x, y, w, h, tag, filled, invert, floatindicatortype); - else - drawindicator(m, c, occ, x, y, w, h, tag, filled, invert, tiledindicatortype); -} - diff --git a/dwm/.dwm.old/patch/bar_indicators.h b/dwm/.dwm.old/patch/bar_indicators.h deleted file mode 100644 index c66e4f0..0000000 --- a/dwm/.dwm.old/patch/bar_indicators.h +++ /dev/null @@ -1,21 +0,0 @@ -enum { - INDICATOR_NONE, - INDICATOR_TOP_LEFT_SQUARE, - INDICATOR_TOP_LEFT_LARGER_SQUARE, - INDICATOR_TOP_BAR, - INDICATOR_TOP_BAR_SLIM, - INDICATOR_BOTTOM_BAR, - INDICATOR_BOTTOM_BAR_SLIM, - INDICATOR_BOX, - INDICATOR_BOX_WIDER, - INDICATOR_BOX_FULL, - INDICATOR_CLIENT_DOTS, - INDICATOR_RIGHT_TAGS, - INDICATOR_PLUS, - INDICATOR_PLUS_AND_SQUARE, - INDICATOR_PLUS_AND_LARGER_SQUARE, -}; - -static void drawindicator(Monitor *m, Client *c, unsigned int occ, int x, int y, int w, int h, unsigned int tag, int filled, int invert, int type); -static void drawstateindicator(Monitor *m, Client *c, unsigned int occ, int x, int y, int w, int h, unsigned int tag, int filled, int invert); - diff --git a/dwm/.dwm.old/patch/bar_layoutmenu.c b/dwm/.dwm.old/patch/bar_layoutmenu.c deleted file mode 100644 index 1b95069..0000000 --- a/dwm/.dwm.old/patch/bar_layoutmenu.c +++ /dev/null @@ -1,18 +0,0 @@ -void -layoutmenu(const Arg *arg) { - FILE *p; - char c[3], *s; - int i; - - if (!(p = popen(layoutmenu_cmd, "r"))) - return; - s = fgets(c, sizeof(c), p); - pclose(p); - - if (!s || *s == '\0' || c == '\0') - return; - - i = atoi(c); - setlayout(&((Arg) { .v = &layouts[i] })); -} - diff --git a/dwm/.dwm.old/patch/bar_layoutmenu.h b/dwm/.dwm.old/patch/bar_layoutmenu.h deleted file mode 100644 index d05455c..0000000 --- a/dwm/.dwm.old/patch/bar_layoutmenu.h +++ /dev/null @@ -1,2 +0,0 @@ -static void layoutmenu(const Arg *arg); - diff --git a/dwm/.dwm.old/patch/bar_ltsymbol.c b/dwm/.dwm.old/patch/bar_ltsymbol.c deleted file mode 100644 index 1fbd1b8..0000000 --- a/dwm/.dwm.old/patch/bar_ltsymbol.c +++ /dev/null @@ -1,18 +0,0 @@ -int -width_ltsymbol(Bar *bar, BarArg *a) -{ - return TEXTW(bar->mon->ltsymbol); -} - -int -draw_ltsymbol(Bar *bar, BarArg *a) -{ - return drw_text(drw, a->x, a->y, a->w, a->h, lrpad / 2, bar->mon->ltsymbol, 0, False); -} - -int -click_ltsymbol(Bar *bar, Arg *arg, BarArg *a) -{ - return ClkLtSymbol; -} - diff --git a/dwm/.dwm.old/patch/bar_ltsymbol.h b/dwm/.dwm.old/patch/bar_ltsymbol.h deleted file mode 100644 index 4de5720..0000000 --- a/dwm/.dwm.old/patch/bar_ltsymbol.h +++ /dev/null @@ -1,4 +0,0 @@ -static int width_ltsymbol(Bar *bar, BarArg *a); -static int draw_ltsymbol(Bar *bar, BarArg *a); -static int click_ltsymbol(Bar *bar, Arg *arg, BarArg *a); - diff --git a/dwm/.dwm.old/patch/bar_powerline_status.c b/dwm/.dwm.old/patch/bar_powerline_status.c deleted file mode 100644 index a09487f..0000000 --- a/dwm/.dwm.old/patch/bar_powerline_status.c +++ /dev/null @@ -1,122 +0,0 @@ -static Clr **statusscheme; - -int -width_pwrl_status(Bar *bar, BarArg *a) -{ - #if BAR_STATUSCMD_PATCH - return widthpowerlinestatus(rawstext); - #else - return widthpowerlinestatus(stext); - #endif // BAR_STATUSCMD_PATCH -} - -#if BAR_EXTRASTATUS_PATCH -int -width_pwrl_status_es(Bar *bar, BarArg *a) -{ - #if BAR_STATUSCMD_PATCH - return widthpowerlinestatus(rawestext); - #else - return widthpowerlinestatus(estext); - #endif // BAR_STATUSCMD_PATCH -} -#endif // BAR_EXTRASTATUS_PATCH - -int -draw_pwrl_status(Bar *bar, BarArg *a) -{ - #if BAR_STATUSCMD_PATCH - return drawpowerlinestatus(a->x + a->w, rawstext, a); - #else - return drawpowerlinestatus(a->x + a->w, stext, a); - #endif // BAR_STATUSCMD_PATCH -} - -#if BAR_EXTRASTATUS_PATCH -int -draw_pwrl_status_es(Bar *bar, BarArg *a) -{ - #if BAR_STATUSCMD_PATCH - return drawpowerlinestatus(a->x + a->w, rawestext, a); - #else - return drawpowerlinestatus(a->x + a->w, estext, a); - #endif // BAR_STATUSCMD_PATCH -} -#endif // BAR_EXTRASTATUS_PATCH - -int -click_pwrl_status(Bar *bar, Arg *arg, BarArg *a) -{ - return ClkStatusText; -} - -int -widthpowerlinestatus(char *stext) -{ - char status[512]; - int w = 0, i, n = strlen(stext); - int plw = drw->fonts->h / 2 + 1; - char *bs, bp = '|'; - strcpy(status, stext); - - for (i = n, bs = &status[n-1]; i >= 0; i--, bs--) { - if (*bs == '<' || *bs == '/' || *bs == '\\' || *bs == '>' || *bs == '|') { /* block start */ - if (bp != '|') - w += plw; - w += TEXTW(bs+2); - bp = *bs; - *bs = 0; - } - } - if (bp != '|') - w += plw * 2; - - return w; -} - -int -drawpowerlinestatus(int xpos, char *stext, BarArg *barg) -{ - char status[512]; - int i, n = strlen(stext), cn = 0; - int x = xpos, w = 0; - int plw = drw->fonts->h / 2 + 1; - char *bs, bp = '|'; - Clr *prevscheme = statusscheme[0], *nxtscheme; - strcpy(status, stext); - - for (i = n, bs = &status[n-1]; i >= 0; i--, bs--) { - if (*bs == '<' || *bs == '/' || *bs == '\\' || *bs == '>' || *bs == '|') { /* block start */ - cn = ((int) *(bs+1)) - 1; - - if (cn < LENGTH(statuscolors)) { - drw_settrans(drw, prevscheme, (nxtscheme = statusscheme[cn])); - } else { - drw_settrans(drw, prevscheme, (nxtscheme = statusscheme[0])); - } - - if (bp != '|') { - drw_arrow(drw, x - plw, barg->y, plw, barg->h, bp == '\\' || bp == '>' ? 1 : 0, bp == '<' ? 0 : 1); - x -= plw; - } - - drw_setscheme(drw, nxtscheme); - w = TEXTW(bs+2); - drw_text(drw, x - w, barg->y, w, barg->h, lrpad / 2, bs+2, 0, False); - x -= w; - - bp = *bs; - *bs = 0; - prevscheme = nxtscheme; - } - } - if (bp != '|') { - drw_settrans(drw, prevscheme, scheme[SchemeNorm]); - drw_arrow(drw, x - plw, barg->y, plw, barg->h, bp == '\\' || bp == '>' ? 1 : 0, bp == '<' ? 0 : 1); - drw_rect(drw, x - 2 * plw, barg->y, plw, barg->h, 1, 1); - x -= plw * 2; - } - - return xpos - x; -} - diff --git a/dwm/.dwm.old/patch/bar_powerline_status.h b/dwm/.dwm.old/patch/bar_powerline_status.h deleted file mode 100644 index 46b78e0..0000000 --- a/dwm/.dwm.old/patch/bar_powerline_status.h +++ /dev/null @@ -1,12 +0,0 @@ -static int width_pwrl_status(Bar *bar, BarArg *a); -#if BAR_EXTRASTATUS_PATCH -static int width_pwrl_status_es(Bar *bar, BarArg *a); -#endif // BAR_EXTRASTATUS_PATCH -static int draw_pwrl_status(Bar *bar, BarArg *a); -#if BAR_EXTRASTATUS_PATCH -static int draw_pwrl_status_es(Bar *bar, BarArg *a); -#endif // BAR_EXTRASTATUS_PATCH -static int click_pwrl_status(Bar *bar, Arg *arg, BarArg *a); -static int drawpowerlinestatus(int x, char *stext, BarArg *a); -static int widthpowerlinestatus(char *stext); - diff --git a/dwm/.dwm.old/patch/bar_powerline_tags.c b/dwm/.dwm.old/patch/bar_powerline_tags.c deleted file mode 100644 index d5ad787..0000000 --- a/dwm/.dwm.old/patch/bar_powerline_tags.c +++ /dev/null @@ -1,107 +0,0 @@ -int -width_pwrl_tags(Bar *bar, BarArg *a) -{ - int w, i; - int plw = drw->fonts->h / 2 + 1; - #if BAR_HIDEVACANTTAGS_PATCH - Client *c; - unsigned int occ = 0; - for (c = bar->mon->clients; c; c = c->next) - occ |= c->tags == 255 ? 0 : c->tags; - #endif // BAR_HIDEVACANTTAGS_PATCH - - for (w = 0, i = 0; i < NUMTAGS; i++) { - #if BAR_HIDEVACANTTAGS_PATCH - if (!(occ & 1 << i || bar->mon->tagset[bar->mon->seltags] & 1 << i)) - continue; - #endif // BAR_HIDEVACANTTAGS_PATCH - w += TEXTW(tagicon(bar->mon, i)) + plw; - } - return w + lrpad; -} - -int -draw_pwrl_tags(Bar *bar, BarArg *a) -{ - int x, w; - int invert; - int plw = drw->fonts->h / 2 + 1; - unsigned int i, occ = 0, urg = 0; - char *icon; - Client *c; - Clr *prevscheme, *nxtscheme; - - for (c = bar->mon->clients; c; c = c->next) { - #if BAR_HIDEVACANTTAGS_PATCH - occ |= c->tags == 255 ? 0 : c->tags; - #else - occ |= c->tags; - #endif // BAR_HIDEVACANTTAGS_PATCH - if (c->isurgent) - urg |= c->tags; - } - x = a->x; - prevscheme = scheme[SchemeNorm]; - for (i = 0; i < NUMTAGS; i++) { - #if BAR_HIDEVACANTTAGS_PATCH - /* do not draw vacant tags */ - if (!(occ & 1 << i || bar->mon->tagset[bar->mon->seltags] & 1 << i)) - continue; - #endif // BAR_HIDEVACANTTAGS_PATCH - - icon = tagicon(bar->mon, i); - invert = 0; - w = TEXTW(icon); - if (urg & 1 << i) { - drw_settrans(drw, prevscheme, (nxtscheme = scheme[bar->mon->tagset[bar->mon->seltags] & 1 << i ? SchemeSel : SchemeUrg])); - } else { - drw_settrans(drw, prevscheme, (nxtscheme = scheme[bar->mon->tagset[bar->mon->seltags] & 1 << i ? SchemeSel : SchemeNorm])); - } - #if BAR_POWERLINE_TAGS_SLASH_PATCH - drw_arrow(drw, x, a->y, plw, a->h, 1, 1); - #else - drw_arrow(drw, x, a->y, plw, a->h, 1, 0); - #endif // BAR_POWERLINE_TAGS_SLASH_PATCH - x += plw; - drw_setscheme(drw, nxtscheme); - drw_text(drw, x, a->y, w, a->h, lrpad / 2, icon, invert, False); - drawindicator(bar->mon, NULL, occ, x, a->y, w, a->h, i, -1, invert, tagindicatortype); - x += w; - prevscheme = nxtscheme; - } - nxtscheme = scheme[SchemeNorm]; - - drw_settrans(drw, prevscheme, nxtscheme); - #if BAR_POWERLINE_TAGS_SLASH_PATCH - drw_arrow(drw, x, a->y, plw, a->h, 1, 1); - #else - drw_arrow(drw, x, a->y, plw, a->h, 1, 0); - #endif // BAR_POWERLINE_TAGS_SLASH_PATCH - return 1; -} - -int -click_pwrl_tags(Bar *bar, Arg *arg, BarArg *a) -{ - int i = 0, x = lrpad / 2; - int plw = drw->fonts->h / 2 + 1; - #if BAR_HIDEVACANTTAGS_PATCH - Client *c; - unsigned int occ = 0; - for (c = bar->mon->clients; c; c = c->next) - occ |= c->tags == 255 ? 0 : c->tags; - #endif // BAR_HIDEVACANTTAGS_PATCH - - do { - #if BAR_HIDEVACANTTAGS_PATCH - if (!(occ & 1 << i || bar->mon->tagset[bar->mon->seltags] & 1 << i)) - continue; - #endif // BAR_HIDEVACANTTAGS_PATCH - x += TEXTW(tagicon(bar->mon, i)) + plw; - } while (a->x >= x && ++i < NUMTAGS); - if (i < NUMTAGS) { - arg->ui = 1 << i; - } - return ClkTagBar; -} - diff --git a/dwm/.dwm.old/patch/bar_powerline_tags.h b/dwm/.dwm.old/patch/bar_powerline_tags.h deleted file mode 100644 index a51dcc7..0000000 --- a/dwm/.dwm.old/patch/bar_powerline_tags.h +++ /dev/null @@ -1,4 +0,0 @@ -static int width_pwrl_tags(Bar *bar, BarArg *a); -static int draw_pwrl_tags(Bar *bar, BarArg *a); -static int click_pwrl_tags(Bar *bar, Arg *arg, BarArg *a); - diff --git a/dwm/.dwm.old/patch/bar_status.c b/dwm/.dwm.old/patch/bar_status.c deleted file mode 100644 index 715b6d2..0000000 --- a/dwm/.dwm.old/patch/bar_status.c +++ /dev/null @@ -1,34 +0,0 @@ -int -width_status(Bar *bar, BarArg *a) -{ - return TEXTWM(stext); -} - -#if BAR_EXTRASTATUS_PATCH -int -width_status_es(Bar *bar, BarArg *a) -{ - return TEXTWM(estext) - lrpad; -} -#endif // BAR_EXTRASTATUS_PATCH - -int -draw_status(Bar *bar, BarArg *a) -{ - return drw_text(drw, a->x, a->y, a->w, a->h, lrpad / 2, stext, 0, True); -} - -#if BAR_EXTRASTATUS_PATCH -int -draw_status_es(Bar *bar, BarArg *a) -{ - return drw_text(drw, a->x, a->y, a->w, a->h, 0, estext, 0, True); -} -#endif // BAR_EXTRASTATUS_PATCH - -int -click_status(Bar *bar, Arg *arg, BarArg *a) -{ - return ClkStatusText; -} - diff --git a/dwm/.dwm.old/patch/bar_status.h b/dwm/.dwm.old/patch/bar_status.h deleted file mode 100644 index 4bf5e58..0000000 --- a/dwm/.dwm.old/patch/bar_status.h +++ /dev/null @@ -1,10 +0,0 @@ -static int width_status(Bar *bar, BarArg *a); -#if BAR_EXTRASTATUS_PATCH -static int width_status_es(Bar *bar, BarArg *a); -#endif // BAR_EXTRASTATUS_PATCH -static int draw_status(Bar *bar, BarArg *a); -#if BAR_EXTRASTATUS_PATCH -static int draw_status_es(Bar *bar, BarArg *a); -#endif // BAR_EXTRASTATUS_PATCH -static int click_status(Bar *bar, Arg *arg, BarArg *a); - diff --git a/dwm/.dwm.old/patch/bar_status2d.c b/dwm/.dwm.old/patch/bar_status2d.c deleted file mode 100644 index 860fd83..0000000 --- a/dwm/.dwm.old/patch/bar_status2d.c +++ /dev/null @@ -1,268 +0,0 @@ -#if BAR_STATUS2D_XRDB_TERMCOLORS_PATCH -static char termcol0[] = "#000000"; /* black */ -static char termcol1[] = "#ff0000"; /* red */ -static char termcol2[] = "#33ff00"; /* green */ -static char termcol3[] = "#ff0099"; /* yellow */ -static char termcol4[] = "#0066ff"; /* blue */ -static char termcol5[] = "#cc00ff"; /* magenta */ -static char termcol6[] = "#00ffff"; /* cyan */ -static char termcol7[] = "#d0d0d0"; /* white */ -static char termcol8[] = "#808080"; /* black */ -static char termcol9[] = "#ff0000"; /* red */ -static char termcol10[] = "#33ff00"; /* green */ -static char termcol11[] = "#ff0099"; /* yellow */ -static char termcol12[] = "#0066ff"; /* blue */ -static char termcol13[] = "#cc00ff"; /* magenta */ -static char termcol14[] = "#00ffff"; /* cyan */ -static char termcol15[] = "#ffffff"; /* white */ -static char *termcolor[] = { - termcol0, termcol1, termcol2, termcol3, termcol4, termcol5, termcol6, termcol7, - termcol8, termcol9, termcol10, termcol11, termcol12, termcol13, termcol14, termcol15, -}; -#endif // BAR_STATUS2D_XRDB_TERMCOLORS_PATCH - -int -width_status2d(Bar *bar, BarArg *a) -{ - int width; - #if BAR_EXTRASTATUS_PATCH || BAR_STATUSCMD_PATCH - width = status2dtextlength(rawstext); - #else - width = status2dtextlength(stext); - #endif // #if BAR_EXTRASTATUS_PATCH | BAR_STATUSCMD_PATCH - return width ? width + lrpad : 0; -} - -#if BAR_EXTRASTATUS_PATCH -int -width_status2d_es(Bar *bar, BarArg *a) -{ - int width; - #if BAR_STATUSCMD_PATCH - width = status2dtextlength(rawestext); - #else - width = status2dtextlength(estext); - #endif // BAR_STATUSCMD_PATCH - return width ? width + lrpad : 0; -} -#endif // BAR_EXTRASTATUS_PATCH - -int -draw_status2d(Bar *bar, BarArg *a) -{ - #if BAR_EXTRASTATUS_PATCH || BAR_STATUSCMD_PATCH - return drawstatusbar(a, rawstext); - #else - return drawstatusbar(a, stext); - #endif // #if BAR_EXTRASTATUS_PATCH | BAR_STATUSCMD_PATCH -} - -#if BAR_EXTRASTATUS_PATCH -int -draw_status2d_es(Bar *bar, BarArg *a) -{ - #if BAR_STATUSCMD_PATCH - return drawstatusbar(a, rawestext); - #else - return drawstatusbar(a, estext); - #endif // BAR_STATUSCMD_PATCH -} -#endif // BAR_EXTRASTATUS_PATCH - -#if !BAR_STATUSCMD_PATCH -int -click_status2d(Bar *bar, Arg *arg, BarArg *a) -{ - return ClkStatusText; -} -#endif // BAR_STATUSCMD_PATCH - -int -drawstatusbar(BarArg *a, char* stext) -{ - int i, w, len; - int x = a->x; - int y = a->y; - short isCode = 0; - char *text; - char *p; - Clr oldbg, oldfg; - len = strlen(stext); - if (!(text = (char*) malloc(sizeof(char)*(len + 1)))) - die("malloc"); - p = text; - #if BAR_STATUSCMD_PATCH - copyvalidchars(text, stext); - #else - memcpy(text, stext, len); - #endif // BAR_STATUSCMD_PATCH - - x += lrpad / 2; - drw_setscheme(drw, scheme[LENGTH(colors)]); - drw->scheme[ColFg] = scheme[SchemeNorm][ColFg]; - drw->scheme[ColBg] = scheme[SchemeNorm][ColBg]; - - /* process status text */ - i = -1; - while (text[++i]) { - if (text[i] == '^' && !isCode) { - isCode = 1; - - text[i] = '\0'; - w = TEXTWM(text) - lrpad; - drw_text(drw, x, y, w, bh, 0, text, 0, True); - - x += w; - - /* process code */ - while (text[++i] != '^') { - if (text[i] == 'c') { - char buf[8]; - if (i + 7 >= len) { - i += 7; - len = 0; - break; - } - memcpy(buf, (char*)text+i+1, 7); - buf[7] = '\0'; - #if BAR_ALPHA_PATCH && BAR_STATUS2D_NO_ALPHA_PATCH - drw_clr_create(drw, &drw->scheme[ColFg], buf, 0xff); - #elif BAR_ALPHA_PATCH - drw_clr_create(drw, &drw->scheme[ColFg], buf, alphas[SchemeNorm][ColFg]); - #else - drw_clr_create(drw, &drw->scheme[ColFg], buf); - #endif // BAR_ALPHA_PATCH - i += 7; - } else if (text[i] == 'b') { - char buf[8]; - if (i + 7 >= len) { - i += 7; - len = 0; - break; - } - memcpy(buf, (char*)text+i+1, 7); - buf[7] = '\0'; - #if BAR_ALPHA_PATCH && BAR_STATUS2D_NO_ALPHA_PATCH - drw_clr_create(drw, &drw->scheme[ColBg], buf, 0xff); - #elif BAR_ALPHA_PATCH - drw_clr_create(drw, &drw->scheme[ColBg], buf, alphas[SchemeNorm][ColBg]); - #else - drw_clr_create(drw, &drw->scheme[ColBg], buf); - #endif // BAR_ALPHA_PATCH - i += 7; - #if BAR_STATUS2D_XRDB_TERMCOLORS_PATCH - } else if (text[i] == 'C') { - int c = atoi(text + ++i) % 16; - #if BAR_ALPHA_PATCH && BAR_STATUS2D_NO_ALPHA_PATCH - drw_clr_create(drw, &drw->scheme[ColFg], termcolor[c], 0xff); - #elif BAR_ALPHA_PATCH - drw_clr_create(drw, &drw->scheme[ColFg], termcolor[c], alphas[SchemeNorm][ColBg]); - #else - drw_clr_create(drw, &drw->scheme[ColFg], termcolor[c]); - #endif // BAR_ALPHA_PATCH - } else if (text[i] == 'B') { - int c = atoi(text + ++i) % 16; - #if BAR_ALPHA_PATCH && BAR_STATUS2D_NO_ALPHA_PATCH - drw_clr_create(drw, &drw->scheme[ColBg], termcolor[c], 0xff); - #elif BAR_ALPHA_PATCH - drw_clr_create(drw, &drw->scheme[ColBg], termcolor[c], alphas[SchemeNorm][ColBg]); - #else - drw_clr_create(drw, &drw->scheme[ColBg], termcolor[c]); - #endif // BAR_ALPHA_PATCH - #endif // BAR_STATUS2D_XRDB_TERMCOLORS_PATCH - } else if (text[i] == 'd') { - drw->scheme[ColFg] = scheme[SchemeNorm][ColFg]; - drw->scheme[ColBg] = scheme[SchemeNorm][ColBg]; - } else if (text[i] == 'w') { - Clr swp; - swp = drw->scheme[ColFg]; - drw->scheme[ColFg] = drw->scheme[ColBg]; - drw->scheme[ColBg] = swp; - } else if (text[i] == 'v') { - oldfg = drw->scheme[ColFg]; - oldbg = drw->scheme[ColBg]; - } else if (text[i] == 't') { - drw->scheme[ColFg] = oldfg; - drw->scheme[ColBg] = oldbg; - } else if (text[i] == 'r') { - int rx = atoi(text + ++i); - while (text[++i] != ','); - int ry = atoi(text + ++i); - while (text[++i] != ','); - int rw = atoi(text + ++i); - while (text[++i] != ','); - int rh = atoi(text + ++i); - - if (ry < 0) - ry = 0; - if (rx < 0) - rx = 0; - - drw_rect(drw, rx + x, y + ry, rw, rh, 1, 0); - } else if (text[i] == 'f') { - x += atoi(text + ++i); - } - } - - text = text + i + 1; - len -= i + 1; - i = -1; - isCode = 0; - if (len <= 0) - break; - } - } - if (!isCode && len > 0) { - w = TEXTWM(text) - lrpad; - drw_text(drw, x, y, w, bh, 0, text, 0, True); - x += w; - } - free(p); - - drw_setscheme(drw, scheme[SchemeNorm]); - return 1; -} - -int -status2dtextlength(char* stext) -{ - int i, w, len; - short isCode = 0; - char *text; - char *p; - - len = strlen(stext) + 1; - if (!(text = (char*) malloc(sizeof(char)*len))) - die("malloc"); - p = text; - #if BAR_STATUSCMD_PATCH - copyvalidchars(text, stext); - #else - memcpy(text, stext, len); - #endif // BAR_STATUSCMD_PATCH - - /* compute width of the status text */ - w = 0; - i = -1; - while (text[++i]) { - if (text[i] == '^') { - if (!isCode) { - isCode = 1; - text[i] = '\0'; - w += TEXTWM(text) - lrpad; - text[i] = '^'; - if (text[++i] == 'f') - w += atoi(text + ++i); - } else { - isCode = 0; - text = text + i + 1; - i = -1; - } - } - } - if (!isCode) - w += TEXTWM(text) - lrpad; - free(p); - return w; -} - diff --git a/dwm/.dwm.old/patch/bar_status2d.h b/dwm/.dwm.old/patch/bar_status2d.h deleted file mode 100644 index 8e088fb..0000000 --- a/dwm/.dwm.old/patch/bar_status2d.h +++ /dev/null @@ -1,14 +0,0 @@ -static int width_status2d(Bar *bar, BarArg *a); -#if BAR_EXTRASTATUS_PATCH -static int width_status2d_es(Bar *bar, BarArg *a); -#endif // BAR_EXTRASTATUS_PATCH -static int draw_status2d(Bar *bar, BarArg *a); -#if BAR_EXTRASTATUS_PATCH -static int draw_status2d_es(Bar *bar, BarArg *a); -#endif // BAR_EXTRASTATUS_PATCH -#if !BAR_STATUSCMD_PATCH -static int click_status2d(Bar *bar, Arg *arg, BarArg *a); -#endif // BAR_STATUSCMD_PATCH -static int drawstatusbar(BarArg *a, char *text); -static int status2dtextlength(char *stext); - diff --git a/dwm/.dwm.old/patch/bar_statusbutton.c b/dwm/.dwm.old/patch/bar_statusbutton.c deleted file mode 100644 index 5e43fe0..0000000 --- a/dwm/.dwm.old/patch/bar_statusbutton.c +++ /dev/null @@ -1,18 +0,0 @@ -int -width_stbutton(Bar *bar, BarArg *a) -{ - return TEXTW(buttonbar); -} - -int -draw_stbutton(Bar *bar, BarArg *a) -{ - return drw_text(drw, a->x, a->y, a->w, a->h, lrpad / 2, buttonbar, 0, False); -} - -int -click_stbutton(Bar *bar, Arg *arg, BarArg *a) -{ - return ClkButton; -} - diff --git a/dwm/.dwm.old/patch/bar_statusbutton.h b/dwm/.dwm.old/patch/bar_statusbutton.h deleted file mode 100644 index ed5beb5..0000000 --- a/dwm/.dwm.old/patch/bar_statusbutton.h +++ /dev/null @@ -1,4 +0,0 @@ -static int width_stbutton(Bar *bar, BarArg *a); -static int draw_stbutton(Bar *bar, BarArg *a); -static int click_stbutton(Bar *bar, Arg *arg, BarArg *a); - diff --git a/dwm/.dwm.old/patch/bar_statuscmd.c b/dwm/.dwm.old/patch/bar_statuscmd.c deleted file mode 100644 index 8a6393d..0000000 --- a/dwm/.dwm.old/patch/bar_statuscmd.c +++ /dev/null @@ -1,79 +0,0 @@ -#if !BAR_DWMBLOCKS_PATCH -static const char statusexport[] = "export BUTTON=-;"; -static int statuscmdn; -static char lastbutton[] = "-"; -#endif // BAR_DWMBLOCKS_PATCH - -int -click_statuscmd(Bar *bar, Arg *arg, BarArg *a) -{ - return click_statuscmd_text(arg, a->x, rawstext); -} - -#if BAR_EXTRASTATUS_PATCH -int -click_statuscmd_es(Bar *bar, Arg *arg, BarArg *a) -{ - return click_statuscmd_text(arg, a->x, rawestext); -} -#endif // BAR_EXTRASTATUS_PATCH - -int -click_statuscmd_text(Arg *arg, int rel_x, char *text) -{ - int i = -1; - int x = 0; - char ch; - #if BAR_DWMBLOCKS_PATCH - statussig = -1; - #else - statuscmdn = 0; - #endif // BAR_DWMBLOCKS_PATCH - while (text[++i]) { - if ((unsigned char)text[i] < ' ') { - #if BAR_STATUSCOLORS_PATCH - if (text[i] < 17) - continue; - #endif // BAR_STATUSCOLORS_PATCH - ch = text[i]; - text[i] = '\0'; - #if BAR_STATUS2D_PATCH && !BAR_STATUSCOLORS_PATCH - x += status2dtextlength(text); - #else - x += TEXTWM(text) - lrpad; - #endif // BAR_STATUS2D_PATCH - text[i] = ch; - text += i+1; - i = -1; - #if BAR_DWMBLOCKS_PATCH - if (x >= rel_x && statussig != -1) - break; - statussig = ch; - #else - if (x >= rel_x) - break; - if (ch <= LENGTH(statuscmds)) - statuscmdn = ch; - #endif // BAR_DWMBLOCKS_PATCH - } - } - #if BAR_DWMBLOCKS_PATCH - if (statussig == -1) - statussig = 0; - #endif // BAR_DWMBLOCKS_PATCH - return ClkStatusText; -} - -void -copyvalidchars(char *text, char *rawtext) -{ - int i = -1, j = 0; - - while (rawtext[++i]) { - if ((unsigned char)rawtext[i] >= ' ') { - text[j++] = rawtext[i]; - } - } - text[j] = '\0'; -} - diff --git a/dwm/.dwm.old/patch/bar_statuscmd.h b/dwm/.dwm.old/patch/bar_statuscmd.h deleted file mode 100644 index a4c4d24..0000000 --- a/dwm/.dwm.old/patch/bar_statuscmd.h +++ /dev/null @@ -1,12 +0,0 @@ -static int click_statuscmd(Bar *bar, Arg *arg, BarArg *a); -#if BAR_EXTRASTATUS_PATCH -static int click_statuscmd_es(Bar *bar, Arg *arg, BarArg *a); -#endif // BAR_EXTRASTATUS_PATCH -static int click_statuscmd_text(Arg *arg, int rel_x, char *text); -static void copyvalidchars(char *text, char *rawtext); - -typedef struct { - const char *cmd; - int id; -} StatusCmd; - diff --git a/dwm/.dwm.old/patch/bar_statuscolors.c b/dwm/.dwm.old/patch/bar_statuscolors.c deleted file mode 100644 index 7ecb049..0000000 --- a/dwm/.dwm.old/patch/bar_statuscolors.c +++ /dev/null @@ -1,102 +0,0 @@ -int -width_statuscolors(Bar *bar, BarArg *a) -{ - #if BAR_STATUSCMD_PATCH - return textw_wosc(rawstext); - #else - return textw_wosc(stext); - #endif // BAR_STATUSCMD_PATCH -} - -#if BAR_EXTRASTATUS_PATCH -int -width_statuscolors_es(Bar *bar, BarArg *a) -{ - #if BAR_STATUSCMD_PATCH - return textw_wosc(rawestext); - #else - return textw_wosc(estext); - #endif // BAR_STATUSCMD_PATCH -} -#endif // BAR_EXTRASTATUS_PATCH - -int -draw_statuscolors(Bar *bar, BarArg *a) -{ - #if BAR_STATUSCMD_PATCH - return draw_wosc(bar, a, rawstext); - #else - return draw_wosc(bar, a, stext); - #endif // BAR_STATUSCMD_PATCH -} - -#if BAR_EXTRASTATUS_PATCH -int -draw_statuscolors_es(Bar *bar, BarArg *a) -{ - #if BAR_STATUSCMD_PATCH - return draw_wosc(bar, a, rawestext); - #else - return draw_wosc(bar, a, estext); - #endif // BAR_STATUSCMD_PATCH -} -#endif // BAR_EXTRASTATUS_PATCH - -#if !BAR_STATUSCMD_PATCH -int -click_statuscolors(Bar *bar, Arg *arg, BarArg *a) -{ - return ClkStatusText; -} -#endif // BAR_STATUSCMD_PATCH - -int -textw_wosc(char *s) -{ - char *ts = s; - char *tp = s; - int sw = 0; - char ctmp; - while (1) { - if ((unsigned int)*ts > LENGTH(colors)) { - ts++; - continue; - } - ctmp = *ts; - *ts = '\0'; - sw += drw_fontset_getwidth(drw, tp, True); - *ts = ctmp; - if (ctmp == '\0') - break; - tp = ++ts; - } - - return sw; -} - -int -draw_wosc(Bar *bar, BarArg *a, char *s) -{ - char *ts = s; - char *tp = s; - int tx = 0; - char ctmp; - - while (1) { - if ((unsigned int)*ts > LENGTH(colors)) { - ts++; - continue; - } - ctmp = *ts; - *ts = '\0'; - drw_text(drw, a->x + tx, a->y, a->w - tx, a->h, 0, tp, 0, True); - tx += TEXTW(tp) - lrpad; - if (ctmp == '\0') - break; - drw_setscheme(drw, scheme[(unsigned int)(ctmp-1)]); - *ts = ctmp; - tp = ++ts; - } - - return 1; -} \ No newline at end of file diff --git a/dwm/.dwm.old/patch/bar_statuscolors.h b/dwm/.dwm.old/patch/bar_statuscolors.h deleted file mode 100644 index f4880a6..0000000 --- a/dwm/.dwm.old/patch/bar_statuscolors.h +++ /dev/null @@ -1,13 +0,0 @@ -static int width_statuscolors(Bar *bar, BarArg *a); -#if BAR_EXTRASTATUS_PATCH -static int width_statuscolors_es(Bar *bar, BarArg *a); -#endif // BAR_EXTRASTATUS_PATCH -static int draw_statuscolors(Bar *bar, BarArg *a); -#if BAR_EXTRASTATUS_PATCH -static int draw_statuscolors_es(Bar *bar, BarArg *a); -#endif // BAR_EXTRASTATUS_PATCH -#if !BAR_STATUSCMD_PATCH -static int click_statuscolors(Bar *bar, Arg *arg, BarArg *a); -#endif // BAR_STATUSCMD_PATCH -static int textw_wosc(char *s); -static int draw_wosc(Bar *bar, BarArg *a, char *s); \ No newline at end of file diff --git a/dwm/.dwm.old/patch/bar_systray.c b/dwm/.dwm.old/patch/bar_systray.c deleted file mode 100644 index be337e4..0000000 --- a/dwm/.dwm.old/patch/bar_systray.c +++ /dev/null @@ -1,202 +0,0 @@ -static Systray *systray = NULL; -static unsigned long systrayorientation = _NET_SYSTEM_TRAY_ORIENTATION_HORZ; - -int -width_systray(Bar *bar, BarArg *a) -{ - unsigned int w = 0; - Client *i; - if (!systray) - return 1; - if (showsystray) { - for (i = systray->icons; i; w += i->w + systrayspacing, i = i->next); - if (!w) - XMoveWindow(dpy, systray->win, -systray->h, bar->by); - } - return w ? w + lrpad - systrayspacing : 0; -} - -int -draw_systray(Bar *bar, BarArg *a) -{ - if (!showsystray) - return 0; - - XSetWindowAttributes wa; - XWindowChanges wc; - Client *i; - unsigned int w; - - if (!systray) { - /* init systray */ - if (!(systray = (Systray *)calloc(1, sizeof(Systray)))) - die("fatal: could not malloc() %u bytes\n", sizeof(Systray)); - - wa.override_redirect = True; - wa.event_mask = ButtonPressMask|ExposureMask; - wa.border_pixel = 0; - systray->h = MIN(a->h, drw->fonts->h); - #if BAR_ALPHA_PATCH - wa.background_pixel = 0; - wa.colormap = cmap; - systray->win = XCreateWindow(dpy, root, bar->bx + a->x + lrpad / 2, -systray->h, MAX(a->w + 40, 1), systray->h, 0, depth, - InputOutput, visual, - CWOverrideRedirect|CWBorderPixel|CWBackPixel|CWColormap|CWEventMask, &wa); // CWBackPixmap - #else - wa.background_pixel = scheme[SchemeNorm][ColBg].pixel; - systray->win = XCreateSimpleWindow(dpy, root, bar->bx + a->x + lrpad / 2, -systray->h, MIN(a->w, 1), systray->h, 0, 0, scheme[SchemeNorm][ColBg].pixel); - XChangeWindowAttributes(dpy, systray->win, CWOverrideRedirect|CWBackPixel|CWBorderPixel|CWEventMask, &wa); - #endif // BAR_ALPHA_PATCH - - XSelectInput(dpy, systray->win, SubstructureNotifyMask); - XChangeProperty(dpy, systray->win, netatom[NetSystemTrayOrientation], XA_CARDINAL, 32, - PropModeReplace, (unsigned char *)&systrayorientation, 1); - #if BAR_ALPHA_PATCH - XChangeProperty(dpy, systray->win, netatom[NetSystemTrayVisual], XA_VISUALID, 32, - PropModeReplace, (unsigned char *)&visual->visualid, 1); - #endif // BAR_ALPHA_PATCH - XChangeProperty(dpy, systray->win, netatom[NetWMWindowType], XA_ATOM, 32, - PropModeReplace, (unsigned char *)&netatom[NetWMWindowTypeDock], 1); - XMapRaised(dpy, systray->win); - XSetSelectionOwner(dpy, netatom[NetSystemTray], systray->win, CurrentTime); - if (XGetSelectionOwner(dpy, netatom[NetSystemTray]) == systray->win) { - sendevent(root, xatom[Manager], StructureNotifyMask, CurrentTime, netatom[NetSystemTray], systray->win, 0, 0); - XSync(dpy, False); - } else { - fprintf(stderr, "dwm: unable to obtain system tray.\n"); - free(systray); - systray = NULL; - return 0; - } - } - - systray->bar = bar; - - wc.stack_mode = Above; - wc.sibling = bar->win; - XConfigureWindow(dpy, systray->win, CWSibling|CWStackMode, &wc); - - drw_setscheme(drw, scheme[SchemeNorm]); - for (w = 0, i = systray->icons; i; i = i->next) { - #if BAR_ALPHA_PATCH - wa.background_pixel = 0; - #else - wa.background_pixel = scheme[SchemeNorm][ColBg].pixel; - #endif // BAR_ALPHA_PATCH - XChangeWindowAttributes(dpy, i->win, CWBackPixel, &wa); - XMapRaised(dpy, i->win); - i->x = w; - XMoveResizeWindow(dpy, i->win, i->x, 0, i->w, i->h); - w += i->w; - if (i->next) - w += systrayspacing; - if (i->mon != bar->mon) - i->mon = bar->mon; - } - - XMoveResizeWindow(dpy, systray->win, bar->bx + a->x + lrpad / 2, (w ? bar->by + a->y + (a->h - systray->h) / 2: -systray->h), MAX(w, 1), systray->h); - return w; -} - -int -click_systray(Bar *bar, Arg *arg, BarArg *a) -{ - return -1; -} - -void -removesystrayicon(Client *i) -{ - Client **ii; - - if (!showsystray || !i) - return; - for (ii = &systray->icons; *ii && *ii != i; ii = &(*ii)->next); - if (ii) - *ii = i->next; - XReparentWindow(dpy, i->win, root, 0, 0); - free(i); - drawbarwin(systray->bar); -} - -void -resizerequest(XEvent *e) -{ - XResizeRequestEvent *ev = &e->xresizerequest; - Client *i; - - if ((i = wintosystrayicon(ev->window))) { - updatesystrayicongeom(i, ev->width, ev->height); - drawbarwin(systray->bar); - } -} - -void -updatesystrayicongeom(Client *i, int w, int h) -{ - if (!systray) - return; - - int icon_height = systray->h; - if (i) { - i->h = icon_height; - if (w == h) - i->w = icon_height; - else if (h == icon_height) - i->w = w; - else - i->w = (int) ((float)icon_height * ((float)w / (float)h)); - applysizehints(i, &(i->x), &(i->y), &(i->w), &(i->h), False); - /* force icons into the systray dimensions if they don't want to */ - if (i->h > icon_height) { - if (i->w == i->h) - i->w = icon_height; - else - i->w = (int) ((float)icon_height * ((float)i->w / (float)i->h)); - i->h = icon_height; - } - if (i->w > 2 * icon_height) - i->w = icon_height; - } -} - -void -updatesystrayiconstate(Client *i, XPropertyEvent *ev) -{ - long flags; - int code = 0; - - if (!showsystray || !systray || !i || ev->atom != xatom[XembedInfo] || - !(flags = getatomprop(i, xatom[XembedInfo], xatom[XembedInfo]))) - return; - - if (flags & XEMBED_MAPPED && !i->tags) { - i->tags = 1; - code = XEMBED_WINDOW_ACTIVATE; - XMapRaised(dpy, i->win); - setclientstate(i, NormalState); - } - else if (!(flags & XEMBED_MAPPED) && i->tags) { - i->tags = 0; - code = XEMBED_WINDOW_DEACTIVATE; - XUnmapWindow(dpy, i->win); - setclientstate(i, WithdrawnState); - } - else - return; - sendevent(i->win, xatom[Xembed], StructureNotifyMask, CurrentTime, code, 0, - systray->win, XEMBED_EMBEDDED_VERSION); -} - -Client * -wintosystrayicon(Window w) -{ - if (!systray) - return NULL; - Client *i = NULL; - if (!showsystray || !w) - return i; - for (i = systray->icons; i && i->win != w; i = i->next); - return i; -} - diff --git a/dwm/.dwm.old/patch/bar_systray.h b/dwm/.dwm.old/patch/bar_systray.h deleted file mode 100644 index 092a6ff..0000000 --- a/dwm/.dwm.old/patch/bar_systray.h +++ /dev/null @@ -1,41 +0,0 @@ -#define SYSTEM_TRAY_REQUEST_DOCK 0 -#define _NET_SYSTEM_TRAY_ORIENTATION_HORZ 0 - -/* XEMBED messages */ -#define XEMBED_EMBEDDED_NOTIFY 0 -#define XEMBED_WINDOW_ACTIVATE 1 -#define XEMBED_FOCUS_IN 4 -#define XEMBED_MODALITY_ON 10 - -#define XEMBED_MAPPED (1 << 0) -#define XEMBED_WINDOW_ACTIVATE 1 -#define XEMBED_WINDOW_DEACTIVATE 2 - -#define VERSION_MAJOR 0 -#define VERSION_MINOR 0 -#define XEMBED_EMBEDDED_VERSION (VERSION_MAJOR << 16) | VERSION_MINOR - -/* enums */ -enum { Manager, Xembed, XembedInfo, XLast }; /* Xembed atoms */ - -typedef struct Systray Systray; -struct Systray { - Window win; - Client *icons; - Bar *bar; - int h; -}; - -/* bar integration */ -static int width_systray(Bar *bar, BarArg *a); -static int draw_systray(Bar *bar, BarArg *a); -static int click_systray(Bar *bar, Arg *arg, BarArg *a); - -/* function declarations */ -static void removesystrayicon(Client *i); -static void resizerequest(XEvent *e); -static void updatesystrayicongeom(Client *i, int w, int h); -static void updatesystrayiconstate(Client *i, XPropertyEvent *ev); -static Client *wintosystrayicon(Window w); - - diff --git a/dwm/.dwm.old/patch/bar_tabgroups.c b/dwm/.dwm.old/patch/bar_tabgroups.c deleted file mode 100644 index b61a0db..0000000 --- a/dwm/.dwm.old/patch/bar_tabgroups.c +++ /dev/null @@ -1,258 +0,0 @@ -/* Bartabgroups properties, you can override these in your config.h if you want. */ -#ifndef BARTAB_BORDERS -#define BARTAB_BORDERS 1 // 0 = off, 1 = on -#endif -#ifndef BARTAB_SHOWFLOATING -#define BARTAB_SHOWFLOATING 0 // whether to show titles for floating windows, hidden clients are always shown -#endif -#ifndef BARTAB_STACKWEIGHT -#define BARTAB_STACKWEIGHT 1 // stack weight compared to hidden and floating window titles -#endif -#ifndef BARTAB_HIDDENWEIGHT -#define BARTAB_HIDDENWEIGHT 1 // hidden window title weight -#endif -#ifndef BARTAB_FLOATWEIGHT -#define BARTAB_FLOATWEIGHT 1 // floating window title weight, set to 0 to not show floating windows -#endif - -int -width_bartabgroups(Bar *bar, BarArg *a) -{ - return a->w; -} - -int -draw_bartabgroups(Bar *bar, BarArg *a) -{ - drw_rect(drw, a->x, a->y, a->w, a->h, 1, 1); - return bartabcalculate(bar->mon, a->x, a->w, -1, bartabdraw, NULL, a); -} - -int -click_bartabgroups(Bar *bar, Arg *arg, BarArg *a) -{ - bartabcalculate(bar->mon, 0, a->w, a->x, bartabclick, arg, a); - return ClkWinTitle; -} - -void -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; - 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 - && HIDDEN(c) - ? SchemeHidSel - : HIDDEN(c) - ? SchemeHidNorm - : m->sel == c - #endif - ? SchemeSel - : groupactive - ? SchemeTitleSel - : SchemeTitleNorm - ]); - 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 - 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(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, 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) - nviewtags++; - if ((c->tags >> i) & 1) - nclienttags++; - } - - if (TAGSINDICATOR == 2 || nclienttags > 1 || nviewtags > 1) - drawindicator(m, c, 1, x, a->y, w, a->h, 0, 0, 0, INDICATOR_RIGHT_TAGS); -} - -#ifndef HIDDEN -#define HIDDEN(C) 0 -#endif - -void -bartabclick(Monitor *m, Client *c, int passx, int x, int w, int unused, Arg *arg, BarArg *barg) -{ - if (passx >= x && passx <= x + w) - arg->v = c; -} - -int -bartabcalculate( - Monitor *m, int offx, int tabw, int passx, - void(*tabfn)(Monitor *, Client *, int, int, int, int, Arg *arg, BarArg *barg), - Arg *arg, BarArg *barg -) { - Client *c; - int - i, clientsnmaster = 0, clientsnstack = 0, clientsnfloating = 0, clientsnhidden = 0, - masteractive = 0, fulllayout = 0, - x = offx, w, r, num = 0, den, tgactive; - - for (i = 0; i < LENGTH(bartabmonfns); i++) - if (m ->lt[m->sellt]->arrange == bartabmonfns[i]) { - fulllayout = 1; - break; - } - - for (i = 0, c = m->clients; c; c = c->next) { - if (!ISVISIBLE(c)) - continue; - if (HIDDEN(c)) { - clientsnhidden++; - continue; - } - if (c->isfloating) { - clientsnfloating++; - continue; - } - if (m->sel == c) - masteractive = i < m->nmaster; - if (i < m->nmaster) - clientsnmaster++; - else - clientsnstack++; - i++; - } - - if (clientsnmaster + clientsnstack + clientsnfloating + clientsnhidden == 0) - return 0; - - tgactive = 1; - num = tabw; - /* floating mode */ - if ((fulllayout && BARTAB_FLOATWEIGHT) || clientsnmaster + clientsnstack == 0 || !m->lt[m->sellt]->arrange) { - den = clientsnmaster + clientsnstack + clientsnfloating + clientsnhidden; - r = num % den; - w = num / den; - for (c = m->clients, i = 0; c; c = c->next) { - if (!ISVISIBLE(c)) - continue; - tabfn(m, c, passx, x, w + (i < r ? 1 : 0), tgactive, arg, barg); - x += w + (i < r ? 1 : 0); - i++; - } - /* no master and stack mode, e.g. monocole, grid layouts, fibonacci */ - } else if (fulllayout) { - den = clientsnmaster + clientsnstack + clientsnhidden; - r = num % den; - w = num / den; - for (c = m->clients, i = 0; c; c = c->next) { - if (!ISVISIBLE(c) || (c->isfloating && !HIDDEN(c))) - continue; - tabfn(m, c, passx, x, w + (i < r ? 1 : 0), tgactive, arg, barg); - x += w + (i < r ? 1 : 0); - i++; - } - /* tiled mode */ - } else { - den = clientsnmaster; - c = m->clients; - i = 0; - if (den) { - if (clientsnstack + clientsnfloating * BARTAB_FLOATWEIGHT + clientsnhidden) { - tgactive = masteractive; - num = tabw * m->mfact; - } - r = num % den; - w = num / den; - for (; c && i < m->nmaster; c = c->next) { // tiled master - if (!ISVISIBLE(c) || c->isfloating || HIDDEN(c)) - continue; - tabfn(m, c, passx, x, w + (i < r ? 1 : 0), tgactive, arg, barg); - x += w + (i < r ? 1 : 0); - i++; - } - tgactive = !tgactive; - num = tabw - num; - } - - den = clientsnstack * BARTAB_STACKWEIGHT + clientsnfloating * BARTAB_FLOATWEIGHT + clientsnhidden * BARTAB_HIDDENWEIGHT; - if (!den) - return 1; - - r = num % den; - w = num / den; - #if BARTAB_STACKWEIGHT - for (; c; c = c->next) { // tiled stack - if (!ISVISIBLE(c) || HIDDEN(c) || c->isfloating) - continue; - tabfn(m, c, passx, x, w * BARTAB_STACKWEIGHT + (i - m->nmaster < r ? 1 : 0), tgactive, arg, barg); - x += w * BARTAB_STACKWEIGHT + (i - m->nmaster < r ? 1 : 0); - i++; - } - #endif // BARTAB_STACKWEIGHT - - #if BARTAB_HIDDENWEIGHT - for (c = m->clients; c; c = c->next) { // hidden windows - if (!ISVISIBLE(c) || !HIDDEN(c)) - continue; - tabfn(m, c, passx, x, w * BARTAB_HIDDENWEIGHT + (i - m->nmaster < r ? 1 : 0), tgactive, arg, barg); - x += w * BARTAB_HIDDENWEIGHT + (i - m->nmaster < r ? 1 : 0); - i++; - } - #endif // BARTAB_HIDDENWEIGHT - - #if BARTAB_FLOATWEIGHT - for (c = m->clients; c; c = c->next) { // floating windows - if (!ISVISIBLE(c) || HIDDEN(c) || !c->isfloating) - continue; - tabfn(m, c, passx, x, w * BARTAB_FLOATWEIGHT + (i - m->nmaster < r ? 1 : 0), tgactive, arg, barg); - x += w * BARTAB_FLOATWEIGHT + (i - m->nmaster < r ? 1 : 0); - i++; - } - #endif // BARTAB_FLOATWEIGHT - } - return 1; -} - diff --git a/dwm/.dwm.old/patch/bar_tabgroups.h b/dwm/.dwm.old/patch/bar_tabgroups.h deleted file mode 100644 index 75a8512..0000000 --- a/dwm/.dwm.old/patch/bar_tabgroups.h +++ /dev/null @@ -1,8 +0,0 @@ -static int width_bartabgroups(Bar *bar, BarArg *a); -static int draw_bartabgroups(Bar *bar, BarArg *a); -static int click_bartabgroups(Bar *bar, Arg *arg, BarArg *a); - -static void bartabdraw(Monitor *m, Client *c, int unused, int x, int w, int groupactive, Arg *arg, BarArg *barg); -static void bartabclick(Monitor *m, Client *c, int passx, int x, int w, int unused, Arg *arg, BarArg *barg); -static int bartabcalculate(Monitor *m, int offx, int w, int passx, void(*tabfn)(Monitor *, Client *, int, int, int, int, Arg *arg, BarArg *barg), Arg *arg, BarArg *barg); - diff --git a/dwm/.dwm.old/patch/bar_taggrid.c b/dwm/.dwm.old/patch/bar_taggrid.c deleted file mode 100644 index 675c8de..0000000 --- a/dwm/.dwm.old/patch/bar_taggrid.c +++ /dev/null @@ -1,150 +0,0 @@ -int -width_taggrid(Bar *bar, BarArg *a) -{ - return (a->h / 2) * (NUMTAGS / tagrows + ((NUMTAGS % tagrows > 0) ? 1 : 0)) + lrpad; -} - -int -draw_taggrid(Bar *bar, BarArg *a) -{ - unsigned int x, y, h, max_x = 0, columns, occ = 0; - int invert, i,j, k; - Client *c; - - for (c = bar->mon->clients; c; c = c->next) - occ |= c->tags; - - max_x = x = a->x + lrpad / 2; - h = a->h / tagrows - 1; - y = a->y; - columns = NUMTAGS / tagrows + ((NUMTAGS % tagrows > 0) ? 1 : 0); - - /* Firstly we will fill the borders of squares */ - XSetForeground(drw->dpy, drw->gc, scheme[SchemeTagsNorm][ColBg].pixel); - XFillRectangle(dpy, drw->drawable, drw->gc, x, y, h*columns + 1, a->h); - - /* We will draw NUMTAGS squares in tagraws raws. */ - for (j = 0, i = 0; j < tagrows; j++) { - x = a->x + lrpad / 2; - for (k = 0; k < columns; k++, i++) { - if (i < NUMTAGS) { - invert = bar->mon->tagset[bar->mon->seltags] & 1 << i ? 0 : 1; - - /* Select active color for current square */ - XSetForeground(drw->dpy, drw->gc, !invert ? scheme[SchemeTagsSel][ColBg].pixel : - scheme[SchemeTagsNorm][ColFg].pixel); - XFillRectangle(dpy, drw->drawable, drw->gc, x+1, y+1, h-1, h-1); - - /* Mark square if tag has client */ - if (occ & 1 << i) { - XSetForeground(drw->dpy, drw->gc, !invert ? scheme[SchemeTagsSel][ColFg].pixel : - scheme[SchemeTagsNorm][ColBg].pixel); - XFillRectangle(dpy, drw->drawable, drw->gc, x + 1, y + 1, - h / 2, h / 2); - } - } else { - XSetForeground(drw->dpy, drw->gc, scheme[SchemeTagsNorm][ColBg].pixel); - XFillRectangle(dpy, drw->drawable, drw->gc, x+1, y+1, h-1, h); - } - x += h; - if (x > max_x) { - max_x = x; - } - } - y += h; - } - return 1; -} - -int -click_taggrid(Bar *bar, Arg *arg, BarArg *a) -{ - unsigned int i, h, columns; - - h = a->h / tagrows - 1; - columns = NUMTAGS / tagrows + ((NUMTAGS % tagrows > 0) ? 1 : 0); - i = (a->x - lrpad / 2) / h + columns * (a->y / h); - if (i >= NUMTAGS) { - i = NUMTAGS - 1; - } - arg->ui = 1 << i; - return ClkTagBar; -} - -void -switchtag(const Arg *arg) -{ - unsigned int columns; - unsigned int new_tagset = 0; - unsigned int pos, i; - int col, row; - Arg new_arg; - - columns = NUMTAGS / tagrows + ((NUMTAGS % tagrows > 0) ? 1 : 0); - - for (i = 0; i < NUMTAGS; ++i) { - if (!(selmon->tagset[selmon->seltags] & 1 << i)) { - continue; - } - pos = i; - row = pos / columns; - col = pos % columns; - if (arg->ui & SWITCHTAG_UP) { /* UP */ - row --; - if (row < 0) { - row = tagrows - 1; - } - do { - pos = row * columns + col; - row --; - } while (pos >= NUMTAGS); - } - if (arg->ui & SWITCHTAG_DOWN) { /* DOWN */ - row ++; - if (row >= tagrows) { - row = 0; - } - pos = row * columns + col; - if (pos >= NUMTAGS) { - row = 0; - } - pos = row * columns + col; - } - if (arg->ui & SWITCHTAG_LEFT) { /* LEFT */ - col --; - if (col < 0) { - col = columns - 1; - } - do { - pos = row * columns + col; - col --; - } while (pos >= NUMTAGS); - } - if (arg->ui & SWITCHTAG_RIGHT) { /* RIGHT */ - col ++; - if (col >= columns) { - col = 0; - } - pos = row * columns + col; - if (pos >= NUMTAGS) { - col = 0; - pos = row * columns + col; - } - } - new_tagset |= 1 << pos; - } - new_arg.ui = new_tagset; - if (arg->ui & SWITCHTAG_TOGGLETAG) { - toggletag(&new_arg); - } - if (arg->ui & SWITCHTAG_TAG) { - tag(&new_arg); - } - if (arg->ui & SWITCHTAG_VIEW) { - view (&new_arg); - } - if (arg->ui & SWITCHTAG_TOGGLEVIEW) { - toggleview (&new_arg); - } -} - diff --git a/dwm/.dwm.old/patch/bar_taggrid.h b/dwm/.dwm.old/patch/bar_taggrid.h deleted file mode 100644 index dfc60de..0000000 --- a/dwm/.dwm.old/patch/bar_taggrid.h +++ /dev/null @@ -1,5 +0,0 @@ -static int width_taggrid(Bar *bar, BarArg *a); -static int draw_taggrid(Bar *bar, BarArg *a); -static int click_taggrid(Bar *bar, Arg *arg, BarArg *a); -static void switchtag(const Arg *arg); - diff --git a/dwm/.dwm.old/patch/bar_tagicons.c b/dwm/.dwm.old/patch/bar_tagicons.c deleted file mode 100644 index fa1b96c..0000000 --- a/dwm/.dwm.old/patch/bar_tagicons.c +++ /dev/null @@ -1,21 +0,0 @@ -char * -tagicon(Monitor *m, int tag) -{ - #if BAR_ALTTAGSDECORATION_PATCH - Client *c; - #endif // BAR_ALTTAGSDECORATION_PATCH - int tagindex = tag + NUMTAGS * m->num; - if (tagindex >= LENGTH(tagicons[DEFAULT_TAGS])) - tagindex = tagindex % LENGTH(tagicons[DEFAULT_TAGS]); - #if BAR_ALTTAGSDECORATION_PATCH - for (c = m->clients; c && (!(c->tags & 1 << tag) || HIDDEN(c)); c = c->next); - if (c) - return tagicons[ALT_TAGS_DECORATION][tagindex]; - #endif // BAR_ALTTAGSDECORATION_PATCH - #if BAR_ALTERNATIVE_TAGS_PATCH - if (m->alttag) - return tagicons[ALTERNATIVE_TAGS][tagindex]; - #endif // BAR_ALTERNATIVE_TAGS_PATCH - return tagicons[DEFAULT_TAGS][tagindex]; -} - diff --git a/dwm/.dwm.old/patch/bar_tagicons.h b/dwm/.dwm.old/patch/bar_tagicons.h deleted file mode 100644 index 16fad2a..0000000 --- a/dwm/.dwm.old/patch/bar_tagicons.h +++ /dev/null @@ -1,8 +0,0 @@ -enum { - DEFAULT_TAGS, - ALTERNATIVE_TAGS, - ALT_TAGS_DECORATION, -}; - -static char * tagicon(Monitor *m, int tag); - diff --git a/dwm/.dwm.old/patch/bar_taglabels.c b/dwm/.dwm.old/patch/bar_taglabels.c deleted file mode 100644 index 9e6d441..0000000 --- a/dwm/.dwm.old/patch/bar_taglabels.c +++ /dev/null @@ -1,91 +0,0 @@ -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/dwm/.dwm.old/patch/bar_taglabels.h b/dwm/.dwm.old/patch/bar_taglabels.h deleted file mode 100644 index 57250f9..0000000 --- a/dwm/.dwm.old/patch/bar_taglabels.h +++ /dev/null @@ -1,5 +0,0 @@ -#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/dwm/.dwm.old/patch/bar_tagpreview.c b/dwm/.dwm.old/patch/bar_tagpreview.c deleted file mode 100644 index 27731b0..0000000 --- a/dwm/.dwm.old/patch/bar_tagpreview.c +++ /dev/null @@ -1,112 +0,0 @@ -#include - -void -createpreview(Monitor *m) -{ - if (m->tagwin) { - XMoveResizeWindow( - dpy, m->tagwin, - m->mx, - m->bar->by + bh, - m->mw / scalepreview, - m->mh / scalepreview - ); - return; - } - - XSetWindowAttributes wa = { - .override_redirect = True, - #if BAR_ALPHA_PATCH - .background_pixel = 0, - .border_pixel = 0, - .colormap = cmap, - #else - .background_pixmap = ParentRelative, - #endif // BAR_ALPHA_PATCH - .event_mask = ButtonPressMask|ExposureMask - }; - - m->tagwin = XCreateWindow(dpy, root, m->wx, m->bar->by + bh, m->mw / scalepreview, m->mh / scalepreview, 0, - #if BAR_ALPHA_PATCH - depth, CopyFromParent, visual, - CWOverrideRedirect|CWBackPixel|CWBorderPixel|CWColormap|CWEventMask, &wa - #else - DefaultDepth(dpy, screen), CopyFromParent, DefaultVisual(dpy, screen), - CWOverrideRedirect|CWBackPixmap|CWEventMask, &wa - #endif // BAR_ALPHA_PATCH - ); - XDefineCursor(dpy, m->tagwin, cursor[CurNormal]->cursor); - XMapRaised(dpy, m->tagwin); - XUnmapWindow(dpy, m->tagwin); -} - -void -hidetagpreview(Monitor *m) -{ - m->previewshow = 0; - XUnmapWindow(dpy, m->tagwin); -} - -void -showtagpreview(int tag, int x, int y) -{ - Monitor *m = selmon; - - if (!m->tagwin) - return; - - if (m->tagmap[tag]) { - XSetWindowBackgroundPixmap(dpy, m->tagwin, m->tagmap[tag]); - XCopyArea(dpy, m->tagmap[tag], m->tagwin, drw->gc, 0, 0, m->mw / scalepreview, m->mh / scalepreview, 0, 0); - XMoveWindow(dpy, m->tagwin, x, y); - XSync(dpy, False); - XMapWindow(dpy, m->tagwin); - } else - XUnmapWindow(dpy, m->tagwin); -} - -void -tagpreviewswitchtag(void) -{ - int i; - unsigned int occ = 0; - Client *c; - Imlib_Image image; - Monitor *m = selmon; - - if (!m->tagwin) - createpreview(m); - - for (c = m->clients; c; c = c->next) - occ |= c->tags; - for (i = 0; i < NUMTAGS; i++) { - if (m->tagset[m->seltags] & 1 << i) { - if (m->tagmap[i] != 0) { - XFreePixmap(dpy, m->tagmap[i]); - m->tagmap[i] = 0; - } - if (occ & 1 << i) { - image = imlib_create_image(sw, sh); - imlib_context_set_image(image); - imlib_context_set_display(dpy); - #if BAR_ALPHA_PATCH - imlib_image_set_has_alpha(1); - imlib_context_set_blend(0); - imlib_context_set_visual(visual); - #else - imlib_context_set_visual(DefaultVisual(dpy, screen)); - #endif // BAR_ALPHA_PATCH - imlib_context_set_drawable(root); - imlib_copy_drawable_to_image(0, m->mx, m->my, m->mw ,m->mh, 0, 0, 1); - #if BAR_ALPHA_PATCH - m->tagmap[i] = XCreatePixmap(dpy, m->tagwin, m->mw / scalepreview, m->mh / scalepreview, depth); - #else - m->tagmap[i] = XCreatePixmap(dpy, m->tagwin, m->mw / scalepreview, m->mh / scalepreview, DefaultDepth(dpy, screen)); - #endif // BAR_ALPHA_PATCH - imlib_context_set_drawable(m->tagmap[i]); - imlib_render_image_part_on_drawable_at_size(0, 0, m->mw, m->mh, 0, 0, m->mw / scalepreview, m->mh / scalepreview); - imlib_free_image(); - } - } - } -} diff --git a/dwm/.dwm.old/patch/bar_tagpreview.h b/dwm/.dwm.old/patch/bar_tagpreview.h deleted file mode 100644 index 44be36d..0000000 --- a/dwm/.dwm.old/patch/bar_tagpreview.h +++ /dev/null @@ -1,4 +0,0 @@ -static void createpreview(Monitor *m); -static void hidetagpreview(Monitor *m); -static void showtagpreview(int tag, int x, int y); -static void tagpreviewswitchtag(void); diff --git a/dwm/.dwm.old/patch/bar_tags.c b/dwm/.dwm.old/patch/bar_tags.c deleted file mode 100644 index 6a420d0..0000000 --- a/dwm/.dwm.old/patch/bar_tags.c +++ /dev/null @@ -1,146 +0,0 @@ -int -width_tags(Bar *bar, BarArg *a) -{ - int w, i; - #if BAR_HIDEVACANTTAGS_PATCH - Client *c; - unsigned int occ = 0; - for (c = bar->mon->clients; c; c = c->next) - occ |= c->tags == 255 ? 0 : c->tags; - #endif // BAR_HIDEVACANTTAGS_PATCH - - for (w = 0, i = 0; i < NUMTAGS; i++) { - #if BAR_HIDEVACANTTAGS_PATCH - if (!(occ & 1 << i || bar->mon->tagset[bar->mon->seltags] & 1 << i)) - continue; - #endif // BAR_HIDEVACANTTAGS_PATCH - w += TEXTW(tagicon(bar->mon, i)); - } - return w; -} - -int -draw_tags(Bar *bar, BarArg *a) -{ - int invert; - int w, x = a->x; - unsigned int i, occ = 0, urg = 0; - char *icon; - Client *c; - Monitor *m = bar->mon; - - for (c = m->clients; c; c = c->next) { - #if BAR_HIDEVACANTTAGS_PATCH - occ |= c->tags == 255 ? 0 : c->tags; - #else - occ |= c->tags; - #endif // BAR_HIDEVACANTTAGS_PATCH - if (c->isurgent) - urg |= c->tags; - } - for (i = 0; i < NUMTAGS; i++) { - #if BAR_HIDEVACANTTAGS_PATCH - /* do not draw vacant tags */ - if (!(occ & 1 << i || m->tagset[m->seltags] & 1 << i)) - continue; - #endif // BAR_HIDEVACANTTAGS_PATCH - - icon = tagicon(bar->mon, i); - invert = 0; - w = TEXTW(icon); - drw_setscheme(drw, scheme[ - m->tagset[m->seltags] & 1 << i - ? SchemeTagsSel - : urg & 1 << i - ? SchemeUrg - : SchemeTagsNorm - ]); - 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; - } - - return 1; -} - -int -click_tags(Bar *bar, Arg *arg, BarArg *a) -{ - int i = 0, x = 0; - #if BAR_HIDEVACANTTAGS_PATCH - Client *c; - unsigned int occ = 0; - for (c = bar->mon->clients; c; c = c->next) - occ |= c->tags == 255 ? 0 : c->tags; - #endif // BAR_HIDEVACANTTAGS_PATCH - - do { - #if BAR_HIDEVACANTTAGS_PATCH - if (!(occ & 1 << i || bar->mon->tagset[bar->mon->seltags] & 1 << i)) - continue; - #endif // BAR_HIDEVACANTTAGS_PATCH - x += TEXTW(tagicon(bar->mon, i)); - } while (a->x >= x && ++i < NUMTAGS); - if (i < NUMTAGS) { - arg->ui = 1 << i; - } - return ClkTagBar; -} - -int -hover_tags(Bar *bar, BarArg *a, XMotionEvent *ev) -{ - #if BAR_TAGPREVIEW_PATCH - int i = 0, x = lrpad / 2; - int px, py; - Monitor *m = bar->mon; - #if VANITYGAPS_PATCH - int ov = gappov; - int oh = gappoh; - #else - int ov = 0; - int oh = 0; - #endif // VANITYGAPS_PATCH - - #if BAR_HIDEVACANTTAGS_PATCH - Client *c; - unsigned int occ = 0; - for (c = bar->mon->clients; c; c = c->next) - occ |= c->tags == 255 ? 0 : c->tags; - #endif // BAR_HIDEVACANTTAGS_PATCH - - do { - #if BAR_HIDEVACANTTAGS_PATCH - if (!(occ & 1 << i || bar->mon->tagset[bar->mon->seltags] & 1 << i)) - continue; - #endif // BAR_HIDEVACANTTAGS_PATCH - x += TEXTW(tagicon(bar->mon, i)); - } while (a->x >= x && ++i < NUMTAGS); - - if (i < NUMTAGS) { - if ((i + 1) != selmon->previewshow && !(selmon->tagset[selmon->seltags] & 1 << i)) { - if (bar->by > m->my + m->mh / 2) // bottom bar - py = bar->by - m->mh / scalepreview - oh; - else // top bar - py = bar->by + bar->bh + oh; - px = bar->bx + ev->x - m->mw / scalepreview / 2; - if (px + m->mw / scalepreview > m->mx + m->mw) - px = m->wx + m->ww - m->mw / scalepreview - ov; - else if (px < bar->bx) - px = m->wx + ov; - selmon->previewshow = i + 1; - showtagpreview(i, px, py); - } else if (selmon->tagset[selmon->seltags] & 1 << i) { - hidetagpreview(selmon); - } - } else if (selmon->previewshow != 0) { - hidetagpreview(selmon); - } - #endif // BAR_TAGPREVIEW_PATCH - - return 1; -} diff --git a/dwm/.dwm.old/patch/bar_tags.h b/dwm/.dwm.old/patch/bar_tags.h deleted file mode 100644 index 70040d2..0000000 --- a/dwm/.dwm.old/patch/bar_tags.h +++ /dev/null @@ -1,4 +0,0 @@ -static int width_tags(Bar *bar, BarArg *a); -static int draw_tags(Bar *bar, BarArg *a); -static int click_tags(Bar *bar, Arg *arg, BarArg *a); -static int hover_tags(Bar *bar, BarArg *a, XMotionEvent *ev); diff --git a/dwm/.dwm.old/patch/bar_vtcolors.c b/dwm/.dwm.old/patch/bar_vtcolors.c deleted file mode 100644 index 7c66e2d..0000000 --- a/dwm/.dwm.old/patch/bar_vtcolors.c +++ /dev/null @@ -1,69 +0,0 @@ -void -get_vt_colors(void) -{ - char *cfs[3] = { - "/sys/module/vt/parameters/default_red", - "/sys/module/vt/parameters/default_grn", - "/sys/module/vt/parameters/default_blu", - }; - char vtcs[16][8]; - char tk[] = ","; - char cl[64]; - char *tp = NULL; - FILE *fp; - size_t r; - int i, c, n, len; - for (i = 0; i < 16; i++) - strcpy(vtcs[i], "#000000"); - - for (i = 0, r = 0; i < 3; i++) { - if ((fp = fopen(cfs[i], "r")) == NULL) - continue; - while ((cl[r] = fgetc(fp)) != EOF && cl[r] != '\n') - r++; - cl[r] = '\0'; - for (c = 0, tp = cl, n = 0; c < 16; c++, tp++) { - if ((r = strcspn(tp, tk)) == -1) - break; - for (n = 0; r && *tp >= 48 && *tp < 58; r--, tp++) - n = n * 10 - 48 + *tp; - vtcs[c][i * 2 + 1] = n / 16 < 10 ? n / 16 + 48 : n / 16 + 87; - vtcs[c][i * 2 + 2] = n % 16 < 10 ? n % 16 + 48 : n % 16 + 87; - } - fclose(fp); - } - - len = LENGTH(colors); - if (len > LENGTH(color_ptrs)) - len = LENGTH(color_ptrs); - for (i = 0; i < len; i++) { - for (c = 0; c < ColCount; c++) { - n = color_ptrs[i][c]; - if (n > -1 && strlen(colors[i][c]) >= strlen(vtcs[n])) - memcpy(colors[i][c], vtcs[n], 7); - } - } -} - -int get_luminance(char *r) -{ - char *c = r; - int n[3] = {0}; - int i = 0; - - while (*c) { - if (*c >= 48 && *c < 58) - n[i / 2] = n[i / 2] * 16 - 48 + *c; - else if (*c >= 65 && *c < 71) - n[i / 2] = n[i / 2] * 16 - 55 + *c; - else if (*c >= 97 && *c < 103) - n[i / 2] = n[i / 2] * 16 - 87 + *c; - else - i--; - i++; - c++; - } - - return (0.299 * n[0] + 0.587 * n[1] + 0.114 * n[2]) / 2.55; -} - diff --git a/dwm/.dwm.old/patch/bar_vtcolors.h b/dwm/.dwm.old/patch/bar_vtcolors.h deleted file mode 100644 index 8c5d6c1..0000000 --- a/dwm/.dwm.old/patch/bar_vtcolors.h +++ /dev/null @@ -1,3 +0,0 @@ -static void get_vt_colors(void); -static int get_luminance(char *rgb); - diff --git a/dwm/.dwm.old/patch/bar_winicon.c b/dwm/.dwm.old/patch/bar_winicon.c deleted file mode 100644 index 697e8b9..0000000 --- a/dwm/.dwm.old/patch/bar_winicon.c +++ /dev/null @@ -1,145 +0,0 @@ -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); -} - -Picture -geticonprop(Window win, unsigned int *picw, unsigned int *pich) -{ - int format; - unsigned long n, extra, *p = NULL; - Atom real; - - if (XGetWindowProperty(dpy, win, netatom[NetWMIcon], 0L, LONG_MAX, False, AnyPropertyType, - &real, &format, &n, &extra, (unsigned char **)&p) != Success) - return None; - if (n == 0 || format != 32) { XFree(p); return None; } - - unsigned long *bstp = NULL; - uint32_t w, h, sz; - { - 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++) >= 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++) >= 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 None; } - } - - if ((w = *(bstp - 2)) == 0 || (h = *(bstp - 1)) == 0) { XFree(p); return None; } - - uint32_t icw, ich; - if (w <= h) { - ich = ICONSIZE; icw = w * ICONSIZE / h; - if (icw == 0) icw = 1; - } - else { - icw = ICONSIZE; ich = h * ICONSIZE / w; - if (ich == 0) ich = 1; - } - *picw = icw; *pich = ich; - - 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, srcw, srch, dstw, dsth); - imlib_free_image_and_decache(); - if (!scaled) return None; - imlib_context_set_image(scaled); - imlib_image_set_has_alpha(1); - - 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); - } - - 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) { - XRenderFreePicture(dpy, c->icon); - c->icon = None; - } -} - -void -updateicon(Client *c) -{ - freeicon(c); - c->icon = geticonprop(c->win, &c->icw, &c->ich); -} diff --git a/dwm/.dwm.old/patch/bar_winicon.h b/dwm/.dwm.old/patch/bar_winicon.h deleted file mode 100644 index 56fc6e3..0000000 --- a/dwm/.dwm.old/patch/bar_winicon.h +++ /dev/null @@ -1,9 +0,0 @@ -#include -#include -#include - -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); diff --git a/dwm/.dwm.old/patch/bar_wintitle.c b/dwm/.dwm.old/patch/bar_wintitle.c deleted file mode 100644 index fdb54ae..0000000 --- a/dwm/.dwm.old/patch/bar_wintitle.c +++ /dev/null @@ -1,88 +0,0 @@ -int -width_wintitle(Bar *bar, BarArg *a) -{ - return a->w; -} - -int -draw_wintitle(Bar *bar, BarArg *a) -{ - #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 - int x = a->x + lrpad / 2, w = a->w - lrpad / 2; - #elif BAR_TITLE_RIGHT_PAD_PATCH - int x = a->x, w = a->w - lrpad / 2; - #else - int x = a->x, w = a->w; - #endif // BAR_TITLE_LEFT_PAD_PATCH | BAR_TITLE_RIGHT_PAD_PATCH - Monitor *m = bar->mon; - Client *c = m->sel; - - if (!c) { - drw_setscheme(drw, scheme[SchemeTitleNorm]); - drw_rect(drw, x, a->y, w, a->h, 1, 1); - 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 (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 - 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); - #endif // BAR_IGNORE_XFT_ERRORS_WHEN_DRAWING_TEXT_PATCH - drawstateindicator(m, c, 1, x, a->y, w, a->h, 0, 0, c->isfixed); - return 1; -} - -int -click_wintitle(Bar *bar, Arg *arg, BarArg *a) -{ - return ClkWinTitle; -} - diff --git a/dwm/.dwm.old/patch/bar_wintitle.h b/dwm/.dwm.old/patch/bar_wintitle.h deleted file mode 100644 index 7e8cce5..0000000 --- a/dwm/.dwm.old/patch/bar_wintitle.h +++ /dev/null @@ -1,4 +0,0 @@ -static int width_wintitle(Bar *bar, BarArg *a); -static int draw_wintitle(Bar *bar, BarArg *a); -static int click_wintitle(Bar *bar, Arg *arg, BarArg *a); - diff --git a/dwm/.dwm.old/patch/bar_wintitle_floating.c b/dwm/.dwm.old/patch/bar_wintitle_floating.c deleted file mode 100644 index 3a15b8e..0000000 --- a/dwm/.dwm.old/patch/bar_wintitle_floating.c +++ /dev/null @@ -1,46 +0,0 @@ -int -width_wintitle_floating(Bar *bar, BarArg *a) -{ - return a->w; -} - -int -draw_wintitle_floating(Bar *bar, BarArg *a) -{ - drw_rect(drw, a->x, a->y, a->w, a->h, 1, 1); - return calc_wintitle_floating(bar->mon, a->x, a->w, -1, flextitledraw, NULL, a); -} - -int -click_wintitle_floating(Bar *bar, Arg *arg, BarArg *a) -{ - calc_wintitle_floating(bar->mon, 0, a->w, a->x, flextitleclick, arg, a); - return ClkWinTitle; -} - -int -calc_wintitle_floating( - Monitor *m, int offx, int tabw, int passx, - void(*tabfn)(Monitor *, Client *, int, int, int, int, Arg *arg, BarArg *barg), - Arg *arg, BarArg *barg -) { - Client *c; - int clientsnfloating = 0, w, r; - int groupactive = GRP_FLOAT; - - for (c = m->clients; c; c = c->next) { - if (!ISVISIBLE(c) || HIDDEN(c)) - continue; - if (c->isfloating) - clientsnfloating++; - } - - if (!clientsnfloating) - return 0; - - w = tabw / clientsnfloating; - r = tabw % clientsnfloating; - c = flextitledrawarea(m, m->clients, offx, r, w, clientsnfloating, SCHEMEFOR(GRP_FLOAT), 0, 0, 1, passx, tabfn, arg, barg); - return 1; -} - diff --git a/dwm/.dwm.old/patch/bar_wintitle_floating.h b/dwm/.dwm.old/patch/bar_wintitle_floating.h deleted file mode 100644 index e73d53a..0000000 --- a/dwm/.dwm.old/patch/bar_wintitle_floating.h +++ /dev/null @@ -1,9 +0,0 @@ -static int width_wintitle_floating(Bar *bar, BarArg *a); -static int draw_wintitle_floating(Bar *bar, BarArg *a); -static int click_wintitle_floating(Bar *bar, Arg *arg, BarArg *a); -static int calc_wintitle_floating( - Monitor *m, int offx, int tabw, int passx, - void(*tabfn)(Monitor *, Client *, int, int, int, int, Arg *arg, BarArg *barg), - Arg *arg, BarArg *barg -); - diff --git a/dwm/.dwm.old/patch/bar_wintitle_hidden.c b/dwm/.dwm.old/patch/bar_wintitle_hidden.c deleted file mode 100644 index 2d2414c..0000000 --- a/dwm/.dwm.old/patch/bar_wintitle_hidden.c +++ /dev/null @@ -1,46 +0,0 @@ -int -width_wintitle_hidden(Bar *bar, BarArg *a) -{ - return a->w; -} - -int -draw_wintitle_hidden(Bar *bar, BarArg *a) -{ - drw_rect(drw, a->x, a->y, a->w, a->h, 1, 1); - return calc_wintitle_hidden(bar->mon, a->x, a->w, -1, flextitledraw, NULL, a); -} - -int -click_wintitle_hidden(Bar *bar, Arg *arg, BarArg *a) -{ - calc_wintitle_hidden(bar->mon, 0, a->w, a->x, flextitleclick, arg, a); - return ClkWinTitle; -} - -int -calc_wintitle_hidden( - Monitor *m, int offx, int tabw, int passx, - void(*tabfn)(Monitor *, Client *, int, int, int, int, Arg *arg, BarArg *barg), - Arg *arg, BarArg *barg -) { - Client *c; - int clientsnhidden = 0, w, r; - int groupactive = GRP_HIDDEN; - - for (c = m->clients; c; c = c->next) { - if (!ISVISIBLE(c)) - continue; - if (HIDDEN(c)) - clientsnhidden++; - } - - if (!clientsnhidden) - return 0; - - w = tabw / clientsnhidden; - r = tabw % clientsnhidden; - c = flextitledrawarea(m, m->clients, offx, r, w, clientsnhidden, SCHEMEFOR(GRP_HIDDEN), 0, 1, 0, passx, tabfn, arg, barg); - return 1; -} - diff --git a/dwm/.dwm.old/patch/bar_wintitle_hidden.h b/dwm/.dwm.old/patch/bar_wintitle_hidden.h deleted file mode 100644 index 0495d49..0000000 --- a/dwm/.dwm.old/patch/bar_wintitle_hidden.h +++ /dev/null @@ -1,9 +0,0 @@ -static int width_wintitle_hidden(Bar *bar, BarArg *a); -static int draw_wintitle_hidden(Bar *bar, BarArg *a); -static int click_wintitle_hidden(Bar *bar, Arg *arg, BarArg *a); -static int calc_wintitle_hidden( - Monitor *m, int offx, int tabw, int passx, - void(*tabfn)(Monitor *, Client *, int, int, int, int, Arg *arg, BarArg *barg), - Arg *arg, BarArg *barg -); - diff --git a/dwm/.dwm.old/patch/bar_wintitleactions.c b/dwm/.dwm.old/patch/bar_wintitleactions.c deleted file mode 100644 index 61a5d21..0000000 --- a/dwm/.dwm.old/patch/bar_wintitleactions.c +++ /dev/null @@ -1,94 +0,0 @@ -void -hide(Client *c) { - - Client *n; - if (!c || HIDDEN(c)) - return; - - Window w = c->win; - static XWindowAttributes ra, ca; - - // more or less taken directly from blackbox's hide() function - XGrabServer(dpy); - XGetWindowAttributes(dpy, root, &ra); - XGetWindowAttributes(dpy, w, &ca); - // prevent UnmapNotify events - XSelectInput(dpy, root, ra.your_event_mask & ~SubstructureNotifyMask); - XSelectInput(dpy, w, ca.your_event_mask & ~StructureNotifyMask); - XUnmapWindow(dpy, w); - setclientstate(c, IconicState); - XSelectInput(dpy, root, ra.your_event_mask); - XSelectInput(dpy, w, ca.your_event_mask); - XUngrabServer(dpy); - - if (c->isfloating || !c->mon->lt[c->mon->sellt]->arrange) { - for (n = c->snext; n && (!ISVISIBLE(n) || HIDDEN(n)); n = n->snext); - if (!n) - for (n = c->mon->stack; n && (!ISVISIBLE(n) || HIDDEN(n)); n = n->snext); - } else { - n = nexttiled(c); - if (!n) - n = prevtiled(c); - } - focus(n); - arrange(c->mon); -} - -void -show(Client *c) -{ - if (!c || !HIDDEN(c)) - return; - - XMapWindow(dpy, c->win); - setclientstate(c, NormalState); - arrange(c->mon); -} - -void -togglewin(const Arg *arg) -{ - Client *c = (Client*)arg->v; - if (!c) - return; - if (c == selmon->sel) - hide(c); - else { - if (HIDDEN(c)) - show(c); - focus(c); - restack(c->mon); - } -} - -Client * -prevtiled(Client *c) -{ - Client *p, *i; - for (p = NULL, i = c->mon->clients; c && i != c; i = i->next) - if (ISVISIBLE(i) && !HIDDEN(i)) - p = i; - return p; -} - -void -showhideclient(const Arg *arg) -{ - Client *c = (Client*)arg->v; - if (!c) - c = selmon->sel; - if (!c) - return; - - #if WARP_PATCH - force_warp = 1; - #endif // WARP_PATCH - if (HIDDEN(c)) { - show(c); - focus(c); - restack(c->mon); - } else { - hide(c); - } -} - diff --git a/dwm/.dwm.old/patch/bar_wintitleactions.h b/dwm/.dwm.old/patch/bar_wintitleactions.h deleted file mode 100644 index 0c8d5f0..0000000 --- a/dwm/.dwm.old/patch/bar_wintitleactions.h +++ /dev/null @@ -1,6 +0,0 @@ -static void hide(Client *c); -static void show(Client *c); -static void togglewin(const Arg *arg); -static Client * prevtiled(Client *c); -static void showhideclient(const Arg *arg); - diff --git a/dwm/.dwm.old/patch/cfacts.c b/dwm/.dwm.old/patch/cfacts.c deleted file mode 100644 index e491a41..0000000 --- a/dwm/.dwm.old/patch/cfacts.c +++ /dev/null @@ -1,24 +0,0 @@ -void -setcfact(const Arg *arg) -{ - float f; - Client *c; - - c = selmon->sel; - - if (!arg || !c || !selmon->lt[selmon->sellt]->arrange) - return; - if (!arg->f) - f = 1.0; - else if (arg->f > 4.0) // set fact absolutely - f = arg->f - 4.0; - else - f = arg->f + c->cfact; - if (f < 0.25) - f = 0.25; - else if (f > 4.0) - f = 4.0; - c->cfact = f; - arrange(selmon); -} - diff --git a/dwm/.dwm.old/patch/cfacts.h b/dwm/.dwm.old/patch/cfacts.h deleted file mode 100644 index 97f9f1c..0000000 --- a/dwm/.dwm.old/patch/cfacts.h +++ /dev/null @@ -1,2 +0,0 @@ -static void setcfact(const Arg *arg); - diff --git a/dwm/.dwm.old/patch/cmdcustomize.c b/dwm/.dwm.old/patch/cmdcustomize.c deleted file mode 100644 index 9769660..0000000 --- a/dwm/.dwm.old/patch/cmdcustomize.c +++ /dev/null @@ -1,6 +0,0 @@ -char* -help(void) -{ - return "usage: dwm [-hv] [-fn font] [-nb color] [-nf color] [-sb color] [-sf color]\n[-df font] [-dnf color] [-dnb color] [-dsf color] [-dsb color]\n"; -} - diff --git a/dwm/.dwm.old/patch/cmdcustomize.h b/dwm/.dwm.old/patch/cmdcustomize.h deleted file mode 100644 index 46b75cf..0000000 --- a/dwm/.dwm.old/patch/cmdcustomize.h +++ /dev/null @@ -1,2 +0,0 @@ -static char* help(); - diff --git a/dwm/.dwm.old/patch/combo.c b/dwm/.dwm.old/patch/combo.c deleted file mode 100644 index 58b31f1..0000000 --- a/dwm/.dwm.old/patch/combo.c +++ /dev/null @@ -1,39 +0,0 @@ -static int combo = 0; - -#if !BAR_HOLDBAR_PATCH -void -keyrelease(XEvent *e) -{ - combo = 0; -} -#endif // !BAR_HOLDBAR_PATCH - -void -combotag(const Arg *arg) -{ - if (selmon->sel && arg->ui & TAGMASK) { - #if SWITCHTAG_PATCH - if (selmon->sel->switchtag) - selmon->sel->switchtag = 0; - #endif // SWITCHTAG_PATCH - if (combo) { - selmon->sel->tags |= arg->ui & TAGMASK; - } else { - combo = 1; - selmon->sel->tags = arg->ui & TAGMASK; - } - focus(NULL); - arrange(selmon); - } -} - -void -comboview(const Arg *arg) -{ - if (combo) { - view(&((Arg) { .ui = selmon->tagset[selmon->seltags] | (arg->ui & TAGMASK) })); - } else { - combo = 1; - view(arg); - } -} diff --git a/dwm/.dwm.old/patch/combo.h b/dwm/.dwm.old/patch/combo.h deleted file mode 100644 index 0c42136..0000000 --- a/dwm/.dwm.old/patch/combo.h +++ /dev/null @@ -1,6 +0,0 @@ -#if !BAR_HOLDBAR_PATCH -static void keyrelease(XEvent *e); -#endif // !BAR_HOLDBAR_PATCH -static void combotag(const Arg *arg); -static void comboview(const Arg *arg); - diff --git a/dwm/.dwm.old/patch/cool_autostart.c b/dwm/.dwm.old/patch/cool_autostart.c deleted file mode 100644 index ffd4ba3..0000000 --- a/dwm/.dwm.old/patch/cool_autostart.c +++ /dev/null @@ -1,29 +0,0 @@ -/* dwm will keep pid's of processes from autostart array and kill them at quit */ -static pid_t *autostart_pids; -static size_t autostart_len; - -/* execute command from autostart array */ -static void -autostart_exec() -{ - const char *const *p; - size_t i = 0; - - /* count entries */ - for (p = autostart; *p; autostart_len++, p++) - while (*++p); - - autostart_pids = malloc(autostart_len * sizeof(pid_t)); - for (p = autostart; *p; i++, p++) { - if ((autostart_pids[i] = fork()) == 0) { - setsid(); - execvp(*p, (char *const *)p); - fprintf(stderr, "dwm: execvp %s\n", *p); - perror(" failed"); - _exit(EXIT_FAILURE); - } - /* skip arguments */ - while (*++p); - } -} - diff --git a/dwm/.dwm.old/patch/cool_autostart.h b/dwm/.dwm.old/patch/cool_autostart.h deleted file mode 100644 index 5534d99..0000000 --- a/dwm/.dwm.old/patch/cool_autostart.h +++ /dev/null @@ -1,2 +0,0 @@ -static void autostart_exec(void); - diff --git a/dwm/.dwm.old/patch/cyclelayouts.c b/dwm/.dwm.old/patch/cyclelayouts.c deleted file mode 100644 index b8a6199..0000000 --- a/dwm/.dwm.old/patch/cyclelayouts.c +++ /dev/null @@ -1,10 +0,0 @@ -void -cyclelayout(const Arg *arg) -{ - int i; - int num_layouts = LENGTH(layouts); - - for (i = 0; i < num_layouts && &layouts[i] != selmon->lt[selmon->sellt]; i++); - i += arg->i; - setlayout(&((Arg) { .v = &layouts[(i % num_layouts + num_layouts) % num_layouts] })); // modulo -} diff --git a/dwm/.dwm.old/patch/cyclelayouts.h b/dwm/.dwm.old/patch/cyclelayouts.h deleted file mode 100644 index 3647d88..0000000 --- a/dwm/.dwm.old/patch/cyclelayouts.h +++ /dev/null @@ -1,2 +0,0 @@ -static void cyclelayout(const Arg *arg); - diff --git a/dwm/.dwm.old/patch/decorationhints.c b/dwm/.dwm.old/patch/decorationhints.c deleted file mode 100644 index 78be5ea..0000000 --- a/dwm/.dwm.old/patch/decorationhints.c +++ /dev/null @@ -1,39 +0,0 @@ -static Atom motifatom; - -void -updatemotifhints(Client *c) -{ - Atom real; - int format; - unsigned char *p = NULL; - unsigned long n, extra; - unsigned long *motif; - int width, height; - - if (!decorhints) - return; - - if (XGetWindowProperty(dpy, c->win, motifatom, 0L, 5L, False, motifatom, - &real, &format, &n, &extra, &p) == Success && p != NULL) { - motif = (unsigned long*)p; - if (motif[MWM_HINTS_FLAGS_FIELD] & MWM_HINTS_DECORATIONS) { - width = WIDTH(c); - height = HEIGHT(c); - - if (motif[MWM_HINTS_DECORATIONS_FIELD] & MWM_DECOR_ALL || - motif[MWM_HINTS_DECORATIONS_FIELD] & MWM_DECOR_BORDER || - motif[MWM_HINTS_DECORATIONS_FIELD] & MWM_DECOR_TITLE) - #if SETBORDERPX_PATCH - c->bw = c->oldbw = c->mon->borderpx; - #else - c->bw = c->oldbw = borderpx; - #endif // SETBORDERPX_PATCH - else - c->bw = c->oldbw = 0; - - resize(c, c->x, c->y, width - (2*c->bw), height - (2*c->bw), 0); - } - XFree(p); - } -} - diff --git a/dwm/.dwm.old/patch/decorationhints.h b/dwm/.dwm.old/patch/decorationhints.h deleted file mode 100644 index e28f507..0000000 --- a/dwm/.dwm.old/patch/decorationhints.h +++ /dev/null @@ -1,9 +0,0 @@ -#define MWM_HINTS_FLAGS_FIELD 0 -#define MWM_HINTS_DECORATIONS_FIELD 2 -#define MWM_HINTS_DECORATIONS (1 << 1) -#define MWM_DECOR_ALL (1 << 0) -#define MWM_DECOR_BORDER (1 << 1) -#define MWM_DECOR_TITLE (1 << 3) - -static void updatemotifhints(Client *c); - diff --git a/dwm/.dwm.old/patch/distributetags.c b/dwm/.dwm.old/patch/distributetags.c deleted file mode 100644 index f20f53f..0000000 --- a/dwm/.dwm.old/patch/distributetags.c +++ /dev/null @@ -1,31 +0,0 @@ -void -distributetags(const Arg *arg) -{ - Client *c; - unsigned int ui = 1; - int i = 0; - - #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)) - continue; - 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/dwm/.dwm.old/patch/distributetags.h b/dwm/.dwm.old/patch/distributetags.h deleted file mode 100644 index 3b276d9..0000000 --- a/dwm/.dwm.old/patch/distributetags.h +++ /dev/null @@ -1,2 +0,0 @@ -static void distributetags(const Arg *arg); - diff --git a/dwm/.dwm.old/patch/dragcfact.c b/dwm/.dwm.old/patch/dragcfact.c deleted file mode 100644 index 1b14513..0000000 --- a/dwm/.dwm.old/patch/dragcfact.c +++ /dev/null @@ -1,83 +0,0 @@ -void -dragcfact(const Arg *arg) -{ - int prev_x, prev_y, dist_x, dist_y; - float fact; - Client *c; - XEvent ev; - Time lasttime = 0; - - if (!(c = selmon->sel)) - return; - if (c->isfloating) { - resizemouse(arg); - return; - } - #if !FAKEFULLSCREEN_PATCH - #if FAKEFULLSCREEN_CLIENT_PATCH - if (c->isfullscreen && !c->fakefullscreen) /* no support resizing fullscreen windows by mouse */ - return; - #else - if (c->isfullscreen) /* no support resizing fullscreen windows by mouse */ - return; - #endif // FAKEFULLSCREEN_CLIENT_PATCH - #endif // !FAKEFULLSCREEN_PATCH - restack(selmon); - - if (XGrabPointer(dpy, root, False, MOUSEMASK, GrabModeAsync, GrabModeAsync, - None, cursor[CurIronCross]->cursor, CurrentTime) != GrabSuccess) - return; - - #if WARP_PATCH - ignore_warp = 1; - #endif // WARP_PATCH - - XWarpPointer(dpy, None, c->win, 0, 0, 0, 0, c->w/2, c->h/2); - - prev_x = prev_y = -999999; - - do { - XMaskEvent(dpy, MOUSEMASK|ExposureMask|SubstructureRedirectMask, &ev); - switch(ev.type) { - case ConfigureRequest: - case Expose: - case MapRequest: - handler[ev.type](&ev); - break; - case MotionNotify: - if ((ev.xmotion.time - lasttime) <= (1000 / 60)) - continue; - lasttime = ev.xmotion.time; - if (prev_x == -999999) { - prev_x = ev.xmotion.x_root; - prev_y = ev.xmotion.y_root; - } - - dist_x = ev.xmotion.x - prev_x; - dist_y = ev.xmotion.y - prev_y; - - if (abs(dist_x) > abs(dist_y)) { - fact = (float) 4.0 * dist_x / c->mon->ww; - } else { - fact = (float) -4.0 * dist_y / c->mon->wh; - } - - if (fact) - setcfact(&((Arg) { .f = fact })); - - prev_x = ev.xmotion.x; - prev_y = ev.xmotion.y; - break; - } - } while (ev.type != ButtonRelease); - - #if WARP_PATCH - ignore_warp = 0; - #endif // WARP_PATCH - - XWarpPointer(dpy, None, c->win, 0, 0, 0, 0, c->w/2, c->h/2); - - XUngrabPointer(dpy, CurrentTime); - while (XCheckMaskEvent(dpy, EnterWindowMask, &ev)); -} - diff --git a/dwm/.dwm.old/patch/dragcfact.h b/dwm/.dwm.old/patch/dragcfact.h deleted file mode 100644 index 6a29783..0000000 --- a/dwm/.dwm.old/patch/dragcfact.h +++ /dev/null @@ -1,2 +0,0 @@ -static void dragcfact(const Arg *arg); - diff --git a/dwm/.dwm.old/patch/dragmfact.c b/dwm/.dwm.old/patch/dragmfact.c deleted file mode 100644 index ee0ed9c..0000000 --- a/dwm/.dwm.old/patch/dragmfact.c +++ /dev/null @@ -1,232 +0,0 @@ -void -dragmfact(const Arg *arg) -{ - unsigned int n; - int py, px; // pointer coordinates - int ax, ay, aw, ah; // area position, width and height - int center = 0, horizontal = 0, mirror = 0, fixed = 0; // layout configuration - double fact; - Monitor *m; - XEvent ev; - Time lasttime = 0; - - m = selmon; - - #if VANITYGAPS_PATCH - int oh, ov, ih, iv; - getgaps(m, &oh, &ov, &ih, &iv, &n); - #else - Client *c; - for (n = 0, c = nexttiled(m->clients); c; c = nexttiled(c->next), n++); - #endif // VANITYGAPS_PATCH - - ax = m->wx; - ay = m->wy; - ah = m->wh; - aw = m->ww; - - if (!n) - return; - #if FLEXTILE_DELUXE_LAYOUT - else if (m->lt[m->sellt]->arrange == &flextile) { - int layout = m->ltaxis[LAYOUT]; - if (layout < 0) { - mirror = 1; - layout *= -1; - } - if (layout > FLOATING_MASTER) { - layout -= FLOATING_MASTER; - fixed = 1; - } - - if (layout == SPLIT_HORIZONTAL || layout == SPLIT_HORIZONTAL_DUAL_STACK) - horizontal = 1; - else if (layout == SPLIT_CENTERED_VERTICAL && (fixed || n - m->nmaster > 1)) - center = 1; - else if (layout == FLOATING_MASTER) { - center = 1; - if (aw < ah) - horizontal = 1; - } - else if (layout == SPLIT_CENTERED_HORIZONTAL) { - if (fixed || n - m->nmaster > 1) - center = 1; - horizontal = 1; - } - } - #endif // FLEXTILE_DELUXE_LAYOUT - #if CENTEREDMASTER_LAYOUT - else if (m->lt[m->sellt]->arrange == ¢eredmaster && (fixed || n - m->nmaster > 1)) - center = 1; - #endif // CENTEREDMASTER_LAYOUT - #if CENTEREDFLOATINGMASTER_LAYOUT - else if (m->lt[m->sellt]->arrange == ¢eredfloatingmaster) - center = 1; - #endif // CENTEREDFLOATINGMASTER_LAYOUT - #if BSTACK_LAYOUT - else if (m->lt[m->sellt]->arrange == &bstack) - horizontal = 1; - #endif // BSTACK_LAYOUT - #if BSTACKHORIZ_LAYOUT - else if (m->lt[m->sellt]->arrange == &bstackhoriz) - horizontal = 1; - #endif // BSTACKHORIZ_LAYOUT - - /* do not allow mfact to be modified under certain conditions */ - if (!m->lt[m->sellt]->arrange // floating layout - || (!fixed && m->nmaster && n <= m->nmaster) // no master - #if MONOCLE_LAYOUT - || m->lt[m->sellt]->arrange == &monocle - #endif // MONOCLE_LAYOUT - #if GRIDMODE_LAYOUT - || m->lt[m->sellt]->arrange == &grid - #endif // GRIDMODE_LAYOUT - #if HORIZGRID_LAYOUT - || m->lt[m->sellt]->arrange == &horizgrid - #endif // HORIZGRID_LAYOUT - #if GAPPLESSGRID_LAYOUT - || m->lt[m->sellt]->arrange == &gaplessgrid - #endif // GAPPLESSGRID_LAYOUT - #if NROWGRID_LAYOUT - || m->lt[m->sellt]->arrange == &nrowgrid - #endif // NROWGRID_LAYOUT - #if FLEXTILE_DELUXE_LAYOUT - || (m->lt[m->sellt]->arrange == &flextile && m->ltaxis[LAYOUT] == NO_SPLIT) - #endif // FLEXTILE_DELUXE_LAYOUT - ) - return; - - #if VANITYGAPS_PATCH - ay += oh; - ax += ov; - aw -= 2*ov; - ah -= 2*oh; - #endif // VANITYGAPS_PATCH - - if (center) { - if (horizontal) { - px = ax + aw / 2; - #if VANITYGAPS_PATCH - py = ay + ah / 2 + (ah - 2*ih) * (m->mfact / 2.0) + ih / 2; - #else - py = ay + ah / 2 + ah * m->mfact / 2.0; - #endif // VANITYGAPS_PATCH - } else { // vertical split - #if VANITYGAPS_PATCH - px = ax + aw / 2 + (aw - 2*iv) * m->mfact / 2.0 + iv / 2; - #else - px = ax + aw / 2 + aw * m->mfact / 2.0; - #endif // VANITYGAPS_PATCH - py = ay + ah / 2; - } - } else if (horizontal) { - px = ax + aw / 2; - if (mirror) - #if VANITYGAPS_PATCH - py = ay + (ah - ih) * (1.0 - m->mfact) + ih / 2; - #else - py = ay + (ah * (1.0 - m->mfact)); - #endif // VANITYGAPS_PATCH - else - #if VANITYGAPS_PATCH - py = ay + ((ah - ih) * m->mfact) + ih / 2; - #else - py = ay + (ah * m->mfact); - #endif // VANITYGAPS_PATCH - } else { // vertical split - if (mirror) - #if VANITYGAPS_PATCH - px = ax + (aw - iv) * (1.0 - m->mfact) + iv / 2; - #else - px = ax + (aw * m->mfact); - #endif // VANITYGAPS_PATCH - else - #if VANITYGAPS_PATCH - px = ax + ((aw - iv) * m->mfact) + iv / 2; - #else - px = ax + (aw * m->mfact); - #endif // VANITYGAPS_PATCH - py = ay + ah / 2; - } - - if (XGrabPointer(dpy, root, False, MOUSEMASK, GrabModeAsync, GrabModeAsync, - None, cursor[horizontal ? CurResizeVertArrow : CurResizeHorzArrow]->cursor, CurrentTime) != GrabSuccess) - return; - - #if WARP_PATCH - ignore_warp = 1; - #endif // WARP_PATCH - - XWarpPointer(dpy, None, root, 0, 0, 0, 0, px, py); - - do { - XMaskEvent(dpy, MOUSEMASK|ExposureMask|SubstructureRedirectMask, &ev); - switch(ev.type) { - case ConfigureRequest: - case Expose: - case MapRequest: - handler[ev.type](&ev); - break; - case MotionNotify: - if ((ev.xmotion.time - lasttime) <= (1000 / 40)) - continue; - if (lasttime != 0) { - px = ev.xmotion.x; - py = ev.xmotion.y; - } - lasttime = ev.xmotion.time; - - #if VANITYGAPS_PATCH - if (center) - if (horizontal) - if (py - ay > ah / 2) - fact = (double) 1.0 - (ay + ah - py - ih / 2) * 2 / (double) (ah - 2*ih); - else - fact = (double) 1.0 - (py - ay - ih / 2) * 2 / (double) (ah - 2*ih); - else - if (px - ax > aw / 2) - fact = (double) 1.0 - (ax + aw - px - iv / 2) * 2 / (double) (aw - 2*iv); - else - fact = (double) 1.0 - (px - ax - iv / 2) * 2 / (double) (aw - 2*iv); - else - if (horizontal) - fact = (double) (py - ay - ih / 2) / (double) (ah - ih); - else - fact = (double) (px - ax - iv / 2) / (double) (aw - iv); - #else - if (center) - if (horizontal) - if (py - ay > ah / 2) - fact = (double) 1.0 - (ay + ah - py) * 2 / (double) ah; - else - fact = (double) 1.0 - (py - ay) * 2 / (double) ah; - else - if (px - ax > aw / 2) - fact = (double) 1.0 - (ax + aw - px) * 2 / (double) aw; - else - fact = (double) 1.0 - (px - ax) * 2 / (double) aw; - else - if (horizontal) - fact = (double) (py - ay) / (double) ah; - else - fact = (double) (px - ax) / (double) aw; - #endif // VANITYGAPS_PATCH - - if (!center && mirror) - fact = 1.0 - fact; - - setmfact(&((Arg) { .f = 1.0 + fact })); - px = ev.xmotion.x; - py = ev.xmotion.y; - break; - } - } while (ev.type != ButtonRelease); - - #if WARP_PATCH - ignore_warp = 0; - #endif // WARP_PATCH - - XUngrabPointer(dpy, CurrentTime); - while (XCheckMaskEvent(dpy, EnterWindowMask, &ev)); -} - diff --git a/dwm/.dwm.old/patch/dragmfact.h b/dwm/.dwm.old/patch/dragmfact.h deleted file mode 100644 index a67432a..0000000 --- a/dwm/.dwm.old/patch/dragmfact.h +++ /dev/null @@ -1,2 +0,0 @@ -static void dragmfact(const Arg *arg); - diff --git a/dwm/.dwm.old/patch/dwmc b/dwm/.dwm.old/patch/dwmc deleted file mode 100755 index c2ddbe8..0000000 --- a/dwm/.dwm.old/patch/dwmc +++ /dev/null @@ -1,135 +0,0 @@ -#!/usr/bin/env bash - -signal() { - xsetroot -name "fsignal:$*" -} - -case $# in -1) - case $1 in - focusurgent) ;& - mirrorlayout) ;& - mpdcontrol) ;& - nametag) ;& - pushdown) ;& - pushup) ;& - self_restart) ;& - setlayout) ;& - setcfact) ;& - showhideclient) ;& - switchcol) ;& - view) ;& - viewall) ;& - viewtoleft) ;& - viewtoright) ;& - tagtoleft) ;& - tagtoright) ;& - tagandviewtoleft) ;& - tagandviewtoright) ;& - transfer) ;& - transferall) ;& - togglealttag) ;& - togglebar) ;& - togglefloating) ;& - togglefullscreen) ;& - fullscreen) ;& - togglefakefullscreen) ;& - togglesticky) ;& - togglehorizontalmax) ;& - toggleverticalmax) ;& - togglemax) ;& - togglegaps) ;& - defaultgaps) ;& - unfloatvisible) ;& - winview) ;& - xrdb) ;& - zoom) ;& - killclient) ;& - quit) - signal $1 - ;; - *) - echo "Unknown command ($1) or missing one argument." - exit 1 - ;; - esac - ;; -2) - case $1 in - cyclelayout) ;& - explace) ;& - moveplace) ;& - mpdchange) ;& - setkeymode) ;& - switchtag) ;& - togglescratch) ;& - view) - signal $1 ui $2 - ;; - viewex) ;& - toggleviewex) ;& - tagallmon) ;& - tagswapmon) ;& - tagex) ;& - toggletagex) ;& - setborderpx) ;& - setgaps) ;& - setlayoutex) ;& - setlayoutaxisex) ;& - swapfocus) ;& - focusstack) ;& - pushstack) ;& - inplacerotate) ;& - rotatestack) ;& - rotatelayoutaxis) ;& - incnmaster) ;& - incnstack) ;& - incrgaps) ;& - incrigaps) ;& - incrogaps) ;& - incrihgaps) ;& - incrivgaps) ;& - incrohgaps) ;& - incrovgaps) ;& - movestack) ;& - shiftview) ;& - shiftviewclients) ;& - focusmon) ;& - tagmon) - signal $1 i $2 - ;; - setcfact) ;& - setmfact) - signal $1 f $2 - ;; - floatpos) - signal $1 v $2 - ;; - *) - echo "Unknown command ($1) or too many arguments" - exit 1 - ;; - esac - ;; -5) - case $1 in - setgaps) - # Expects "setgaps oh ov ih iv" where -1 means to keep existing values - [ $2 = -1 ] && oh=128 || oh=$2 - [ $3 = -1 ] && ov=128 || ov=$3 - [ $4 = -1 ] && ih=128 || ih=$4 - [ $5 = -1 ] && iv=128 || iv=$5 - signal $1 i $(((oh << 24) + (ov << 16) + (ih << 8) + iv)) - ;; - *) - echo "Unknown command ($1) or too many arguments" - exit 1 - ;; - esac - ;; -*) - echo "Unknown command ($1) or too many arguments" - exit 1 - ;; -esac - diff --git a/dwm/.dwm.old/patch/dwmc.c b/dwm/.dwm.old/patch/dwmc.c deleted file mode 100644 index 17f226f..0000000 --- a/dwm/.dwm.old/patch/dwmc.c +++ /dev/null @@ -1,103 +0,0 @@ -void -setlayoutex(const Arg *arg) -{ - setlayout(&((Arg) { .v = &layouts[arg->i] })); -} - -void -viewex(const Arg *arg) -{ - view(&((Arg) { .ui = 1 << arg->ui })); -} - -void -viewallex(const Arg *arg) -{ - #if SCRATCHPADS_PATCH && !RENAMED_SCRATCHPADS_PATCH - view(&((Arg){.ui = ~SPTAGMASK})); - #else - view(&((Arg){.ui = ~0})); - #endif // SCRATCHPADS_PATCH -} - -void -toggleviewex(const Arg *arg) -{ - toggleview(&((Arg) { .ui = 1 << arg->ui })); -} - -void -tagex(const Arg *arg) -{ - tag(&((Arg) { .ui = 1 << arg->ui })); -} - -void -toggletagex(const Arg *arg) -{ - toggletag(&((Arg) { .ui = 1 << arg->ui })); -} - -void -tagallex(const Arg *arg) -{ - #if SCRATCHPADS_PATCH && !RENAMED_SCRATCHPADS_PATCH - tag(&((Arg){.ui = ~SPTAGMASK})); - #else - tag(&((Arg){.ui = ~0})); - #endif // SCRATCHPADS_PATCH -} - -int -fake_signal(void) -{ - char fsignal[256]; - char indicator[9] = "fsignal:"; - char str_sig[50]; - char param[16]; - int i, len_str_sig, n, paramn; - size_t len_fsignal, len_indicator = strlen(indicator); - Arg arg; - - // Get root name property - if (gettextprop(root, XA_WM_NAME, fsignal, sizeof(fsignal))) { - len_fsignal = strlen(fsignal); - - // Check if this is indeed a fake signal - if (len_indicator > len_fsignal ? 0 : strncmp(indicator, fsignal, len_indicator) == 0) { - paramn = sscanf(fsignal+len_indicator, "%s%n%s%n", str_sig, &len_str_sig, param, &n); - - if (paramn == 1) arg = (Arg) {0}; - else if (paramn > 2) return 1; - else if (strncmp(param, "i", n - len_str_sig) == 0) - #if IPC_PATCH - sscanf(fsignal + len_indicator + n, "%li", &(arg.i)); - #else - sscanf(fsignal + len_indicator + n, "%i", &(arg.i)); - #endif // IPC_PATCH - else if (strncmp(param, "ui", n - len_str_sig) == 0) - #if IPC_PATCH - sscanf(fsignal + len_indicator + n, "%lu", &(arg.ui)); - #else - sscanf(fsignal + len_indicator + n, "%u", &(arg.ui)); - #endif // IPC_PATCH - else if (strncmp(param, "f", n - len_str_sig) == 0) - sscanf(fsignal + len_indicator + n, "%f", &(arg.f)); - else if (strncmp(param, "v", n - len_str_sig) == 0) - arg.v = &(fsignal[len_indicator + n + 1]); - else return 1; - - // Check if a signal was found, and if so handle it - for (i = 0; i < LENGTH(signals); i++) - if (strncmp(str_sig, signals[i].sig, len_str_sig) == 0 && signals[i].func) - signals[i].func(&(arg)); - - // A fake signal was sent - return 1; - } - } - - // No fake signal was sent, so proceed with update - return 0; -} - diff --git a/dwm/.dwm.old/patch/dwmc.h b/dwm/.dwm.old/patch/dwmc.h deleted file mode 100644 index 66e23a9..0000000 --- a/dwm/.dwm.old/patch/dwmc.h +++ /dev/null @@ -1,14 +0,0 @@ -typedef struct { - const char * sig; - void (*func)(const Arg *); -} Signal; - -static void setlayoutex(const Arg *arg); -static void viewex(const Arg *arg); -static void viewallex(const Arg *arg); -static void toggleviewex(const Arg *arg); -static void tagex(const Arg *arg); -static void toggletagex(const Arg *arg); -static void tagallex(const Arg *arg); -static int fake_signal(void); - diff --git a/dwm/.dwm.old/patch/exresize.c b/dwm/.dwm.old/patch/exresize.c deleted file mode 100644 index ac3eab7..0000000 --- a/dwm/.dwm.old/patch/exresize.c +++ /dev/null @@ -1,196 +0,0 @@ -#define EXPAND_LEFT (1 << 0) -#define EXPAND_RIGHT (1 << 2) -#define EXPAND_UP (1 << 4) -#define EXPAND_DOWN (1 << 6) - -#define IS_SET(q, w) ((q & w) != 0) -#define IS_FORCED(q, w) IS_SET((q << 1), w) - -#define EXPANDALL (EXPAND_LEFT | EXPAND_RIGHT | EXPAND_UP | EXPAND_DOWN) -#define UNEXPAND (EXPANDALL << 1) // Force all directions to 0 -#define FORCE_EXPANDALL ~0 // Force expand in all directions - -void -exresize(const Arg *arg) -{ - Client *c; - int x, y, nx, ny, nw, nh; - c = selmon->sel; - - if (!c || !arg) return; - if (selmon->lt[selmon->sellt]->arrange && !c->isfloating) - togglefloating(NULL); - if (c->expandmask != 0) - expand(UNEXPAND); - - x = ((int *)arg->v)[0]; - y = ((int *)arg->v)[1]; - - nw = MIN(selmon->ww - c->bw*2, c->w + x); - nh = MIN(selmon->wh - c->bw*2, c->h + y); - nx = c->x - x/2; - ny = c->y - y/2; - - if (!((abs(c->x + c->w/2 - (selmon->wx + selmon->ww/2)) < snap))) { - if ((nw == selmon->ww) || - (nx < selmon->wx) || - (abs(selmon->wx - c->x) < snap)) - nx = selmon->wx; - else if ((nx+nw > (selmon->wx + selmon->ww)) || - (abs((selmon->wx + selmon->ww) - (c->x + c->w)) < snap)) - nx = (selmon->wx + selmon->ww) - nw - c->bw*2; - } else - nx = selmon->wx + selmon->ww/2 - nw/2; - - if (!((abs(c->y + c->h/2 - (selmon->wy + selmon->wh/2)) < snap))) { - - if ((nh == selmon->wh) || - (ny < selmon->wy) || - (abs(selmon->wy - c->y) < snap)) - ny = selmon->wy; - else if ((ny+nh > (selmon->wy + selmon->wh)) || - (abs((selmon->wy + selmon->wh) - (c->y + c->h)) < snap)) - ny = (selmon->wy + selmon->wh) - nh - c->bw*2; - } else - ny = selmon->wy + selmon->wh/2 - nh/2; - - - resizeclient(c, nx, ny, MAX(nw, 32), MAX(nh, 32)); - XWarpPointer(dpy, None, c->win, 0, 0, 0, 0, c->w/2, c->h/2); -} - -void -explace(const Arg *arg) -{ - Client *c; - int nx, ny; - - c = selmon->sel; - if (!c || (arg->ui >= 9)) return; - if (selmon->lt[selmon->sellt]->arrange && !c->isfloating) - togglefloating(NULL); - - nx = (arg->ui % 3) - 1; - ny = (arg->ui / 3) - 1; - - if (nx < 0) nx = selmon->wx; - else if (nx > 0) nx = selmon->wx + selmon->ww - c->w - c->bw*2; - else nx = selmon->wx + selmon->ww/2 - c->w/2; - - if (ny < 0) ny = selmon->wy; - else if (ny > 0) ny = selmon->wy + selmon->wh - c->h - c->bw*2; - else ny = selmon->wy + selmon->wh/2 - c->h/2; - - resize(c, nx, ny, c->w, c->h, True); - XWarpPointer(dpy, None, c->win, 0, 0, 0, 0, c->w/2, c->h/2); -} - -int -calculate_expand(unsigned char mask, unsigned char curmask, - unsigned char *newmask, unsigned char key, - int *reset_value, int new_reset_value, - int max_value, int old_value) -{ - if (IS_SET(key, mask) || - (IS_SET(key, curmask) && (!IS_SET(key, mask) && IS_FORCED(key, mask))) || - (!IS_SET(key, curmask) && (IS_SET(key, mask) && IS_FORCED(key, mask)))) { - - if (IS_SET(key, mask) && (!IS_SET(key,curmask) || IS_FORCED(key,mask))) { - if (!IS_SET(key, curmask)) - *reset_value = new_reset_value; - *newmask |= key; - return max_value; - } else if ((IS_SET(key,curmask) && IS_SET(key, mask)) || - (!IS_SET(key, mask) && IS_FORCED(key, mask))) { - *newmask &= ~key; - return *reset_value; - } else { - *newmask &= ~key; - return old_value; - } - } else - return new_reset_value; -} - -void -expand(unsigned char mask) -{ - XEvent ev; - int nx1, ny1, nx2, ny2; - #if SETBORDERPX_PATCH - int bp = selmon->borderpx; - #else - int bp = borderpx; - #endif // SETBORDERPX_PATCH - unsigned char curmask; - unsigned char newmask; - - if (!selmon->sel || selmon->sel->isfixed) - return; - XRaiseWindow(dpy, selmon->sel->win); - newmask = curmask = selmon->sel->expandmask; - - if (curmask == 0) { - if(!selmon->lt[selmon->sellt]->arrange || selmon->sel->isfloating) - selmon->sel->wasfloating = 1; - else { - togglefloating(NULL); - selmon->sel->wasfloating = 0; - } - } - - nx1 = calculate_expand(mask, curmask, &newmask, - EXPAND_LEFT, &selmon->sel->expandx1, - selmon->sel->x, - selmon->wx, - selmon->sel->oldx); - nx2 = calculate_expand(mask, curmask, &newmask, - EXPAND_RIGHT, &selmon->sel->expandx2, - selmon->sel->x + selmon->sel->w, - selmon->wx + selmon->ww - 2*bp, - selmon->sel->oldw + selmon->sel->x); - ny1 = calculate_expand(mask, curmask, &newmask, - EXPAND_UP, &selmon->sel->expandy1, - selmon->sel->y, - selmon->wy, - selmon->sel->oldy); - ny2 = calculate_expand(mask, curmask, &newmask, - EXPAND_DOWN, &selmon->sel->expandy2, - selmon->sel->y + selmon->sel->h, - selmon->wy + selmon->wh - 2*bp, - selmon->sel->oldh + selmon->sel->y); - - - resizeclient(selmon->sel, nx1, ny1, MAX(nx2-nx1, 32), MAX(ny2-ny1, 32)); - - if ((newmask == 0) && (!selmon->sel->wasfloating)) - togglefloating(NULL); - selmon->sel->expandmask = newmask; - drawbar(selmon); - while(XCheckMaskEvent(dpy, EnterWindowMask, &ev)); -} - -void -togglemaximize(const Arg *arg) -{ - if (arg->i > 0) expand(FORCE_EXPANDALL); - else if (arg->i < 0) expand(UNEXPAND); - else expand(EXPANDALL); -} - -void -toggleverticalexpand(const Arg *arg) -{ - if (arg->i < 0) expand(EXPAND_DOWN); - else if (arg->i > 0) expand(EXPAND_UP); - else expand(EXPAND_DOWN | EXPAND_UP); -} - -void -togglehorizontalexpand(const Arg *arg) -{ - if (arg->i < 0) expand(EXPAND_LEFT); - else if (arg->i > 0) expand(EXPAND_RIGHT); - else expand(EXPAND_LEFT | EXPAND_RIGHT); -} - diff --git a/dwm/.dwm.old/patch/exresize.h b/dwm/.dwm.old/patch/exresize.h deleted file mode 100644 index 73a636a..0000000 --- a/dwm/.dwm.old/patch/exresize.h +++ /dev/null @@ -1,9 +0,0 @@ -enum { EX_NW, EX_N, EX_NE, EX_W, EX_C, EX_E, EX_SW, EX_S, EX_SE }; - -void expand(unsigned char mask); -void togglemaximize(const Arg *arg); -void toggleverticalexpand(const Arg *arg); -void togglehorizontalexpand(const Arg *arg); -void exresize(const Arg *arg); -void explace(const Arg *arg); - diff --git a/dwm/.dwm.old/patch/fakefullscreenclient.c b/dwm/.dwm.old/patch/fakefullscreenclient.c deleted file mode 100644 index 509211f..0000000 --- a/dwm/.dwm.old/patch/fakefullscreenclient.c +++ /dev/null @@ -1,19 +0,0 @@ -void -togglefakefullscreen(const Arg *arg) -{ - Client *c = selmon->sel; - if (!c) - return; - - if (c->fakefullscreen != 1 && c->isfullscreen) { // exit fullscreen --> fake fullscreen - c->fakefullscreen = 2; - setfullscreen(c, 0); - } else if (c->fakefullscreen == 1) { - setfullscreen(c, 0); - c->fakefullscreen = 0; - } else { - c->fakefullscreen = 1; - setfullscreen(c, 1); - } -} - diff --git a/dwm/.dwm.old/patch/fakefullscreenclient.h b/dwm/.dwm.old/patch/fakefullscreenclient.h deleted file mode 100644 index 889eed6..0000000 --- a/dwm/.dwm.old/patch/fakefullscreenclient.h +++ /dev/null @@ -1,2 +0,0 @@ -static void togglefakefullscreen(const Arg *arg); - diff --git a/dwm/.dwm.old/patch/floatpos.c b/dwm/.dwm.old/patch/floatpos.c deleted file mode 100644 index f5e83a7..0000000 --- a/dwm/.dwm.old/patch/floatpos.c +++ /dev/null @@ -1,195 +0,0 @@ -void -floatpos(const Arg *arg) -{ - Client *c = selmon->sel; - - if (!c || (selmon->lt[selmon->sellt]->arrange && !c->isfloating)) - return; - - setfloatpos(c, (char *)arg->v); - resizeclient(c, c->x, c->y, c->w, c->h); - - #if !FOCUSONCLICK_PATCH - XRaiseWindow(dpy, c->win); - XWarpPointer(dpy, None, c->win, 0, 0, 0, 0, c->w/2, c->h/2); - #endif // FOCUSONCLICK_PATCH -} - -void -setfloatpos(Client *c, const char *floatpos) -{ - char xCh, yCh, wCh, hCh; - int x, y, w, h, wx, ww, wy, wh; - #if FLOATPOS_RESPECT_GAPS_PATCH && VANITYGAPS_PATCH - int oh, ov, ih, iv; - unsigned int n; - #endif // FLOATPOS_RESPECT_GAPS_PATCH | VANITYGAPS_PATCH - - if (!c || !floatpos) - return; - if (selmon->lt[selmon->sellt]->arrange && !c->isfloating) - return; - - switch(sscanf(floatpos, "%d%c %d%c %d%c %d%c", &x, &xCh, &y, &yCh, &w, &wCh, &h, &hCh)) { - case 4: - if (xCh == 'w' || xCh == 'W') { - w = x; wCh = xCh; - h = y; hCh = yCh; - x = -1; xCh = 'C'; - y = -1; yCh = 'C'; - } else if (xCh == 'p' || xCh == 'P') { - w = x; wCh = xCh; - h = y; hCh = yCh; - x = 0; xCh = 'G'; - y = 0; yCh = 'G'; - } else if (xCh == 'm' || xCh == 'M') { - getrootptr(&x, &y); - } else { - w = 0; wCh = 0; - h = 0; hCh = 0; - } - break; - case 8: - if (xCh == 'm' || xCh == 'M') - getrootptr(&x, &y); - break; - default: - return; - } - - #if FLOATPOS_RESPECT_GAPS_PATCH && VANITYGAPS_PATCH - getgaps(c->mon, &oh, &ov, &ih, &iv, &n); - wx = c->mon->wx + ov; - wy = c->mon->wy + oh; - ww = c->mon->ww - 2*ov; - wh = c->mon->wh - 2*oh; - #else - wx = c->mon->wx; - wy = c->mon->wy; - ww = c->mon->ww; - wh = c->mon->wh; - #endif // FLOATPOS_RESPECT_GAPS_PATCH | VANITYGAPS_PATCH - - getfloatpos(x, xCh, w, wCh, wx, ww, c->x, c->w, c->bw, floatposgrid_x, &c->x, &c->w); - getfloatpos(y, yCh, h, hCh, wy, wh, c->y, c->h, c->bw, floatposgrid_y, &c->y, &c->h); -} - -/* p - position, s - size, cp and cs represents current position and size */ -void -getfloatpos(int pos, char pCh, int size, char sCh, int min_p, int max_s, int cp, int cs, int cbw, int defgrid, int *out_p, int *out_s) -{ - int abs_p, abs_s, i, delta, rest; - - abs_p = pCh == 'A' || pCh == 'a'; - abs_s = sCh == 'A' || sCh == 'a'; - - cs += 2*cbw; - - switch(pCh) { - case 'A': // absolute position - cp = pos; - break; - case 'a': // absolute relative position - cp += pos; - break; - case 'y': - case 'x': // client relative position - cp = MIN(cp + pos, min_p + max_s); - break; - case 'Y': - case 'X': // client position relative to monitor - cp = min_p + MIN(pos, max_s); - break; - case 'S': // fixed client position (sticky) - case 'C': // fixed client position (center) - case 'Z': // fixed client right-hand position (position + size) - if (pos == -1) - break; - pos = MAX(MIN(pos, max_s), 0); - if (pCh == 'Z') - cs = abs((cp + cs) - (min_p + pos)); - else if (pCh == 'C') - cs = abs((cp + cs / 2) - (min_p + pos)); - else - cs = abs(cp - (min_p + pos)); - cp = min_p + pos; - sCh = 0; // size determined by position, override defined size - break; - case 'G': // grid - if (pos <= 0) - pos = defgrid; // default configurable - if (size == 0 || pos < 2 || (sCh != 'p' && sCh != 'P')) - break; - delta = (max_s - cs) / (pos - 1); - rest = max_s - cs - delta * (pos - 1); - if (sCh == 'P') { - if (size < 1 || size > pos) - break; - cp = min_p + delta * (size - 1); - } else { - for (i = 0; i < pos && cp >= min_p + delta * i + (i > pos - rest ? i + rest - pos + 1 : 0); i++); - cp = min_p + delta * (MAX(MIN(i + size, pos), 1) - 1) + (i > pos - rest ? i + rest - pos + 1 : 0); - } - break; - } - - switch(sCh) { - case 'A': // absolute size - cs = size; - break; - case 'a': // absolute relative size - cs = MAX(1, cs + size); - break; - case '%': // client size percentage in relation to monitor window area size - if (size <= 0) - break; - size = max_s * MIN(size, 100) / 100; - /* falls through */ - case 'h': - case 'w': // size relative to client - if (sCh == 'w' || sCh == 'h') { - if (size == 0) - break; - size += cs; - } - /* falls through */ - case 'H': - case 'W': // normal size, position takes precedence - if (pCh == 'S' && cp + size > min_p + max_s) - size = min_p + max_s - cp; - else if (size > max_s) - size = max_s; - - if (pCh == 'C') { // fixed client center, expand or contract client - delta = size - cs; - if (delta < 0 || (cp - delta / 2 + size <= min_p + max_s)) - cp -= delta / 2; - else if (cp - delta / 2 < min_p) - cp = min_p; - else if (delta) - cp = min_p + max_s; - } else if (pCh == 'Z') - cp -= size - cs; - - cs = size; - break; - } - - if (pCh == '%') // client mid-point position in relation to monitor window area size - cp = min_p + max_s * MAX(MIN(pos, 100), 0) / 100 - (cs) / 2; - if (pCh == 'm' || pCh == 'M') - cp = pos - cs / 2; - - if (!abs_p && cp < min_p) - cp = min_p; - if (cp + cs > min_p + max_s && !(abs_p && abs_s)) { - if (abs_p || cp == min_p) - cs = min_p + max_s - cp; - else - cp = min_p + max_s - cs; - } - - *out_p = cp; - *out_s = MAX(cs - 2*cbw, 1); -} - diff --git a/dwm/.dwm.old/patch/floatpos.h b/dwm/.dwm.old/patch/floatpos.h deleted file mode 100644 index ecdcf0b..0000000 --- a/dwm/.dwm.old/patch/floatpos.h +++ /dev/null @@ -1,4 +0,0 @@ -static void floatpos(const Arg *arg); -static void setfloatpos(Client *c, const char *floatpos); -static void getfloatpos(int pos, char pCh, int size, char sCh, int min_p, int max_s, int cp, int cs, int cbw, int defgrid, int *out_p, int *out_s); - diff --git a/dwm/.dwm.old/patch/focusadjacenttag.c b/dwm/.dwm.old/patch/focusadjacenttag.c deleted file mode 100644 index 67dd768..0000000 --- a/dwm/.dwm.old/patch/focusadjacenttag.c +++ /dev/null @@ -1,69 +0,0 @@ -void -tagtoleft(const Arg *arg) -{ - unsigned int MASK = (1 << NUMTAGS) - 1; - if (selmon->sel != NULL - && __builtin_popcount(selmon->tagset[selmon->seltags] & MASK) == 1 - && selmon->tagset[selmon->seltags] > 1) { - selmon->sel->tags >>= 1; - focus(NULL); - arrange(selmon); - } -} - -void -tagtoright(const Arg *arg) -{ - unsigned int MASK = (1 << NUMTAGS) - 1; - if (selmon->sel != NULL - && __builtin_popcount(selmon->tagset[selmon->seltags] & MASK) == 1 - && selmon->tagset[selmon->seltags] & (MASK >> 1)) { - selmon->sel->tags <<= 1; - focus(NULL); - arrange(selmon); - } -} - -void -viewtoleft(const Arg *arg) -{ - unsigned int MASK = (1 << NUMTAGS) - 1; - if (__builtin_popcount(selmon->tagset[selmon->seltags] & MASK) == 1 - && selmon->tagset[selmon->seltags] > 1) { - view(&((Arg) { .ui = selmon->tagset[selmon->seltags] >> 1 })); - } -} - -void -viewtoright(const Arg *arg) -{ - 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] & MASK) == 1 - && selmon->tagset[selmon->seltags] > 1) { - selmon->sel->tags >>= 1; - 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] & MASK) == 1 - && selmon->tagset[selmon->seltags] & (MASK >> 1)) { - selmon->sel->tags <<= 1; - view(&((Arg) { .ui = selmon->tagset[selmon->seltags] << 1 })); - } -} diff --git a/dwm/.dwm.old/patch/focusadjacenttag.h b/dwm/.dwm.old/patch/focusadjacenttag.h deleted file mode 100644 index abd7439..0000000 --- a/dwm/.dwm.old/patch/focusadjacenttag.h +++ /dev/null @@ -1,7 +0,0 @@ -static void tagtoleft(const Arg *arg); -static void tagtoright(const Arg *arg); -static void viewtoleft(const Arg *arg); -static void viewtoright(const Arg *arg); -static void tagandviewtoleft(const Arg *arg); -static void tagandviewtoright(const Arg *arg); - diff --git a/dwm/.dwm.old/patch/focusdir.c b/dwm/.dwm.old/patch/focusdir.c deleted file mode 100644 index 65798c5..0000000 --- a/dwm/.dwm.old/patch/focusdir.c +++ /dev/null @@ -1,66 +0,0 @@ -void -focusdir(const Arg *arg) -{ - Client *s = selmon->sel, *f = NULL, *c, *next; - - if (!s) - return; - - unsigned int score = -1; - unsigned int client_score; - int dist; - int dirweight = 20; - int isfloating = s->isfloating; - - next = s->next; - if (!next) - next = s->mon->clients; - for (c = next; c != s; c = next) { - - next = c->next; - if (!next) - next = s->mon->clients; - - if (!ISVISIBLE(c) || c->isfloating != isfloating) // || HIDDEN(c) - continue; - - switch (arg->i) { - case 0: // left - dist = s->x - c->x - c->w; - client_score = - dirweight * MIN(abs(dist), abs(dist + s->mon->ww)) + - abs(s->y - c->y); - break; - case 1: // right - dist = c->x - s->x - s->w; - client_score = - dirweight * MIN(abs(dist), abs(dist + s->mon->ww)) + - abs(c->y - s->y); - break; - case 2: // up - dist = s->y - c->y - c->h; - client_score = - dirweight * MIN(abs(dist), abs(dist + s->mon->wh)) + - abs(s->x - c->x); - break; - default: - case 3: // down - dist = c->y - s->y - s->h; - client_score = - dirweight * MIN(abs(dist), abs(dist + s->mon->wh)) + - abs(c->x - s->x); - break; - } - - if (((arg->i == 0 || arg->i == 2) && client_score <= score) || client_score < score) { - score = client_score; - f = c; - } - } - - if (f && f != s) { - focus(f); - restack(f->mon); - } -} - diff --git a/dwm/.dwm.old/patch/focusdir.h b/dwm/.dwm.old/patch/focusdir.h deleted file mode 100644 index 0d82ebf..0000000 --- a/dwm/.dwm.old/patch/focusdir.h +++ /dev/null @@ -1,2 +0,0 @@ -static void focusdir(const Arg *arg); - diff --git a/dwm/.dwm.old/patch/focusmaster.c b/dwm/.dwm.old/patch/focusmaster.c deleted file mode 100644 index 13a47e5..0000000 --- a/dwm/.dwm.old/patch/focusmaster.c +++ /dev/null @@ -1,14 +0,0 @@ -void -focusmaster(const Arg *arg) -{ - Client *c; - - if (selmon->nmaster < 1) - return; - - c = nexttiled(selmon->clients); - - if (c) - focus(c); -} - diff --git a/dwm/.dwm.old/patch/focusmaster.h b/dwm/.dwm.old/patch/focusmaster.h deleted file mode 100644 index 32e7c7c..0000000 --- a/dwm/.dwm.old/patch/focusmaster.h +++ /dev/null @@ -1,2 +0,0 @@ -static void focusmaster(const Arg *arg); - diff --git a/dwm/.dwm.old/patch/focusurgent.c b/dwm/.dwm.old/patch/focusurgent.c deleted file mode 100644 index 86a918e..0000000 --- a/dwm/.dwm.old/patch/focusurgent.c +++ /dev/null @@ -1,16 +0,0 @@ -void -focusurgent(const Arg *arg) -{ - Client *c; - int i; - for (c = selmon->clients; c && !c->isurgent; c = c->next); - if (c) { - for (i = 0; i < NUMTAGS && !((1 << i) & c->tags); i++); - if (i < NUMTAGS) { - if (((1 << i) & TAGMASK) != selmon->tagset[selmon->seltags]) - view(&((Arg) { .ui = 1 << i })); - focus(c); - } - } -} - diff --git a/dwm/.dwm.old/patch/focusurgent.h b/dwm/.dwm.old/patch/focusurgent.h deleted file mode 100644 index 854258d..0000000 --- a/dwm/.dwm.old/patch/focusurgent.h +++ /dev/null @@ -1,2 +0,0 @@ -static void focusurgent(const Arg *arg); - diff --git a/dwm/.dwm.old/patch/fsignal.c b/dwm/.dwm.old/patch/fsignal.c deleted file mode 100644 index b0ce2ea..0000000 --- a/dwm/.dwm.old/patch/fsignal.c +++ /dev/null @@ -1,41 +0,0 @@ -int -fake_signal(void) -{ - char fsignal[256]; - char indicator[9] = "fsignal:"; - char str_signum[16]; - int i, v, signum; - size_t len_fsignal, len_indicator = strlen(indicator); - - // Get root name property - if (gettextprop(root, XA_WM_NAME, fsignal, sizeof(fsignal))) { - len_fsignal = strlen(fsignal); - - // Check if this is indeed a fake signal - if (len_indicator > len_fsignal ? 0 : strncmp(indicator, fsignal, len_indicator) == 0) { - memcpy(str_signum, &fsignal[len_indicator], len_fsignal - len_indicator); - str_signum[len_fsignal - len_indicator] = '\0'; - - // Convert string value into managable integer - for (i = signum = 0; i < strlen(str_signum); i++) { - v = str_signum[i] - '0'; - if (v >= 0 && v <= 9) { - signum = signum * 10 + v; - } - } - - // Check if a signal was found, and if so handle it - if (signum) - for (i = 0; i < LENGTH(signals); i++) - if (signum == signals[i].signum && signals[i].func) - signals[i].func(&(signals[i].arg)); - - // A fake signal was sent - return 1; - } - } - - // No fake signal was sent, so proceed with update - return 0; -} - diff --git a/dwm/.dwm.old/patch/fsignal.h b/dwm/.dwm.old/patch/fsignal.h deleted file mode 100644 index 55fed6c..0000000 --- a/dwm/.dwm.old/patch/fsignal.h +++ /dev/null @@ -1,8 +0,0 @@ -typedef struct { - unsigned int signum; - void (*func)(const Arg *); - const Arg arg; -} Signal; - -static int fake_signal(void); - diff --git a/dwm/.dwm.old/patch/fullscreen.c b/dwm/.dwm.old/patch/fullscreen.c deleted file mode 100644 index 667cdc9..0000000 --- a/dwm/.dwm.old/patch/fullscreen.c +++ /dev/null @@ -1,18 +0,0 @@ -Layout *last_layout; - -void -fullscreen(const Arg *arg) -{ - int monocle_pos = 0; - if (selmon->showbar || last_layout == NULL) { - #if MONOCLE_LAYOUT - for (monocle_pos = 0, last_layout = (Layout *)layouts; !last_layout->arrange || last_layout->arrange != &monocle; monocle_pos++, last_layout++ ); - #endif // MONOCLE_LAYOUT - for (last_layout = (Layout *)layouts; last_layout != selmon->lt[selmon->sellt]; last_layout++); - setlayout(&((Arg) { .v = &layouts[monocle_pos] })); - } else { - setlayout(&((Arg) { .v = last_layout })); - } - togglebar(arg); -} - diff --git a/dwm/.dwm.old/patch/fullscreen.h b/dwm/.dwm.old/patch/fullscreen.h deleted file mode 100644 index 72983e1..0000000 --- a/dwm/.dwm.old/patch/fullscreen.h +++ /dev/null @@ -1,2 +0,0 @@ -static void fullscreen(const Arg *arg); - diff --git a/dwm/.dwm.old/patch/include.c b/dwm/.dwm.old/patch/include.c deleted file mode 100644 index 326323c..0000000 --- a/dwm/.dwm.old/patch/include.c +++ /dev/null @@ -1,392 +0,0 @@ -/* Bar functionality */ -#include "bar_indicators.c" -#include "bar_tagicons.c" -#include "bar.c" - -#if BAR_ALPHA_PATCH -#include "bar_alpha.c" -#endif -#if BAR_ALTERNATIVE_TAGS_PATCH -#include "bar_alternativetags.c" -#endif -#if BAR_ANYBAR_PATCH -#include "bar_anybar.c" -#endif -#if BAR_DWMBLOCKS_PATCH && BAR_STATUSCMD_PATCH -#include "bar_dwmblocks.c" -#endif -#if BAR_EWMHTAGS_PATCH -#include "bar_ewmhtags.c" -#endif -#if COMBO_PATCH -#include "combo.c" -#endif -#if BAR_LTSYMBOL_PATCH -#include "bar_ltsymbol.c" -#endif -#if BAR_POWERLINE_STATUS_PATCH -#include "bar_powerline_status.c" -#endif -#if BAR_POWERLINE_TAGS_PATCH -#include "bar_powerline_tags.c" -#endif -#if BAR_STATUS_PATCH -#include "bar_status.c" -#endif -#if BAR_STATUS2D_PATCH -#include "bar_status2d.c" -#endif -#if BAR_STATUSBUTTON_PATCH -#include "bar_statusbutton.c" -#endif -#if BAR_STATUSCMD_PATCH -#include "bar_statuscmd.c" -#endif -#if BAR_STATUSCOLORS_PATCH -#include "bar_statuscolors.c" -#endif -#if BAR_WINICON_PATCH -#include "bar_winicon.c" -#endif -#if BAR_TABGROUPS_PATCH -#include "bar_tabgroups.c" -#endif -#if BAR_TAGPREVIEW_PATCH -#include "bar_tagpreview.c" -#endif -#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 -#if BAR_WINTITLE_PATCH -#include "bar_wintitle.c" -#endif -#if BAR_FANCYBAR_PATCH -#include "bar_fancybar.c" -#endif -#if BAR_FLEXWINTITLE_PATCH -#include "bar_flexwintitle.c" -#if BAR_WINTITLE_FLOATING_PATCH -#include "bar_wintitle_floating.c" -#endif -#if BAR_WINTITLE_HIDDEN_PATCH -#include "bar_wintitle_hidden.c" -#endif -#endif // BAR_FLEXWINTITLE_PATCH -#if BAR_AWESOMEBAR_PATCH -#include "bar_awesomebar.c" -#endif -#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 -#if BAR_WINTITLEACTIONS_PATCH -#include "bar_wintitleactions.c" -#endif -#if BAR_LAYOUTMENU_PATCH -#include "bar_layoutmenu.c" -#endif - -/* Other patches */ -#if ALT_TAB_PATCH -#include "alttab.c" -#endif -#if ASPECTRESIZE_PATCH -#include "aspectresize.c" -#endif -#if ATTACHABOVE_PATCH || ATTACHASIDE_PATCH || ATTACHBELOW_PATCH || ATTACHBOTTOM_PATCH || SEAMLESS_RESTART_PATCH -#include "attachx.c" -#endif -#if AUTOSTART_PATCH -#include "autostart.c" -#endif -#if CFACTS_PATCH -#include "cfacts.c" -#endif -#if CMDCUSTOMIZE_PATCH -#include "cmdcustomize.c" -#endif -#if COOL_AUTOSTART_PATCH -#include "cool_autostart.c" -#endif -#if CYCLELAYOUTS_PATCH -#include "cyclelayouts.c" -#endif -#if DECORATION_HINTS_PATCH -#include "decorationhints.c" -#endif -#if DISTRIBUTETAGS_PATCH -#include "distributetags.c" -#endif -#if DRAGCFACT_PATCH && CFACTS_PATCH -#include "dragcfact.c" -#endif -#if DWMC_PATCH -#include "dwmc.c" -#elif FSIGNAL_PATCH -#include "fsignal.c" -#endif -#if EXRESIZE_PATCH -#include "exresize.c" -#endif -#if !FAKEFULLSCREEN_PATCH && FAKEFULLSCREEN_CLIENT_PATCH -#include "fakefullscreenclient.c" -#endif -#if FLOATPOS_PATCH -#include "floatpos.c" -#endif -#if FOCUSADJACENTTAG_PATCH -#include "focusadjacenttag.c" -#endif -#if FOCUSDIR_PATCH -#include "focusdir.c" -#endif -#if FOCUSMASTER_PATCH -#include "focusmaster.c" -#endif -#if FOCUSURGENT_PATCH -#include "focusurgent.c" -#endif -#if FULLSCREEN_PATCH -#include "fullscreen.c" -#endif -#if INPLACEROTATE_PATCH -#include "inplacerotate.c" -#endif -#if IPC_PATCH -#include "ipc.c" -#ifdef VERSION -#include "ipc/IPCClient.c" -#include "ipc/yajl_dumps.c" -#include "ipc/ipc.c" -#include "ipc/util.c" -#endif -#endif // IPC_PATCH -#if INSETS_PATCH -#include "insets.c" -#endif -#if KEYMODES_PATCH -#include "keymodes.c" -#endif -#if KILLUNSEL_PATCH -#include "killunsel.c" -#endif -#if MAXIMIZE_PATCH -#include "maximize.c" -#endif -#if MPDCONTROL_PATCH -#include "mpdcontrol.c" -#endif -#if MOVEPLACE_PATCH -#include "moveplace.c" -#endif -#if MOVERESIZE_PATCH -#include "moveresize.c" -#endif -#if MOVESTACK_PATCH -#include "movestack.c" -#endif -#if NAMETAG_PATCH -#include "nametag.c" -#endif -#if NO_MOD_BUTTONS_PATCH -#include "nomodbuttons.c" -#endif -#if PERTAG_PATCH -#include "pertag.c" -#endif -#if PLACEMOUSE_PATCH -#include "placemouse.c" -#endif -#if PUSH_NO_MASTER_PATCH -#include "push_no_master.c" -#elif PUSH_PATCH -#include "push.c" -#endif -#if REORGANIZETAGS_PATCH -#include "reorganizetags.c" -#endif -#if RESTARTSIG_PATCH -#include "restartsig.c" -#endif -#if RIODRAW_PATCH -#include "riodraw.c" -#endif -#if ROTATESTACK_PATCH -#include "rotatestack.c" -#endif -#if ROUNDED_CORNERS_PATCH -#include "roundedcorners.c" -#endif -#if RENAMED_SCRATCHPADS_PATCH -#include "renamed_scratchpads.c" -#elif SCRATCHPADS_PATCH -#include "scratchpad.c" -#endif -#if SCRATCHPAD_ALT_1_PATCH -#include "scratchpad_alt_1.c" -#endif -#if SELFRESTART_PATCH -#include "selfrestart.c" -#endif -#if SETBORDERPX_PATCH -#include "setborderpx.c" -#endif -#if SHIFTBOTH_PATCH || SHIFTSWAPTAGS_PATCH || SHIFTTAG_PATCH || SHIFTTAGCLIENTS_PATCH || SHIFTVIEW_PATCH || SHIFTVIEW_CLIENTS_PATCH -#include "shift.c" -#endif -#if SHIFTBOTH_PATCH -#include "shiftboth.c" -#endif -#if SHIFTSWAPTAGS_PATCH && SWAPTAGS_PATCH -#include "shiftswaptags.c" -#endif -#if SHIFTTAG_PATCH -#include "shifttag.c" -#endif -#if SHIFTTAGCLIENTS_PATCH -#include "shifttagclients.c" -#endif -#if SHIFTVIEW_PATCH -#include "shiftview.c" -#endif -#if SHIFTVIEW_CLIENTS_PATCH -#include "shiftviewclients.c" -#endif -#if SIZEHINTS_RULED_PATCH -#include "sizehints_ruled.c" -#endif -#if SORTSCREENS_PATCH -#ifdef XINERAMA -#include "sortscreens.c" -#endif // XINERAMA -#endif -#if STACKER_PATCH -#include "stacker.c" -#endif -#if STICKY_PATCH -#include "sticky.c" -#endif -#if SWALLOW_PATCH -#include "swallow.c" -#endif -#if SWAPFOCUS_PATCH && PERTAG_PATCH -#include "swapfocus.c" -#endif -#if SWAPTAGS_PATCH -#include "swaptags.c" -#endif -#if SWITCHCOL_PATCH -#include "switchcol.c" -#endif -#if TAB_PATCH -#include "tab.c" -#endif -#if TAGALL_PATCH -#include "tagall.c" -#endif -#if TAGALLMON_PATCH -#include "tagallmon.c" -#endif -#if TAGOTHERMONITOR_PATCH -#include "tagothermonitor.c" -#endif -#if TAGSWAPMON_PATCH -#include "tagswapmon.c" -#endif -#if TAPRESIZE_PATCH -#include "tapresize.c" -#endif -#if TOGGLEFULLSCREEN_PATCH -#include "togglefullscreen.c" -#endif -#if TRANSFER_PATCH -#include "transfer.c" -#endif -#if TRANSFER_ALL_PATCH -#include "transferall.c" -#endif -#if UNFLOATVISIBLE_PATCH -#include "unfloatvisible.c" -#endif -#if VANITYGAPS_PATCH -#include "vanitygaps.c" -#endif -#if WARP_PATCH -#include "warp.c" -#endif -#if WINVIEW_PATCH -#include "winview.c" -#endif -#if ZOOMSWAP_PATCH -#include "zoomswap.c" -#endif -#if XKB_PATCH -#include "xkb.c" -#endif -#if XRDB_PATCH && !BAR_VTCOLORS_PATCH -#include "xrdb.c" -#endif -#if DRAGMFACT_PATCH -#include "dragmfact.c" -#endif -#if SEAMLESS_RESTART_PATCH -#include "seamless_restart.c" -#endif -/* Layouts */ -#if BSTACK_LAYOUT || BSTACKHORIZ_LAYOUT || CENTEREDMASTER_LAYOUT || CENTEREDFLOATINGMASTER_LAYOUT || COLUMNS_LAYOUT || DECK_LAYOUT || TILE_LAYOUT -#include "layout_facts.c" -#endif -#if BSTACK_LAYOUT -#include "layout_bstack.c" -#endif -#if BSTACKHORIZ_LAYOUT -#include "layout_bstackhoriz.c" -#endif -#if CENTEREDMASTER_LAYOUT -#include "layout_centeredmaster.c" -#endif -#if CENTEREDFLOATINGMASTER_LAYOUT -#include "layout_centeredfloatingmaster.c" -#endif -#if COLUMNS_LAYOUT -#include "layout_columns.c" -#endif -#if DECK_LAYOUT -#include "layout_deck.c" -#endif -#if FIBONACCI_DWINDLE_LAYOUT || FIBONACCI_SPIRAL_LAYOUT -#include "layout_fibonacci.c" -#endif -#if FLEXTILE_DELUXE_LAYOUT -#include "layout_flextile-deluxe.c" -#endif -#if GAPPLESSGRID_LAYOUT -#include "layout_gapplessgrid.c" -#endif -#if GRIDMODE_LAYOUT -#include "layout_grid.c" -#endif -#if HORIZGRID_LAYOUT -#include "layout_horizgrid.c" -#endif -#if MONOCLE_LAYOUT -#include "layout_monocle.c" -#endif -#if NROWGRID_LAYOUT -#include "layout_nrowgrid.c" -#endif -#if TILE_LAYOUT -#include "layout_tile.c" -#endif - diff --git a/dwm/.dwm.old/patch/include.h b/dwm/.dwm.old/patch/include.h deleted file mode 100644 index 9ab7527..0000000 --- a/dwm/.dwm.old/patch/include.h +++ /dev/null @@ -1,385 +0,0 @@ -/* Bar functionality */ -#include "bar_indicators.h" -#include "bar_tagicons.h" -#include "bar.h" - -#if BAR_ALPHA_PATCH -#include "bar_alpha.h" -#endif -#if BAR_ALTERNATIVE_TAGS_PATCH -#include "bar_alternativetags.h" -#endif -#if BAR_ANYBAR_PATCH -#include "bar_anybar.h" -#endif -#if BAR_DWMBLOCKS_PATCH && BAR_STATUSCMD_PATCH -#include "bar_dwmblocks.h" -#endif -#if BAR_EWMHTAGS_PATCH -#include "bar_ewmhtags.h" -#endif -#if COMBO_PATCH -#include "combo.h" -#endif -#if BAR_HOLDBAR_PATCH -#include "bar_holdbar.h" -#endif -#if BAR_LTSYMBOL_PATCH -#include "bar_ltsymbol.h" -#endif -#if BAR_POWERLINE_STATUS_PATCH -#include "bar_powerline_status.h" -#endif -#if BAR_POWERLINE_TAGS_PATCH -#include "bar_powerline_tags.h" -#endif -#if BAR_STATUS_PATCH -#include "bar_status.h" -#endif -#if BAR_STATUS2D_PATCH -#include "bar_status2d.h" -#endif -#if BAR_STATUSBUTTON_PATCH -#include "bar_statusbutton.h" -#endif -#if BAR_STATUSCMD_PATCH -#include "bar_statuscmd.h" -#endif -#if BAR_STATUSCOLORS_PATCH -#include "bar_statuscolors.h" -#endif -#if BAR_WINICON_PATCH -#include "bar_winicon.h" -#endif -#if BAR_TABGROUPS_PATCH -#include "bar_tabgroups.h" -#endif -#if BAR_TAGS_PATCH -#include "bar_tags.h" -#endif -#if BAR_TAGLABELS_PATCH -#include "bar_taglabels.h" -#endif -#if BAR_TAGPREVIEW_PATCH -#include "bar_tagpreview.h" -#endif -#if BAR_TAGGRID_PATCH -#include "bar_taggrid.h" -#endif -#if BAR_WINTITLE_PATCH -#include "bar_wintitle.h" -#endif -#if BAR_FANCYBAR_PATCH -#include "bar_fancybar.h" -#endif -#if BAR_FLEXWINTITLE_PATCH -#include "bar_flexwintitle.h" -#if BAR_WINTITLE_FLOATING_PATCH -#include "bar_wintitle_floating.h" -#endif -#if BAR_WINTITLE_HIDDEN_PATCH -#include "bar_wintitle_hidden.h" -#endif -#endif // BAR_FLEXWINTITLE_PATCH -#if BAR_AWESOMEBAR_PATCH -#include "bar_awesomebar.h" -#endif -#if BAR_SYSTRAY_PATCH -#include "bar_systray.h" -#endif -#if BAR_VTCOLORS_PATCH -#include "bar_vtcolors.h" -#endif -#if BAR_WINTITLEACTIONS_PATCH -#include "bar_wintitleactions.h" -#endif -#if BAR_LAYOUTMENU_PATCH -#include "bar_layoutmenu.h" -#endif - -/* Other patches */ -#if ALT_TAB_PATCH -#include "alttab.h" -#endif -#if ASPECTRESIZE_PATCH -#include "aspectresize.h" -#endif -#if ATTACHABOVE_PATCH || ATTACHASIDE_PATCH || ATTACHBELOW_PATCH || ATTACHBOTTOM_PATCH || SEAMLESS_RESTART_PATCH -#include "attachx.h" -#endif -#if AUTOSTART_PATCH -#include "autostart.h" -#endif -#if CFACTS_PATCH -#include "cfacts.h" -#endif -#if CMDCUSTOMIZE_PATCH -#include "cmdcustomize.h" -#endif -#if COOL_AUTOSTART_PATCH -#include "cool_autostart.h" -#endif -#if CYCLELAYOUTS_PATCH -#include "cyclelayouts.h" -#endif -#if DECORATION_HINTS_PATCH -#include "decorationhints.h" -#endif -#if DISTRIBUTETAGS_PATCH -#include "distributetags.h" -#endif -#if DRAGCFACT_PATCH && CFACTS_PATCH -#include "dragcfact.h" -#endif -#if DRAGMFACT_PATCH -#include "dragmfact.h" -#endif -#if DWMC_PATCH -#include "dwmc.h" -#elif FSIGNAL_PATCH -#include "fsignal.h" -#endif -#if EXRESIZE_PATCH -#include "exresize.h" -#endif -#if !FAKEFULLSCREEN_PATCH && FAKEFULLSCREEN_CLIENT_PATCH -#include "fakefullscreenclient.h" -#endif -#if FLOATPOS_PATCH -#include "floatpos.h" -#endif -#if FOCUSDIR_PATCH -#include "focusdir.h" -#endif -#if FOCUSADJACENTTAG_PATCH -#include "focusadjacenttag.h" -#endif -#if FOCUSMASTER_PATCH -#include "focusmaster.h" -#endif -#if FOCUSURGENT_PATCH -#include "focusurgent.h" -#endif -#if FULLSCREEN_PATCH -#include "fullscreen.h" -#endif -#if INPLACEROTATE_PATCH -#include "inplacerotate.h" -#endif -#if IPC_PATCH -#include "ipc.h" -#include "ipc/ipc.h" -#include "ipc/util.h" -#endif -#if INSETS_PATCH -#include "insets.h" -#endif -#if KEYMODES_PATCH -#include "keymodes.h" -#endif -#if KILLUNSEL_PATCH -#include "killunsel.h" -#endif -#if MAXIMIZE_PATCH -#include "maximize.h" -#endif -#if MPDCONTROL_PATCH -#include "mpdcontrol.h" -#endif -#if MOVEPLACE_PATCH -#include "moveplace.h" -#endif -#if MOVERESIZE_PATCH -#include "moveresize.h" -#endif -#if MOVESTACK_PATCH -#include "movestack.h" -#endif -#if NAMETAG_PATCH -#include "nametag.h" -#endif -#if NO_MOD_BUTTONS_PATCH -#include "nomodbuttons.h" -#endif -#if PERTAG_PATCH -#include "pertag.h" -#endif -#if PLACEMOUSE_PATCH -#include "placemouse.h" -#endif -#if PUSH_NO_MASTER_PATCH -#include "push_no_master.h" -#elif PUSH_PATCH -#include "push.h" -#endif -#if REORGANIZETAGS_PATCH -#include "reorganizetags.h" -#endif -#if RESTARTSIG_PATCH -#include "restartsig.h" -#endif -#if RIODRAW_PATCH -#include "riodraw.h" -#endif -#if ROTATESTACK_PATCH -#include "rotatestack.h" -#endif -#if ROUNDED_CORNERS_PATCH -#include "roundedcorners.h" -#endif -#if RENAMED_SCRATCHPADS_PATCH -#include "renamed_scratchpads.h" -#elif SCRATCHPADS_PATCH -#include "scratchpad.h" -#endif -#if SCRATCHPAD_ALT_1_PATCH -#include "scratchpad_alt_1.h" -#endif -#if SEAMLESS_RESTART_PATCH -#include "seamless_restart.h" -#endif -#if SELFRESTART_PATCH -#include "selfrestart.h" -#endif -#if SETBORDERPX_PATCH -#include "setborderpx.h" -#endif -#if SHIFTBOTH_PATCH || SHIFTSWAPTAGS_PATCH || SHIFTTAG_PATCH || SHIFTTAGCLIENTS_PATCH || SHIFTVIEW_PATCH || SHIFTVIEW_CLIENTS_PATCH -#include "shift.h" -#endif -#if SHIFTBOTH_PATCH -#include "shiftboth.h" -#endif -#if SHIFTSWAPTAGS_PATCH && SWAPTAGS_PATCH -#include "shiftswaptags.h" -#endif -#if SHIFTTAG_PATCH -#include "shifttag.h" -#endif -#if SHIFTTAGCLIENTS_PATCH -#include "shifttagclients.h" -#endif -#if SHIFTVIEW_PATCH -#include "shiftview.h" -#endif -#if SHIFTVIEW_CLIENTS_PATCH -#include "shiftviewclients.h" -#endif -#if SIZEHINTS_RULED_PATCH -#include "sizehints_ruled.h" -#endif -#if SORTSCREENS_PATCH -#ifdef XINERAMA -#include "sortscreens.h" -#endif // XINERAMA -#endif -#if STACKER_PATCH -#include "stacker.h" -#endif -#if STICKY_PATCH -#include "sticky.h" -#endif -#if SWALLOW_PATCH -#include "swallow.h" -#endif -#if SWAPFOCUS_PATCH && PERTAG_PATCH -#include "swapfocus.h" -#endif -#if SWAPTAGS_PATCH -#include "swaptags.h" -#endif -#if SWITCHCOL_PATCH -#include "switchcol.h" -#endif -#if TAB_PATCH -#include "tab.h" -#endif -#if TAGALL_PATCH -#include "tagall.h" -#endif -#if TAGALLMON_PATCH -#include "tagallmon.h" -#endif -#if TAGOTHERMONITOR_PATCH -#include "tagothermonitor.h" -#endif -#if TAGSWAPMON_PATCH -#include "tagswapmon.h" -#endif -#if TAPRESIZE_PATCH -#include "tapresize.h" -#endif -#if TOGGLEFULLSCREEN_PATCH -#include "togglefullscreen.h" -#endif -#if TRANSFER_PATCH -#include "transfer.h" -#endif -#if TRANSFER_ALL_PATCH -#include "transferall.h" -#endif -#if UNFLOATVISIBLE_PATCH -#include "unfloatvisible.h" -#endif -#if VANITYGAPS_PATCH -#include "vanitygaps.h" -#endif -#if WARP_PATCH -#include "warp.h" -#endif -#if WINVIEW_PATCH -#include "winview.h" -#endif -#if ZOOMSWAP_PATCH -#include "zoomswap.h" -#endif -#if XKB_PATCH -#include "xkb.h" -#endif -#if XRDB_PATCH && !BAR_VTCOLORS_PATCH -#include "xrdb.h" -#endif -/* Layouts */ -#if BSTACK_LAYOUT -#include "layout_bstack.h" -#endif -#if BSTACKHORIZ_LAYOUT -#include "layout_bstackhoriz.h" -#endif -#if CENTEREDMASTER_LAYOUT -#include "layout_centeredmaster.h" -#endif -#if CENTEREDFLOATINGMASTER_LAYOUT -#include "layout_centeredfloatingmaster.h" -#endif -#if COLUMNS_LAYOUT -#include "layout_columns.h" -#endif -#if DECK_LAYOUT -#include "layout_deck.h" -#endif -#if FIBONACCI_DWINDLE_LAYOUT || FIBONACCI_SPIRAL_LAYOUT -#include "layout_fibonacci.h" -#endif -#if FLEXTILE_DELUXE_LAYOUT -#include "layout_flextile-deluxe.h" -#endif -#if GAPPLESSGRID_LAYOUT -#include "layout_gapplessgrid.h" -#endif -#if GRIDMODE_LAYOUT -#include "layout_grid.h" -#endif -#if HORIZGRID_LAYOUT -#include "layout_horizgrid.h" -#endif -#if MONOCLE_LAYOUT -#include "layout_monocle.h" -#endif -#if NROWGRID_LAYOUT -#include "layout_nrowgrid.h" -#endif -#if TILE_LAYOUT -#include "layout_tile.h" -#endif - diff --git a/dwm/.dwm.old/patch/inplacerotate.c b/dwm/.dwm.old/patch/inplacerotate.c deleted file mode 100644 index b700e04..0000000 --- a/dwm/.dwm.old/patch/inplacerotate.c +++ /dev/null @@ -1,84 +0,0 @@ -void -insertclient(Client *item, Client *insertItem, int after) -{ - Client *c; - if (item == NULL || insertItem == NULL || item == insertItem) - return; - detach(insertItem); - if (!after && selmon->clients == item) { - attach(insertItem); - return; - } - if (after) { - c = item; - } else { - for (c = selmon->clients; c; c = c->next) { - if (c->next == item) - break; - } - } - insertItem->next = c->next; - c->next = insertItem; -} - -void -inplacerotate(const Arg *arg) -{ - if (!selmon->sel || (selmon->sel->isfloating && !arg->f)) - return; - - unsigned int selidx = 0, i = 0; - Client *c = NULL, *stail = NULL, *mhead = NULL, *mtail = NULL, *shead = NULL; - - // Determine positionings for insertclient - for (c = selmon->clients; c; c = c->next) { - if (ISVISIBLE(c) && !(c->isfloating)) { - if (selmon->sel == c) - selidx = i; - if (i == selmon->nmaster - 1) - mtail = c; - if (i == selmon->nmaster) - shead = c; - if (mhead == NULL) - mhead = c; - stail = c; - i++; - } - } - - switch(arg->i) { - case 1: - if (selidx >= selmon->nmaster) - insertclient(shead, stail, 0); - else - insertclient(mhead, mtail, 0); - break; - case -1: - if (selidx >= selmon->nmaster) - insertclient(stail, shead, 1); - else - insertclient(mtail, mhead, 1); - break; - case 2: - insertclient(selmon->clients, stail, 0); - break; - case -2: - insertclient(stail, selmon->clients, 1); - break; - } - - // Restore focus position - i = 0; - for (c = selmon->clients; c; c = c->next) { - if (!ISVISIBLE(c) || (c->isfloating)) - continue; - if (i == selidx) { - focus(c); - break; - } - i++; - } - arrange(selmon); - focus(c); -} - diff --git a/dwm/.dwm.old/patch/inplacerotate.h b/dwm/.dwm.old/patch/inplacerotate.h deleted file mode 100644 index 2669375..0000000 --- a/dwm/.dwm.old/patch/inplacerotate.h +++ /dev/null @@ -1,2 +0,0 @@ -static void inplacerotate(const Arg *arg); - diff --git a/dwm/.dwm.old/patch/insets.c b/dwm/.dwm.old/patch/insets.c deleted file mode 100644 index 8ad99b3..0000000 --- a/dwm/.dwm.old/patch/insets.c +++ /dev/null @@ -1,19 +0,0 @@ -void -setinset(Monitor *m, Inset inset) -{ - Bar *bar; - m->inset = inset; - updatebarpos(m); - for (bar = m->bar; bar; bar = bar->next) - XMoveResizeWindow(dpy, bar->win, bar->bx, bar->by, bar->bw, bar->bh); - arrange(m); -} - -void -updateinset(const Arg *arg) -{ - Inset *inset = (Inset *)arg->v; - for (Monitor *m = mons; m; m = m->next) - setinset(m, *inset); -} - diff --git a/dwm/.dwm.old/patch/insets.h b/dwm/.dwm.old/patch/insets.h deleted file mode 100644 index 54635db..0000000 --- a/dwm/.dwm.old/patch/insets.h +++ /dev/null @@ -1,3 +0,0 @@ -static void setinset(Monitor *m, Inset inset); -static void updateinset(const Arg *arg); - diff --git a/dwm/.dwm.old/patch/ipc.c b/dwm/.dwm.old/patch/ipc.c deleted file mode 100644 index f5ec62c..0000000 --- a/dwm/.dwm.old/patch/ipc.c +++ /dev/null @@ -1,111 +0,0 @@ -static int epoll_fd; -static int dpy_fd; -static Monitor *lastselmon; - -int -handlexevent(struct epoll_event *ev) -{ - if (ev->events & EPOLLIN) { - XEvent ev; - while (running && XPending(dpy)) { - XNextEvent(dpy, &ev); - #if XKB_PATCH - /* Unfortunately the xkbEventType is not constant hence it can't be part of the - * normal event handler below */ - if (ev.type == xkbEventType) { - xkbeventnotify(&ev); - continue; - } - #endif // XKB_PATCH - - if (handler[ev.type]) { - handler[ev.type](&ev); /* call handler */ - ipc_send_events(mons, &lastselmon, selmon); - } - } - } else if (ev-> events & EPOLLHUP) - return -1; - - return 0; -} - -void -setlayoutsafe(const Arg *arg) -{ - const Layout *ltptr = (Layout *)arg->v; - if (ltptr == 0) - setlayout(arg); - for (int i = 0; i < LENGTH(layouts); i++) { - if (ltptr == &layouts[i]) - setlayout(arg); - } -} - -void -setupepoll(void) -{ - epoll_fd = epoll_create1(0); - dpy_fd = ConnectionNumber(dpy); - struct epoll_event dpy_event; - - // Initialize struct to 0 - memset(&dpy_event, 0, sizeof(dpy_event)); - - DEBUG("Display socket is fd %d\n", dpy_fd); - - if (epoll_fd == -1) - fputs("Failed to create epoll file descriptor", stderr); - - dpy_event.events = EPOLLIN; - dpy_event.data.fd = dpy_fd; - if (epoll_ctl(epoll_fd, EPOLL_CTL_ADD, dpy_fd, &dpy_event)) { - fputs("Failed to add display file descriptor to epoll", stderr); - close(epoll_fd); - exit(1); - } - - if (ipc_init(ipcsockpath, epoll_fd, ipccommands, LENGTH(ipccommands)) < 0) - fputs("Failed to initialize IPC\n", stderr); -} - -void -setstatus(const Arg *arg) -{ - Monitor *m; - #if BAR_EXTRASTATUS_PATCH - if (arg->v == NULL) { - strcpy(stext, "dwm-"VERSION); - estext[0] = '\0'; - } else { - strcpy(rawstext, arg->v); - char *e = strchr(rawstext, statussep); - if (e) { - *e = '\0'; e++; - #if BAR_STATUSCMD_PATCH - strncpy(rawestext, e, sizeof(estext) - 1); - copyvalidchars(estext, rawestext); - #else - strncpy(estext, e, sizeof(estext) - 1); - #endif // BAR_STATUSCMD_PATCH - } else { - estext[0] = '\0'; - } - #if BAR_STATUSCMD_PATCH - copyvalidchars(stext, rawstext); - #else - strncpy(stext, rawstext, sizeof(stext) - 1); - #endif // BAR_STATUSCMD_PATCH - } - #elif BAR_STATUSCMD_PATCH - if (!gettextprop(root, XA_WM_NAME, rawstext, sizeof(rawstext))) - strcpy(stext, "dwm-"VERSION); - else - copyvalidchars(stext, rawstext); - #else - if (!gettextprop(root, XA_WM_NAME, stext, sizeof(stext))) - strcpy(stext, "dwm-"VERSION); - #endif // BAR_EXTRASTATUS_PATCH | BAR_STATUSCMD_PATCH - for (m = mons; m; m = m->next) - drawbar(m); -} - diff --git a/dwm/.dwm.old/patch/ipc.h b/dwm/.dwm.old/patch/ipc.h deleted file mode 100644 index ac8fb73..0000000 --- a/dwm/.dwm.old/patch/ipc.h +++ /dev/null @@ -1,7 +0,0 @@ -#include - -static int handlexevent(struct epoll_event *ev); -static void setlayoutsafe(const Arg *arg); -static void setupepoll(void); -static void setstatus(const Arg *arg); - diff --git a/dwm/.dwm.old/patch/ipc/IPCClient.c b/dwm/.dwm.old/patch/ipc/IPCClient.c deleted file mode 100644 index a157513..0000000 --- a/dwm/.dwm.old/patch/ipc/IPCClient.c +++ /dev/null @@ -1,67 +0,0 @@ -#include "IPCClient.h" - -#include -#include - -#include "util.h" - -IPCClient * -ipc_client_new(int fd) -{ - IPCClient *c = (IPCClient *)malloc(sizeof(IPCClient)); - - if (c == NULL) return NULL; - - // Initialize struct - memset(&c->event, 0, sizeof(struct epoll_event)); - - c->buffer_size = 0; - c->buffer = NULL; - c->fd = fd; - c->event.data.fd = fd; - c->next = NULL; - c->prev = NULL; - c->subscriptions = 0; - - return c; -} - -void -ipc_list_add_client(IPCClientList *list, IPCClient *nc) -{ - DEBUG("Adding client with fd %d to list\n", nc->fd); - - if (*list == NULL) { - // List is empty, point list at first client - *list = nc; - } else { - IPCClient *c; - // Go to last client in list - for (c = *list; c && c->next; c = c->next) - ; - c->next = nc; - nc->prev = c; - } -} - -void -ipc_list_remove_client(IPCClientList *list, IPCClient *c) -{ - IPCClient *cprev = c->prev; - IPCClient *cnext = c->next; - - if (cprev != NULL) cprev->next = c->next; - if (cnext != NULL) cnext->prev = c->prev; - if (c == *list) *list = c->next; -} - -IPCClient * -ipc_list_get_client(IPCClientList list, int fd) -{ - for (IPCClient *c = list; c; c = c->next) { - if (c->fd == fd) return c; - } - - return NULL; -} - diff --git a/dwm/.dwm.old/patch/ipc/IPCClient.h b/dwm/.dwm.old/patch/ipc/IPCClient.h deleted file mode 100644 index ee93030..0000000 --- a/dwm/.dwm.old/patch/ipc/IPCClient.h +++ /dev/null @@ -1,62 +0,0 @@ -#ifndef IPC_CLIENT_H_ -#define IPC_CLIENT_H_ - -#include -#include -#include - -typedef struct IPCClient IPCClient; -/** - * This structure contains the details of an IPC Client and pointers for a - * linked list - */ -struct IPCClient { - int fd; - int subscriptions; - - char *buffer; - uint32_t buffer_size; - - struct epoll_event event; - IPCClient *next; - IPCClient *prev; -}; - -typedef IPCClient *IPCClientList; - -/** - * Allocate memory for new IPCClient with the specified file descriptor and - * initialize struct. - * - * @param fd File descriptor of IPC client - * - * @return Address to allocated IPCClient struct - */ -IPCClient *ipc_client_new(int fd); - -/** - * Add an IPC Client to the specified list - * - * @param list Address of the list to add the client to - * @param nc Address of the IPCClient - */ -void ipc_list_add_client(IPCClientList *list, IPCClient *nc); - -/** - * Remove an IPCClient from the specified list - * - * @param list Address of the list to remove the client from - * @param c Address of the IPCClient - */ -void ipc_list_remove_client(IPCClientList *list, IPCClient *c); - -/** - * Get an IPCClient from the specified IPCClient list - * - * @param list List to remove the client from - * @param fd File descriptor of the IPCClient - */ -IPCClient *ipc_list_get_client(IPCClientList list, int fd); - -#endif // IPC_CLIENT_H_ - diff --git a/dwm/.dwm.old/patch/ipc/dwm-msg.c b/dwm/.dwm.old/patch/ipc/dwm-msg.c deleted file mode 100644 index ca1e1a4..0000000 --- a/dwm/.dwm.old/patch/ipc/dwm-msg.c +++ /dev/null @@ -1,549 +0,0 @@ -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include - -#define IPC_MAGIC "DWM-IPC" -// clang-format off -#define IPC_MAGIC_ARR { 'D', 'W', 'M', '-', 'I', 'P', 'C' } -// clang-format on -#define IPC_MAGIC_LEN 7 // Not including null char - -#define IPC_EVENT_TAG_CHANGE "tag_change_event" -#define IPC_EVENT_CLIENT_FOCUS_CHANGE "client_focus_change_event" -#define IPC_EVENT_LAYOUT_CHANGE "layout_change_event" -#define IPC_EVENT_MONITOR_FOCUS_CHANGE "monitor_focus_change_event" -#define IPC_EVENT_FOCUSED_TITLE_CHANGE "focused_title_change_event" -#define IPC_EVENT_FOCUSED_STATE_CHANGE "focused_state_change_event" - -#define YSTR(str) yajl_gen_string(gen, (unsigned char *)str, strlen(str)) -#define YINT(num) yajl_gen_integer(gen, num) -#define YDOUBLE(num) yajl_gen_double(gen, num) -#define YBOOL(v) yajl_gen_bool(gen, v) -#define YNULL() yajl_gen_null(gen) -#define YARR(body) \ - { \ - yajl_gen_array_open(gen); \ - body; \ - yajl_gen_array_close(gen); \ - } -#define YMAP(body) \ - { \ - yajl_gen_map_open(gen); \ - body; \ - yajl_gen_map_close(gen); \ - } - -typedef unsigned long Window; - -const char *DEFAULT_SOCKET_PATH = "/tmp/dwm.sock"; -static int sock_fd = -1; -static unsigned int ignore_reply = 0; - -typedef enum IPCMessageType { - IPC_TYPE_RUN_COMMAND = 0, - IPC_TYPE_GET_MONITORS = 1, - IPC_TYPE_GET_TAGS = 2, - IPC_TYPE_GET_LAYOUTS = 3, - IPC_TYPE_GET_DWM_CLIENT = 4, - IPC_TYPE_SUBSCRIBE = 5, - IPC_TYPE_EVENT = 6 -} IPCMessageType; - -// Every IPC message must begin with this -typedef struct dwm_ipc_header { - uint8_t magic[IPC_MAGIC_LEN]; - uint32_t size; - uint8_t type; -} __attribute((packed)) dwm_ipc_header_t; - -static int -recv_message(uint8_t *msg_type, uint32_t *reply_size, uint8_t **reply) -{ - uint32_t read_bytes = 0; - const int32_t to_read = sizeof(dwm_ipc_header_t); - char header[to_read]; - char *walk = header; - - // Try to read header - while (read_bytes < to_read) { - ssize_t n = read(sock_fd, header + read_bytes, to_read - read_bytes); - - if (n == 0) { - if (read_bytes == 0) { - fprintf(stderr, "Unexpectedly reached EOF while reading header."); - fprintf(stderr, - "Read %" PRIu32 " bytes, expected %" PRIu32 " total bytes.\n", - read_bytes, to_read); - return -2; - } else { - fprintf(stderr, "Unexpectedly reached EOF while reading header."); - fprintf(stderr, - "Read %" PRIu32 " bytes, expected %" PRIu32 " total bytes.\n", - read_bytes, to_read); - return -3; - } - } else if (n == -1) { - return -1; - } - - read_bytes += n; - } - - // Check if magic string in header matches - if (memcmp(walk, IPC_MAGIC, IPC_MAGIC_LEN) != 0) { - fprintf(stderr, "Invalid magic string. Got '%.*s', expected '%s'\n", - IPC_MAGIC_LEN, walk, IPC_MAGIC); - return -3; - } - - walk += IPC_MAGIC_LEN; - - // Extract reply size - memcpy(reply_size, walk, sizeof(uint32_t)); - walk += sizeof(uint32_t); - - // Extract message type - memcpy(msg_type, walk, sizeof(uint8_t)); - walk += sizeof(uint8_t); - - (*reply) = malloc(*reply_size); - - // Extract payload - read_bytes = 0; - while (read_bytes < *reply_size) { - ssize_t n = read(sock_fd, *reply + read_bytes, *reply_size - read_bytes); - - if (n == 0) { - fprintf(stderr, "Unexpectedly reached EOF while reading payload."); - fprintf(stderr, "Read %" PRIu32 " bytes, expected %" PRIu32 " bytes.\n", - read_bytes, *reply_size); - free(*reply); - return -2; - } else if (n == -1) { - if (errno == EINTR || errno == EAGAIN) continue; - free(*reply); - return -1; - } - - read_bytes += n; - } - - return 0; -} - -static int -read_socket(IPCMessageType *msg_type, uint32_t *msg_size, char **msg) -{ - int ret = -1; - - while (ret != 0) { - ret = recv_message((uint8_t *)msg_type, msg_size, (uint8_t **)msg); - - if (ret < 0) { - // Try again (non-fatal error) - if (ret == -1 && (errno == EINTR || errno == EAGAIN)) continue; - - fprintf(stderr, "Error receiving response from socket. "); - fprintf(stderr, "The connection might have been lost.\n"); - exit(2); - } - } - - return 0; -} - -static ssize_t -write_socket(const void *buf, size_t count) -{ - size_t written = 0; - - while (written < count) { - const ssize_t n = - write(sock_fd, ((uint8_t *)buf) + written, count - written); - - if (n == -1) { - if (errno == EAGAIN || errno == EWOULDBLOCK || errno == EINTR) - continue; - else - return n; - } - written += n; - } - return written; -} - -static void -connect_to_socket() -{ - struct sockaddr_un addr; - - int sock = socket(AF_UNIX, SOCK_STREAM, 0); - - // Initialize struct to 0 - memset(&addr, 0, sizeof(struct sockaddr_un)); - - addr.sun_family = AF_UNIX; - strcpy(addr.sun_path, DEFAULT_SOCKET_PATH); - - connect(sock, (const struct sockaddr *)&addr, sizeof(struct sockaddr_un)); - - sock_fd = sock; -} - -static int -send_message(IPCMessageType msg_type, uint32_t msg_size, uint8_t *msg) -{ - dwm_ipc_header_t header = { - .magic = IPC_MAGIC_ARR, .size = msg_size, .type = msg_type}; - - size_t header_size = sizeof(dwm_ipc_header_t); - size_t total_size = header_size + msg_size; - - uint8_t buffer[total_size]; - - // Copy header to buffer - memcpy(buffer, &header, header_size); - // Copy message to buffer - memcpy(buffer + header_size, msg, header.size); - - write_socket(buffer, total_size); - - return 0; -} - -static int -is_float(const char *s) -{ - size_t len = strlen(s); - int is_dot_used = 0; - int is_minus_used = 0; - - // Floats can only have one decimal point in between or digits - // Optionally, floats can also be below zero (negative) - for (int i = 0; i < len; i++) { - if (isdigit(s[i])) - continue; - else if (!is_dot_used && s[i] == '.' && i != 0 && i != len - 1) { - is_dot_used = 1; - continue; - } else if (!is_minus_used && s[i] == '-' && i == 0) { - is_minus_used = 1; - continue; - } else - return 0; - } - - return 1; -} - -static int -is_unsigned_int(const char *s) -{ - size_t len = strlen(s); - - // Unsigned int can only have digits - for (int i = 0; i < len; i++) { - if (isdigit(s[i])) - continue; - else - return 0; - } - - return 1; -} - -static int -is_signed_int(const char *s) -{ - size_t len = strlen(s); - - // Signed int can only have digits and a negative sign at the start - for (int i = 0; i < len; i++) { - if (isdigit(s[i])) - continue; - else if (i == 0 && s[i] == '-') { - continue; - } else - return 0; - } - - return 1; -} - -static void -flush_socket_reply() -{ - IPCMessageType reply_type; - uint32_t reply_size; - char *reply; - - read_socket(&reply_type, &reply_size, &reply); - - free(reply); -} - -static void -print_socket_reply() -{ - IPCMessageType reply_type; - uint32_t reply_size; - char *reply; - - read_socket(&reply_type, &reply_size, &reply); - - printf("%.*s\n", reply_size, reply); - fflush(stdout); - free(reply); -} - -static int -run_command(const char *name, char *args[], int argc) -{ - const unsigned char *msg; - size_t msg_size; - - yajl_gen gen = yajl_gen_alloc(NULL); - - // Message format: - // { - // "command": "", - // "args": [ ... ] - // } - // clang-format off - YMAP( - YSTR("command"); YSTR(name); - YSTR("args"); YARR( - for (int i = 0; i < argc; i++) { - if (is_signed_int(args[i])) { - long long num = atoll(args[i]); - YINT(num); - } else if (is_float(args[i])) { - float num = atof(args[i]); - YDOUBLE(num); - } else { - YSTR(args[i]); - } - } - ) - ) - // clang-format on - - yajl_gen_get_buf(gen, &msg, &msg_size); - - send_message(IPC_TYPE_RUN_COMMAND, msg_size, (uint8_t *)msg); - - if (!ignore_reply) - print_socket_reply(); - else - flush_socket_reply(); - - yajl_gen_free(gen); - - return 0; -} - -static int -get_monitors() -{ - send_message(IPC_TYPE_GET_MONITORS, 1, (uint8_t *)""); - print_socket_reply(); - return 0; -} - -static int -get_tags() -{ - send_message(IPC_TYPE_GET_TAGS, 1, (uint8_t *)""); - print_socket_reply(); - - return 0; -} - -static int -get_layouts() -{ - send_message(IPC_TYPE_GET_LAYOUTS, 1, (uint8_t *)""); - print_socket_reply(); - - return 0; -} - -static int -get_dwm_client(Window win) -{ - const unsigned char *msg; - size_t msg_size; - - yajl_gen gen = yajl_gen_alloc(NULL); - - // Message format: - // { - // "client_window_id": "" - // } - // clang-format off - YMAP( - YSTR("client_window_id"); YINT(win); - ) - // clang-format on - - yajl_gen_get_buf(gen, &msg, &msg_size); - - send_message(IPC_TYPE_GET_DWM_CLIENT, msg_size, (uint8_t *)msg); - - print_socket_reply(); - - yajl_gen_free(gen); - - return 0; -} - -static int -subscribe(const char *event) -{ - const unsigned char *msg; - size_t msg_size; - - yajl_gen gen = yajl_gen_alloc(NULL); - - // Message format: - // { - // "event": "", - // "action": "subscribe" - // } - // clang-format off - YMAP( - YSTR("event"); YSTR(event); - YSTR("action"); YSTR("subscribe"); - ) - // clang-format on - - yajl_gen_get_buf(gen, &msg, &msg_size); - - send_message(IPC_TYPE_SUBSCRIBE, msg_size, (uint8_t *)msg); - - if (!ignore_reply) - print_socket_reply(); - else - flush_socket_reply(); - - yajl_gen_free(gen); - - return 0; -} - -static void -usage_error(const char *prog_name, const char *format, ...) -{ - va_list args; - va_start(args, format); - - fprintf(stderr, "Error: "); - vfprintf(stderr, format, args); - fprintf(stderr, "\nusage: %s [...]\n", prog_name); - fprintf(stderr, "Try '%s help'\n", prog_name); - - va_end(args); - exit(1); -} - -static void -print_usage(const char *name) -{ - printf("usage: %s [options] [...]\n", name); - puts(""); - puts("Commands:"); - puts(" run_command [args...] Run an IPC command"); - puts(""); - puts(" get_monitors Get monitor properties"); - puts(""); - puts(" get_tags Get list of tags"); - puts(""); - puts(" get_layouts Get list of layouts"); - puts(""); - puts(" get_dwm_client Get dwm client proprties"); - puts(""); - puts(" subscribe [events...] Subscribe to specified events"); - puts(" Options: " IPC_EVENT_TAG_CHANGE ","); - puts(" " IPC_EVENT_LAYOUT_CHANGE ","); - puts(" " IPC_EVENT_CLIENT_FOCUS_CHANGE ","); - puts(" " IPC_EVENT_MONITOR_FOCUS_CHANGE ","); - puts(" " IPC_EVENT_FOCUSED_TITLE_CHANGE ","); - puts(" " IPC_EVENT_FOCUSED_STATE_CHANGE); - puts(""); - puts(" help Display this message"); - puts(""); - puts("Options:"); - puts(" --ignore-reply Don't print reply messages from"); - puts(" run_command and subscribe."); - puts(""); -} - -int -main(int argc, char *argv[]) -{ - const char *prog_name = argv[0]; - - connect_to_socket(); - if (sock_fd == -1) { - fprintf(stderr, "Failed to connect to socket\n"); - return 1; - } - - int i = 1; - if (i < argc && strcmp(argv[i], "--ignore-reply") == 0) { - ignore_reply = 1; - i++; - } - - if (i >= argc) usage_error(prog_name, "Expected an argument, got none"); - - if (!argc || strcmp(argv[i], "help") == 0) - print_usage(prog_name); - else if (strcmp(argv[i], "run_command") == 0) { - if (++i >= argc) usage_error(prog_name, "No command specified"); - // Command name - char *command = argv[i]; - // Command arguments are everything after command name - char **command_args = argv + ++i; - // Number of command arguments - int command_argc = argc - i; - run_command(command, command_args, command_argc); - } else if (strcmp(argv[i], "get_monitors") == 0) { - get_monitors(); - } else if (strcmp(argv[i], "get_tags") == 0) { - get_tags(); - } else if (strcmp(argv[i], "get_layouts") == 0) { - get_layouts(); - } else if (strcmp(argv[i], "get_dwm_client") == 0) { - if (++i < argc) { - if (is_unsigned_int(argv[i])) { - Window win = atol(argv[i]); - get_dwm_client(win); - } else - usage_error(prog_name, "Expected unsigned integer argument"); - } else - usage_error(prog_name, "Expected the window id"); - } else if (strcmp(argv[i], "subscribe") == 0) { - if (++i < argc) { - for (int j = i; j < argc; j++) subscribe(argv[j]); - } else - usage_error(prog_name, "Expected event name"); - // Keep listening for events forever - while (1) { - print_socket_reply(); - } - } else - usage_error(prog_name, "Invalid argument '%s'", argv[i]); - - return 0; -} - diff --git a/dwm/.dwm.old/patch/ipc/ipc.c b/dwm/.dwm.old/patch/ipc/ipc.c deleted file mode 100644 index eae9667..0000000 --- a/dwm/.dwm.old/patch/ipc/ipc.c +++ /dev/null @@ -1,1202 +0,0 @@ -#include "ipc.h" - -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include - -#include "util.h" -#include "yajl_dumps.h" - -static struct sockaddr_un sockaddr; -static struct epoll_event sock_epoll_event; -static IPCClientList ipc_clients = NULL; -static int epoll_fd = -1; -static int sock_fd = -1; -static IPCCommand *ipc_commands; -static unsigned int ipc_commands_len; -// Max size is 1 MB -static const uint32_t MAX_MESSAGE_SIZE = 1000000; -static const int IPC_SOCKET_BACKLOG = 5; - -/** - * Create IPC socket at specified path and return file descriptor to socket. - * This initializes the static variable sockaddr. - */ -static int -ipc_create_socket(const char *filename) -{ - char *normal_filename; - char *parent; - const size_t addr_size = sizeof(struct sockaddr_un); - const int sock_type = SOCK_STREAM | SOCK_NONBLOCK | SOCK_CLOEXEC; - - normalizepath(filename, &normal_filename); - - // In case socket file exists - unlink(normal_filename); - - // For portability clear the addr structure, since some implementations have - // nonstandard fields in the structure - memset(&sockaddr, 0, addr_size); - - parentdir(normal_filename, &parent); - // Create parent directories - mkdirp(parent); - free(parent); - - sockaddr.sun_family = AF_LOCAL; - strcpy(sockaddr.sun_path, normal_filename); - free(normal_filename); - - sock_fd = socket(AF_LOCAL, sock_type, 0); - if (sock_fd == -1) { - fputs("Failed to create socket\n", stderr); - return -1; - } - - DEBUG("Created socket at %s\n", sockaddr.sun_path); - - if (bind(sock_fd, (const struct sockaddr *)&sockaddr, addr_size) == -1) { - fputs("Failed to bind socket\n", stderr); - return -1; - } - - DEBUG("Socket binded\n"); - - if (listen(sock_fd, IPC_SOCKET_BACKLOG) < 0) { - fputs("Failed to listen for connections on socket\n", stderr); - return -1; - } - - DEBUG("Now listening for connections on socket\n"); - - return sock_fd; -} - -/** - * Internal function used to receive IPC messages from a given file descriptor. - * - * Returns -1 on error reading (could be EAGAIN or EINTR) - * Returns -2 if EOF before header could be read - * Returns -3 if invalid IPC header - * Returns -4 if message length exceeds MAX_MESSAGE_SIZE - */ -static int -ipc_recv_message(int fd, uint8_t *msg_type, uint32_t *reply_size, - uint8_t **reply) -{ - uint32_t read_bytes = 0; - const int32_t to_read = sizeof(dwm_ipc_header_t); - char header[to_read]; - char *walk = header; - - // Try to read header - while (read_bytes < to_read) { - const ssize_t n = read(fd, header + read_bytes, to_read - read_bytes); - - if (n == 0) { - if (read_bytes == 0) { - fprintf(stderr, "Unexpectedly reached EOF while reading header."); - fprintf(stderr, - "Read %" PRIu32 " bytes, expected %" PRIu32 " total bytes.\n", - read_bytes, to_read); - return -2; - } else { - fprintf(stderr, "Unexpectedly reached EOF while reading header."); - fprintf(stderr, - "Read %" PRIu32 " bytes, expected %" PRIu32 " total bytes.\n", - read_bytes, to_read); - return -3; - } - } else if (n == -1) { - // errno will still be set - return -1; - } - - read_bytes += n; - } - - // Check if magic string in header matches - if (memcmp(walk, IPC_MAGIC, IPC_MAGIC_LEN) != 0) { - fprintf(stderr, "Invalid magic string. Got '%.*s', expected '%s'\n", - IPC_MAGIC_LEN, walk, IPC_MAGIC); - return -3; - } - - walk += IPC_MAGIC_LEN; - - // Extract reply size - memcpy(reply_size, walk, sizeof(uint32_t)); - walk += sizeof(uint32_t); - - if (*reply_size > MAX_MESSAGE_SIZE) { - fprintf(stderr, "Message too long: %" PRIu32 " bytes. ", *reply_size); - fprintf(stderr, "Maximum message size is: %d\n", MAX_MESSAGE_SIZE); - return -4; - } - - // Extract message type - memcpy(msg_type, walk, sizeof(uint8_t)); - walk += sizeof(uint8_t); - - if (*reply_size > 0) - (*reply) = malloc(*reply_size); - else - return 0; - - read_bytes = 0; - while (read_bytes < *reply_size) { - const ssize_t n = read(fd, *reply + read_bytes, *reply_size - read_bytes); - - if (n == 0) { - fprintf(stderr, "Unexpectedly reached EOF while reading payload."); - fprintf(stderr, "Read %" PRIu32 " bytes, expected %" PRIu32 " bytes.\n", - read_bytes, *reply_size); - free(*reply); - return -2; - } else if (n == -1) { - // TODO: Should we return and wait for another epoll event? - // This would require saving the partial read in some way. - if (errno == EINTR || errno == EAGAIN || errno == EWOULDBLOCK) continue; - - free(*reply); - return -1; - } - - read_bytes += n; - } - - return 0; -} - -/** - * Internal function used to write a buffer to a file descriptor - * - * Returns number of bytes written if successful write - * Returns 0 if no bytes were written due to EAGAIN or EWOULDBLOCK - * Returns -1 on unknown error trying to write, errno will carry over from - * write() call - */ -static ssize_t -ipc_write_message(int fd, const void *buf, size_t count) -{ - size_t written = 0; - - while (written < count) { - const ssize_t n = write(fd, (uint8_t *)buf + written, count - written); - - if (n == -1) { - if (errno == EAGAIN || errno == EWOULDBLOCK) - return written; - else if (errno == EINTR) - continue; - else - return n; - } - - written += n; - DEBUG("Wrote %zu/%zu to client at fd %d\n", written, count, fd); - } - - return written; -} - -/** - * Initialization for generic event message. This is used to allocate the yajl - * handle, set yajl options, and in the future any other initialization that - * should occur for event messages. - */ -static void -ipc_event_init_message(yajl_gen *gen) -{ - *gen = yajl_gen_alloc(NULL); - yajl_gen_config(*gen, yajl_gen_beautify, 1); -} - -/** - * Prepares buffers of IPC subscribers of specified event using buffer from yajl - * handle. - */ -static void -ipc_event_prepare_send_message(yajl_gen gen, IPCEvent event) -{ - const unsigned char *buffer; - size_t len = 0; - - yajl_gen_get_buf(gen, &buffer, &len); - len++; // For null char - - for (IPCClient *c = ipc_clients; c; c = c->next) { - if (c->subscriptions & event) { - DEBUG("Sending selected client change event to fd %d\n", c->fd); - ipc_prepare_send_message(c, IPC_TYPE_EVENT, len, (char *)buffer); - } - } - - // Not documented, but this frees temp_buffer - yajl_gen_free(gen); -} - -/** - * Initialization for generic reply message. This is used to allocate the yajl - * handle, set yajl options, and in the future any other initialization that - * should occur for reply messages. - */ -static void -ipc_reply_init_message(yajl_gen *gen) -{ - *gen = yajl_gen_alloc(NULL); - yajl_gen_config(*gen, yajl_gen_beautify, 1); -} - -/** - * Prepares the IPC client's buffer with a message using the buffer of the yajl - * handle. - */ -static void -ipc_reply_prepare_send_message(yajl_gen gen, IPCClient *c, - IPCMessageType msg_type) -{ - const unsigned char *buffer; - size_t len = 0; - - yajl_gen_get_buf(gen, &buffer, &len); - len++; // For null char - - ipc_prepare_send_message(c, msg_type, len, (const char *)buffer); - - // Not documented, but this frees temp_buffer - yajl_gen_free(gen); -} - -/** - * Find the IPCCommand with the specified name - * - * Returns 0 if a command with the specified name was found - * Returns -1 if a command with the specified name could not be found - */ -static int -ipc_get_ipc_command(const char *name, IPCCommand *ipc_command) -{ - for (int i = 0; i < ipc_commands_len; i++) { - if (strcmp(ipc_commands[i].name, name) == 0) { - *ipc_command = ipc_commands[i]; - return 0; - } - } - - return -1; -} - -/** - * Parse a IPC_TYPE_RUN_COMMAND message from a client. This function extracts - * the arguments, argument count, argument types, and command name and returns - * the parsed information as an IPCParsedCommand. If this function returns - * successfully, the parsed_command must be freed using - * ipc_free_parsed_command_members. - * - * Returns 0 if the message was successfully parsed - * Returns -1 otherwise - */ -static int -ipc_parse_run_command(char *msg, IPCParsedCommand *parsed_command) -{ - char error_buffer[1000]; - yajl_val parent = yajl_tree_parse(msg, error_buffer, 1000); - - if (parent == NULL) { - fputs("Failed to parse command from client\n", stderr); - fprintf(stderr, "%s\n", error_buffer); - fprintf(stderr, "Tried to parse: %s\n", msg); - return -1; - } - - // Format: - // { - // "command": "" - // "args": [ "arg1", "arg2", ... ] - // } - const char *command_path[] = {"command", 0}; - yajl_val command_val = yajl_tree_get(parent, command_path, yajl_t_string); - - if (command_val == NULL) { - fputs("No command key found in client message\n", stderr); - yajl_tree_free(parent); - return -1; - } - - const char *command_name = YAJL_GET_STRING(command_val); - size_t command_name_len = strlen(command_name); - parsed_command->name = (char *)malloc((command_name_len + 1) * sizeof(char)); - strcpy(parsed_command->name, command_name); - - DEBUG("Received command: %s\n", parsed_command->name); - - const char *args_path[] = {"args", 0}; - yajl_val args_val = yajl_tree_get(parent, args_path, yajl_t_array); - - if (args_val == NULL) { - fputs("No args key found in client message\n", stderr); - yajl_tree_free(parent); - return -1; - } - - unsigned int *argc = &parsed_command->argc; - Arg **args = &parsed_command->args; - ArgType **arg_types = &parsed_command->arg_types; - - *argc = args_val->u.array.len; - - // If no arguments are specified, make a dummy argument to pass to the - // function. This is just the way dwm's void(Arg*) functions are setup. - if (*argc == 0) { - *args = (Arg *)malloc(sizeof(Arg)); - *arg_types = (ArgType *)malloc(sizeof(ArgType)); - (*arg_types)[0] = ARG_TYPE_NONE; - (*args)[0].f = 0; - (*argc)++; - } else if (*argc > 0) { - *args = (Arg *)calloc(*argc, sizeof(Arg)); - *arg_types = (ArgType *)malloc(*argc * sizeof(ArgType)); - - for (int i = 0; i < *argc; i++) { - yajl_val arg_val = args_val->u.array.values[i]; - - if (YAJL_IS_NUMBER(arg_val)) { - if (YAJL_IS_INTEGER(arg_val)) { - // Any values below 0 must be a signed int - if (YAJL_GET_INTEGER(arg_val) < 0) { - (*args)[i].i = YAJL_GET_INTEGER(arg_val); - (*arg_types)[i] = ARG_TYPE_SINT; - DEBUG("i=%ld\n", (*args)[i].i); - // Any values above 0 should be an unsigned int - } else if (YAJL_GET_INTEGER(arg_val) >= 0) { - (*args)[i].ui = YAJL_GET_INTEGER(arg_val); - (*arg_types)[i] = ARG_TYPE_UINT; - DEBUG("ui=%ld\n", (*args)[i].i); - } - // If the number is not an integer, it must be a float - } else { - (*args)[i].f = (float)YAJL_GET_DOUBLE(arg_val); - (*arg_types)[i] = ARG_TYPE_FLOAT; - DEBUG("f=%f\n", (*args)[i].f); - // If argument is not a number, it must be a string - } - } else if (YAJL_IS_STRING(arg_val)) { - char *arg_s = YAJL_GET_STRING(arg_val); - size_t arg_s_size = (strlen(arg_s) + 1) * sizeof(char); - (*args)[i].v = (char *)malloc(arg_s_size); - (*arg_types)[i] = ARG_TYPE_STR; - strcpy((char *)(*args)[i].v, arg_s); - } - } - } - - yajl_tree_free(parent); - - return 0; -} - -/** - * Free the members of a IPCParsedCommand struct - */ -static void -ipc_free_parsed_command_members(IPCParsedCommand *command) -{ - for (int i = 0; i < command->argc; i++) { - if (command->arg_types[i] == ARG_TYPE_STR) free((void *)command->args[i].v); - } - free(command->args); - free(command->arg_types); - free(command->name); -} - -/** - * Check if the given arguments are the correct length and type. Also do any - * casting to correct the types. - * - * Returns 0 if the arguments were the correct length and types - * Returns -1 if the argument count doesn't match - * Returns -2 if the argument types don't match - */ -static int -ipc_validate_run_command(IPCParsedCommand *parsed, const IPCCommand actual) -{ - if (actual.argc != parsed->argc) return -1; - - for (int i = 0; i < parsed->argc; i++) { - ArgType ptype = parsed->arg_types[i]; - ArgType atype = actual.arg_types[i]; - - if (ptype != atype) { - if (ptype == ARG_TYPE_UINT && atype == ARG_TYPE_PTR) - // If this argument is supposed to be a void pointer, cast it - parsed->args[i].v = (void *)parsed->args[i].ui; - else if (ptype == ARG_TYPE_UINT && atype == ARG_TYPE_SINT) - // If this argument is supposed to be a signed int, cast it - parsed->args[i].i = parsed->args[i].ui; - else - return -2; - } - } - - return 0; -} - -/** - * Convert event name to their IPCEvent equivalent enum value - * - * Returns 0 if a valid event name was given - * Returns -1 otherwise - */ -static int -ipc_event_stoi(const char *subscription, IPCEvent *event) -{ - if (strcmp(subscription, "tag_change_event") == 0) - *event = IPC_EVENT_TAG_CHANGE; - else if (strcmp(subscription, "client_focus_change_event") == 0) - *event = IPC_EVENT_CLIENT_FOCUS_CHANGE; - else if (strcmp(subscription, "layout_change_event") == 0) - *event = IPC_EVENT_LAYOUT_CHANGE; - else if (strcmp(subscription, "monitor_focus_change_event") == 0) - *event = IPC_EVENT_MONITOR_FOCUS_CHANGE; - else if (strcmp(subscription, "focused_title_change_event") == 0) - *event = IPC_EVENT_FOCUSED_TITLE_CHANGE; - else if (strcmp(subscription, "focused_state_change_event") == 0) - *event = IPC_EVENT_FOCUSED_STATE_CHANGE; - else - return -1; - return 0; -} - -/** - * Parse a IPC_TYPE_SUBSCRIBE message from a client. This function extracts the - * event name and the subscription action from the message. - * - * Returns 0 if message was successfully parsed - * Returns -1 otherwise - */ -static int -ipc_parse_subscribe(const char *msg, IPCSubscriptionAction *subscribe, - IPCEvent *event) -{ - char error_buffer[100]; - yajl_val parent = yajl_tree_parse((char *)msg, error_buffer, 100); - - if (parent == NULL) { - fputs("Failed to parse command from client\n", stderr); - fprintf(stderr, "%s\n", error_buffer); - return -1; - } - - // Format: - // { - // "event": "" - // "action": "" - // } - const char *event_path[] = {"event", 0}; - yajl_val event_val = yajl_tree_get(parent, event_path, yajl_t_string); - - if (event_val == NULL) { - fputs("No 'event' key found in client message\n", stderr); - return -1; - } - - const char *event_str = YAJL_GET_STRING(event_val); - DEBUG("Received event: %s\n", event_str); - - if (ipc_event_stoi(event_str, event) < 0) return -1; - - const char *action_path[] = {"action", 0}; - yajl_val action_val = yajl_tree_get(parent, action_path, yajl_t_string); - - if (action_val == NULL) { - fputs("No 'action' key found in client message\n", stderr); - return -1; - } - - const char *action = YAJL_GET_STRING(action_val); - - if (strcmp(action, "subscribe") == 0) - *subscribe = IPC_ACTION_SUBSCRIBE; - else if (strcmp(action, "unsubscribe") == 0) - *subscribe = IPC_ACTION_UNSUBSCRIBE; - else { - fputs("Invalid action specified for subscription\n", stderr); - return -1; - } - - yajl_tree_free(parent); - - return 0; -} - -/** - * Parse an IPC_TYPE_GET_DWM_CLIENT message from a client. This function - * extracts the window id from the message. - * - * Returns 0 if message was successfully parsed - * Returns -1 otherwise - */ -static int -ipc_parse_get_dwm_client(const char *msg, Window *win) -{ - char error_buffer[100]; - - yajl_val parent = yajl_tree_parse(msg, error_buffer, 100); - - if (parent == NULL) { - fputs("Failed to parse message from client\n", stderr); - fprintf(stderr, "%s\n", error_buffer); - return -1; - } - - // Format: - // { - // "client_window_id": - // } - const char *win_path[] = {"client_window_id", 0}; - yajl_val win_val = yajl_tree_get(parent, win_path, yajl_t_number); - - if (win_val == NULL) { - fputs("No client window id found in client message\n", stderr); - return -1; - } - - *win = YAJL_GET_INTEGER(win_val); - - yajl_tree_free(parent); - - return 0; -} - -/** - * Called when an IPC_TYPE_RUN_COMMAND message is received from a client. This - * function parses, executes the given command, and prepares a reply message to - * the client indicating success/failure. - * - * NOTE: There is currently no check for argument validity beyond the number of - * arguments given and types of arguments. There is also no way to check if the - * function succeeded based on dwm's void(const Arg*) function types. Pointer - * arguments can cause crashes if they are not validated in the function itself. - * - * Returns 0 if message was successfully parsed - * Returns -1 on failure parsing message - */ -static int -ipc_run_command(IPCClient *ipc_client, char *msg) -{ - IPCParsedCommand parsed_command; - IPCCommand ipc_command; - - // Initialize struct - memset(&parsed_command, 0, sizeof(IPCParsedCommand)); - - if (ipc_parse_run_command(msg, &parsed_command) < 0) { - ipc_prepare_reply_failure(ipc_client, IPC_TYPE_RUN_COMMAND, - "Failed to parse run command"); - return -1; - } - - if (ipc_get_ipc_command(parsed_command.name, &ipc_command) < 0) { - ipc_prepare_reply_failure(ipc_client, IPC_TYPE_RUN_COMMAND, - "Command %s not found", parsed_command.name); - ipc_free_parsed_command_members(&parsed_command); - return -1; - } - - int res = ipc_validate_run_command(&parsed_command, ipc_command); - if (res < 0) { - if (res == -1) - ipc_prepare_reply_failure(ipc_client, IPC_TYPE_RUN_COMMAND, - "%u arguments provided, %u expected", - parsed_command.argc, ipc_command.argc); - else if (res == -2) - ipc_prepare_reply_failure(ipc_client, IPC_TYPE_RUN_COMMAND, - "Type mismatch"); - ipc_free_parsed_command_members(&parsed_command); - return -1; - } - - if (parsed_command.argc == 1) - ipc_command.func.single_param(parsed_command.args); - else if (parsed_command.argc > 1) - ipc_command.func.array_param(parsed_command.args, parsed_command.argc); - - DEBUG("Called function for command %s\n", parsed_command.name); - - ipc_free_parsed_command_members(&parsed_command); - - ipc_prepare_reply_success(ipc_client, IPC_TYPE_RUN_COMMAND); - return 0; -} - -/** - * Called when an IPC_TYPE_GET_MONITORS message is received from a client. It - * prepares a reply with the properties of all of the monitors in JSON. - */ -static void -ipc_get_monitors(IPCClient *c, Monitor *mons, Monitor *selmon) -{ - yajl_gen gen; - ipc_reply_init_message(&gen); - dump_monitors(gen, mons, selmon); - - ipc_reply_prepare_send_message(gen, c, IPC_TYPE_GET_MONITORS); -} - -/** - * Called when an IPC_TYPE_GET_TAGS message is received from a client. It - * prepares a reply with info about all the tags in JSON. - */ -static void -ipc_get_tags(IPCClient *c, const int tags_len) -{ - yajl_gen gen; - ipc_reply_init_message(&gen); - - dump_tags(gen, tags_len); - - ipc_reply_prepare_send_message(gen, c, IPC_TYPE_GET_TAGS); -} - -/** - * Called when an IPC_TYPE_GET_LAYOUTS message is received from a client. It - * prepares a reply with a JSON array of available layouts - */ -static void -ipc_get_layouts(IPCClient *c, const Layout layouts[], const int layouts_len) -{ - yajl_gen gen; - ipc_reply_init_message(&gen); - - dump_layouts(gen, layouts, layouts_len); - - ipc_reply_prepare_send_message(gen, c, IPC_TYPE_GET_LAYOUTS); -} - -/** - * Called when an IPC_TYPE_GET_DWM_CLIENT message is received from a client. It - * prepares a JSON reply with the properties of the client with the specified - * window XID. - * - * Returns 0 if the message was successfully parsed and if the client with the - * specified window XID was found - * Returns -1 if the message could not be parsed - */ -static int -ipc_get_dwm_client(IPCClient *ipc_client, const char *msg, const Monitor *mons) -{ - Window win; - - if (ipc_parse_get_dwm_client(msg, &win) < 0) return -1; - - // Find client with specified window XID - for (const Monitor *m = mons; m; m = m->next) - for (Client *c = m->clients; c; c = c->next) - if (c->win == win) { - yajl_gen gen; - ipc_reply_init_message(&gen); - - dump_client(gen, c); - - ipc_reply_prepare_send_message(gen, ipc_client, - IPC_TYPE_GET_DWM_CLIENT); - - return 0; - } - - ipc_prepare_reply_failure(ipc_client, IPC_TYPE_GET_DWM_CLIENT, - "Client with window id %d not found", win); - return -1; -} - -/** - * Called when an IPC_TYPE_SUBSCRIBE message is received from a client. It - * subscribes/unsubscribes the client from the specified event and replies with - * the result. - * - * Returns 0 if the message was successfully parsed. - * Returns -1 if the message could not be parsed - */ -static int -ipc_subscribe(IPCClient *c, const char *msg) -{ - IPCSubscriptionAction action = IPC_ACTION_SUBSCRIBE; - IPCEvent event = 0; - - if (ipc_parse_subscribe(msg, &action, &event)) { - ipc_prepare_reply_failure(c, IPC_TYPE_SUBSCRIBE, "Event does not exist"); - return -1; - } - - if (action == IPC_ACTION_SUBSCRIBE) { - DEBUG("Subscribing client on fd %d to %d\n", c->fd, event); - c->subscriptions |= event; - } else if (action == IPC_ACTION_UNSUBSCRIBE) { - DEBUG("Unsubscribing client on fd %d to %d\n", c->fd, event); - c->subscriptions ^= event; - } else { - ipc_prepare_reply_failure(c, IPC_TYPE_SUBSCRIBE, - "Invalid subscription action"); - return -1; - } - - ipc_prepare_reply_success(c, IPC_TYPE_SUBSCRIBE); - return 0; -} - -int -ipc_init(const char *socket_path, const int p_epoll_fd, IPCCommand commands[], - const int commands_len) -{ - // Initialize struct to 0 - memset(&sock_epoll_event, 0, sizeof(sock_epoll_event)); - - int socket_fd = ipc_create_socket(socket_path); - if (socket_fd < 0) return -1; - - ipc_commands = commands; - ipc_commands_len = commands_len; - - epoll_fd = p_epoll_fd; - - // Wake up to incoming connection requests - sock_epoll_event.data.fd = socket_fd; - sock_epoll_event.events = EPOLLIN; - if (epoll_ctl(epoll_fd, EPOLL_CTL_ADD, socket_fd, &sock_epoll_event)) { - fputs("Failed to add sock file descriptor to epoll", stderr); - return -1; - } - - return socket_fd; -} - -void -ipc_cleanup() -{ - IPCClient *c = ipc_clients; - // Free clients and their buffers - while (c) { - ipc_drop_client(c); - c = ipc_clients; - } - - // Stop waking up for socket events - epoll_ctl(epoll_fd, EPOLL_CTL_DEL, sock_fd, &sock_epoll_event); - - // Uninitialize all static variables - epoll_fd = -1; - sock_fd = -1; - ipc_commands = NULL; - ipc_commands_len = 0; - memset(&sock_epoll_event, 0, sizeof(struct epoll_event)); - memset(&sockaddr, 0, sizeof(struct sockaddr_un)); - - // Delete socket - unlink(sockaddr.sun_path); - - shutdown(sock_fd, SHUT_RDWR); - close(sock_fd); -} - -int -ipc_get_sock_fd() -{ - return sock_fd; -} - -IPCClient * -ipc_get_client(int fd) -{ - return ipc_list_get_client(ipc_clients, fd); -} - -int -ipc_is_client_registered(int fd) -{ - return (ipc_get_client(fd) != NULL); -} - -int -ipc_accept_client() -{ - int fd = -1; - - struct sockaddr_un client_addr; - socklen_t len = 0; - - // For portability clear the addr structure, since some implementations - // have nonstandard fields in the structure - memset(&client_addr, 0, sizeof(struct sockaddr_un)); - - fd = accept(sock_fd, (struct sockaddr *)&client_addr, &len); - if (fd < 0 && errno != EINTR) { - fputs("Failed to accept IPC connection from client", stderr); - return -1; - } - - if (fcntl(fd, F_SETFD, FD_CLOEXEC) < 0) { - shutdown(fd, SHUT_RDWR); - close(fd); - fputs("Failed to set flags on new client fd", stderr); - } - - IPCClient *nc = ipc_client_new(fd); - if (nc == NULL) return -1; - - // Wake up to messages from this client - nc->event.data.fd = fd; - nc->event.events = EPOLLIN | EPOLLHUP; - epoll_ctl(epoll_fd, EPOLL_CTL_ADD, fd, &nc->event); - - ipc_list_add_client(&ipc_clients, nc); - - DEBUG("%s%d\n", "New client at fd: ", fd); - - return fd; -} - -int -ipc_drop_client(IPCClient *c) -{ - int fd = c->fd; - shutdown(fd, SHUT_RDWR); - int res = close(fd); - - if (res == 0) { - struct epoll_event ev; - - // Stop waking up to messages from this client - epoll_ctl(epoll_fd, EPOLL_CTL_DEL, fd, &ev); - ipc_list_remove_client(&ipc_clients, c); - - free(c->buffer); - free(c); - - DEBUG("Successfully removed client on fd %d\n", fd); - } else if (res < 0 && res != EINTR) { - fprintf(stderr, "Failed to close fd %d\n", fd); - } - - return res; -} - -int -ipc_read_client(IPCClient *c, IPCMessageType *msg_type, uint32_t *msg_size, - char **msg) -{ - int fd = c->fd; - int ret = - ipc_recv_message(fd, (uint8_t *)msg_type, msg_size, (uint8_t **)msg); - - if (ret < 0) { - // This will happen if these errors occur while reading header - if (ret == -1 && - (errno == EINTR || errno == EAGAIN || errno == EWOULDBLOCK)) - return -2; - - fprintf(stderr, "Error reading message: dropping client at fd %d\n", fd); - ipc_drop_client(c); - - return -1; - } - - // Make sure receive message is null terminated to avoid parsing issues - if (*msg_size > 0) { - size_t len = *msg_size; - nullterminate(msg, &len); - *msg_size = len; - } - - DEBUG("[fd %d] ", fd); - if (*msg_size > 0) - DEBUG("Received message: '%.*s' ", *msg_size, *msg); - else - DEBUG("Received empty message "); - DEBUG("Message type: %" PRIu8 " ", (uint8_t)*msg_type); - DEBUG("Message size: %" PRIu32 "\n", *msg_size); - - return 0; -} - -ssize_t -ipc_write_client(IPCClient *c) -{ - const ssize_t n = ipc_write_message(c->fd, c->buffer, c->buffer_size); - - if (n < 0) return n; - - // TODO: Deal with client timeouts - - if (n == c->buffer_size) { - c->buffer_size = 0; - free(c->buffer); - // No dangling pointers! - c->buffer = NULL; - // Stop waking up when client is ready to receive messages - if (c->event.events & EPOLLOUT) { - c->event.events -= EPOLLOUT; - epoll_ctl(epoll_fd, EPOLL_CTL_MOD, c->fd, &c->event); - } - return n; - } - - // Shift unwritten buffer to beginning of buffer and reallocate - c->buffer_size -= n; - memmove(c->buffer, c->buffer + n, c->buffer_size); - c->buffer = (char *)realloc(c->buffer, c->buffer_size); - - return n; -} - -void -ipc_prepare_send_message(IPCClient *c, const IPCMessageType msg_type, - const uint32_t msg_size, const char *msg) -{ - dwm_ipc_header_t header = { - .magic = IPC_MAGIC_ARR, .type = msg_type, .size = msg_size}; - - uint32_t header_size = sizeof(dwm_ipc_header_t); - uint32_t packet_size = header_size + msg_size; - - if (c->buffer == NULL) - c->buffer = (char *)malloc(c->buffer_size + packet_size); - else - c->buffer = (char *)realloc(c->buffer, c->buffer_size + packet_size); - - // Copy header to end of client buffer - memcpy(c->buffer + c->buffer_size, &header, header_size); - c->buffer_size += header_size; - - // Copy message to end of client buffer - memcpy(c->buffer + c->buffer_size, msg, msg_size); - c->buffer_size += msg_size; - - // Wake up when client is ready to receive messages - c->event.events |= EPOLLOUT; - epoll_ctl(epoll_fd, EPOLL_CTL_MOD, c->fd, &c->event); -} - -void -ipc_prepare_reply_failure(IPCClient *c, IPCMessageType msg_type, - const char *format, ...) -{ - yajl_gen gen; - va_list args; - - // Get output size - va_start(args, format); - size_t len = vsnprintf(NULL, 0, format, args); - va_end(args); - char *buffer = (char *)malloc((len + 1) * sizeof(char)); - - ipc_reply_init_message(&gen); - - va_start(args, format); - vsnprintf(buffer, len + 1, format, args); - va_end(args); - dump_error_message(gen, buffer); - - ipc_reply_prepare_send_message(gen, c, msg_type); - fprintf(stderr, "[fd %d] Error: %s\n", c->fd, buffer); - - free(buffer); -} - -void -ipc_prepare_reply_success(IPCClient *c, IPCMessageType msg_type) -{ - const char *success_msg = "{\"result\":\"success\"}"; - const size_t msg_len = strlen(success_msg) + 1; // +1 for null char - - ipc_prepare_send_message(c, msg_type, msg_len, success_msg); -} - -void -ipc_tag_change_event(int mon_num, TagState old_state, TagState new_state) -{ - yajl_gen gen; - ipc_event_init_message(&gen); - dump_tag_event(gen, mon_num, old_state, new_state); - ipc_event_prepare_send_message(gen, IPC_EVENT_TAG_CHANGE); -} - -void -ipc_client_focus_change_event(int mon_num, Client *old_client, - Client *new_client) -{ - yajl_gen gen; - ipc_event_init_message(&gen); - dump_client_focus_change_event(gen, old_client, new_client, mon_num); - ipc_event_prepare_send_message(gen, IPC_EVENT_CLIENT_FOCUS_CHANGE); -} - -void -ipc_layout_change_event(const int mon_num, const char *old_symbol, - const Layout *old_layout, const char *new_symbol, - const Layout *new_layout) -{ - yajl_gen gen; - ipc_event_init_message(&gen); - dump_layout_change_event(gen, mon_num, old_symbol, old_layout, new_symbol, - new_layout); - ipc_event_prepare_send_message(gen, IPC_EVENT_LAYOUT_CHANGE); -} - -void -ipc_monitor_focus_change_event(const int last_mon_num, const int new_mon_num) -{ - yajl_gen gen; - ipc_event_init_message(&gen); - dump_monitor_focus_change_event(gen, last_mon_num, new_mon_num); - ipc_event_prepare_send_message(gen, IPC_EVENT_MONITOR_FOCUS_CHANGE); -} - -void -ipc_focused_title_change_event(const int mon_num, const Window client_id, - const char *old_name, const char *new_name) -{ - yajl_gen gen; - ipc_event_init_message(&gen); - dump_focused_title_change_event(gen, mon_num, client_id, old_name, new_name); - ipc_event_prepare_send_message(gen, IPC_EVENT_FOCUSED_TITLE_CHANGE); -} - -void -ipc_focused_state_change_event(const int mon_num, const Window client_id, - const ClientState *old_state, - const ClientState *new_state) -{ - yajl_gen gen; - ipc_event_init_message(&gen); - dump_focused_state_change_event(gen, mon_num, client_id, old_state, - new_state); - ipc_event_prepare_send_message(gen, IPC_EVENT_FOCUSED_STATE_CHANGE); -} - -void -ipc_send_events(Monitor *mons, Monitor **lastselmon, Monitor *selmon) -{ - for (Monitor *m = mons; m; m = m->next) { - unsigned int urg = 0, occ = 0, tagset = 0; - - for (Client *c = m->clients; c; c = c->next) { - occ |= c->tags; - - if (c->isurgent) urg |= c->tags; - } - tagset = m->tagset[m->seltags]; - - TagState new_state = {.selected = tagset, .occupied = occ, .urgent = urg}; - - if (memcmp(&m->tagstate, &new_state, sizeof(TagState)) != 0) { - ipc_tag_change_event(m->num, m->tagstate, new_state); - m->tagstate = new_state; - } - - if (m->lastsel != m->sel) { - ipc_client_focus_change_event(m->num, m->lastsel, m->sel); - m->lastsel = m->sel; - } - - if (strcmp(m->ltsymbol, m->lastltsymbol) != 0 || - m->lastlt != m->lt[m->sellt]) { - ipc_layout_change_event(m->num, m->lastltsymbol, m->lastlt, m->ltsymbol, - m->lt[m->sellt]); - strcpy(m->lastltsymbol, m->ltsymbol); - m->lastlt = m->lt[m->sellt]; - } - - if (*lastselmon != selmon) { - if (*lastselmon != NULL) - ipc_monitor_focus_change_event((*lastselmon)->num, selmon->num); - *lastselmon = selmon; - } - - Client *sel = m->sel; - if (!sel) continue; - ClientState *o = &m->sel->prevstate; - ClientState n = {.oldstate = sel->oldstate, - .isfixed = sel->isfixed, - .isfloating = sel->isfloating, - .isfullscreen = sel->isfullscreen, - .isurgent = sel->isurgent, - .neverfocus = sel->neverfocus}; - if (memcmp(o, &n, sizeof(ClientState)) != 0) { - ipc_focused_state_change_event(m->num, m->sel->win, o, &n); - *o = n; - } - } -} - -int -ipc_handle_client_epoll_event(struct epoll_event *ev, Monitor *mons, - Monitor **lastselmon, Monitor *selmon, const int tags_len, - const Layout *layouts, const int layouts_len) -{ - int fd = ev->data.fd; - IPCClient *c = ipc_get_client(fd); - - if (ev->events & EPOLLHUP) { - DEBUG("EPOLLHUP received from client at fd %d\n", fd); - ipc_drop_client(c); - } else if (ev->events & EPOLLOUT) { - DEBUG("Sending message to client at fd %d...\n", fd); - if (c->buffer_size) ipc_write_client(c); - } else if (ev->events & EPOLLIN) { - IPCMessageType msg_type = 0; - uint32_t msg_size = 0; - char *msg = NULL; - - DEBUG("Received message from fd %d\n", fd); - if (ipc_read_client(c, &msg_type, &msg_size, &msg) < 0) return -1; - - if (msg_type == IPC_TYPE_GET_MONITORS) - ipc_get_monitors(c, mons, selmon); - else if (msg_type == IPC_TYPE_GET_TAGS) - ipc_get_tags(c, tags_len); - else if (msg_type == IPC_TYPE_GET_LAYOUTS) - ipc_get_layouts(c, layouts, layouts_len); - else if (msg_type == IPC_TYPE_RUN_COMMAND) { - if (ipc_run_command(c, msg) < 0) return -1; - ipc_send_events(mons, lastselmon, selmon); - } else if (msg_type == IPC_TYPE_GET_DWM_CLIENT) { - if (ipc_get_dwm_client(c, msg, mons) < 0) return -1; - } else if (msg_type == IPC_TYPE_SUBSCRIBE) { - if (ipc_subscribe(c, msg) < 0) return -1; - } else { - fprintf(stderr, "Invalid message type received from fd %d", fd); - ipc_prepare_reply_failure(c, msg_type, "Invalid message type: %d", - msg_type); - } - free(msg); - } else { - fprintf(stderr, "Epoll event returned %d from fd %d\n", ev->events, fd); - return -1; - } - - return 0; -} - -int -ipc_handle_socket_epoll_event(struct epoll_event *ev) -{ - if (!(ev->events & EPOLLIN)) return -1; - - // EPOLLIN means incoming client connection request - fputs("Received EPOLLIN event on socket\n", stderr); - int new_fd = ipc_accept_client(); - - return new_fd; -} - diff --git a/dwm/.dwm.old/patch/ipc/ipc.h b/dwm/.dwm.old/patch/ipc/ipc.h deleted file mode 100644 index 4a72fb8..0000000 --- a/dwm/.dwm.old/patch/ipc/ipc.h +++ /dev/null @@ -1,320 +0,0 @@ -#ifndef IPC_H_ -#define IPC_H_ - -#include -#include -#include - -#include "IPCClient.h" - -// clang-format off -#define IPC_MAGIC "DWM-IPC" -#define IPC_MAGIC_ARR { 'D', 'W', 'M', '-', 'I', 'P', 'C'} -#define IPC_MAGIC_LEN 7 // Not including null char - -#define IPCCOMMAND(FUNC, ARGC, TYPES) \ - { #FUNC, {FUNC }, ARGC, (ArgType[ARGC])TYPES } -// clang-format on - -typedef enum IPCMessageType { - IPC_TYPE_RUN_COMMAND = 0, - IPC_TYPE_GET_MONITORS = 1, - IPC_TYPE_GET_TAGS = 2, - IPC_TYPE_GET_LAYOUTS = 3, - IPC_TYPE_GET_DWM_CLIENT = 4, - IPC_TYPE_SUBSCRIBE = 5, - IPC_TYPE_EVENT = 6 -} IPCMessageType; - -typedef enum IPCEvent { - IPC_EVENT_TAG_CHANGE = 1 << 0, - IPC_EVENT_CLIENT_FOCUS_CHANGE = 1 << 1, - IPC_EVENT_LAYOUT_CHANGE = 1 << 2, - IPC_EVENT_MONITOR_FOCUS_CHANGE = 1 << 3, - IPC_EVENT_FOCUSED_TITLE_CHANGE = 1 << 4, - IPC_EVENT_FOCUSED_STATE_CHANGE = 1 << 5 -} IPCEvent; - -typedef enum IPCSubscriptionAction { - IPC_ACTION_UNSUBSCRIBE = 0, - IPC_ACTION_SUBSCRIBE = 1 -} IPCSubscriptionAction; - -/** - * Every IPC packet starts with this structure - */ -typedef struct dwm_ipc_header { - uint8_t magic[IPC_MAGIC_LEN]; - uint32_t size; - uint8_t type; -} __attribute((packed)) dwm_ipc_header_t; - -typedef enum ArgType { - ARG_TYPE_NONE = 0, - ARG_TYPE_UINT = 1, - ARG_TYPE_SINT = 2, - ARG_TYPE_FLOAT = 3, - ARG_TYPE_PTR = 4, - ARG_TYPE_STR = 5 -} ArgType; - -/** - * An IPCCommand function can have either of these function signatures - */ -typedef union ArgFunction { - void (*single_param)(const Arg *); - void (*array_param)(const Arg *, int); -} ArgFunction; - -typedef struct IPCCommand { - char *name; - ArgFunction func; - unsigned int argc; - ArgType *arg_types; -} IPCCommand; - -typedef struct IPCParsedCommand { - char *name; - Arg *args; - ArgType *arg_types; - unsigned int argc; -} IPCParsedCommand; - -/** - * Initialize the IPC socket and the IPC module - * - * @param socket_path Path to create the socket at - * @param epoll_fd File descriptor for epoll - * @param commands Address of IPCCommands array defined in config.h - * @param commands_len Length of commands[] array - * - * @return int The file descriptor of the socket if it was successfully created, - * -1 otherwise - */ -int ipc_init(const char *socket_path, const int p_epoll_fd, - IPCCommand commands[], const int commands_len); - -/** - * Uninitialize the socket and module. Free allocated memory and restore static - * variables to their state before ipc_init - */ -void ipc_cleanup(); - -/** - * Get the file descriptor of the IPC socket - * - * @return int File descriptor of IPC socket, -1 if socket not created. - */ -int ipc_get_sock_fd(); - -/** - * Get address to IPCClient with specified file descriptor - * - * @param fd File descriptor of IPC Client - * - * @return Address to IPCClient with specified file descriptor, -1 otherwise - */ -IPCClient *ipc_get_client(int fd); - -/** - * Check if an IPC client exists with the specified file descriptor - * - * @param fd File descriptor - * - * @return int 1 if client exists, 0 otherwise - */ -int ipc_is_client_registered(int fd); - -/** - * Disconnect an IPCClient from the socket and remove the client from the list - * of known connected clients - * - * @param c Address of IPCClient - * - * @return 0 if the client's file descriptor was closed successfully, the - * result of executing close() on the file descriptor otherwise. - */ -int ipc_drop_client(IPCClient *c); - -/** - * Accept an IPC Client requesting to connect to the socket and add it to the - * list of clients - * - * @return File descriptor of new client, -1 on error - */ -int ipc_accept_client(); - -/** - * Read an incoming message from an accepted IPC client - * - * @param c Address of IPCClient - * @param msg_type Address to IPCMessageType variable which will be assigned - * the message type of the received message - * @param msg_size Address to uint32_t variable which will be assigned the size - * of the received message - * @param msg Address to char* variable which will be assigned the address of - * the received message. This must be freed using free(). - * - * @return 0 on success, -1 on error reading message, -2 if reading the message - * resulted in EAGAIN, EINTR, or EWOULDBLOCK. - */ -int ipc_read_client(IPCClient *c, IPCMessageType *msg_type, uint32_t *msg_size, - char **msg); - -/** - * Write any pending buffer of the client to the client's socket - * - * @param c Client whose buffer to write - * - * @return Number of bytes written >= 0, -1 otherwise. errno will still be set - * from the write operation. - */ -ssize_t ipc_write_client(IPCClient *c); - -/** - * Prepare a message in the specified client's buffer. - * - * @param c Client to prepare message for - * @param msg_type Type of message to prepare - * @param msg_size Size of the message in bytes. Should not exceed - * MAX_MESSAGE_SIZE - * @param msg Message to prepare (not including header). This pointer can be - * freed after the function invocation. - */ -void ipc_prepare_send_message(IPCClient *c, const IPCMessageType msg_type, - const uint32_t msg_size, const char *msg); - -/** - * Prepare an error message in the specified client's buffer - * - * @param c Client to prepare message for - * @param msg_type Type of message - * @param format Format string following vsprintf - * @param ... Arguments for format string - */ -void ipc_prepare_reply_failure(IPCClient *c, IPCMessageType msg_type, - const char *format, ...); - -/** - * Prepare a success message in the specified client's buffer - * - * @param c Client to prepare message for - * @param msg_type Type of message - */ -void ipc_prepare_reply_success(IPCClient *c, IPCMessageType msg_type); - -/** - * Send a tag_change_event to all subscribers. Should be called only when there - * has been a tag state change. - * - * @param mon_num The index of the monitor (Monitor.num property) - * @param old_state The old tag state - * @param new_state The new (now current) tag state - */ -void ipc_tag_change_event(const int mon_num, TagState old_state, - TagState new_state); - -/** - * Send a client_focus_change_event to all subscribers. Should be called only - * when the client focus changes. - * - * @param mon_num The index of the monitor (Monitor.num property) - * @param old_client The old DWM client selection (Monitor.oldsel) - * @param new_client The new (now current) DWM client selection - */ -void ipc_client_focus_change_event(const int mon_num, Client *old_client, - Client *new_client); - -/** - * Send a layout_change_event to all subscribers. Should be called only - * when there has been a layout change. - * - * @param mon_num The index of the monitor (Monitor.num property) - * @param old_symbol The old layout symbol - * @param old_layout Address to the old Layout - * @param new_symbol The new (now current) layout symbol - * @param new_layout Address to the new Layout - */ -void ipc_layout_change_event(const int mon_num, const char *old_symbol, - const Layout *old_layout, const char *new_symbol, - const Layout *new_layout); - -/** - * Send a monitor_focus_change_event to all subscribers. Should be called only - * when the monitor focus changes. - * - * @param last_mon_num The index of the previously selected monitor - * @param new_mon_num The index of the newly selected monitor - */ -void ipc_monitor_focus_change_event(const int last_mon_num, - const int new_mon_num); - -/** - * Send a focused_title_change_event to all subscribers. Should only be called - * if a selected client has a title change. - * - * @param mon_num Index of the client's monitor - * @param client_id Window XID of client - * @param old_name Old name of the client window - * @param new_name New name of the client window - */ -void ipc_focused_title_change_event(const int mon_num, const Window client_id, - const char *old_name, const char *new_name); - -/** - * Send a focused_state_change_event to all subscribers. Should only be called - * if a selected client has a state change. - * - * @param mon_num Index of the client's monitor - * @param client_id Window XID of client - * @param old_state Old state of the client - * @param new_state New state of the client - */ -void ipc_focused_state_change_event(const int mon_num, const Window client_id, - const ClientState *old_state, - const ClientState *new_state); -/** - * Check to see if an event has occured and call the *_change_event functions - * accordingly - * - * @param mons Address of Monitor pointing to start of linked list - * @param lastselmon Address of pointer to previously selected monitor - * @param selmon Address of selected Monitor - */ -void ipc_send_events(Monitor *mons, Monitor **lastselmon, Monitor *selmon); - -/** - * Handle an epoll event caused by a registered IPC client. Read, process, and - * handle any received messages from clients. Write pending buffer to client if - * the client is ready to receive messages. Drop clients that have sent an - * EPOLLHUP. - * - * @param ev Associated epoll event returned by epoll_wait - * @param mons Address of Monitor pointing to start of linked list - * @param selmon Address of selected Monitor - * @param lastselmon Address of pointer to previously selected monitor - * @param tags Array of tag names - * @param tags_len Length of tags array - * @param layouts Array of available layouts - * @param layouts_len Length of layouts array - * - * @return 0 if event was successfully handled, -1 on any error receiving - * or handling incoming messages or unhandled epoll event. - */ -int ipc_handle_client_epoll_event(struct epoll_event *ev, Monitor *mons, - Monitor **lastselmon, Monitor *selmon, const int tags_len, - const Layout *layouts, const int layouts_len); - -/** - * Handle an epoll event caused by the IPC socket. This function only handles an - * EPOLLIN event indicating a new client requesting to connect to the socket. - * - * @param ev Associated epoll event returned by epoll_wait - * - * @return 0, if the event was successfully handled, -1 if not an EPOLLIN event - * or if a new IPC client connection request could not be accepted. - */ -int ipc_handle_socket_epoll_event(struct epoll_event *ev); - -#endif /* IPC_H_ */ - diff --git a/dwm/.dwm.old/patch/ipc/util.c b/dwm/.dwm.old/patch/ipc/util.c deleted file mode 100644 index 7ea425e..0000000 --- a/dwm/.dwm.old/patch/ipc/util.c +++ /dev/null @@ -1,136 +0,0 @@ -#include -#include - -int -normalizepath(const char *path, char **normal) -{ - size_t len = strlen(path); - *normal = (char *)malloc((len + 1) * sizeof(char)); - const char *walk = path; - const char *match; - size_t newlen = 0; - - while ((match = strchr(walk, '/'))) { - // Copy everything between match and walk - strncpy(*normal + newlen, walk, match - walk); - newlen += match - walk; - walk += match - walk; - - // Skip all repeating slashes - while (*walk == '/') - walk++; - - // If not last character in path - if (walk != path + len) - (*normal)[newlen++] = '/'; - } - - (*normal)[newlen++] = '\0'; - - // Copy remaining path - strcat(*normal, walk); - newlen += strlen(walk); - - *normal = (char *)realloc(*normal, newlen * sizeof(char)); - - return 0; -} - -int -parentdir(const char *path, char **parent) -{ - char *normal; - char *walk; - - normalizepath(path, &normal); - - // Pointer to last '/' - if (!(walk = strrchr(normal, '/'))) { - free(normal); - return -1; - } - - // Get path up to last '/' - size_t len = walk - normal; - *parent = (char *)malloc((len + 1) * sizeof(char)); - - // Copy path up to last '/' - strncpy(*parent, normal, len); - // Add null char - (*parent)[len] = '\0'; - - free(normal); - - return 0; -} - -int -mkdirp(const char *path) -{ - char *normal; - char *walk; - size_t normallen; - - normalizepath(path, &normal); - normallen = strlen(normal); - walk = normal; - - while (walk < normal + normallen + 1) { - // Get length from walk to next / - size_t n = strcspn(walk, "/"); - - // Skip path / - if (n == 0) { - walk++; - continue; - } - - // Length of current path segment - size_t curpathlen = walk - normal + n; - char curpath[curpathlen + 1]; - struct stat s; - - // Copy path segment to stat - strncpy(curpath, normal, curpathlen); - strcpy(curpath + curpathlen, ""); - int res = stat(curpath, &s); - - if (res < 0) { - if (errno == ENOENT) { - DEBUG("Making directory %s\n", curpath); - if (mkdir(curpath, 0700) < 0) { - fprintf(stderr, "Failed to make directory %s\n", curpath); - perror(""); - free(normal); - return -1; - } - } else { - fprintf(stderr, "Error statting directory %s\n", curpath); - perror(""); - free(normal); - return -1; - } - } - - // Continue to next path segment - walk += n; - } - - free(normal); - - return 0; -} - -int -nullterminate(char **str, size_t *len) -{ - if ((*str)[*len - 1] == '\0') - return 0; - - (*len)++; - *str = (char*)realloc(*str, *len * sizeof(char)); - (*str)[*len - 1] = '\0'; - - return 0; -} - diff --git a/dwm/.dwm.old/patch/ipc/util.h b/dwm/.dwm.old/patch/ipc/util.h deleted file mode 100644 index 8d2a626..0000000 --- a/dwm/.dwm.old/patch/ipc/util.h +++ /dev/null @@ -1,5 +0,0 @@ -int normalizepath(const char *path, char **normal); -int mkdirp(const char *path); -int parentdir(const char *path, char **parent); -int nullterminate(char **str, size_t *len); - diff --git a/dwm/.dwm.old/patch/ipc/yajl_dumps.c b/dwm/.dwm.old/patch/ipc/yajl_dumps.c deleted file mode 100644 index b24a429..0000000 --- a/dwm/.dwm.old/patch/ipc/yajl_dumps.c +++ /dev/null @@ -1,356 +0,0 @@ -#include "yajl_dumps.h" - -#include - -int -dump_tag(yajl_gen gen, const char *name, const int tag_mask) -{ - if (!name) - return 0; - - // clang-format off - YMAP( - YSTR("bit_mask"); YINT(tag_mask); - YSTR("name"); YSTR(name); - ) - // clang-format on - return 0; -} - -int -dump_tags(yajl_gen gen, int tags_len) -{ - // clang-format off - YARR( - for (int i = 0; i < tags_len; i++) - dump_tag(gen, tagicon(mons, i), 1 << i); - ) - // clang-format on - - return 0; -} - -int -dump_client(yajl_gen gen, Client *c) -{ - // clang-format off - YMAP( - YSTR("name"); YSTR(c->name); - YSTR("tags"); YINT(c->tags); - YSTR("window_id"); YINT(c->win); - YSTR("monitor_number"); YINT(c->mon->num); - - YSTR("geometry"); YMAP( - YSTR("current"); YMAP ( - YSTR("x"); YINT(c->x); - YSTR("y"); YINT(c->y); - YSTR("width"); YINT(c->w); - YSTR("height"); YINT(c->h); - ) - YSTR("old"); YMAP( - YSTR("x"); YINT(c->oldx); - YSTR("y"); YINT(c->oldy); - YSTR("width"); YINT(c->oldw); - YSTR("height"); YINT(c->oldh); - ) - ) - - YSTR("size_hints"); YMAP( - YSTR("base"); YMAP( - YSTR("width"); YINT(c->basew); - YSTR("height"); YINT(c->baseh); - ) - YSTR("step"); YMAP( - YSTR("width"); YINT(c->incw); - YSTR("height"); YINT(c->inch); - ) - YSTR("max"); YMAP( - YSTR("width"); YINT(c->maxw); - YSTR("height"); YINT(c->maxh); - ) - YSTR("min"); YMAP( - YSTR("width"); YINT(c->minw); - YSTR("height"); YINT(c->minh); - ) - YSTR("aspect_ratio"); YMAP( - YSTR("min"); YDOUBLE(c->mina); - YSTR("max"); YDOUBLE(c->maxa); - ) - ) - - YSTR("border_width"); YMAP( - YSTR("current"); YINT(c->bw); - YSTR("old"); YINT(c->oldbw); - ) - - YSTR("states"); YMAP( - YSTR("is_fixed"); YBOOL(c->isfixed); - YSTR("is_floating"); YBOOL(c->isfloating); - YSTR("is_urgent"); YBOOL(c->isurgent); - YSTR("never_focus"); YBOOL(c->neverfocus); - YSTR("old_state"); YBOOL(c->oldstate); - YSTR("is_fullscreen"); YBOOL(c->isfullscreen); - ) - ) - // clang-format on - - return 0; -} - -int -dump_monitor(yajl_gen gen, Monitor *mon, int is_selected) -{ - // clang-format off - YMAP( - YSTR("master_factor"); YDOUBLE(mon->mfact); - YSTR("num_master"); YINT(mon->nmaster); - YSTR("num"); YINT(mon->num); - YSTR("is_selected"); YBOOL(is_selected); - - YSTR("monitor_geometry"); YMAP( - YSTR("x"); YINT(mon->mx); - YSTR("y"); YINT(mon->my); - YSTR("width"); YINT(mon->mw); - YSTR("height"); YINT(mon->mh); - ) - - YSTR("window_geometry"); YMAP( - YSTR("x"); YINT(mon->wx); - YSTR("y"); YINT(mon->wy); - YSTR("width"); YINT(mon->ww); - YSTR("height"); YINT(mon->wh); - ) - - YSTR("tagset"); YMAP( - YSTR("current"); YINT(mon->tagset[mon->seltags]); - YSTR("old"); YINT(mon->tagset[mon->seltags ^ 1]); - ) - - YSTR("tag_state"); dump_tag_state(gen, mon->tagstate); - - YSTR("clients"); YMAP( - YSTR("selected"); YINT(mon->sel ? mon->sel->win : 0); - YSTR("stack"); YARR( - for (Client* c = mon->stack; c; c = c->snext) - YINT(c->win); - ) - YSTR("all"); YARR( - for (Client* c = mon->clients; c; c = c->next) - YINT(c->win); - ) - ) - - YSTR("layout"); YMAP( - YSTR("symbol"); YMAP( - YSTR("current"); YSTR(mon->ltsymbol); - YSTR("old"); YSTR(mon->lastltsymbol); - ) - YSTR("address"); YMAP( - YSTR("current"); YINT((uintptr_t)mon->lt[mon->sellt]); - YSTR("old"); YINT((uintptr_t)mon->lt[mon->sellt ^ 1]); - ) - ) - - if (mon->bar) { - YSTR("bar"); YMAP( - YSTR("y"); YINT(mon->bar->by); - YSTR("is_shown"); YBOOL(mon->showbar); - YSTR("is_top"); YBOOL(mon->bar->topbar); - YSTR("window_id"); YINT(mon->bar->win); - ) - } - ) - // clang-format on - - return 0; -} - -int -dump_monitors(yajl_gen gen, Monitor *mons, Monitor *selmon) -{ - // clang-format off - YARR( - for (Monitor *mon = mons; mon; mon = mon->next) { - if (mon == selmon) - dump_monitor(gen, mon, 1); - else - dump_monitor(gen, mon, 0); - } - ) - // clang-format on - - return 0; -} - -int -dump_layouts(yajl_gen gen, const Layout layouts[], const int layouts_len) -{ - // clang-format off - YARR( - for (int i = 0; i < layouts_len; i++) { - YMAP( - // Check for a NULL pointer. The cycle layouts patch adds an entry at - // the end of the layouts array with a NULL pointer for the symbol - YSTR("symbol"); YSTR((layouts[i].symbol ? layouts[i].symbol : "")); - YSTR("address"); YINT((uintptr_t)(layouts + i)); - ) - } - ) - // clang-format on - - return 0; -} - -int -dump_tag_state(yajl_gen gen, TagState state) -{ - // clang-format off - YMAP( - YSTR("selected"); YINT(state.selected); - YSTR("occupied"); YINT(state.occupied); - YSTR("urgent"); YINT(state.urgent); - ) - // clang-format on - - return 0; -} - -int -dump_tag_event(yajl_gen gen, int mon_num, TagState old_state, - TagState new_state) -{ - // clang-format off - YMAP( - YSTR("tag_change_event"); YMAP( - YSTR("monitor_number"); YINT(mon_num); - YSTR("old_state"); dump_tag_state(gen, old_state); - YSTR("new_state"); dump_tag_state(gen, new_state); - ) - ) - // clang-format on - - return 0; -} - -int -dump_client_focus_change_event(yajl_gen gen, Client *old_client, - Client *new_client, int mon_num) -{ - // clang-format off - YMAP( - YSTR("client_focus_change_event"); YMAP( - YSTR("monitor_number"); YINT(mon_num); - YSTR("old_win_id"); old_client == NULL ? YNULL() : YINT(old_client->win); - YSTR("new_win_id"); new_client == NULL ? YNULL() : YINT(new_client->win); - ) - ) - // clang-format on - - return 0; -} - -int -dump_layout_change_event(yajl_gen gen, const int mon_num, - const char *old_symbol, const Layout *old_layout, - const char *new_symbol, const Layout *new_layout) -{ - // clang-format off - YMAP( - YSTR("layout_change_event"); YMAP( - YSTR("monitor_number"); YINT(mon_num); - YSTR("old_symbol"); YSTR(old_symbol); - YSTR("old_address"); YINT((uintptr_t)old_layout); - YSTR("new_symbol"); YSTR(new_symbol); - YSTR("new_address"); YINT((uintptr_t)new_layout); - ) - ) - // clang-format on - - return 0; -} - -int -dump_monitor_focus_change_event(yajl_gen gen, const int last_mon_num, - const int new_mon_num) -{ - // clang-format off - YMAP( - YSTR("monitor_focus_change_event"); YMAP( - YSTR("old_monitor_number"); YINT(last_mon_num); - YSTR("new_monitor_number"); YINT(new_mon_num); - ) - ) - // clang-format on - - return 0; -} - -int -dump_focused_title_change_event(yajl_gen gen, const int mon_num, - const Window client_id, const char *old_name, - const char *new_name) -{ - // clang-format off - YMAP( - YSTR("focused_title_change_event"); YMAP( - YSTR("monitor_number"); YINT(mon_num); - YSTR("client_window_id"); YINT(client_id); - YSTR("old_name"); YSTR(old_name); - YSTR("new_name"); YSTR(new_name); - ) - ) - // clang-format on - - return 0; -} - -int -dump_client_state(yajl_gen gen, const ClientState *state) -{ - // clang-format off - YMAP( - YSTR("old_state"); YBOOL(state->oldstate); - YSTR("is_fixed"); YBOOL(state->isfixed); - YSTR("is_floating"); YBOOL(state->isfloating); - YSTR("is_fullscreen"); YBOOL(state->isfullscreen); - YSTR("is_urgent"); YBOOL(state->isurgent); - YSTR("never_focus"); YBOOL(state->neverfocus); - ) - // clang-format on - - return 0; -} - -int -dump_focused_state_change_event(yajl_gen gen, const int mon_num, - const Window client_id, - const ClientState *old_state, - const ClientState *new_state) -{ - // clang-format off - YMAP( - YSTR("focused_state_change_event"); YMAP( - YSTR("monitor_number"); YINT(mon_num); - YSTR("client_window_id"); YINT(client_id); - YSTR("old_state"); dump_client_state(gen, old_state); - YSTR("new_state"); dump_client_state(gen, new_state); - ) - ) - // clang-format on - - return 0; -} - -int -dump_error_message(yajl_gen gen, const char *reason) -{ - // clang-format off - YMAP( - YSTR("result"); YSTR("error"); - YSTR("reason"); YSTR(reason); - ) - // clang-format on - - return 0; -} - diff --git a/dwm/.dwm.old/patch/ipc/yajl_dumps.h b/dwm/.dwm.old/patch/ipc/yajl_dumps.h deleted file mode 100644 index bb57a17..0000000 --- a/dwm/.dwm.old/patch/ipc/yajl_dumps.h +++ /dev/null @@ -1,66 +0,0 @@ -#ifndef YAJL_DUMPS_H_ -#define YAJL_DUMPS_H_ - -#include -#include - -#define YSTR(str) yajl_gen_string(gen, (unsigned char *)str, strlen(str)) -#define YINT(num) yajl_gen_integer(gen, num) -#define YDOUBLE(num) yajl_gen_double(gen, num) -#define YBOOL(v) yajl_gen_bool(gen, v) -#define YNULL() yajl_gen_null(gen) -#define YARR(body) \ - { \ - yajl_gen_array_open(gen); \ - body; \ - yajl_gen_array_close(gen); \ - } -#define YMAP(body) \ - { \ - yajl_gen_map_open(gen); \ - body; \ - yajl_gen_map_close(gen); \ - } - -int dump_tag(yajl_gen gen, const char *name, const int tag_mask); - -int dump_tags(yajl_gen gen, int tags_len); - -int dump_client(yajl_gen gen, Client *c); - -int dump_monitor(yajl_gen gen, Monitor *mon, int is_selected); - -int dump_monitors(yajl_gen gen, Monitor *mons, Monitor *selmon); - -int dump_layouts(yajl_gen gen, const Layout layouts[], const int layouts_len); - -int dump_tag_state(yajl_gen gen, TagState state); - -int dump_tag_event(yajl_gen gen, int mon_num, TagState old_state, - TagState new_state); - -int dump_client_focus_change_event(yajl_gen gen, Client *old_client, - Client *new_client, int mon_num); - -int dump_layout_change_event(yajl_gen gen, const int mon_num, - const char *old_symbol, const Layout *old_layout, - const char *new_symbol, const Layout *new_layout); - -int dump_monitor_focus_change_event(yajl_gen gen, const int last_mon_num, - const int new_mon_num); - -int dump_focused_title_change_event(yajl_gen gen, const int mon_num, - const Window client_id, - const char *old_name, const char *new_name); - -int dump_client_state(yajl_gen gen, const ClientState *state); - -int dump_focused_state_change_event(yajl_gen gen, const int mon_num, - const Window client_id, - const ClientState *old_state, - const ClientState *new_state); - -int dump_error_message(yajl_gen gen, const char *reason); - -#endif // YAJL_DUMPS_H_ - diff --git a/dwm/.dwm.old/patch/keymodes.c b/dwm/.dwm.old/patch/keymodes.c deleted file mode 100644 index 6f2f840..0000000 --- a/dwm/.dwm.old/patch/keymodes.c +++ /dev/null @@ -1,144 +0,0 @@ -/* function implementations */ -void -clearcmd(const Arg *arg) -{ - unsigned int i; - - for (i = 0; i < LENGTH(cmdkeysym); i++) { - cmdkeysym[i] = 0; - cmdmod[i] = 0; - } -} - -void -grabkeys(void) -{ - if (keymode == INSERTMODE) { - grabdefkeys(); - } else if (keymode == COMMANDMODE) { - XUngrabKey(dpy, AnyKey, AnyModifier, root); - XGrabKey(dpy, AnyKey, AnyModifier, root, - True, GrabModeAsync, GrabModeAsync); - } -} - -int -isprotodel(Client *c) -{ - int n; - Atom *protocols; - int ret = 0; - - if (XGetWMProtocols(dpy, c->win, &protocols, &n)) { - while (!ret && n--) - ret = protocols[n] == wmatom[WMDelete]; - XFree(protocols); - } - return ret; -} - - -void -keypress(XEvent *e) -{ - unsigned int i, j; - Arg a = {0}; - Bool ismatch = False, maybematch = False; - KeySym keysym; - XKeyEvent *ev; - - if (keymode == INSERTMODE) - keydefpress(e); - else if (keymode == COMMANDMODE) { - ev = &e->xkey; - keysym = XKeycodeToKeysym(dpy, (KeyCode)ev->keycode, 0); - if (keysym < XK_Shift_L || keysym > XK_Hyper_R) { - for (i = 0; i < LENGTH(cmdkeys); i++) - if (keysym == cmdkeys[i].keysym - && CLEANMASK(cmdkeys[i].mod) == CLEANMASK(ev->state) - && cmdkeys[i].func) { - cmdkeys[i].func(&(cmdkeys[i].arg)); - ismatch = True; - break; - } - if (!ismatch) { - for (j = 0; j < LENGTH(cmdkeysym); j++) - if (cmdkeysym[j] == 0) { - cmdkeysym[j] = keysym; - cmdmod[j] = ev->state; - break; - } - for (i = 0; i < LENGTH(commands); i++) { - for (j = 0; j < LENGTH(cmdkeysym); j++) { - if (cmdkeysym[j] == commands[i].keysym[j] - && CLEANMASK(cmdmod[j]) == CLEANMASK(commands[i].mod[j])) - ismatch = True; - else if (cmdkeysym[j] == 0 - && cmdmod[j] == 0) { - ismatch = False; - maybematch = True; - break; - } else { - ismatch = False; - break; - } - } - if (ismatch) { - if (commands[i].func) - commands[i].func(&(commands[i].arg)); - clearcmd(&a); - break; - } - - } - if (!maybematch) - clearcmd(&a); - } - } - } -} - -void -onlyclient(const Arg *arg) -{ - Client *c; - XEvent ev; - - if (!selmon->sel) - return; - for (c = selmon->clients; c; c = c->next) { - if (c != selmon->sel && ISVISIBLE(c)) { - if (isprotodel(c)) { - ev.type = ClientMessage; - ev.xclient.window = c->win; - ev.xclient.message_type = wmatom[WMProtocols]; - ev.xclient.format = 32; - ev.xclient.data.l[0] = wmatom[WMDelete]; - ev.xclient.data.l[1] = CurrentTime; - XSendEvent(dpy, c->win, False, NoEventMask, &ev); - } - else { - XGrabServer(dpy); - XSetErrorHandler(xerrordummy); - XSetCloseDownMode(dpy, DestroyAll); - XKillClient(dpy, c->win); - XSync(dpy, False); - XSetErrorHandler(xerror); - XUngrabServer(dpy); - } - } - } -} - -void -setkeymode(const Arg *arg) -{ - Arg a = {0}; - - if (!arg) - return; - keymode = arg->ui; - clearcmd(&a); - grabkeys(); -} - diff --git a/dwm/.dwm.old/patch/keymodes.h b/dwm/.dwm.old/patch/keymodes.h deleted file mode 100644 index 0a46125..0000000 --- a/dwm/.dwm.old/patch/keymodes.h +++ /dev/null @@ -1,22 +0,0 @@ -#define COMMANDMODE 1 -#define INSERTMODE 2 - -typedef struct { - unsigned int mod[4]; - KeySym keysym[4]; - void (*func)(const Arg *); - const Arg arg; -} Command; - -static void clearcmd(const Arg *arg); -static void grabkeys(void); -static int isprotodel(Client *c); -static void keypress(XEvent *e); -static void onlyclient(const Arg *arg); -static void setkeymode(const Arg *arg); - -/* variables */ -static unsigned int cmdmod[4]; -static unsigned int keymode = INSERTMODE; -static KeySym cmdkeysym[4]; - diff --git a/dwm/.dwm.old/patch/killunsel.c b/dwm/.dwm.old/patch/killunsel.c deleted file mode 100644 index 8d7a7b8..0000000 --- a/dwm/.dwm.old/patch/killunsel.c +++ /dev/null @@ -1,28 +0,0 @@ -void -killunsel(const Arg *arg) -{ - Client *i = NULL; - - if (!selmon->sel) - return; - - for (i = selmon->clients; i; i = i->next) { - if (ISVISIBLE(i) && i != selmon->sel) { - #if BAR_SYSTRAY_PATCH - if (!sendevent(i->win, wmatom[WMDelete], NoEventMask, wmatom[WMDelete], CurrentTime, 0, 0, 0)) - #else - if (!sendevent(i, wmatom[WMDelete])) - #endif // BAR_SYSTRAY_PATCH - { - XGrabServer(dpy); - XSetErrorHandler(xerrordummy); - XSetCloseDownMode(dpy, DestroyAll); - XKillClient(dpy, i->win); - XSync(dpy, False); - XSetErrorHandler(xerror); - XUngrabServer(dpy); - } - } - } -} - diff --git a/dwm/.dwm.old/patch/killunsel.h b/dwm/.dwm.old/patch/killunsel.h deleted file mode 100644 index 4fc154f..0000000 --- a/dwm/.dwm.old/patch/killunsel.h +++ /dev/null @@ -1,2 +0,0 @@ -static void killunsel(const Arg *arg); - diff --git a/dwm/.dwm.old/patch/layout_bstack.c b/dwm/.dwm.old/patch/layout_bstack.c deleted file mode 100644 index 8989975..0000000 --- a/dwm/.dwm.old/patch/layout_bstack.c +++ /dev/null @@ -1,75 +0,0 @@ -static void -bstack(Monitor *m) -{ - unsigned int i, n; - int mx = 0, my = 0, mh = 0, mw = 0; - int sx = 0, sy = 0, sh = 0, sw = 0; - float mfacts, sfacts; - int mrest, srest; - Client *c; - - #if VANITYGAPS_PATCH - int oh, ov, ih, iv; - getgaps(m, &oh, &ov, &ih, &iv, &n); - #else - for (n = 0, c = nexttiled(m->clients); c; c = nexttiled(c->next), n++); - #endif // VANITYGAPS_PATCH - - if (n == 0) - return; - - #if VANITYGAPS_PATCH - sx = mx = m->wx + ov; - sy = my = m->wy + oh; - sh = mh = m->wh - 2*oh; - mw = m->ww - 2*ov - iv * (MIN(n, m->nmaster) - 1); - sw = m->ww - 2*ov - iv * (n - m->nmaster - 1); - - if (m->nmaster && n > m->nmaster) { - sh = (mh - ih) * (1 - m->mfact); - mh = (mh - ih) * m->mfact; - sx = mx; - sy = my + mh + ih; - } - #else - sx = mx = m->wx; - sy = my = m->wy; - sh = mh = m->wh; - sw = mw = m->ww; - - if (m->nmaster && n > m->nmaster) { - sh = mh * (1 - m->mfact); - mh = mh * m->mfact; - sy = my + mh; - } - #endif // VANITYGAPS_PATCH - - getfacts(m, mw, sw, &mfacts, &sfacts, &mrest, &srest); - - for (i = 0, c = nexttiled(m->clients); c; c = nexttiled(c->next), i++) { - if (i < m->nmaster) { - #if CFACTS_PATCH - resize(c, mx, my, (mw / mfacts) * c->cfact + (i < mrest ? 1 : 0) - (2*c->bw), mh - (2*c->bw), 0); - #else - resize(c, mx, my, (mw / mfacts) + (i < mrest ? 1 : 0) - (2*c->bw), mh - (2*c->bw), 0); - #endif // CFACTS_PATCH - #if VANITYGAPS_PATCH - mx += WIDTH(c) + iv; - #else - mx += WIDTH(c); - #endif - } else { - #if CFACTS_PATCH - resize(c, sx, sy, (sw / sfacts) * c->cfact + ((i - m->nmaster) < srest ? 1 : 0) - (2*c->bw), sh - (2*c->bw), 0); - #else - resize(c, sx, sy, (sw / sfacts) + ((i - m->nmaster) < srest ? 1 : 0) - (2*c->bw), sh - (2*c->bw), 0); - #endif // CFACTS_PATCH - #if VANITYGAPS_PATCH - sx += WIDTH(c) + iv; - #else - sx += WIDTH(c); - #endif - } - } -} - diff --git a/dwm/.dwm.old/patch/layout_bstack.h b/dwm/.dwm.old/patch/layout_bstack.h deleted file mode 100644 index 07e8c0a..0000000 --- a/dwm/.dwm.old/patch/layout_bstack.h +++ /dev/null @@ -1,2 +0,0 @@ -static void bstack(Monitor *m); - diff --git a/dwm/.dwm.old/patch/layout_bstackhoriz.c b/dwm/.dwm.old/patch/layout_bstackhoriz.c deleted file mode 100644 index 462301c..0000000 --- a/dwm/.dwm.old/patch/layout_bstackhoriz.c +++ /dev/null @@ -1,77 +0,0 @@ -static void -bstackhoriz(Monitor *m) -{ - unsigned int i, n; - int mx = 0, my = 0, mh = 0, mw = 0; - int sx = 0, sy = 0, sh = 0, sw = 0; - float mfacts, sfacts; - int mrest, srest; - Client *c; - - #if VANITYGAPS_PATCH - int oh, ov, ih, iv; - getgaps(m, &oh, &ov, &ih, &iv, &n); - #else - for (n = 0, c = nexttiled(m->clients); c; c = nexttiled(c->next), n++); - #endif // VANITYGAPS_PATCH - - if (n == 0) - return; - - #if VANITYGAPS_PATCH - sx = mx = m->wx + ov; - sy = my = m->wy + oh; - mh = m->wh - 2*oh; - sh = m->wh - 2*oh - ih * (n - m->nmaster - 1); - mw = m->ww - 2*ov - iv * (MIN(n, m->nmaster) - 1); - sw = m->ww - 2*ov; - - if (m->nmaster && n > m->nmaster) { - sh = (mh - ih) * (1 - m->mfact); - mh = (mh - ih) * m->mfact; - sy = my + mh + ih; - sh = m->wh - mh - 2*oh - ih * (n - m->nmaster); - } - #else - sx = mx = m->wx; - sy = my = m->wy; - sh = mh = m->wh; - sw = mw = m->ww; - - if (m->nmaster && n > m->nmaster) { - sh = mh * (1 - m->mfact); - mh = mh * m->mfact; - sy = my + mh; - sh = m->wh - mh; - } - #endif // VANITYGAPS_PATCH - - getfacts(m, mw, sh, &mfacts, &sfacts, &mrest, &srest); - - for (i = 0, c = nexttiled(m->clients); c; c = nexttiled(c->next), i++) { - if (i < m->nmaster) { - #if CFACTS_PATCH - resize(c, mx, my, (mw / mfacts) * c->cfact + (i < mrest ? 1 : 0) - (2*c->bw), mh - (2*c->bw), 0); - #else - resize(c, mx, my, (mw / mfacts) + (i < mrest ? 1 : 0) - (2*c->bw), mh - (2*c->bw), 0); - #endif // CFACTS_PATCH - #if VANITYGAPS_PATCH - mx += WIDTH(c) + iv; - #else - mx += WIDTH(c); - #endif - } else { - #if CFACTS_PATCH - resize(c, sx, sy, sw - (2*c->bw), (sh / sfacts) * c->cfact + ((i - m->nmaster) < srest ? 1 : 0) - (2*c->bw), 0); - #else - resize(c, sx, sy, sw - (2*c->bw), (sh / sfacts) + ((i - m->nmaster) < srest ? 1 : 0) - (2*c->bw), 0); - #endif // CFACTS_PATCH - #if VANITYGAPS_PATCH - sy += HEIGHT(c) + ih; - #else - sy += HEIGHT(c); - #endif - } - } -} - diff --git a/dwm/.dwm.old/patch/layout_bstackhoriz.h b/dwm/.dwm.old/patch/layout_bstackhoriz.h deleted file mode 100644 index a421d6f..0000000 --- a/dwm/.dwm.old/patch/layout_bstackhoriz.h +++ /dev/null @@ -1,2 +0,0 @@ -static void bstackhoriz(Monitor *m); - diff --git a/dwm/.dwm.old/patch/layout_centeredfloatingmaster.c b/dwm/.dwm.old/patch/layout_centeredfloatingmaster.c deleted file mode 100644 index 6d1aff0..0000000 --- a/dwm/.dwm.old/patch/layout_centeredfloatingmaster.c +++ /dev/null @@ -1,95 +0,0 @@ -void -centeredfloatingmaster(Monitor *m) -{ - unsigned int i, n; - float mfacts, sfacts; - int mrest, srest; - int mx = 0, my = 0, mh = 0, mw = 0; - int sx = 0, sy = 0, sh = 0, sw = 0; - Client *c; - - #if VANITYGAPS_PATCH - float mivf = 1.0; // master inner vertical gap factor - int oh, ov, ih, iv; - getgaps(m, &oh, &ov, &ih, &iv, &n); - #else - for (n = 0, c = nexttiled(m->clients); c; c = nexttiled(c->next), n++); - #endif // VANITYGAPS_PATCH - - if (n == 0) - return; - - #if VANITYGAPS_PATCH - sx = mx = m->wx + ov; - sy = my = m->wy + oh; - sh = mh = m->wh - 2*oh; - mw = m->ww - 2*ov - iv*(n - 1); - sw = m->ww - 2*ov - iv*(n - m->nmaster - 1); - - if (m->nmaster && n > m->nmaster) { - mivf = 0.8; - /* go mfact box in the center if more than nmaster clients */ - if (m->ww > m->wh) { - mw = m->ww * m->mfact - iv*mivf*(MIN(n, m->nmaster) - 1); - mh = m->wh * 0.9; - } else { - mw = m->ww * 0.9 - iv*mivf*(MIN(n, m->nmaster) - 1); - mh = m->wh * m->mfact; - } - mx = m->wx + (m->ww - mw) / 2; - my = m->wy + (m->wh - mh - 2*oh) / 2; - - sx = m->wx + ov; - sy = m->wy + oh; - sh = m->wh - 2*oh; - } - #else - sx = mx = m->wx; - sy = my = m->wy; - sh = mh = m->wh; - sw = mw = m->ww; - - if (m->nmaster && n > m->nmaster) { - /* go mfact box in the center if more than nmaster clients */ - if (m->ww > m->wh) { - mw = m->ww * m->mfact; - mh = m->wh * 0.9; - } else { - mw = m->ww * 0.9; - mh = m->wh * m->mfact; - } - mx = m->wx + (m->ww - mw) / 2; - my = m->wy + (m->wh - mh) / 2; - } - #endif // VANITYGAPS_PATCH - - getfacts(m, mw, sw, &mfacts, &sfacts, &mrest, &srest); - - for (i = 0, c = nexttiled(m->clients); c; c = nexttiled(c->next), i++) - if (i < m->nmaster) { - /* nmaster clients are stacked horizontally, in the center of the screen */ - #if CFACTS_PATCH - resize(c, mx, my, (mw / mfacts) * c->cfact + (i < mrest ? 1 : 0) - (2*c->bw), mh - (2*c->bw), 0); - #else - resize(c, mx, my, (mw / mfacts) + (i < mrest ? 1 : 0) - (2*c->bw), mh - (2*c->bw), 0); - #endif // CFACTS_PATCH - #if VANITYGAPS_PATCH - mx += WIDTH(c) + iv*mivf; - #else - mx += WIDTH(c); - #endif - } else { - /* stack clients are stacked horizontally */ - #if CFACTS_PATCH - resize(c, sx, sy, (sw / sfacts) * c->cfact + ((i - m->nmaster) < srest ? 1 : 0) - (2*c->bw), sh - (2*c->bw), 0); - #else - resize(c, sx, sy, (sw / sfacts) + ((i - m->nmaster) < srest ? 1 : 0) - (2*c->bw), sh - (2*c->bw), 0); - #endif // CFACTS_PATCH - #if VANITYGAPS_PATCH - sx += WIDTH(c) + iv; - #else - sx += WIDTH(c); - #endif - } -} - diff --git a/dwm/.dwm.old/patch/layout_centeredfloatingmaster.h b/dwm/.dwm.old/patch/layout_centeredfloatingmaster.h deleted file mode 100644 index 66b0b0e..0000000 --- a/dwm/.dwm.old/patch/layout_centeredfloatingmaster.h +++ /dev/null @@ -1,2 +0,0 @@ -static void centeredfloatingmaster(Monitor *m); - diff --git a/dwm/.dwm.old/patch/layout_centeredmaster.c b/dwm/.dwm.old/patch/layout_centeredmaster.c deleted file mode 100644 index 39aa67f..0000000 --- a/dwm/.dwm.old/patch/layout_centeredmaster.c +++ /dev/null @@ -1,160 +0,0 @@ -void -centeredmaster(Monitor *m) -{ - unsigned int i, n; - int mx = 0, my = 0, mh = 0, mw = 0; - int lx = 0, ly = 0, lw = 0, lh = 0; - int rx = 0, ry = 0, rw = 0, rh = 0; - float mfacts = 0, lfacts = 0, rfacts = 0; - int mtotal = 0, ltotal = 0, rtotal = 0; - int mrest = 0, lrest = 0, rrest = 0; - Client *c; - - #if VANITYGAPS_PATCH - int oh, ov, ih, iv; - getgaps(m, &oh, &ov, &ih, &iv, &n); - #else - for (n = 0, c = nexttiled(m->clients); c; c = nexttiled(c->next), n++); - #endif // VANITYGAPS_PATCH - - if (n == 0) - return; - - /* initialize areas */ - #if VANITYGAPS_PATCH - mx = m->wx + ov; - my = m->wy + oh; - mh = m->wh - 2*oh - ih * ((!m->nmaster ? n : MIN(n, m->nmaster)) - 1); - mw = m->ww - 2*ov; - lh = m->wh - 2*oh - ih * (((n - m->nmaster) / 2) - 1); - rh = m->wh - 2*oh - ih * (((n - m->nmaster) / 2) - ((n - m->nmaster) % 2 ? 0 : 1)); - - if (m->nmaster && n > m->nmaster) { - /* go mfact box in the center if more than nmaster clients */ - if (n - m->nmaster > 1) { - /* ||<-S->|<---M--->|<-S->|| */ - mw = (m->ww - 2*ov - 2*iv) * m->mfact; - lw = (m->ww - mw - 2*ov - 2*iv) / 2; - mx += lw + iv; - } else { - /* ||<---M--->|<-S->|| */ - mw = (mw - iv) * m->mfact; - lw = m->ww - mw - iv - 2*ov; - } - rw = lw; - lx = m->wx + ov; - ly = m->wy + oh; - rx = mx + mw + iv; - ry = m->wy + oh; - } - #else - mx = m->wx; - my = m->wy; - mh = m->wh; - mw = m->ww; - lh = m->wh; - rh = m->wh; - - if (m->nmaster && n > m->nmaster) { - /* go mfact box in the center if more than nmaster clients */ - if (n - m->nmaster > 1) { - /* ||<-S->|<---M--->|<-S->|| */ - mw = m->ww * m->mfact; - lw = (m->ww - mw) / 2; - mx += lw; - } else { - /* ||<---M--->|<-S->|| */ - mw = mw * m->mfact; - lw = m->ww - mw; - } - rw = lw; - lx = m->wx; - ly = m->wy; - rx = mx + mw; - ry = m->wy; - } - #endif // VANITYGAPS_PATCH - - /* calculate facts */ - #if CFACTS_PATCH - for (n = 0, c = nexttiled(m->clients); c; c = nexttiled(c->next), n++) { - if (!m->nmaster || n < m->nmaster) - mfacts += c->cfact; // total factor of master area - else if ((n - m->nmaster) % 2) - lfacts += c->cfact; // total factor of left hand stack area - else - rfacts += c->cfact; // total factor of right hand stack area - } - - for (n = 0, c = nexttiled(m->clients); c; c = nexttiled(c->next), n++) - if (!m->nmaster || n < m->nmaster) - mtotal += mh / mfacts; - else if ((n - m->nmaster) % 2) - ltotal += lh * (c->cfact / lfacts); - else - rtotal += rh * (c->cfact / rfacts); - #else - for (n = 0, c = nexttiled(m->clients); c; c = nexttiled(c->next), n++) { - if (!m->nmaster || n < m->nmaster) - mfacts += 1; - else if ((n - m->nmaster) % 2) - lfacts += 1; // total factor of left hand stack area - else - rfacts += 1; // total factor of right hand stack area - } - - for (n = 0, c = nexttiled(m->clients); c; c = nexttiled(c->next), n++) - if (!m->nmaster || n < m->nmaster) - mtotal += mh / mfacts; - else if ((n - m->nmaster) % 2) - ltotal += lh / lfacts; - else - rtotal += rh / rfacts; - #endif // CFACTS_PATCH - - mrest = mh - mtotal; - lrest = lh - ltotal; - rrest = rh - rtotal; - - for (i = 0, c = nexttiled(m->clients); c; c = nexttiled(c->next), i++) { - if (!m->nmaster || i < m->nmaster) { - /* nmaster clients are stacked vertically, in the center of the screen */ - #if CFACTS_PATCH - resize(c, mx, my, mw - (2*c->bw), (mh / mfacts) * c->cfact + (i < mrest ? 1 : 0) - (2*c->bw), 0); - #else - resize(c, mx, my, mw - (2*c->bw), (mh / mfacts) + (i < mrest ? 1 : 0) - (2*c->bw), 0); - #endif // CFACTS_PATCH - #if VANITYGAPS_PATCH - my += HEIGHT(c) + ih; - #else - my += HEIGHT(c); - #endif - } else { - /* stack clients are stacked vertically */ - if ((i - m->nmaster) % 2 ) { - #if CFACTS_PATCH - resize(c, lx, ly, lw - (2*c->bw), (lh / lfacts) * c->cfact + ((i - 2*m->nmaster) < 2*lrest ? 1 : 0) - (2*c->bw), 0); - #else - resize(c, lx, ly, lw - (2*c->bw), (lh / lfacts) + ((i - 2*m->nmaster) < 2*lrest ? 1 : 0) - (2*c->bw), 0); - #endif // CFACTS_PATCH - #if VANITYGAPS_PATCH - ly += HEIGHT(c) + ih; - #else - ly += HEIGHT(c); - #endif - } else { - #if CFACTS_PATCH - resize(c, rx, ry, rw - (2*c->bw), (rh / rfacts) * c->cfact + ((i - 2*m->nmaster) < 2*rrest ? 1 : 0) - (2*c->bw), 0); - #else - resize(c, rx, ry, rw - (2*c->bw), (rh / rfacts) + ((i - 2*m->nmaster) < 2*rrest ? 1 : 0) - (2*c->bw), 0); - #endif // CFACTS_PATCH - #if VANITYGAPS_PATCH - ry += HEIGHT(c) + ih; - #else - ry += HEIGHT(c); - #endif - } - } - } -} - diff --git a/dwm/.dwm.old/patch/layout_centeredmaster.h b/dwm/.dwm.old/patch/layout_centeredmaster.h deleted file mode 100644 index 703f8b8..0000000 --- a/dwm/.dwm.old/patch/layout_centeredmaster.h +++ /dev/null @@ -1,2 +0,0 @@ -static void centeredmaster(Monitor *m); - diff --git a/dwm/.dwm.old/patch/layout_columns.c b/dwm/.dwm.old/patch/layout_columns.c deleted file mode 100644 index 8a0e551..0000000 --- a/dwm/.dwm.old/patch/layout_columns.c +++ /dev/null @@ -1,74 +0,0 @@ -static void -col(Monitor *m) -{ - unsigned int i, n; - int mx = 0, my = 0, mh = 0, mw = 0; - int sx = 0, sy = 0, sh = 0, sw = 0; - float mfacts, sfacts; - int mrest, srest; - Client *c; - - #if VANITYGAPS_PATCH - int oh, ov, ih, iv; - getgaps(m, &oh, &ov, &ih, &iv, &n); - #else - for (n = 0, c = nexttiled(m->clients); c; c = nexttiled(c->next), n++); - #endif // VANITYGAPS_PATCH - - if (n == 0) - return; - - #if VANITYGAPS_PATCH - sx = mx = m->wx + ov; - sy = my = m->wy + oh; - mh = m->wh - 2*oh; - sh = m->wh - 2*oh - ih * (n - m->nmaster - 1); - mw = m->ww - 2*ov - iv * (MIN(n, m->nmaster) - 1); - sw = m->ww - 2*ov; - - if (m->nmaster && n > m->nmaster) { - sw = (mw - iv) * (1 - m->mfact); - mw = (mw - iv) * m->mfact; - sx = mx + mw + iv * m->nmaster; - } - #else - sx = mx = m->wx; - sy = my = m->wy; - sh = mh = m->wh; - sw = mw = m->ww; - - if (m->nmaster && n > m->nmaster) { - sw = mw * (1 - m->mfact); - mw = mw * m->mfact; - sx = mx + mw; - } - #endif // VANITYGAPS_PATCH - - getfacts(m, mw, sh, &mfacts, &sfacts, &mrest, &srest); - - for (i = 0, c = nexttiled(m->clients); c; c = nexttiled(c->next), i++) - if (i < m->nmaster) { - #if CFACTS_PATCH - resize(c, mx, my, (mw / mfacts) * c->cfact + (i < mrest ? 1 : 0) - (2*c->bw), mh - (2*c->bw), 0); - #else - resize(c, mx, my, (mw / mfacts) + (i < mrest ? 1 : 0) - (2*c->bw), mh - (2*c->bw), 0); - #endif // CFACTS_PATCH - #if VANITYGAPS_PATCH - mx += WIDTH(c) + iv; - #else - mx += WIDTH(c); - #endif - } else { - #if CFACTS_PATCH - resize(c, sx, sy, sw - (2*c->bw), (sh / sfacts) * c->cfact + ((i - m->nmaster) < srest ? 1 : 0) - (2*c->bw), 0); - #else - resize(c, sx, sy, sw - (2*c->bw), (sh / sfacts) + ((i - m->nmaster) < srest ? 1 : 0) - (2*c->bw), 0); - #endif // CFACTS_PATCH - #if VANITYGAPS_PATCH - sy += HEIGHT(c) + ih; - #else - sy += HEIGHT(c); - #endif - } -} - diff --git a/dwm/.dwm.old/patch/layout_columns.h b/dwm/.dwm.old/patch/layout_columns.h deleted file mode 100644 index 017243e..0000000 --- a/dwm/.dwm.old/patch/layout_columns.h +++ /dev/null @@ -1,2 +0,0 @@ -static void col(Monitor *m); - diff --git a/dwm/.dwm.old/patch/layout_deck.c b/dwm/.dwm.old/patch/layout_deck.c deleted file mode 100644 index 1cabf0e..0000000 --- a/dwm/.dwm.old/patch/layout_deck.c +++ /dev/null @@ -1,67 +0,0 @@ -static void -deck(Monitor *m) -{ - unsigned int i, n; - int mx = 0, my = 0, mh = 0, mw = 0; - int sx = 0, sy = 0, sh = 0, sw = 0; - float mfacts, sfacts; - int mrest, srest; - Client *c; - - #if VANITYGAPS_PATCH - int oh, ov, ih, iv; - getgaps(m, &oh, &ov, &ih, &iv, &n); - #else - for (n = 0, c = nexttiled(m->clients); c; c = nexttiled(c->next), n++); - #endif // VANITYGAPS_PATCH - - if (n == 0) - return; - - #if VANITYGAPS_PATCH - sx = mx = m->wx + ov; - sy = my = m->wy + oh; - sh = mh = m->wh - 2*oh - ih * (MIN(n, m->nmaster) - 1); - sw = mw = m->ww - 2*ov; - - if (m->nmaster && n > m->nmaster) { - sw = (mw - iv) * (1 - m->mfact); - mw = (mw - iv) * m->mfact; - sx = mx + mw + iv; - sh = m->wh - 2*oh; - } - #else - sx = mx = m->wx; - sy = my = m->wy; - sh = mh = m->wh; - sw = mw = m->ww; - - if (m->nmaster && n > m->nmaster) { - sw = mw * (1 - m->mfact); - mw = mw * m->mfact; - sx = mx + mw; - } - #endif // VANITYGAPS_PATCH - - getfacts(m, mh, sh, &mfacts, &sfacts, &mrest, &srest); - - if (n - m->nmaster > 0) /* override layout symbol */ - snprintf(m->ltsymbol, sizeof m->ltsymbol, "D %d", n - m->nmaster); - - for (i = 0, c = nexttiled(m->clients); c; c = nexttiled(c->next), i++) - if (i < m->nmaster) { - #if CFACTS_PATCH - resize(c, mx, my, mw - (2*c->bw), (mh / mfacts) * c->cfact + (i < mrest ? 1 : 0) - (2*c->bw), 0); - #else - resize(c, mx, my, mw - (2*c->bw), (mh / mfacts) + (i < mrest ? 1 : 0) - (2*c->bw), 0); - #endif // CFACTS_PATCH - #if VANITYGAPS_PATCH - my += HEIGHT(c) + ih; - #else - my += HEIGHT(c); - #endif - } else { - resize(c, sx, sy, sw - (2*c->bw), sh - (2*c->bw), 0); - } -} - diff --git a/dwm/.dwm.old/patch/layout_deck.h b/dwm/.dwm.old/patch/layout_deck.h deleted file mode 100644 index b6e3c41..0000000 --- a/dwm/.dwm.old/patch/layout_deck.h +++ /dev/null @@ -1,2 +0,0 @@ -static void deck(Monitor *m); - diff --git a/dwm/.dwm.old/patch/layout_facts.c b/dwm/.dwm.old/patch/layout_facts.c deleted file mode 100644 index 611e89e..0000000 --- a/dwm/.dwm.old/patch/layout_facts.c +++ /dev/null @@ -1,52 +0,0 @@ -#if CFACTS_PATCH -void -getfacts(Monitor *m, int msize, int ssize, float *mf, float *sf, int *mr, int *sr) -{ - unsigned int n; - float mfacts = 0, sfacts = 0; - int mtotal = 0, stotal = 0; - Client *c; - - for (n = 0, c = nexttiled(m->clients); c; c = nexttiled(c->next), n++) - if (n < m->nmaster) - mfacts += c->cfact; - else - sfacts += c->cfact; - - for (n = 0, c = nexttiled(m->clients); c; c = nexttiled(c->next), n++) - if (n < m->nmaster) - mtotal += msize * (c->cfact / mfacts); - else - stotal += ssize * (c->cfact / sfacts); - - *mf = mfacts; // total factor of master area - *sf = sfacts; // total factor of stack area - *mr = msize - mtotal; // the remainder (rest) of pixels after a cfacts master split - *sr = ssize - stotal; // the remainder (rest) of pixels after a cfacts stack split -} -#else -void -getfacts(Monitor *m, int msize, int ssize, float *mf, float *sf, int *mr, int *sr) -{ - unsigned int n; - float mfacts, sfacts; - int mtotal = 0, stotal = 0; - Client *c; - - for (n = 0, c = nexttiled(m->clients); c; c = nexttiled(c->next), n++); - mfacts = MIN(n, m->nmaster); - sfacts = n - m->nmaster; - - for (n = 0, c = nexttiled(m->clients); c; c = nexttiled(c->next), n++) - if (n < m->nmaster) - mtotal += msize / mfacts; - else - stotal += ssize / sfacts; - - *mf = mfacts; // total factor of master area - *sf = sfacts; // total factor of stack area - *mr = msize - mtotal; // the remainder (rest) of pixels after an even master split - *sr = ssize - stotal; // the remainder (rest) of pixels after an even stack split -} -#endif // CFACTS_PATCH - diff --git a/dwm/.dwm.old/patch/layout_fibonacci.c b/dwm/.dwm.old/patch/layout_fibonacci.c deleted file mode 100644 index 4c5eb72..0000000 --- a/dwm/.dwm.old/patch/layout_fibonacci.c +++ /dev/null @@ -1,191 +0,0 @@ -#if VANITYGAPS_PATCH -void -fibonacci(Monitor *m, int s) -{ - unsigned int i, n; - int nx, ny, nw, nh; - int oh, ov, ih, iv; - int nv, hrest = 0, wrest = 0, r = 1; - Client *c; - - getgaps(m, &oh, &ov, &ih, &iv, &n); - if (n == 0) - return; - - nx = m->wx + ov; - ny = oh; - nw = m->ww - 2*ov; - nh = m->wh - 2*oh; - - for (i = 0, c = nexttiled(m->clients); c; c = nexttiled(c->next)) { - if (r) { - if ((i % 2 && (nh - ih) / 2 <= (bh + 2*c->bw)) - || (!(i % 2) && (nw - iv) / 2 <= (bh + 2*c->bw))) { - r = 0; - } - if (r && i < n - 1) { - if (i % 2) { - nv = (nh - ih) / 2; - hrest = nh - 2*nv - ih; - nh = nv; - } else { - nv = (nw - iv) / 2; - wrest = nw - 2*nv - iv; - nw = nv; - } - - if ((i % 4) == 2 && !s) - nx += nw + iv; - else if ((i % 4) == 3 && !s) - ny += nh + ih; - } - - if ((i % 4) == 0) { - if (s) { - ny += nh + ih; - nh += hrest; - } - else { - nh -= hrest; - ny -= nh + ih; - } - } - else if ((i % 4) == 1) { - nx += nw + iv; - nw += wrest; - } - else if ((i % 4) == 2) { - ny += nh + ih; - nh += hrest; - if (i < n - 1) - nw += wrest; - } - else if ((i % 4) == 3) { - if (s) { - nx += nw + iv; - nw -= wrest; - } else { - nw -= wrest; - nx -= nw + iv; - nh += hrest; - } - } - if (i == 0) { - if (n != 1) { - nw = (m->ww - iv - 2*ov) - (m->ww - iv - 2*ov) * (1 - m->mfact); - wrest = 0; - } - ny = m->wy + oh; - } - else if (i == 1) - nw = m->ww - nw - iv - 2*ov; - i++; - } - - resize(c, nx, ny, nw - (2*c->bw), nh - (2*c->bw), False); - } -} -#else -void -fibonacci(Monitor *m, int s) -{ - unsigned int i, n; - int nx, ny, nw, nh; - int nv, hrest = 0, wrest = 0, r = 1; - Client *c; - - for (n = 0, c = nexttiled(m->clients); c; c = nexttiled(c->next), n++); - if (n == 0) - return; - - nx = m->wx; - ny = m->wy; - nw = m->ww; - nh = m->wh; - - for (i = 0, c = nexttiled(m->clients); c; c = nexttiled(c->next)) { - if (r) { - if ((i % 2 && nh / 2 <= (bh + 2*c->bw)) - || (!(i % 2) && nw / 2 <= (bh + 2*c->bw))) { - r = 0; - } - if (r && i < n - 1) { - if (i % 2) { - nv = nh / 2; - hrest = nh - 2*nv; - nh = nv; - } else { - nv = nw / 2; - wrest = nw - 2*nv; - nw = nv; - } - - if ((i % 4) == 2 && !s) - nx += nw; - else if ((i % 4) == 3 && !s) - ny += nh; - } - - if ((i % 4) == 0) { - if (s) { - ny += nh; - nh += hrest; - } - else { - nh -= hrest; - ny -= nh; - } - } - else if ((i % 4) == 1) { - nx += nw; - nw += wrest; - } - else if ((i % 4) == 2) { - ny += nh; - nh += hrest; - if (i < n - 1) - nw += wrest; - } - else if ((i % 4) == 3) { - if (s) { - nx += nw; - nw -= wrest; - } else { - nw -= wrest; - nx -= nw; - nh += hrest; - } - } - if (i == 0) { - if (n != 1) { - nw = m->ww - m->ww * (1 - m->mfact); - wrest = 0; - } - ny = m->wy; - } - else if (i == 1) - nw = m->ww - nw; - i++; - } - - resize(c, nx, ny, nw - (2*c->bw), nh - (2*c->bw), False); - } -} -#endif - -#if FIBONACCI_DWINDLE_LAYOUT -static void -dwindle(Monitor *m) -{ - fibonacci(m, 1); -} -#endif - -#if FIBONACCI_SPIRAL_LAYOUT -static void -spiral(Monitor *m) -{ - fibonacci(m, 0); -} -#endif - diff --git a/dwm/.dwm.old/patch/layout_fibonacci.h b/dwm/.dwm.old/patch/layout_fibonacci.h deleted file mode 100644 index 3d6f77f..0000000 --- a/dwm/.dwm.old/patch/layout_fibonacci.h +++ /dev/null @@ -1,8 +0,0 @@ -#if FIBONACCI_DWINDLE_LAYOUT -static void dwindle(Monitor *m); -#endif // FIBONACCI_DWINDLE_LAYOUT -static void fibonacci(Monitor *m, int s); -#if FIBONACCI_SPIRAL_LAYOUT -static void spiral(Monitor *m); -#endif // FIBONACCI_SPIRAL_LAYOUT - diff --git a/dwm/.dwm.old/patch/layout_flextile-deluxe.c b/dwm/.dwm.old/patch/layout_flextile-deluxe.c deleted file mode 100644 index c7429f4..0000000 --- a/dwm/.dwm.old/patch/layout_flextile-deluxe.c +++ /dev/null @@ -1,891 +0,0 @@ -typedef struct { - void (*arrange)(Monitor *, int, int, int, int, int, int, int); -} LayoutArranger; - -typedef struct { - void (*arrange)(Monitor *, int, int, int, int, int, int, int, int, int); -} TileArranger; - -static const LayoutArranger flexlayouts[] = { - { layout_no_split }, - { layout_split_vertical }, - { layout_split_horizontal }, - { layout_split_centered_vertical }, - { layout_split_centered_horizontal }, - { layout_split_vertical_dual_stack }, - { layout_split_horizontal_dual_stack }, - { layout_floating_master }, - { layout_split_vertical_fixed }, - { layout_split_horizontal_fixed }, - { layout_split_centered_vertical_fixed }, - { layout_split_centered_horizontal_fixed }, - { layout_split_vertical_dual_stack_fixed }, - { layout_split_horizontal_dual_stack_fixed }, - { layout_floating_master_fixed }, -}; - -static const TileArranger flextiles[] = { - { arrange_top_to_bottom }, - { arrange_left_to_right }, - { arrange_monocle }, - { arrange_gapplessgrid }, - { arrange_gapplessgrid_alt1 }, - { arrange_gapplessgrid_alt2 }, - { arrange_gridmode }, - { arrange_horizgrid }, - { arrange_dwindle }, - { arrange_spiral }, - { arrange_tatami }, -}; - -static void -getfactsforrange(Monitor *m, int an, int ai, int size, int *rest, float *fact) -{ - int i; - float facts; - Client *c; - int total = 0; - - facts = 0; - for (i = 0, c = nexttiled(m->clients); c; c = nexttiled(c->next), i++) - if (i >= ai && i < (ai + an)) - #if CFACTS_PATCH - facts += c->cfact; - #else - facts += 1; - #endif // CFACTS_PATCH - - for (i = 0, c = nexttiled(m->clients); c; c = nexttiled(c->next), i++) - if (i >= ai && i < (ai + an)) - #if CFACTS_PATCH - total += size * (c->cfact / facts); - #else - total += size / facts; - #endif // CFACTS_PATCH - - *rest = size - total; - *fact = facts; -} - -#if IPC_PATCH || DWMC_PATCH -static void -setlayoutaxisex(const Arg *arg) -{ - int axis, arr; - - axis = arg->i & 0x3; // lower two bytes indicates layout, master or stack1-2 - arr = ((arg->i & 0xFC) >> 2); // remaining six upper bytes indicate arrangement - - if ((axis == 0 && abs(arr) > LAYOUT_LAST) - || (axis > 0 && (arr > AXIS_LAST || arr < 0))) - arr = 0; - - selmon->ltaxis[axis] = arr; - #if PERTAG_PATCH - selmon->pertag->ltaxis[selmon->pertag->curtag][axis] = selmon->ltaxis[axis]; - #endif // PERTAG_PATCH - arrange(selmon); -} -#endif // IPC_PATCH | DWMC_PATCH - -static void -layout_no_split(Monitor *m, int x, int y, int h, int w, int ih, int iv, int n) -{ - (&flextiles[m->ltaxis[m->nmaster >= n ? MASTER : STACK]])->arrange(m, x, y, h, w, ih, iv, n, n, 0); -} - -static void -layout_split_vertical(Monitor *m, int x, int y, int h, int w, int ih, int iv, int n) -{ - /* Split master into master + stack if we have enough clients */ - if (m->nmaster && n > m->nmaster) { - layout_split_vertical_fixed(m, x, y, h, w, ih, iv, n); - } else { - layout_no_split(m, x, y, h, w, ih, iv, n); - } -} - -static void -layout_split_vertical_fixed(Monitor *m, int x, int y, int h, int w, int ih, int iv, int n) -{ - int sw, sx; - - sw = (w - iv) * (1 - m->mfact); - w = (w - iv) * m->mfact; - if (m->ltaxis[LAYOUT] < 0) { // mirror - sx = x; - x += sw + iv; - } else { - sx = x + w + iv; - } - - (&flextiles[m->ltaxis[MASTER]])->arrange(m, x, y, h, w, ih, iv, n, m->nmaster, 0); - (&flextiles[m->ltaxis[STACK]])->arrange(m, sx, y, h, sw, ih, iv, n, n - m->nmaster, m->nmaster); -} - -static void -layout_split_vertical_dual_stack(Monitor *m, int x, int y, int h, int w, int ih, int iv, int n) -{ - /* Split master into master + stack if we have enough clients */ - if (!m->nmaster || n <= m->nmaster) { - layout_no_split(m, x, y, h, w, ih, iv, n); - } else if (n <= m->nmaster + (m->nstack ? m->nstack : 1)) { - layout_split_vertical(m, x, y, h, w, ih, iv, n); - } else { - layout_split_vertical_dual_stack_fixed(m, x, y, h, w, ih, iv, n); - } -} - -static void -layout_split_vertical_dual_stack_fixed(Monitor *m, int x, int y, int h, int w, int ih, int iv, int n) -{ - int sh, sw, sx, oy, sc; - - if (m->nstack) - sc = m->nstack; - else - sc = (n - m->nmaster) / 2 + ((n - m->nmaster) % 2 > 0 ? 1 : 0); - - sw = (w - iv) * (1 - m->mfact); - sh = (h - ih) / 2; - w = (w - iv) * m->mfact; - oy = y + sh + ih; - if (m->ltaxis[LAYOUT] < 0) { // mirror - sx = x; - x += sw + iv; - } else { - sx = x + w + iv; - } - - (&flextiles[m->ltaxis[MASTER]])->arrange(m, x, y, h, w, ih, iv, n, m->nmaster, 0); - (&flextiles[m->ltaxis[STACK]])->arrange(m, sx, y, sh, sw, ih, iv, n, sc, m->nmaster); - (&flextiles[m->ltaxis[STACK2]])->arrange(m, sx, oy, sh, sw, ih, iv, n, n - m->nmaster - sc, m->nmaster + sc); -} - -static void -layout_split_horizontal(Monitor *m, int x, int y, int h, int w, int ih, int iv, int n) -{ - /* Split master into master + stack if we have enough clients */ - if (m->nmaster && n > m->nmaster) { - layout_split_horizontal_fixed(m, x, y, h, w, ih, iv, n); - } else { - layout_no_split(m, x, y, h, w, ih, iv, n); - } -} - -static void -layout_split_horizontal_fixed(Monitor *m, int x, int y, int h, int w, int ih, int iv, int n) -{ - int sh, sy; - - sh = (h - ih) * (1 - m->mfact); - h = (h - ih) * m->mfact; - if (m->ltaxis[LAYOUT] < 0) { // mirror - sy = y; - y += sh + ih; - } else { - sy = y + h + ih; - } - - (&flextiles[m->ltaxis[MASTER]])->arrange(m, x, y, h, w, ih, iv, n, m->nmaster, 0); - (&flextiles[m->ltaxis[STACK]])->arrange(m, x, sy, sh, w, ih, iv, n, n - m->nmaster, m->nmaster); -} - -static void -layout_split_horizontal_dual_stack(Monitor *m, int x, int y, int h, int w, int ih, int iv, int n) -{ - /* Split master into master + stack if we have enough clients */ - if (!m->nmaster || n <= m->nmaster) { - layout_no_split(m, x, y, h, w, ih, iv, n); - } else if (n <= m->nmaster + (m->nstack ? m->nstack : 1)) { - layout_split_horizontal(m, x, y, h, w, ih, iv, n); - } else { - layout_split_horizontal_dual_stack_fixed(m, x, y, h, w, ih, iv, n); - } -} - -static void -layout_split_horizontal_dual_stack_fixed(Monitor *m, int x, int y, int h, int w, int ih, int iv, int n) -{ - int sh, sy, ox, sc; - - if (m->nstack) - sc = m->nstack; - else - sc = (n - m->nmaster) / 2 + ((n - m->nmaster) % 2 > 0 ? 1 : 0); - - sh = (h - ih) * (1 - m->mfact); - h = (h - ih) * m->mfact; - sw = (w - iv) / 2; - ox = x + sw + iv; - if (m->ltaxis[LAYOUT] < 0) { // mirror - sy = y; - y += sh + ih; - } else { - sy = y + h + ih; - } - - (&flextiles[m->ltaxis[MASTER]])->arrange(m, x, y, h, w, ih, iv, n, m->nmaster, 0); - (&flextiles[m->ltaxis[STACK]])->arrange(m, x, sy, sh, sw, ih, iv, n, sc, m->nmaster); - (&flextiles[m->ltaxis[STACK2]])->arrange(m, ox, sy, sh, sw, ih, iv, n, n - m->nmaster - sc, m->nmaster + sc); -} - -static void -layout_split_centered_vertical(Monitor *m, int x, int y, int h, int w, int ih, int iv, int n) -{ - /* Split master into master + stack if we have enough clients */ - if (!m->nmaster || n <= m->nmaster) { - layout_no_split(m, x, y, h, w, ih, iv, n); - } else if (n <= m->nmaster + (m->nstack ? m->nstack : 1)) { - layout_split_vertical(m, x, y, h, w, ih, iv, n); - } else { - layout_split_centered_vertical_fixed(m, x, y, h, w, ih, iv, n); - } -} - -static void -layout_split_centered_vertical_fixed(Monitor *m, int x, int y, int h, int w, int ih, int iv, int n) -{ - int sw, sx, ox, sc; - - if (m->nstack) - sc = m->nstack; - else - sc = (n - m->nmaster) / 2 + ((n - m->nmaster) % 2 > 0 ? 1 : 0); - - sw = (w - 2*iv) * (1 - m->mfact) / 2; - w = (w - 2*iv) * m->mfact; - if (m->ltaxis[LAYOUT] < 0) { // mirror - sx = x; - x += sw + iv; - ox = x + w + iv; - } else { - ox = x; - x += sw + iv; - sx = x + w + iv; - } - - (&flextiles[m->ltaxis[MASTER]])->arrange(m, x, y, h, w, ih, iv, n, m->nmaster, 0); - (&flextiles[m->ltaxis[STACK]])->arrange(m, sx, y, h, sw, ih, iv, n, sc, m->nmaster); - (&flextiles[m->ltaxis[STACK2]])->arrange(m, ox, y, h, sw, ih, iv, n, n - m->nmaster - sc, m->nmaster + sc); -} - -static void -layout_split_centered_horizontal(Monitor *m, int x, int y, int h, int w, int ih, int iv, int n) -{ - /* Split master into master + stack if we have enough clients */ - if (!m->nmaster || n <= m->nmaster) { - layout_no_split(m, x, y, h, w, ih, iv, n); - } else if (n <= m->nmaster + (m->nstack ? m->nstack : 1)) { - layout_split_horizontal(m, x, y, h, w, ih, iv, n); - } else { - layout_split_centered_horizontal_fixed(m, x, y, h, w, ih, iv, n); - } -} - -static void -layout_split_centered_horizontal_fixed(Monitor *m, int x, int y, int h, int w, int ih, int iv, int n) -{ - int sh, sy, oy, sc; - - if (m->nstack) - sc = m->nstack; - else - sc = (n - m->nmaster) / 2 + ((n - m->nmaster) % 2 > 0 ? 1 : 0); - - sh = (h - 2*ih) * (1 - m->mfact) / 2; - h = (h - 2*ih) * m->mfact; - if (m->ltaxis[LAYOUT] < 0) { // mirror - sy = y; - y += sh + ih; - oy = y + h + ih; - } else { - oy = y; - y += sh + ih; - sy = y + h + ih; - } - - (&flextiles[m->ltaxis[MASTER]])->arrange(m, x, y, h, w, ih, iv, n, m->nmaster, 0); - (&flextiles[m->ltaxis[STACK]])->arrange(m, x, sy, sh, w, ih, iv, n, sc, m->nmaster); - (&flextiles[m->ltaxis[STACK2]])->arrange(m, x, oy, sh, w, ih, iv, n, n - m->nmaster - sc, m->nmaster + sc); -} - -static void -layout_floating_master(Monitor *m, int x, int y, int h, int w, int ih, int iv, int n) -{ - /* Split master into master + stack if we have enough clients */ - if (!m->nmaster || n <= m->nmaster) { - layout_no_split(m, x, y, h, w, ih, iv, n); - } else { - layout_floating_master_fixed(m, x, y, h, w, ih, iv, n); - } -} - -static void -layout_floating_master_fixed(Monitor *m, int x, int y, int h, int w, int ih, int iv, int n) -{ - int mh, mw; - - /* Draw stack area first */ - (&flextiles[m->ltaxis[STACK]])->arrange(m, x, y, h, w, ih, iv, n, n - m->nmaster, m->nmaster); - - if (w > h) { - mw = w * m->mfact; - mh = h * 0.9; - } else { - mw = w * 0.9; - mh = h * m->mfact; - } - x = x + (w - mw) / 2; - y = y + (h - mh) / 2; - - (&flextiles[m->ltaxis[MASTER]])->arrange(m, x, y, mh, mw, ih, iv, n, m->nmaster, 0); -} - -static void -arrange_left_to_right(Monitor *m, int x, int y, int h, int w, int ih, int iv, int n, int an, int ai) -{ - int i, rest; - float facts, fact = 1; - Client *c; - - if (ai + an > n) - an = n - ai; - - w -= iv * (an - 1); - getfactsforrange(m, an, ai, w, &rest, &facts); - for (i = 0, c = nexttiled(m->clients); c; c = nexttiled(c->next), i++) { - if (i >= ai && i < (ai + an)) { - #if CFACTS_PATCH - fact = c->cfact; - #endif // CFACTS_PATCH - resize(c, x, y, w * (fact / facts) + ((i - ai) < rest ? 1 : 0) - (2*c->bw), h - (2*c->bw), 0); - x += WIDTH(c) + iv; - } - } -} - -static void -arrange_top_to_bottom(Monitor *m, int x, int y, int h, int w, int ih, int iv, int n, int an, int ai) -{ - int i, rest; - float facts, fact = 1; - Client *c; - - if (ai + an > n) - an = n - ai; - - h -= ih * (an - 1); - getfactsforrange(m, an, ai, h, &rest, &facts); - for (i = 0, c = nexttiled(m->clients); c; c = nexttiled(c->next), i++) { - if (i >= ai && i < (ai + an)) { - #if CFACTS_PATCH - fact = c->cfact; - #endif // CFACTS_PATCH - resize(c, x, y, w - (2*c->bw), h * (fact / facts) + ((i - ai) < rest ? 1 : 0) - (2*c->bw), 0); - y += HEIGHT(c) + ih; - } - } -} - -static void -arrange_monocle(Monitor *m, int x, int y, int h, int w, int ih, int iv, int n, int an, int ai) -{ - int i; - Client *c; - - for (i = 0, c = nexttiled(m->clients); c; c = nexttiled(c->next), i++) - if (i >= ai && i < (ai + an)) - resize(c, x, y, w - (2*c->bw), h - (2*c->bw), 0); -} - -static void -arrange_gridmode(Monitor *m, int x, int y, int h, int w, int ih, int iv, int n, int an, int ai) -{ - int i, cols, rows, ch, cw, cx, cy, cc, cr, chrest, cwrest; // counters - Client *c; - - /* grid dimensions */ - for (rows = 0; rows <= an/2; rows++) - if (rows*rows >= an) - break; - cols = (rows && (rows - 1) * rows >= an) ? rows - 1 : rows; - - /* window geoms (cell height/width) */ - ch = (h - ih * (rows - 1)) / (rows ? rows : 1); - cw = (w - iv * (cols - 1)) / (cols ? cols : 1); - chrest = h - ih * (rows - 1) - ch * rows; - cwrest = w - iv * (cols - 1) - cw * cols; - for (i = 0, c = nexttiled(m->clients); c; c = nexttiled(c->next), i++) { - if (i >= ai && i < (ai + an)) { - cc = ((i - ai) / rows); // client column number - cr = ((i - ai) % rows); // client row number - cx = x + cc * (cw + iv) + MIN(cc, cwrest); - cy = y + cr * (ch + ih) + MIN(cr, chrest); - resize(c, cx, cy, cw + (cc < cwrest ? 1 : 0) - 2*c->bw, ch + (cr < chrest ? 1 : 0) - 2*c->bw, False); - } - } -} - -static void -arrange_horizgrid(Monitor *m, int x, int y, int h, int w, int ih, int iv, int n, int an, int ai) -{ - int ntop, nbottom, rh, rest; - - /* Exception when there is only one client; don't split into two rows */ - if (an == 1) { - arrange_monocle(m, x, y, h, w, ih, iv, n, an, ai); - return; - } - - ntop = an / 2; - nbottom = an - ntop; - rh = (h - ih) / 2; - rest = h - ih - rh * 2; - arrange_left_to_right(m, x, y, rh + rest, w, ih, iv, n, ntop, ai); - arrange_left_to_right(m, x, y + rh + ih + rest, rh, w, ih, iv, n, nbottom, ai + ntop); -} - -static void -arrange_gapplessgrid(Monitor *m, int x, int y, int h, int w, int ih, int iv, int n, int an, int ai) -{ - int i, cols, rows, ch, cw, cn, rn, cc, rrest, crest; // counters - Client *c; - - /* grid dimensions */ - for (cols = 1; cols <= an/2; cols++) - if (cols*cols >= an) - break; - if (an == 5) /* set layout against the general calculation: not 1:2:2, but 2:3 */ - cols = 2; - rows = an/cols; - cn = rn = cc = 0; // reset column no, row no, client count - - ch = (h - ih * (rows - 1)) / rows; - rrest = (h - ih * (rows - 1)) - ch * rows; - cw = (w - iv * (cols - 1)) / cols; - crest = (w - iv * (cols - 1)) - cw * cols; - - for (i = 0, c = nexttiled(m->clients); c; c = nexttiled(c->next), i++) { - if (i >= ai && i < (ai + an)) { - if (cc/rows + 1 > cols - an%cols) { - rows = an/cols + 1; - ch = (h - ih * (rows - 1)) / rows; - rrest = (h - ih * (rows - 1)) - ch * rows; - } - resize(c, - x, - y + rn*(ch + ih) + MIN(rn, rrest), - cw + (cn < crest ? 1 : 0) - 2*c->bw, - ch + (rn < rrest ? 1 : 0) - 2*c->bw, - 0); - rn++; - cc++; - if (rn >= rows) { - rn = 0; - x += cw + ih + (cn < crest ? 1 : 0); - cn++; - } - } - } -} - -/* This version of gappless grid fills rows first */ -static void -arrange_gapplessgrid_alt1(Monitor *m, int x, int y, int h, int w, int ih, int iv, int n, int an, int ai) -{ - int i, cols, rows, rest, ch; - - /* grid dimensions */ - for (cols = 1; cols <= an/2; cols++) - if (cols*cols >= an) - break; - rows = (cols && (cols - 1) * cols >= an) ? cols - 1 : cols; - ch = (h - ih * (rows - 1)) / (rows ? rows : 1); - rest = (h - ih * (rows - 1)) - ch * rows; - - for (i = 0; i < rows; i++) { - arrange_left_to_right(m, x, y, ch + (i < rest ? 1 : 0), w, ih, iv, n, MIN(cols, an - i*cols), ai + i*cols); - y += ch + (i < rest ? 1 : 0) + ih; - } -} - -/* This version of gappless grid fills columns first */ -static void -arrange_gapplessgrid_alt2(Monitor *m, int x, int y, int h, int w, int ih, int iv, int n, int an, int ai) -{ - int i, cols, rows, rest, cw; - - /* grid dimensions */ - for (rows = 0; rows <= an/2; rows++) - if (rows*rows >= an) - break; - cols = (rows && (rows - 1) * rows >= an) ? rows - 1 : rows; - cw = (w - iv * (cols - 1)) / (cols ? cols : 1); - rest = (w - iv * (cols - 1)) - cw * cols; - - for (i = 0; i < cols; i++) { - arrange_top_to_bottom(m, x, y, h, cw + (i < rest ? 1 : 0), ih, iv, n, MIN(rows, an - i*rows), ai + i*rows); - x += cw + (i < rest ? 1 : 0) + iv; - } -} - -static void -arrange_fibonacci(Monitor *m, int x, int y, int h, int w, int ih, int iv, int n, int an, int ai, int s) -{ - int i, j, nv, hrest = 0, wrest = 0, nx = x, ny = y, nw = w, nh = h, r = 1; - Client *c; - - for (i = 0, j = 0, c = nexttiled(m->clients); c; c = nexttiled(c->next), j++) { - if (j >= ai && j < (ai + an)) { - if (r) { - if ((i % 2 && ((nh - ih) / 2) <= (bh + 2*c->bw)) || (!(i % 2) && ((nw - iv) / 2) <= (bh + 2*c->bw))) { - r = 0; - } - if (r && i < an - 1) { - if (i % 2) { - nv = (nh - ih) / 2; - hrest = nh - 2*nv - ih; - nh = nv; - } else { - nv = (nw - iv) / 2; - wrest = nw - 2*nv - iv; - nw = nv; - } - - if ((i % 4) == 2 && !s) - nx += nw + iv; - else if ((i % 4) == 3 && !s) - ny += nh + ih; - } - if ((i % 4) == 0) { - if (s) { - ny += nh + ih; - nh += hrest; - } else { - nh -= hrest; - ny -= nh + ih; - } - } else if ((i % 4) == 1) { - nx += nw + iv; - nw += wrest; - } else if ((i % 4) == 2) { - ny += nh + ih; - nh += hrest; - if (i < n - 1) - nw += wrest; - } else if ((i % 4) == 3) { - if (s) { - nx += nw + iv; - nw -= wrest; - } else { - nw -= wrest; - nx -= nw + iv; - nh += hrest; - } - } - if (i == 0) { - if (an != 1) { - nw = (w - iv) - (w - iv) * (1 - m->mfact); - wrest = 0; - } - ny = y; - } else if (i == 1) - nw = w - nw - iv; - i++; - } - - resize(c, nx, ny, nw - 2 * c->bw, nh - 2*c->bw, False); - } - } -} - -static void -arrange_dwindle(Monitor *m, int x, int y, int h, int w, int ih, int iv, int n, int an, int ai) -{ - arrange_fibonacci(m, x, y, h, w, ih, iv, n, an, ai, 1); -} - -static void -arrange_spiral(Monitor *m, int x, int y, int h, int w, int ih, int iv, int n, int an, int ai) -{ - arrange_fibonacci(m, x, y, h, w, ih, iv, n, an, ai, 0); -} - -static void -arrange_tatami(Monitor *m, int x, int y, int h, int w, int ih, int iv, int n, int an, int ai) -{ - unsigned int i, j, nx, ny, nw, nh, tnx, tny, tnw, tnh, nhrest, hrest, wrest, areas, mats, cats; - Client *c; - - nx = x; - ny = y; - nw = w; - nh = h; - - mats = an / 5; - cats = an % 5; - hrest = 0; - wrest = 0; - - areas = mats + (cats > 0); - nh = (h - ih * (areas - 1)) / areas; - nhrest = (h - ih * (areas - 1)) % areas; - - for (i = 0, j = 0, c = nexttiled(m->clients); c; c = nexttiled(c->next), j++) { - if (j >= ai && j < (ai + an)) { - - tnw = nw; - tnx = nx; - tnh = nh; - tny = ny; - - if (j < ai + cats) { - /* Arrange cats (all excess clients that can't be tiled as mats). Cats sleep on mats. */ - - switch (cats) { - case 1: // fill - break; - case 2: // up and down - if ((i % 5) == 0) //up - tnh = (nh - ih) / 2 + (nh - ih) % 2; - else if ((i % 5) == 1) { //down - tny += (nh - ih) / 2 + (nh - ih) % 2 + ih; - tnh = (nh - ih) / 2; - } - break; - case 3: //bottom, up-left and up-right - if ((i % 5) == 0) { // up-left - tnw = (nw - iv) / 2 + (nw - iv) % 2; - tnh = (nh - ih) * 2 / 3 + (nh - ih) * 2 % 3; - } else if ((i % 5) == 1) { // up-right - tnx += (nw - iv) / 2 + (nw - iv) % 2 + iv; - tnw = (nw - iv) / 2; - tnh = (nh - ih) * 2 / 3 + (nh - ih) * 2 % 3; - } else if ((i % 5) == 2) { //bottom - tnh = (nh - ih) / 3; - tny += (nh - ih) * 2 / 3 + (nh - ih) * 2 % 3 + ih; - } - break; - case 4: // bottom, left, right and top - if ((i % 5) == 0) { //top - hrest = (nh - 2 * ih) % 4; - tnh = (nh - 2 * ih) / 4 + (hrest ? 1 : 0); - } else if ((i % 5) == 1) { // left - tnw = (nw - iv) / 2 + (nw - iv) % 2; - tny += (nh - 2 * ih) / 4 + (hrest ? 1 : 0) + ih; - tnh = (nh - 2 * ih) * 2 / 4 + (hrest > 1 ? 1 : 0); - } else if ((i % 5) == 2) { // right - tnx += (nw - iv) / 2 + (nw - iv) % 2 + iv; - tnw = (nw - iv) / 2; - tny += (nh - 2 * ih) / 4 + (hrest ? 1 : 0) + ih; - tnh = (nh - 2 * ih) * 2 / 4 + (hrest > 1 ? 1 : 0); - } else if ((i % 5) == 3) { // bottom - tny += (nh - 2 * ih) / 4 + (hrest ? 1 : 0) + (nh - 2 * ih) * 2 / 4 + (hrest > 1 ? 1 : 0) + 2 * ih; - tnh = (nh - 2 * ih) / 4 + (hrest > 2 ? 1 : 0); - } - break; - } - - } else { - /* Arrange mats. One mat is a collection of five clients arranged tatami style */ - - if (((i - cats) % 5) == 0) { - if ((cats > 0) || ((i - cats) >= 5)) { - tny = ny = ny + nh + (nhrest > 0 ? 1 : 0) + ih; - --nhrest; - } - } - - switch ((i - cats) % 5) { - case 0: // top-left-vert - wrest = (nw - 2 * iv) % 3; - hrest = (nh - 2 * ih) % 3; - tnw = (nw - 2 * iv) / 3 + (wrest ? 1 : 0); - tnh = (nh - 2 * ih) * 2 / 3 + hrest + iv; - break; - case 1: // top-right-hor - tnx += (nw - 2 * iv) / 3 + (wrest ? 1 : 0) + iv; - tnw = (nw - 2 * iv) * 2 / 3 + (wrest > 1 ? 1 : 0) + iv; - tnh = (nh - 2 * ih) / 3 + (hrest ? 1 : 0); - break; - case 2: // center - tnx += (nw - 2 * iv) / 3 + (wrest ? 1 : 0) + iv; - tnw = (nw - 2 * iv) / 3 + (wrest > 1 ? 1 : 0); - tny += (nh - 2 * ih) / 3 + (hrest ? 1 : 0) + ih; - tnh = (nh - 2 * ih) / 3 + (hrest > 1 ? 1 : 0); - break; - case 3: // bottom-right-vert - tnx += (nw - 2 * iv) * 2 / 3 + wrest + 2 * iv; - tnw = (nw - 2 * iv) / 3; - tny += (nh - 2 * ih) / 3 + (hrest ? 1 : 0) + ih; - tnh = (nh - 2 * ih) * 2 / 3 + hrest + iv; - break; - case 4: // (oldest) bottom-left-hor - tnw = (nw - 2 * iv) * 2 / 3 + wrest + iv; - tny += (nh - 2 * ih) * 2 / 3 + hrest + 2 * iv; - tnh = (nh - 2 * ih) / 3; - break; - } - - } - - resize(c, tnx, tny, tnw - 2 * c->bw, tnh - 2 * c->bw, False); - ++i; - } - } -} - -static void -flextile(Monitor *m) -{ - unsigned int n; - int oh = 0, ov = 0, ih = 0, iv = 0; // gaps outer/inner horizontal/vertical - - #if VANITYGAPS_PATCH - getgaps(m, &oh, &ov, &ih, &iv, &n); - #else - Client *c; - for (n = 0, c = nexttiled(m->clients); c; c = nexttiled(c->next), n++); - #endif // VANITYGAPS_PATCH - - if (m->lt[m->sellt]->preset.layout != m->ltaxis[LAYOUT] || - m->lt[m->sellt]->preset.masteraxis != m->ltaxis[MASTER] || - m->lt[m->sellt]->preset.stack1axis != m->ltaxis[STACK] || - m->lt[m->sellt]->preset.stack2axis != m->ltaxis[STACK2]) - setflexsymbols(m, n); - else if (m->lt[m->sellt]->preset.symbolfunc != NULL) - m->lt[m->sellt]->preset.symbolfunc(m, n); - - if (n == 0) - return; - - #if VANITYGAPS_PATCH && !VANITYGAPS_MONOCLE_PATCH - /* No outer gap if full screen monocle */ - if (abs(m->ltaxis[MASTER]) == MONOCLE && (abs(m->ltaxis[LAYOUT]) == NO_SPLIT || n <= m->nmaster)) { - oh = 0; - ov = 0; - } - #endif // VANITYGAPS_PATCH && !VANITYGAPS_MONOCLE_PATCH - - (&flexlayouts[abs(m->ltaxis[LAYOUT])])->arrange(m, m->wx + ov, m->wy + oh, m->wh - 2*oh, m->ww - 2*ov, ih, iv, n); - return; -} - -static void -setflexsymbols(Monitor *m, unsigned int n) -{ - int l; - char sym1, sym2, sym3; - Client *c; - - if (n == 0) - for (c = nexttiled(m->clients); c; c = nexttiled(c->next), n++); - - l = abs(m->ltaxis[LAYOUT]); - if (m->ltaxis[MASTER] == MONOCLE && (l == NO_SPLIT || !m->nmaster || n <= m->nmaster)) { - monoclesymbols(m, n); - return; - } - - if (m->ltaxis[STACK] == MONOCLE && (l == SPLIT_VERTICAL || l == SPLIT_HORIZONTAL_FIXED)) { - decksymbols(m, n); - return; - } - - /* Layout symbols */ - if (l == NO_SPLIT || !m->nmaster) { - sym1 = sym2 = sym3 = (int)tilesymb[m->ltaxis[MASTER]]; - } else { - sym2 = layoutsymb[l]; - if (m->ltaxis[LAYOUT] < 0) { - sym1 = tilesymb[m->ltaxis[STACK]]; - sym3 = tilesymb[m->ltaxis[MASTER]]; - } else { - sym1 = tilesymb[m->ltaxis[MASTER]]; - sym3 = tilesymb[m->ltaxis[STACK]]; - } - } - - snprintf(m->ltsymbol, sizeof m->ltsymbol, "%c%c%c", sym1, sym2, sym3); -} - -static void -monoclesymbols(Monitor *m, unsigned int n) -{ - if (n > 0) - snprintf(m->ltsymbol, sizeof m->ltsymbol, "[%d]", n); - else - snprintf(m->ltsymbol, sizeof m->ltsymbol, "[M]"); -} - -static void -decksymbols(Monitor *m, unsigned int n) -{ - if (n > m->nmaster) - snprintf(m->ltsymbol, sizeof m->ltsymbol, "[]%d", n); - else - snprintf(m->ltsymbol, sizeof m->ltsymbol, "[D]"); -} - -/* Mirror layout axis for flextile */ -void -mirrorlayout(const Arg *arg) -{ - if (!selmon->lt[selmon->sellt]->arrange) - return; - selmon->ltaxis[LAYOUT] *= -1; - #if PERTAG_PATCH - selmon->pertag->ltaxis[selmon->pertag->curtag][0] = selmon->ltaxis[LAYOUT]; - #endif // PERTAG_PATCH - arrange(selmon); -} - -/* Rotate layout axis for flextile */ -void -rotatelayoutaxis(const Arg *arg) -{ - int incr = (arg->i > 0 ? 1 : -1); - int axis = abs(arg->i) - 1; - - if (!selmon->lt[selmon->sellt]->arrange) - return; - if (axis == LAYOUT) { - if (selmon->ltaxis[LAYOUT] >= 0) { - selmon->ltaxis[LAYOUT] += incr; - if (selmon->ltaxis[LAYOUT] >= LAYOUT_LAST) - selmon->ltaxis[LAYOUT] = 0; - else if (selmon->ltaxis[LAYOUT] < 0) - selmon->ltaxis[LAYOUT] = LAYOUT_LAST - 1; - } else { - selmon->ltaxis[LAYOUT] -= incr; - if (selmon->ltaxis[LAYOUT] <= -LAYOUT_LAST) - selmon->ltaxis[LAYOUT] = 0; - else if (selmon->ltaxis[LAYOUT] > 0) - selmon->ltaxis[LAYOUT] = -LAYOUT_LAST + 1; - } - } else { - selmon->ltaxis[axis] += incr; - if (selmon->ltaxis[axis] >= AXIS_LAST) - selmon->ltaxis[axis] = 0; - else if (selmon->ltaxis[axis] < 0) - selmon->ltaxis[axis] = AXIS_LAST - 1; - } - #if PERTAG_PATCH - selmon->pertag->ltaxis[selmon->pertag->curtag][axis] = selmon->ltaxis[axis]; - #endif // PERTAG_PATCH - arrange(selmon); - setflexsymbols(selmon, 0); -} - -void -incnstack(const Arg *arg) -{ - #if PERTAG_PATCH - selmon->nstack = selmon->pertag->nstacks[selmon->pertag->curtag] = MAX(selmon->nstack + arg->i, 0); - #else - selmon->nstack = MAX(selmon->nstack + arg->i, 0); - #endif // PERTAG_PATCH - arrange(selmon); -} - diff --git a/dwm/.dwm.old/patch/layout_flextile-deluxe.h b/dwm/.dwm.old/patch/layout_flextile-deluxe.h deleted file mode 100644 index 92df5c5..0000000 --- a/dwm/.dwm.old/patch/layout_flextile-deluxe.h +++ /dev/null @@ -1,121 +0,0 @@ -static void flextile(Monitor *m); -static void getfactsforrange(Monitor *m, int an, int ai, int size, int *rest, float *fact); -static void mirrorlayout(const Arg *arg); -static void rotatelayoutaxis(const Arg *arg); -#if IPC_PATCH || DWMC_PATCH -static void setlayoutaxisex(const Arg *arg); -#endif // IPC_PATCH | DWMC_PATCH -static void incnstack(const Arg *arg); - -/* Symbol handlers */ -static void setflexsymbols(Monitor *m, unsigned int n); -static void monoclesymbols(Monitor *m, unsigned int n); -static void decksymbols(Monitor *m, unsigned int n); - -/* Layout split */ -static void layout_no_split(Monitor *m, int x, int y, int h, int w, int ih, int iv, int n); -static void layout_split_vertical(Monitor *m, int x, int y, int h, int w, int ih, int iv, int n); -static void layout_split_horizontal(Monitor *m, int x, int y, int h, int w, int ih, int iv, int n); -static void layout_split_vertical_dual_stack(Monitor *m, int x, int y, int h, int w, int ih, int iv, int n); -static void layout_split_horizontal_dual_stack(Monitor *m, int x, int y, int h, int w, int ih, int iv, int n); -static void layout_split_centered_vertical(Monitor *m, int x, int y, int h, int w, int ih, int iv, int n); -static void layout_split_centered_horizontal(Monitor *m, int x, int y, int h, int w, int ih, int iv, int n); -static void layout_floating_master(Monitor *m, int x, int y, int h, int w, int ih, int iv, int n); -static void layout_split_vertical_fixed(Monitor *m, int x, int y, int h, int w, int ih, int iv, int n); -static void layout_split_horizontal_fixed(Monitor *m, int x, int y, int h, int w, int ih, int iv, int n); -static void layout_split_vertical_dual_stack_fixed(Monitor *m, int x, int y, int h, int w, int ih, int iv, int n); -static void layout_split_horizontal_dual_stack_fixed(Monitor *m, int x, int y, int h, int w, int ih, int iv, int n); -static void layout_split_centered_vertical_fixed(Monitor *m, int x, int y, int h, int w, int ih, int iv, int n); -static void layout_split_centered_horizontal_fixed(Monitor *m, int x, int y, int h, int w, int ih, int iv, int n); -static void layout_floating_master_fixed(Monitor *m, int x, int y, int h, int w, int ih, int iv, int n); - -/* Layout tile arrangements */ -static void arrange_left_to_right(Monitor *m, int ax, int ay, int ah, int aw, int ih, int iv, int n, int an, int ai); -static void arrange_top_to_bottom(Monitor *m, int ax, int ay, int ah, int aw, int ih, int iv, int n, int an, int ai); -static void arrange_monocle(Monitor *m, int ax, int ay, int ah, int aw, int ih, int iv, int n, int an, int ai); -static void arrange_gapplessgrid(Monitor *m, int ax, int ay, int ah, int aw, int ih, int iv, int n, int an, int ai); -static void arrange_gapplessgrid_alt1(Monitor *m, int ax, int ay, int ah, int aw, int ih, int iv, int n, int an, int ai); -static void arrange_gapplessgrid_alt2(Monitor *m, int ax, int ay, int ah, int aw, int ih, int iv, int n, int an, int ai); -static void arrange_gridmode(Monitor *m, int ax, int ay, int ah, int aw, int ih, int iv, int n, int an, int ai); -static void arrange_horizgrid(Monitor *m, int ax, int ay, int ah, int aw, int ih, int iv, int n, int an, int ai); -static void arrange_dwindle(Monitor *m, int ax, int ay, int ah, int aw, int ih, int iv, int n, int an, int ai); -static void arrange_spiral(Monitor *m, int ax, int ay, int ah, int aw, int ih, int iv, int n, int an, int ai); -static void arrange_tatami(Monitor *m, int ax, int ay, int ah, int aw, int ih, int iv, int n, int an, int ai); - -/* Named flextile constants */ -enum { - LAYOUT, // controls overall layout arrangement / split - MASTER, // indicates the tile arrangement for the master area - STACK, // indicates the tile arrangement for the stack area - STACK2, // indicates the tile arrangement for the secondary stack area - LTAXIS_LAST, -}; - -/* Layout arrangements */ -enum { - NO_SPLIT, - SPLIT_VERTICAL, // master stack vertical split - SPLIT_HORIZONTAL, // master stack horizontal split - SPLIT_CENTERED_VERTICAL, // centered master vertical split - SPLIT_CENTERED_HORIZONTAL, // centered master horizontal split - SPLIT_VERTICAL_DUAL_STACK, // master stack vertical split with dual stack - SPLIT_HORIZONTAL_DUAL_STACK, // master stack vertical split with dual stack - FLOATING_MASTER, // (fake) floating master - SPLIT_VERTICAL_FIXED, // master stack vertical fixed split - SPLIT_HORIZONTAL_FIXED, // master stack horizontal fixed split - SPLIT_CENTERED_VERTICAL_FIXED, // centered master vertical fixed split - SPLIT_CENTERED_HORIZONTAL_FIXED, // centered master horizontal fixed split - SPLIT_VERTICAL_DUAL_STACK_FIXED, // master stack vertical split with fixed dual stack - SPLIT_HORIZONTAL_DUAL_STACK_FIXED, // master stack vertical split with fixed dual stack - FLOATING_MASTER_FIXED, // (fake) fixed floating master - LAYOUT_LAST, -}; - -static char layoutsymb[] = { - 32, // " ", - 124, // "|", - 61, // "=", - 94, // "^", - 126, // "~", - 58, // ":", - 59, // ";", - 43, // "+", - 124, // "¦", - 61, // "=", - 94, // "^", - 126, // "~", - 58, // ":", - 59, // ";", - 43, // "+", -}; - -/* Tile arrangements */ -enum { - TOP_TO_BOTTOM, // clients are arranged vertically - LEFT_TO_RIGHT, // clients are arranged horizontally - MONOCLE, // clients are arranged in deck / monocle mode - GAPPLESSGRID, // clients are arranged in a gappless grid (original formula) - GAPPLESSGRID_ALT1, // clients are arranged in a gappless grid (alt. 1, fills rows first) - GAPPLESSGRID_ALT2, // clients are arranged in a gappless grid (alt. 2, fills columns first) - GRIDMODE, // clients are arranged in a grid - HORIZGRID, // clients are arranged in a horizontal grid - DWINDLE, // clients are arranged in fibonacci dwindle mode - SPIRAL, // clients are arranged in fibonacci spiral mode - TATAMI, // clients are arranged as tatami mats - AXIS_LAST, -}; - -static char tilesymb[] = { - 61, // "=", - 124, // "|", - 68, // "D", - 71, // "G", - 49, // "1", - 50, // "2" - 35, // "#", - 126, // "~", - 92, // "\\", - 64, // "@", - 84, // "T", -}; - diff --git a/dwm/.dwm.old/patch/layout_gapplessgrid.c b/dwm/.dwm.old/patch/layout_gapplessgrid.c deleted file mode 100644 index 79f236a..0000000 --- a/dwm/.dwm.old/patch/layout_gapplessgrid.c +++ /dev/null @@ -1,99 +0,0 @@ -#if VANITYGAPS_PATCH -void -gaplessgrid(Monitor *m) -{ - unsigned int i, n; - int x, y, cols, rows, ch, cw, cn, rn, rrest, crest; // counters - int oh, ov, ih, iv; - Client *c; - - getgaps(m, &oh, &ov, &ih, &iv, &n); - if (n == 0) - return; - - /* grid dimensions */ - for (cols = 0; cols <= n/2; cols++) - if (cols*cols >= n) - break; - if (n == 5) /* set layout against the general calculation: not 1:2:2, but 2:3 */ - cols = 2; - rows = n/cols; - cn = rn = 0; // reset column no, row no, client count - - ch = (m->wh - 2*oh - ih * (rows - 1)) / rows; - cw = (m->ww - 2*ov - iv * (cols - 1)) / cols; - rrest = (m->wh - 2*oh - ih * (rows - 1)) - ch * rows; - crest = (m->ww - 2*ov - iv * (cols - 1)) - cw * cols; - x = m->wx + ov; - y = m->wy + oh; - - for (i = 0, c = nexttiled(m->clients); c; i++, c = nexttiled(c->next)) { - if (i/rows + 1 > cols - n%cols) { - rows = n/cols + 1; - ch = (m->wh - 2*oh - ih * (rows - 1)) / rows; - rrest = (m->wh - 2*oh - ih * (rows - 1)) - ch * rows; - } - resize(c, - x, - y + rn*(ch + ih) + MIN(rn, rrest), - cw + (cn < crest ? 1 : 0) - 2*c->bw, - ch + (rn < rrest ? 1 : 0) - 2*c->bw, - 0); - rn++; - if (rn >= rows) { - rn = 0; - x += cw + ih + (cn < crest ? 1 : 0); - cn++; - } - } -} -#else -void -gaplessgrid(Monitor *m) -{ - unsigned int i, n; - int x, y, cols, rows, ch, cw, cn, rn, rrest, crest; // counters - Client *c; - - for (n = 0, c = nexttiled(m->clients); c; c = nexttiled(c->next), n++); - if (n == 0) - return; - - /* grid dimensions */ - for (cols = 0; cols <= n/2; cols++) - if (cols*cols >= n) - break; - if (n == 5) /* set layout against the general calculation: not 1:2:2, but 2:3 */ - cols = 2; - rows = n/cols; - cn = rn = 0; // reset column no, row no, client count - - ch = m->wh / rows; - cw = m->ww / cols; - rrest = m->wh - ch * rows; - crest = m->ww - cw * cols; - x = m->wx; - y = m->wy; - - for (i = 0, c = nexttiled(m->clients); c; i++, c = nexttiled(c->next)) { - if (i/rows + 1 > cols - n%cols) { - rows = n/cols + 1; - ch = m->wh / rows; - rrest = m->wh - ch * rows; - } - resize(c, - x, - y + rn*ch + MIN(rn, rrest), - cw + (cn < crest ? 1 : 0) - 2*c->bw, - ch + (rn < rrest ? 1 : 0) - 2*c->bw, - 0); - rn++; - if (rn >= rows) { - rn = 0; - x += cw + (cn < crest ? 1 : 0); - cn++; - } - } -} -#endif - diff --git a/dwm/.dwm.old/patch/layout_gapplessgrid.h b/dwm/.dwm.old/patch/layout_gapplessgrid.h deleted file mode 100644 index 1a4ffc2..0000000 --- a/dwm/.dwm.old/patch/layout_gapplessgrid.h +++ /dev/null @@ -1,2 +0,0 @@ -static void gaplessgrid(Monitor *m); - diff --git a/dwm/.dwm.old/patch/layout_grid.c b/dwm/.dwm.old/patch/layout_grid.c deleted file mode 100644 index 7ac832f..0000000 --- a/dwm/.dwm.old/patch/layout_grid.c +++ /dev/null @@ -1,61 +0,0 @@ -#if VANITYGAPS_PATCH -void -grid(Monitor *m) -{ - unsigned int i, n; - int cx, cy, cw, ch, cc, cr, chrest, cwrest, cols, rows; - int oh, ov, ih, iv; - Client *c; - - getgaps(m, &oh, &ov, &ih, &iv, &n); - - /* grid dimensions */ - for (rows = 0; rows <= n/2; rows++) - if (rows*rows >= n) - break; - cols = (rows && (rows - 1) * rows >= n) ? rows - 1 : rows; - - /* window geoms (cell height/width) */ - ch = (m->wh - 2*oh - ih * (rows - 1)) / (rows ? rows : 1); - cw = (m->ww - 2*ov - iv * (cols - 1)) / (cols ? cols : 1); - chrest = (m->wh - 2*oh - ih * (rows - 1)) - ch * rows; - cwrest = (m->ww - 2*ov - iv * (cols - 1)) - cw * cols; - for (i = 0, c = nexttiled(m->clients); c; c = nexttiled(c->next), i++) { - cc = i / rows; - cr = i % rows; - cx = m->wx + ov + cc * (cw + iv) + MIN(cc, cwrest); - cy = m->wy + oh + cr * (ch + ih) + MIN(cr, chrest); - resize(c, cx, cy, cw + (cc < cwrest ? 1 : 0) - 2*c->bw, ch + (cr < chrest ? 1 : 0) - 2*c->bw, False); - } -} -#else -void -grid(Monitor *m) -{ - unsigned int i, n; - int cx, cy, cw, ch, cc, cr, chrest, cwrest, cols, rows; - Client *c; - - for (n = 0, c = nexttiled(m->clients); c; c = nexttiled(c->next), n++); - - /* grid dimensions */ - for (rows = 0; rows <= n/2; rows++) - if (rows*rows >= n) - break; - cols = (rows && (rows - 1) * rows >= n) ? rows - 1 : rows; - - /* window geoms (cell height/width) */ - ch = m->wh / (rows ? rows : 1); - cw = m->ww / (cols ? cols : 1); - chrest = m->wh - ch * rows; - cwrest = m->ww - cw * cols; - for (i = 0, c = nexttiled(m->clients); c; c = nexttiled(c->next), i++) { - cc = i / rows; - cr = i % rows; - cx = m->wx + cc * cw + MIN(cc, cwrest); - cy = m->wy + cr * ch + MIN(cr, chrest); - resize(c, cx, cy, cw + (cc < cwrest ? 1 : 0) - 2*c->bw, ch + (cr < chrest ? 1 : 0) - 2*c->bw, False); - } -} -#endif - diff --git a/dwm/.dwm.old/patch/layout_grid.h b/dwm/.dwm.old/patch/layout_grid.h deleted file mode 100644 index 2c03abb..0000000 --- a/dwm/.dwm.old/patch/layout_grid.h +++ /dev/null @@ -1,2 +0,0 @@ -static void grid(Monitor *m); - diff --git a/dwm/.dwm.old/patch/layout_horizgrid.c b/dwm/.dwm.old/patch/layout_horizgrid.c deleted file mode 100644 index beb8e0b..0000000 --- a/dwm/.dwm.old/patch/layout_horizgrid.c +++ /dev/null @@ -1,104 +0,0 @@ -void -horizgrid(Monitor *m) { - Client *c; - unsigned int n, i; - int mx = 0, my = 0, mh = 0, mw = 0; - int sx = 0, sy = 0, sh = 0, sw = 0; - int ntop; - float mfacts = 0, sfacts = 0; - int mrest, srest, mtotal = 0, stotal = 0; - - #if VANITYGAPS_PATCH - int oh, ov, ih, iv; - getgaps(m, &oh, &ov, &ih, &iv, &n); - #else - for (n = 0, c = nexttiled(m->clients); c; c = nexttiled(c->next), n++); - #endif // VANITYGAPS_PATCH - if (n == 0) - return; - - if (n <= 2) - ntop = n; - else { - ntop = n / 2; - } - - #if VANITYGAPS_PATCH - sx = mx = m->wx + ov; - sy = my = m->wy + oh; - sh = mh = m->wh - 2*oh; - sw = mw = m->ww - 2*ov; - - if (n > ntop) { - sh = (mh - ih) / 2; - mh = mh - ih - sh; - sy = my + mh + ih; - mw = m->ww - 2*ov - iv * (ntop - 1); - sw = m->ww - 2*ov - iv * (n - ntop - 1); - } - #else - sx = mx = m->wx; - sy = my = m->wy; - sh = mh = m->wh; - sw = mw = m->ww; - - if (n > ntop) { - sh = mh / 2; - mh = mh - sh; - sy = my + mh; - } - #endif // VANITYGAPS_PATCH - - /* calculate facts */ - #if CFACTS_PATCH - for (i = 0, c = nexttiled(m->clients); c; c = nexttiled(c->next), i++) - if (i < ntop) - mfacts += c->cfact; - else - sfacts += c->cfact; - - for (i = 0, c = nexttiled(m->clients); c; c = nexttiled(c->next), i++) - if (i < ntop) - mtotal += mh * (c->cfact / mfacts); - else - stotal += sw * (c->cfact / sfacts); - #else - mfacts = ntop; - sfacts = n - ntop; - - for (i = 0, c = nexttiled(m->clients); c; c = nexttiled(c->next), i++) - if (i < ntop) - mtotal += mh / mfacts; - else - stotal += sw / sfacts; - #endif // CFACTS_PATCH - - mrest = mh - mtotal; - srest = sw - stotal; - - for (i = 0, c = nexttiled(m->clients); c; c = nexttiled(c->next), i++) - if (i < ntop) { - #if CFACTS_PATCH - resize(c, mx, my, mw * (c->cfact / mfacts) + (i < mrest ? 1 : 0) - (2*c->bw), mh - (2*c->bw), 0); - #else - resize(c, mx, my, mw / mfacts + (i < mrest ? 1 : 0) - (2*c->bw), mh - (2*c->bw), 0); - #endif // CFACTS_PATCH - #if VANITYGAPS_PATCH - mx += WIDTH(c) + iv; - #else - mx += WIDTH(c); - #endif // VANITYGAPS_PATCH - } else { - #if CFACTS_PATCH - resize(c, sx, sy, sw * (c->cfact / sfacts) + ((i - ntop) < srest ? 1 : 0) - (2*c->bw), sh - (2*c->bw), 0); - #else - resize(c, sx, sy, sw / sfacts + ((i - ntop) < srest ? 1 : 0) - (2*c->bw), sh - (2*c->bw), 0); - #endif // CFACTS_PATCH - #if VANITYGAPS_PATCH - sx += WIDTH(c) + iv; - #else - sx += WIDTH(c); - #endif // VANITYGAPS_PATCH - } -} - diff --git a/dwm/.dwm.old/patch/layout_horizgrid.h b/dwm/.dwm.old/patch/layout_horizgrid.h deleted file mode 100644 index 799fa9c..0000000 --- a/dwm/.dwm.old/patch/layout_horizgrid.h +++ /dev/null @@ -1,2 +0,0 @@ -static void horizgrid(Monitor *m); - diff --git a/dwm/.dwm.old/patch/layout_monocle.c b/dwm/.dwm.old/patch/layout_monocle.c deleted file mode 100644 index f7b5bc3..0000000 --- a/dwm/.dwm.old/patch/layout_monocle.c +++ /dev/null @@ -1,38 +0,0 @@ -#if VANITYGAPS_PATCH && VANITYGAPS_MONOCLE_PATCH -void -monocle(Monitor *m) -{ - unsigned int n; - int oh, ov, ih, iv; - Client *c; - - getgaps(m, &oh, &ov, &ih, &iv, &n); - - #if !MONOCLESYMBOL_PATCH - if (n > 0) /* override layout symbol */ - snprintf(m->ltsymbol, sizeof m->ltsymbol, "[%d]", n); - #endif // MONOCLESYMBOL_PATCH - for (c = nexttiled(m->clients); c; c = nexttiled(c->next)) - resize(c, m->wx + ov, m->wy + oh, m->ww - 2 * c->bw - 2 * ov, m->wh - 2 * c->bw - 2 * oh, 0); -} -#else -void -monocle(Monitor *m) -{ - #if !MONOCLESYMBOL_PATCH - unsigned int n = 0; - #endif // MONOCLESYMBOL_PATCH - Client *c; - - #if !MONOCLESYMBOL_PATCH - for (c = m->clients; c; c = c->next) - if (ISVISIBLE(c)) - n++; - if (n > 0) /* override layout symbol */ - snprintf(m->ltsymbol, sizeof m->ltsymbol, "[%d]", n); - #endif // MONOCLESYMBOL_PATCH - for (c = nexttiled(m->clients); c; c = nexttiled(c->next)) - resize(c, m->wx, m->wy, m->ww - 2 * c->bw, m->wh - 2 * c->bw, 0); -} -#endif // VANITYGAPS_PATCH - diff --git a/dwm/.dwm.old/patch/layout_monocle.h b/dwm/.dwm.old/patch/layout_monocle.h deleted file mode 100644 index f32e49f..0000000 --- a/dwm/.dwm.old/patch/layout_monocle.h +++ /dev/null @@ -1,2 +0,0 @@ -static void monocle(Monitor *m); - diff --git a/dwm/.dwm.old/patch/layout_nrowgrid.c b/dwm/.dwm.old/patch/layout_nrowgrid.c deleted file mode 100644 index 7fada74..0000000 --- a/dwm/.dwm.old/patch/layout_nrowgrid.c +++ /dev/null @@ -1,104 +0,0 @@ -#if VANITYGAPS_PATCH -void -nrowgrid(Monitor *m) -{ - unsigned int n = 0, i = 0, ri = 0, ci = 0; /* counters */ - int oh, ov, ih, iv; /* vanitygap settings */ - unsigned int cx, cy, cw, ch; /* client geometry */ - unsigned int uw = 0, uh = 0, uc = 0; /* utilization trackers */ - unsigned int cols, rows = m->nmaster + 1; - Client *c; - - /* count clients */ - getgaps(m, &oh, &ov, &ih, &iv, &n); - - /* nothing to do here */ - if (n == 0) - return; - - /* force 2 clients to always split vertically */ - if (FORCE_VSPLIT && n == 2) - rows = 1; - - /* never allow empty rows */ - if (n < rows) - rows = n; - - /* define first row */ - cols = n / rows; - uc = cols; - cy = m->wy + oh; - ch = (m->wh - 2*oh - ih*(rows - 1)) / rows; - uh = ch; - - for (c = nexttiled(m->clients); c; c = nexttiled(c->next), i++, ci++) { - if (ci == cols) { - uw = 0; - ci = 0; - ri++; - - /* next row */ - cols = (n - uc) / (rows - ri); - uc += cols; - cy = m->wy + oh + uh + ih; - uh += ch + ih; - } - - cx = m->wx + ov + uw; - cw = (m->ww - 2*ov - uw) / (cols - ci); - uw += cw + iv; - - resize(c, cx, cy, cw - (2*c->bw), ch - (2*c->bw), 0); - } -} -#else -void -nrowgrid(Monitor *m) -{ - unsigned int n = 0, i = 0, ri = 0, ci = 0; /* counters */ - unsigned int cx, cy, cw, ch; /* client geometry */ - unsigned int uw = 0, uh = 0, uc = 0; /* utilization trackers */ - unsigned int cols, rows = m->nmaster + 1; - Client *c; - - for (n = 0, c = nexttiled(m->clients); c; c = nexttiled(c->next), n++); - if (n == 0) - return; - - /* force 2 clients to always split vertically */ - if (FORCE_VSPLIT && n == 2) - rows = 1; - - /* never allow empty rows */ - if (n < rows) - rows = n; - - /* define first row */ - cols = n / rows; - uc = cols; - cy = m->wy; - ch = m->wh / rows; - uh = ch; - - for (c = nexttiled(m->clients); c; c = nexttiled(c->next), i++, ci++) { - if (ci == cols) { - uw = 0; - ci = 0; - ri++; - - /* next row */ - cols = (n - uc) / (rows - ri); - uc += cols; - cy = m->wy + uh; - uh += ch; - } - - cx = m->wx + uw; - cw = (m->ww - uw) / (cols - ci); - uw += cw; - - resize(c, cx, cy, cw - (2*c->bw), ch - (2*c->bw), 0); - } -} -#endif - diff --git a/dwm/.dwm.old/patch/layout_nrowgrid.h b/dwm/.dwm.old/patch/layout_nrowgrid.h deleted file mode 100644 index 9cce593..0000000 --- a/dwm/.dwm.old/patch/layout_nrowgrid.h +++ /dev/null @@ -1,2 +0,0 @@ -static void nrowgrid(Monitor *m); - diff --git a/dwm/.dwm.old/patch/layout_tile.c b/dwm/.dwm.old/patch/layout_tile.c deleted file mode 100644 index cd4f1ae..0000000 --- a/dwm/.dwm.old/patch/layout_tile.c +++ /dev/null @@ -1,74 +0,0 @@ -static void -tile(Monitor *m) -{ - unsigned int i, n; - int mx = 0, my = 0, mh = 0, mw = 0; - int sx = 0, sy = 0, sh = 0, sw = 0; - float mfacts, sfacts; - int mrest, srest; - Client *c; - - - #if VANITYGAPS_PATCH - int oh, ov, ih, iv; - getgaps(m, &oh, &ov, &ih, &iv, &n); - #else - for (n = 0, c = nexttiled(m->clients); c; c = nexttiled(c->next), n++); - #endif // VANITYGAPS_PATCH - - if (n == 0) - return; - - #if VANITYGAPS_PATCH - sx = mx = m->wx + ov; - sy = my = m->wy + oh; - mh = m->wh - 2*oh - ih * (MIN(n, m->nmaster) - 1); - sh = m->wh - 2*oh - ih * (n - m->nmaster - 1); - sw = mw = m->ww - 2*ov; - - if (m->nmaster && n > m->nmaster) { - sw = (mw - iv) * (1 - m->mfact); - mw = (mw - iv) * m->mfact; - sx = mx + mw + iv; - } - #else - sx = mx = m->wx; - sy = my = m->wy; - sh = mh = m->wh; - sw = mw = m->ww; - - if (m->nmaster && n > m->nmaster) { - sw = mw * (1 - m->mfact); - mw = mw * m->mfact; - sx = mx + mw; - } - #endif // VANITYGAPS_PATCH - - getfacts(m, mh, sh, &mfacts, &sfacts, &mrest, &srest); - - for (i = 0, c = nexttiled(m->clients); c; c = nexttiled(c->next), i++) - if (i < m->nmaster) { - #if CFACTS_PATCH - resize(c, mx, my, mw - (2*c->bw), (mh / mfacts) * c->cfact + (i < mrest ? 1 : 0) - (2*c->bw), 0); - #else - resize(c, mx, my, mw - (2*c->bw), (mh / mfacts) + (i < mrest ? 1 : 0) - (2*c->bw), 0); - #endif // CFACTS_PATCH - #if VANITYGAPS_PATCH - my += HEIGHT(c) + ih; - #else - my += HEIGHT(c); - #endif - } else { - #if CFACTS_PATCH - resize(c, sx, sy, sw - (2*c->bw), (sh / sfacts) * c->cfact + ((i - m->nmaster) < srest ? 1 : 0) - (2*c->bw), 0); - #else - resize(c, sx, sy, sw - (2*c->bw), (sh / sfacts) + ((i - m->nmaster) < srest ? 1 : 0) - (2*c->bw), 0); - #endif // CFACTS_PATCH - #if VANITYGAPS_PATCH - sy += HEIGHT(c) + ih; - #else - sy += HEIGHT(c); - #endif - } -} - diff --git a/dwm/.dwm.old/patch/layout_tile.h b/dwm/.dwm.old/patch/layout_tile.h deleted file mode 100644 index 4aff634..0000000 --- a/dwm/.dwm.old/patch/layout_tile.h +++ /dev/null @@ -1,2 +0,0 @@ -static void tile(Monitor *m); - diff --git a/dwm/.dwm.old/patch/layoutmenu.sh b/dwm/.dwm.old/patch/layoutmenu.sh deleted file mode 100755 index 0bb0456..0000000 --- a/dwm/.dwm.old/patch/layoutmenu.sh +++ /dev/null @@ -1,8 +0,0 @@ -#!/bin/sh - -cat <<> Floating Layout 1 -[M] Monocle Layout 2 -EOF - diff --git a/dwm/.dwm.old/patch/maximize.c b/dwm/.dwm.old/patch/maximize.c deleted file mode 100644 index c89dbda..0000000 --- a/dwm/.dwm.old/patch/maximize.c +++ /dev/null @@ -1,70 +0,0 @@ -void -maximize(int x, int y, int w, int h) -{ - XEvent ev; - - if (!selmon->sel || selmon->sel->isfixed) - return; - XRaiseWindow(dpy, selmon->sel->win); - if (!selmon->sel->ismax) { - if (!selmon->lt[selmon->sellt]->arrange || selmon->sel->isfloating) - selmon->sel->wasfloating = True; - else { - togglefloating(NULL); - selmon->sel->wasfloating = False; - } - selmon->sel->oldx = selmon->sel->x; - selmon->sel->oldy = selmon->sel->y; - selmon->sel->oldw = selmon->sel->w; - selmon->sel->oldh = selmon->sel->h; - resize(selmon->sel, x, y, w, h, True); - selmon->sel->ismax = True; - } - else { - resize(selmon->sel, selmon->sel->oldx, selmon->sel->oldy, selmon->sel->oldw, selmon->sel->oldh, True); - if (!selmon->sel->wasfloating) - togglefloating(NULL); - selmon->sel->ismax = False; - } - drawbar(selmon); - while (XCheckMaskEvent(dpy, EnterWindowMask, &ev)); -} - -#if SETBORDERPX_PATCH -void -togglemax(const Arg *arg) -{ - maximize(selmon->wx, selmon->wy, selmon->ww - 2 * selmon->borderpx, selmon->wh - 2 * selmon->borderpx); -} - -void -toggleverticalmax(const Arg *arg) -{ - maximize(selmon->sel->x, selmon->wy, selmon->sel->w, selmon->wh - 2 * selmon->borderpx); -} - -void -togglehorizontalmax(const Arg *arg) -{ - maximize(selmon->wx, selmon->sel->y, selmon->ww - 2 * selmon->borderpx, selmon->sel->h); -} -#else -void -togglemax(const Arg *arg) -{ - maximize(selmon->wx, selmon->wy, selmon->ww - 2 * borderpx, selmon->wh - 2 * borderpx); -} - -void -toggleverticalmax(const Arg *arg) -{ - maximize(selmon->sel->x, selmon->wy, selmon->sel->w, selmon->wh - 2 * borderpx); -} - -void -togglehorizontalmax(const Arg *arg) -{ - maximize(selmon->wx, selmon->sel->y, selmon->ww - 2 * borderpx, selmon->sel->h); -} -#endif // SETBORDERPX_PATCH - diff --git a/dwm/.dwm.old/patch/maximize.h b/dwm/.dwm.old/patch/maximize.h deleted file mode 100644 index f3c6c9a..0000000 --- a/dwm/.dwm.old/patch/maximize.h +++ /dev/null @@ -1,5 +0,0 @@ -static void maximize(int x, int y, int w, int h); -static void togglemax(const Arg *arg); -static void toggleverticalmax(const Arg *arg); -static void togglehorizontalmax(const Arg *arg); - diff --git a/dwm/.dwm.old/patch/moveplace.c b/dwm/.dwm.old/patch/moveplace.c deleted file mode 100644 index 7211417..0000000 --- a/dwm/.dwm.old/patch/moveplace.c +++ /dev/null @@ -1,30 +0,0 @@ -void -moveplace(const Arg *arg) -{ - Client *c; - int nh, nw, nx, ny; - c = selmon->sel; - if (!c || (arg->ui >= 9)) - return; - if (selmon->lt[selmon->sellt]->arrange && !c->isfloating) - togglefloating(NULL); - nh = (selmon->wh / 3) - (c->bw * 2); - nw = (selmon->ww / 3) - (c->bw * 2); - nx = (arg->ui % 3) -1; - ny = (arg->ui / 3) -1; - if (nx < 0) - nx = selmon->wx; - else if (nx > 0) - nx = selmon->wx + selmon->ww - nw - c->bw*2; - else - nx = selmon->wx + selmon->ww/2 - nw/2 - c->bw; - if (ny <0) - ny = selmon->wy; - else if (ny > 0) - ny = selmon->wy + selmon->wh - nh - c->bw*2; - else - ny = selmon->wy + selmon->wh/2 - nh/2 - c->bw; - resize(c, nx, ny, nw, nh, True); - XWarpPointer(dpy, None, c->win, 0, 0, 0, 0, nw/2, nh/2); -} - diff --git a/dwm/.dwm.old/patch/moveplace.h b/dwm/.dwm.old/patch/moveplace.h deleted file mode 100644 index 57bc924..0000000 --- a/dwm/.dwm.old/patch/moveplace.h +++ /dev/null @@ -1,4 +0,0 @@ -enum { WIN_NW, WIN_N, WIN_NE, WIN_W, WIN_C, WIN_E, WIN_SW, WIN_S, WIN_SE }; - -static void moveplace(const Arg *arg); - diff --git a/dwm/.dwm.old/patch/moveresize.c b/dwm/.dwm.old/patch/moveresize.c deleted file mode 100644 index 75d58e2..0000000 --- a/dwm/.dwm.old/patch/moveresize.c +++ /dev/null @@ -1,65 +0,0 @@ -void -moveresize(const Arg *arg) { - /* only floating windows can be moved */ - Client *c; - c = selmon->sel; - int x, y, w, h, nx, ny, nw, nh, ox, oy, ow, oh; - char xAbs, yAbs, wAbs, hAbs; - int msx, msy, dx, dy, nmx, nmy; - unsigned int dui; - Window dummy; - - if (!c || !arg) - return; - if (selmon->lt[selmon->sellt]->arrange && !c->isfloating) - return; - if (sscanf((char *)arg->v, "%d%c %d%c %d%c %d%c", &x, &xAbs, &y, &yAbs, &w, &wAbs, &h, &hAbs) != 8) - return; - - /* compute new window position; prevent window from be positioned outside the current monitor */ - nw = c->w + w; - if (wAbs == 'W') - nw = w < selmon->mw - 2 * c->bw ? w : selmon->mw - 2 * c->bw; - - nh = c->h + h; - if (hAbs == 'H') - nh = h < selmon->mh - 2 * c->bw ? h : selmon->mh - 2 * c->bw; - - nx = c->x + x; - if (xAbs == 'X') { - if (x < selmon->mx) - nx = selmon->mx; - else if (x > selmon->mx + selmon->mw) - nx = selmon->mx + selmon->mw - nw - 2 * c->bw; - else - nx = x; - } - - ny = c->y + y; - if (yAbs == 'Y') { - if (y < selmon->my) - ny = selmon->my; - else if (y > selmon->my + selmon->mh) - ny = selmon->my + selmon->mh - nh - 2 * c->bw; - else - ny = y; - } - - ox = c->x; - oy = c->y; - ow = c->w; - oh = c->h; - - XRaiseWindow(dpy, c->win); - Bool xqp = XQueryPointer(dpy, root, &dummy, &dummy, &msx, &msy, &dx, &dy, &dui); - resize(c, nx, ny, nw, nh, True); - - /* move cursor along with the window to avoid problems caused by the sloppy focus */ - if (xqp && ox <= msx && (ox + ow) >= msx && oy <= msy && (oy + oh) >= msy) - { - nmx = c->x - ox + c->w - ow; - nmy = c->y - oy + c->h - oh; - XWarpPointer(dpy, None, None, 0, 0, 0, 0, nmx, nmy); - } -} - diff --git a/dwm/.dwm.old/patch/moveresize.h b/dwm/.dwm.old/patch/moveresize.h deleted file mode 100644 index 919ebad..0000000 --- a/dwm/.dwm.old/patch/moveresize.h +++ /dev/null @@ -1,2 +0,0 @@ -static void moveresize(const Arg *arg); - diff --git a/dwm/.dwm.old/patch/movestack.c b/dwm/.dwm.old/patch/movestack.c deleted file mode 100644 index fe97f1d..0000000 --- a/dwm/.dwm.old/patch/movestack.c +++ /dev/null @@ -1,51 +0,0 @@ -void -movestack(const Arg *arg) -{ - Client *c = NULL, *p = NULL, *pc = NULL, *i; - if (arg->i > 0) { - if (!selmon->sel) - return; - /* find the client after selmon->sel */ - for (c = selmon->sel->next; c && (!ISVISIBLE(c) || c->isfloating); c = c->next); - if (!c) - for (c = selmon->clients; c && (!ISVISIBLE(c) || c->isfloating); c = c->next); - } - else { - /* find the client before selmon->sel */ - for (i = selmon->clients; i != selmon->sel; i = i->next) - if(ISVISIBLE(i) && !i->isfloating) - c = i; - if (!c) - for (; i; i = i->next) - if (ISVISIBLE(i) && !i->isfloating) - c = i; - } - - /* find the client before selmon->sel and c */ - for (i = selmon->clients; i && (!p || !pc); i = i->next) { - if (i->next == selmon->sel) - p = i; - if (i->next == c) - pc = i; - } - - /* swap c and selmon->sel selmon->clients in the selmon->clients list */ - if (c && c != selmon->sel) { - Client *temp = selmon->sel->next==c?selmon->sel:selmon->sel->next; - selmon->sel->next = c->next==selmon->sel?c:c->next; - c->next = temp; - - if (p && p != c) - p->next = c; - if (pc && pc != selmon->sel) - pc->next = selmon->sel; - - if (selmon->sel == selmon->clients) - selmon->clients = c; - else if (c == selmon->clients) - selmon->clients = selmon->sel; - - arrange(selmon); - } -} - diff --git a/dwm/.dwm.old/patch/movestack.h b/dwm/.dwm.old/patch/movestack.h deleted file mode 100644 index 25f198f..0000000 --- a/dwm/.dwm.old/patch/movestack.h +++ /dev/null @@ -1,2 +0,0 @@ -static void movestack(const Arg *arg); - diff --git a/dwm/.dwm.old/patch/mpdcontrol.c b/dwm/.dwm.old/patch/mpdcontrol.c deleted file mode 100644 index fc81e07..0000000 --- a/dwm/.dwm.old/patch/mpdcontrol.c +++ /dev/null @@ -1,145 +0,0 @@ -#include -#include -#include -#include - -#include - -#define MPDHOST "localhost" -#define MPDPORT 6600 - -struct mpd_connection *get_conn() -{ - struct mpd_connection *conn; - - conn = mpd_connection_new(MPDHOST, MPDPORT, 1000); - - if (mpd_connection_get_error(conn) != MPD_ERROR_SUCCESS) { - fprintf(stderr, "Could not connect to mpd: %s\n", mpd_connection_get_error_message(conn)); - - mpd_connection_free(conn); - return NULL; - } - - return conn; -} - -void mpdchange(const Arg *direction) -{ - struct mpd_connection *conn; - - conn = get_conn(); - - if (conn == NULL) { - return; - } - - if (direction->i > 0) { - mpd_run_next(conn); - } - else { - mpd_run_previous(conn); - } - - mpd_connection_free(conn); -} - -char *get_regerror(int errcode, regex_t *compiled) -{ - size_t length = regerror(errcode, compiled, NULL, 0); - char *buffer = malloc(length); - (void) regerror(errcode, compiled, buffer, length); - - return buffer; -} - -void mpdcontrol() -{ - struct mpd_connection *conn; - struct mpd_status *status; - struct mpd_song *song; - enum mpd_state state; - - const char *filename; - - regex_t expr; - - conn = get_conn(); - - if (conn == NULL) { - return; - } - - status = mpd_run_status(conn); - - if (status == NULL) { - fprintf(stderr, "Could not get mpd status: %s\n", mpd_status_get_error(status)); - - mpd_status_free(status); - mpd_connection_free(conn); - return; - } - - state = mpd_status_get_state(status); - - if (state == MPD_STATE_STOP || state == MPD_STATE_PAUSE) { - mpd_run_play(conn); - mpd_status_free(status); - mpd_connection_free(conn); - } - else if (state != MPD_STATE_UNKNOWN) { //playing some music - song = mpd_run_current_song(conn); - - if (song == NULL){ - fprintf(stderr, "Error fetching current song!\n"); - - mpd_song_free(song); - mpd_status_free(status); - mpd_connection_free(conn); - return; - } - - filename = mpd_song_get_uri(song); - - int errcode = regcomp(&expr, "^[[:alnum:]]+://", REG_EXTENDED|REG_NOSUB); - if (errcode != 0) { - char *err = get_regerror(errcode, &expr); - fprintf(stderr, "Could not compile regexp: %s\n", err); - - mpd_song_free(song); - mpd_status_free(status); - mpd_connection_free(conn); - free(err); - regfree(&expr); - return; - } - - int matchcode = regexec(&expr, filename, 0, NULL, 0); - - if (matchcode == 0) { - if (strstr(filename, "file://") == filename) { //match just at the start of the filename - //this means that mpd is playing a file outside the music_dir, - //but on disk, so we can safely pause - mpd_run_toggle_pause(conn); - } - else { - mpd_run_stop(conn); - } - } - else if (matchcode == REG_NOMATCH) { - mpd_run_toggle_pause(conn); - } - else { - char *err = get_regerror(matchcode, &expr); - fprintf(stderr, "Error while matching regexp: %s\n", err); - - free(err); - } - - regfree(&expr); - mpd_song_free(song); - mpd_status_free(status); - mpd_connection_free(conn); - } -} - diff --git a/dwm/.dwm.old/patch/mpdcontrol.h b/dwm/.dwm.old/patch/mpdcontrol.h deleted file mode 100644 index 1ce304e..0000000 --- a/dwm/.dwm.old/patch/mpdcontrol.h +++ /dev/null @@ -1,3 +0,0 @@ -static void mpdchange(const Arg *direction); -static void mpdcontrol(); - diff --git a/dwm/.dwm.old/patch/nametag.c b/dwm/.dwm.old/patch/nametag.c deleted file mode 100644 index 2b7b038..0000000 --- a/dwm/.dwm.old/patch/nametag.c +++ /dev/null @@ -1,61 +0,0 @@ -void -nametag(const Arg *arg) -{ - char *p, name[MAX_TAGLEN]; - FILE *f; - int i, group; - int tagindex; - Monitor *m = selmon; - #if BAR_ALTTAGSDECORATION_PATCH - Client *c; - int occ = 0; - - for (c = m->clients; c; c = c->next) - occ |= c->tags == 255 ? 0 : c->tags; - #endif // BAR_ALTTAGSDECORATION_PATCH - - errno = 0; // popen(3p) says on failure it "may" set errno - if (!(f = popen(NAMETAG_COMMAND, "r"))) { - fprintf(stderr, "dwm: popen command failed%s%s\n", errno ? ": " : "", errno ? strerror(errno) : ""); - return; - } - - if (!(p = fgets(name, MAX_TAGLEN, f)) && (i = errno) && ferror(f)) - fprintf(stderr, "dwm: fgets failed: %s\n", strerror(i)); - - pclose(f); - - if (!p) - return; - if ((p = strchr(name, '\n'))) - *p = '\0'; - - for (i = 0; i < NUMTAGS; i++) { - if (m->tagset[m->seltags] & (1 << i)) { - - tagindex = i + NUMTAGS * m->num; - if (tagindex >= LENGTH(tagicons[DEFAULT_TAGS])) - tagindex = tagindex % LENGTH(tagicons[DEFAULT_TAGS]); - - #if BAR_ALTTAGSDECORATION_PATCH - if (occ & 1 << i) - group = ALT_TAGS_DECORATION; - else - #endif // BAR_ALTTAGSDECORATION_PATCH - #if BAR_ALTERNATIVE_TAGS_PATCH - if (m->alttag) - group = ALTERNATIVE_TAGS; - else - #endif // BAR_ALTERNATIVE_TAGS_PATCH - group = DEFAULT_TAGS; - - #if NAMETAG_PREPEND_PATCH - if (snprintf(tagicons[group][i], MAX_TAGLEN, NAMETAG_FORMAT, i+1, name) < 0) - fprintf(stderr, "nametag: if statement to avoid -Wformat-truncation= warnings\n"); - #else - snprintf(tagicons[group][i], MAX_TAGLEN, NAMETAG_FORMAT, name); - #endif // NAMETAG_PREPEND_PATCH - } - } - drawbars(); -} diff --git a/dwm/.dwm.old/patch/nametag.h b/dwm/.dwm.old/patch/nametag.h deleted file mode 100644 index 3e632be..0000000 --- a/dwm/.dwm.old/patch/nametag.h +++ /dev/null @@ -1 +0,0 @@ -static void nametag(const Arg *arg); diff --git a/dwm/.dwm.old/patch/nomodbuttons.c b/dwm/.dwm.old/patch/nomodbuttons.c deleted file mode 100644 index 9c196de..0000000 --- a/dwm/.dwm.old/patch/nomodbuttons.c +++ /dev/null @@ -1,8 +0,0 @@ -void -togglenomodbuttons(const Arg *arg) -{ - nomodbuttons = !nomodbuttons; - if (selmon->sel) - grabbuttons(selmon->sel, 1); -} - diff --git a/dwm/.dwm.old/patch/nomodbuttons.h b/dwm/.dwm.old/patch/nomodbuttons.h deleted file mode 100644 index a613ed4..0000000 --- a/dwm/.dwm.old/patch/nomodbuttons.h +++ /dev/null @@ -1,2 +0,0 @@ -static void togglenomodbuttons(const Arg *arg); - diff --git a/dwm/.dwm.old/patch/pertag.c b/dwm/.dwm.old/patch/pertag.c deleted file mode 100644 index 292076e..0000000 --- a/dwm/.dwm.old/patch/pertag.c +++ /dev/null @@ -1,71 +0,0 @@ -struct Pertag { - unsigned int curtag; /* current tag index */ - int nmasters[NUMTAGS + 1]; /* number of windows in master area */ - #if FLEXTILE_DELUXE_LAYOUT - int nstacks[NUMTAGS + 1]; /* number of windows in primary stack area */ - int ltaxis[NUMTAGS + 1][LTAXIS_LAST]; - const Layout *ltidxs[NUMTAGS + 1][3]; /* matrix of tags and layouts indexes */ - #else - const Layout *ltidxs[NUMTAGS + 1][2]; /* matrix of tags and layouts indexes */ - #endif // FLEXTILE_DELUXE_LAYOUT - float mfacts[NUMTAGS + 1]; /* mfacts per tag */ - unsigned int sellts[NUMTAGS + 1]; /* selected layouts */ - #if PERTAGBAR_PATCH - int showbars[NUMTAGS + 1]; /* display bar for the current tag */ - #endif // PERTAGBAR_PATCH - #if SWAPFOCUS_PATCH - Client *prevclient[NUMTAGS + 1]; - #endif // SWAPFOCUS_PATCH - #if ZOOMSWAP_PATCH - Client *prevzooms[NUMTAGS + 1]; /* store zoom information */ - #endif // ZOOMSWAP_PATCH - #if PERTAG_VANITYGAPS_PATCH && VANITYGAPS_PATCH - int enablegaps[NUMTAGS + 1]; - unsigned int gaps[NUMTAGS + 1]; - #endif // PERTAG_VANITYGAPS_PATCH | VANITYGAPS_PATCH -}; - -void -pertagview(const Arg *arg) -{ - int i; - - #if SCRATCHPADS_PATCH && !RENAMED_SCRATCHPADS_PATCH - if (arg->ui == ~SPTAGMASK) - #else - if (arg->ui == ~0) - #endif // SCRATCHPADS_PATCH - selmon->pertag->curtag = 0; - else { - for (i = 0; !(selmon->tagset[selmon->seltags] & 1 << i); i++); - selmon->pertag->curtag = i + 1; - } - - selmon->nmaster = selmon->pertag->nmasters[selmon->pertag->curtag]; - #if FLEXTILE_DELUXE_LAYOUT - selmon->nstack = selmon->pertag->nstacks[selmon->pertag->curtag]; - #endif // FLEXTILE_DELUXE_LAYOUT - selmon->mfact = selmon->pertag->mfacts[selmon->pertag->curtag]; - selmon->sellt = selmon->pertag->sellts[selmon->pertag->curtag]; - selmon->lt[selmon->sellt] = selmon->pertag->ltidxs[selmon->pertag->curtag][selmon->sellt]; - selmon->lt[selmon->sellt^1] = selmon->pertag->ltidxs[selmon->pertag->curtag][selmon->sellt^1]; - - #if PERTAG_VANITYGAPS_PATCH && VANITYGAPS_PATCH - selmon->gappoh = (selmon->pertag->gaps[selmon->pertag->curtag] & 0xff) >> 0; - selmon->gappov = (selmon->pertag->gaps[selmon->pertag->curtag] & 0xff00) >> 8; - selmon->gappih = (selmon->pertag->gaps[selmon->pertag->curtag] & 0xff0000) >> 16; - selmon->gappiv = (selmon->pertag->gaps[selmon->pertag->curtag] & 0xff000000) >> 24; - #endif // PERTAG_VANITYGAPS_PATCH | VANITYGAPS_PATCH - - #if FLEXTILE_DELUXE_LAYOUT - selmon->ltaxis[LAYOUT] = selmon->pertag->ltaxis[selmon->pertag->curtag][LAYOUT]; - selmon->ltaxis[MASTER] = selmon->pertag->ltaxis[selmon->pertag->curtag][MASTER]; - selmon->ltaxis[STACK] = selmon->pertag->ltaxis[selmon->pertag->curtag][STACK]; - selmon->ltaxis[STACK2] = selmon->pertag->ltaxis[selmon->pertag->curtag][STACK2]; - #endif // FLEXTILE_DELUXE_LAYOUT - #if PERTAGBAR_PATCH - if (selmon->showbar != selmon->pertag->showbars[selmon->pertag->curtag]) - togglebar(NULL); - #endif // PERTAGBAR_PATCH -} - diff --git a/dwm/.dwm.old/patch/pertag.h b/dwm/.dwm.old/patch/pertag.h deleted file mode 100644 index 5c53ac9..0000000 --- a/dwm/.dwm.old/patch/pertag.h +++ /dev/null @@ -1,2 +0,0 @@ -static void pertagview(const Arg *arg); - diff --git a/dwm/.dwm.old/patch/placemouse.c b/dwm/.dwm.old/patch/placemouse.c deleted file mode 100644 index 0851e89..0000000 --- a/dwm/.dwm.old/patch/placemouse.c +++ /dev/null @@ -1,155 +0,0 @@ -void -moveorplace(const Arg *arg) { - if ((!selmon->lt[selmon->sellt]->arrange || (selmon->sel && selmon->sel->isfloating))) - movemouse(arg); - else - placemouse(arg); -} - -void -placemouse(const Arg *arg) -{ - int x, y, px, py, ocx, ocy, nx = -9999, ny = -9999, freemove = 0; - Client *c, *r = NULL, *at, *prevr; - Monitor *m; - XEvent ev; - XWindowAttributes wa; - Time lasttime = 0; - int attachmode, prevattachmode; - attachmode = prevattachmode = -1; - - if (!(c = selmon->sel) || !c->mon->lt[c->mon->sellt]->arrange) /* no support for placemouse when floating layout is used */ - return; - if (c->isfullscreen) /* no support placing fullscreen windows by mouse */ - return; - restack(selmon); - prevr = c; - if (XGrabPointer(dpy, root, False, MOUSEMASK, GrabModeAsync, GrabModeAsync, - None, cursor[CurMove]->cursor, CurrentTime) != GrabSuccess) - return; - - c->isfloating = 0; - c->beingmoved = 1; - - XGetWindowAttributes(dpy, c->win, &wa); - ocx = wa.x; - ocy = wa.y; - - if (arg->i == 2) // warp cursor to client center - XWarpPointer(dpy, None, c->win, 0, 0, 0, 0, WIDTH(c) / 2, HEIGHT(c) / 2); - - if (!getrootptr(&x, &y)) - return; - - do { - XMaskEvent(dpy, MOUSEMASK|ExposureMask|SubstructureRedirectMask, &ev); - switch (ev.type) { - case ConfigureRequest: - case Expose: - case MapRequest: - handler[ev.type](&ev); - break; - case MotionNotify: - if ((ev.xmotion.time - lasttime) <= (1000 / 60)) - continue; - lasttime = ev.xmotion.time; - - nx = ocx + (ev.xmotion.x - x); - ny = ocy + (ev.xmotion.y - y); - - if (!freemove && (abs(nx - ocx) > snap || abs(ny - ocy) > snap)) - freemove = 1; - - if (freemove) - XMoveWindow(dpy, c->win, nx, ny); - - if ((m = recttomon(ev.xmotion.x, ev.xmotion.y, 1, 1)) && m != selmon) - selmon = m; - - if (arg->i == 1) { // tiled position is relative to the client window center point - px = nx + wa.width / 2; - py = ny + wa.height / 2; - } else { // tiled position is relative to the mouse cursor - px = ev.xmotion.x; - py = ev.xmotion.y; - } - - r = recttoclient(px, py, 1, 1); - - if (!r || r == c) - break; - - if ((((float)(r->y + r->h - py) / r->h) > ((float)(r->x + r->w - px) / r->w) - && (abs(r->y - py) < r->h / 2)) || (abs(r->x - px) < r->w / 2)) - attachmode = 1; // above - else - attachmode = 0; // below - - if ((r && r != prevr) || (attachmode != prevattachmode)) { - detachstack(c); - detach(c); - if (c->mon != r->mon) { - arrangemon(c->mon); - c->tags = r->mon->tagset[r->mon->seltags]; - } - - c->mon = r->mon; - r->mon->sel = r; - - if (attachmode) { - if (r == r->mon->clients) - attach(c); - else { - for (at = r->mon->clients; at->next != r; at = at->next); - c->next = at->next; - at->next = c; - } - } else { - c->next = r->next; - r->next = c; - } - - attachstack(c); - arrangemon(r->mon); - prevr = r; - prevattachmode = attachmode; - } - break; - } - } while (ev.type != ButtonRelease); - XUngrabPointer(dpy, CurrentTime); - - if ((m = recttomon(ev.xmotion.x, ev.xmotion.y, 1, 1)) && m != c->mon) { - detach(c); - detachstack(c); - arrangemon(c->mon); - c->mon = m; - c->tags = m->tagset[m->seltags]; - attach(c); - attachstack(c); - selmon = m; - } - - focus(c); - c->beingmoved = 0; - - if (nx != -9999) - resize(c, nx, ny, c->w, c->h, 0); - arrangemon(c->mon); -} - -Client * -recttoclient(int x, int y, int w, int h) -{ - Client *c, *r = NULL; - int a, area = 0; - - for (c = nexttiled(selmon->clients); c; c = nexttiled(c->next)) { - if ((a = INTERSECTC(x, y, w, h, c)) > area) { - area = a; - r = c; - } - } - return r; -} - diff --git a/dwm/.dwm.old/patch/placemouse.h b/dwm/.dwm.old/patch/placemouse.h deleted file mode 100644 index 20c3eca..0000000 --- a/dwm/.dwm.old/patch/placemouse.h +++ /dev/null @@ -1,7 +0,0 @@ -#define INTERSECTC(x,y,w,h,z) (MAX(0, MIN((x)+(w),(z)->x+(z)->w) - MAX((x),(z)->x)) \ - * MAX(0, MIN((y)+(h),(z)->y+(z)->h) - MAX((y),(z)->y))) - -static void moveorplace(const Arg *arg); -static void placemouse(const Arg *arg); -static Client *recttoclient(int x, int y, int w, int h); - diff --git a/dwm/.dwm.old/patch/push.c b/dwm/.dwm.old/patch/push.c deleted file mode 100644 index 68123a6..0000000 --- a/dwm/.dwm.old/patch/push.c +++ /dev/null @@ -1,74 +0,0 @@ -static Client * -nextc(Client *c, float f) -{ - if (!f) - return nexttiled(c); - - for (; c && !ISVISIBLE(c); c = c->next); - return c; -} - -static Client * -prevc(Client *c, float f) -{ - Client *p, *r; - - for (p = selmon->clients, r = NULL; c && p && p != c; p = p->next) - if ((f || !p->isfloating) && ISVISIBLE(p)) - r = p; - return r; -} - -static void -pushup(const Arg *arg) -{ - Client *sel = selmon->sel; - Client *c; - - if (!sel || (sel->isfloating && !arg->f)) - return; - if ((c = prevc(sel, arg->f))) { - /* attach before c */ - detach(sel); - sel->next = c; - if (selmon->clients == c) - selmon->clients = sel; - else { - for (c = selmon->clients; c->next != sel->next; c = c->next); - c->next = sel; - } - } else { - /* move to the end */ - for (c = sel; c->next; c = c->next); - if (sel != c) { - detach(sel); - sel->next = NULL; - c->next = sel; - } - } - focus(sel); - arrange(selmon); -} - -static void -pushdown(const Arg *arg) -{ - Client *sel = selmon->sel; - Client *c; - - if (!sel || (sel->isfloating && !arg->f)) - return; - if ((c = nextc(sel->next, arg->f))) { - /* attach after c */ - detach(sel); - sel->next = c->next; - c->next = sel; - } else { - /* move to the front */ - detach(sel); - attach(sel); - } - focus(sel); - arrange(selmon); -} - diff --git a/dwm/.dwm.old/patch/push.h b/dwm/.dwm.old/patch/push.h deleted file mode 100644 index 6415f80..0000000 --- a/dwm/.dwm.old/patch/push.h +++ /dev/null @@ -1,5 +0,0 @@ -static Client * nextc(Client *c, float f); -static Client * prevc(Client *c, float f); -static void pushup(const Arg *arg); -static void pushdown(const Arg *arg); - diff --git a/dwm/.dwm.old/patch/push_no_master.c b/dwm/.dwm.old/patch/push_no_master.c deleted file mode 100644 index 2d78cf4..0000000 --- a/dwm/.dwm.old/patch/push_no_master.c +++ /dev/null @@ -1,44 +0,0 @@ -Client * -prevt(Client *c) -{ - Client *p, *r; - - for (p = selmon->clients, r = NULL; p && p != c; p = p->next) - if (!p->isfloating && ISVISIBLE(p)) - r = p; - return r; -} - -void -pushup(const Arg *arg) -{ - Client *sel = selmon->sel, *c; - - if (!sel || sel->isfloating) - return; - if ((c = prevt(sel)) && c != nexttiled(selmon->clients)) { - detach(sel); - sel->next = c; - for (c = selmon->clients; c->next != sel->next; c = c->next); - c->next = sel; - } - focus(sel); - arrange(selmon); -} - -void -pushdown(const Arg *arg) -{ - Client *sel = selmon->sel, *c; - - if (!sel || sel->isfloating || sel == nexttiled(selmon->clients)) - return; - if ((c = nexttiled(sel->next))) { - detach(sel); - sel->next = c->next; - c->next = sel; - } - focus(sel); - arrange(selmon); -} - diff --git a/dwm/.dwm.old/patch/push_no_master.h b/dwm/.dwm.old/patch/push_no_master.h deleted file mode 100644 index 6904fb0..0000000 --- a/dwm/.dwm.old/patch/push_no_master.h +++ /dev/null @@ -1,4 +0,0 @@ -Client * prevt(Client *c); -static void pushup(const Arg *arg); -static void pushdown(const Arg *arg); - diff --git a/dwm/.dwm.old/patch/renamed_scratchpads.c b/dwm/.dwm.old/patch/renamed_scratchpads.c deleted file mode 100644 index db99723..0000000 --- a/dwm/.dwm.old/patch/renamed_scratchpads.c +++ /dev/null @@ -1,151 +0,0 @@ -void -removescratch(const Arg *arg) -{ - Client *c = selmon->sel; - if (!c) - return; - c->scratchkey = 0; -} - -void -setscratch(const Arg *arg) -{ - Client *c = selmon->sel; - if (!c) - return; - - c->scratchkey = ((char**)arg->v)[0][0]; -} - -void spawnscratch(const Arg *arg) -{ - if (fork() == 0) { - if (dpy) - close(ConnectionNumber(dpy)); - setsid(); - execvp(((char **)arg->v)[1], ((char **)arg->v)+1); - fprintf(stderr, "dwm: execvp %s", ((char **)arg->v)[1]); - perror(" failed"); - exit(EXIT_SUCCESS); - } -} - -void -togglescratch(const Arg *arg) -{ - Client *c, *next, *last = NULL, *found = NULL, *monclients = NULL; - Monitor *mon; - int scratchvisible = 0; // whether the scratchpads are currently visible or not - int multimonscratch = 0; // whether we have scratchpads that are placed on multiple monitors - int scratchmon = -1; // the monitor where the scratchpads exist - int numscratchpads = 0; // count of scratchpads - - /* Looping through monitors and client's twice, the first time to work out whether we need - to move clients across from one monitor to another or not */ - for (mon = mons; mon; mon = mon->next) - for (c = mon->clients; c; c = c->next) { - if (c->scratchkey != ((char**)arg->v)[0][0]) - continue; - if (scratchmon != -1 && scratchmon != mon->num) - multimonscratch = 1; - if (c->mon->tagset[c->mon->seltags] & c->tags) // && !HIDDEN(c) - ++scratchvisible; - scratchmon = mon->num; - ++numscratchpads; - } - - /* Now for the real deal. The logic should go like: - - hidden scratchpads will be shown - - shown scratchpads will be hidden, unless they are being moved to the current monitor - - the scratchpads will be moved to the current monitor if they all reside on the same monitor - - multiple scratchpads residing on separate monitors will be left in place - */ - for (mon = mons; mon; mon = mon->next) { - for (c = mon->stack; c; c = next) { - next = c->snext; - if (c->scratchkey != ((char**)arg->v)[0][0]) - continue; - - /* awesomebar / wintitleactions compatibility, unhide scratchpad if hidden - if (HIDDEN(c)) { - XMapWindow(dpy, c->win); - setclientstate(c, NormalState); - } - */ - - /* Record the first found scratchpad client for focus purposes, but prioritise the - scratchpad on the current monitor if one exists */ - if (!found || (mon == selmon && found->mon != selmon)) - found = c; - - /* If scratchpad clients reside on another monitor and we are moving them across then - as we are looping through monitors we could be moving a client to a monitor that has - not been processed yet, hence we could be processing a scratchpad twice. To avoid - this we detach them and add them to a temporary list (monclients) which is to be - processed later. */ - if (!multimonscratch && c->mon != selmon) { - detach(c); - detachstack(c); - c->next = NULL; - /* Note that we are adding clients at the end of the list, this is to preserve the - order of clients as they were on the adjacent monitor (relevant when tiled) */ - if (last) - last = last->next = c; - else - last = monclients = c; - } else if (scratchvisible == numscratchpads) { - c->tags = 0; - } else { - XSetWindowBorder(dpy, c->win, scheme[SchemeScratchNorm][ColBorder].pixel); - c->tags = c->mon->tagset[c->mon->seltags]; - if (c->isfloating) - XRaiseWindow(dpy, c->win); - } - } - } - - /* Attach moved scratchpad clients on the selected monitor */ - for (c = monclients; c; c = next) { - next = c->next; - mon = c->mon; - c->mon = selmon; - c->tags = selmon->tagset[selmon->seltags]; - /* Attach scratchpad clients from other monitors at the bottom of the stack */ - if (selmon->clients) { - for (last = selmon->clients; last && last->next; last = last->next); - last->next = c; - } else - selmon->clients = c; - c->next = NULL; - attachstack(c); - - /* Center floating scratchpad windows when moved from one monitor to another */ - if (c->isfloating) { - if (c->w > selmon->ww) - c->w = selmon->ww - c->bw * 2; - if (c->h > selmon->wh) - c->h = selmon->wh - c->bw * 2; - - if (numscratchpads > 1) { - c->x = c->mon->wx + (c->x - mon->wx) * ((double)(abs(c->mon->ww - WIDTH(c))) / MAX(abs(mon->ww - WIDTH(c)), 1)); - c->y = c->mon->wy + (c->y - mon->wy) * ((double)(abs(c->mon->wh - HEIGHT(c))) / MAX(abs(mon->wh - HEIGHT(c)), 1)); - } else if (c->x < c->mon->mx || c->x > c->mon->mx + c->mon->mw || - c->y < c->mon->my || c->y > c->mon->my + c->mon->mh) { - c->x = c->mon->wx + (c->mon->ww / 2 - WIDTH(c) / 2); - c->y = c->mon->wy + (c->mon->wh / 2 - HEIGHT(c) / 2); - } - resizeclient(c, c->x, c->y, c->w, c->h); - XRaiseWindow(dpy, c->win); - } - } - - if (found) { - focus(ISVISIBLE(found) ? found : NULL); - arrange(NULL); - if (found->isfloating) - XRaiseWindow(dpy, found->win); - } else { - spawnscratch(arg); - } -} - diff --git a/dwm/.dwm.old/patch/renamed_scratchpads.h b/dwm/.dwm.old/patch/renamed_scratchpads.h deleted file mode 100644 index 3260462..0000000 --- a/dwm/.dwm.old/patch/renamed_scratchpads.h +++ /dev/null @@ -1,4 +0,0 @@ -static void removescratch(const Arg *arg); -static void setscratch(const Arg *arg); -static void spawnscratch(const Arg *arg); -static void togglescratch(const Arg *arg); diff --git a/dwm/.dwm.old/patch/reorganizetags.c b/dwm/.dwm.old/patch/reorganizetags.c deleted file mode 100644 index 440d75c..0000000 --- a/dwm/.dwm.old/patch/reorganizetags.c +++ /dev/null @@ -1,42 +0,0 @@ -void -reorganizetags(const Arg *arg) -{ - Client *c; - unsigned int occ, unocc, i; - unsigned int tagdest[NUMTAGS]; - - #if TAGSYNC_PATCH - Monitor *origselmon = selmon; - for (selmon = mons; selmon; selmon = selmon->next) { - #endif // TAGSYNC_PATCH - - 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/dwm/.dwm.old/patch/reorganizetags.h b/dwm/.dwm.old/patch/reorganizetags.h deleted file mode 100644 index c4917af..0000000 --- a/dwm/.dwm.old/patch/reorganizetags.h +++ /dev/null @@ -1,2 +0,0 @@ -static void reorganizetags(const Arg *arg); - diff --git a/dwm/.dwm.old/patch/restartsig.c b/dwm/.dwm.old/patch/restartsig.c deleted file mode 100644 index adb61b5..0000000 --- a/dwm/.dwm.old/patch/restartsig.c +++ /dev/null @@ -1,16 +0,0 @@ -static int restart = 0; - -void -sighup(int unused) -{ - Arg a = {.i = 1}; - quit(&a); -} - -void -sigterm(int unused) -{ - Arg a = {.i = 0}; - quit(&a); -} - diff --git a/dwm/.dwm.old/patch/restartsig.h b/dwm/.dwm.old/patch/restartsig.h deleted file mode 100644 index b16975b..0000000 --- a/dwm/.dwm.old/patch/restartsig.h +++ /dev/null @@ -1,3 +0,0 @@ -static void sighup(int unused); -static void sigterm(int unused); - diff --git a/dwm/.dwm.old/patch/riodraw.c b/dwm/.dwm.old/patch/riodraw.c deleted file mode 100644 index aebf726..0000000 --- a/dwm/.dwm.old/patch/riodraw.c +++ /dev/null @@ -1,105 +0,0 @@ -/* drag out an area using slop and resize the selected window to it. */ -int -riodraw(Client *c, const char slopstyle[]) -{ - int i; - char str[100]; - char strout[100]; - char tmpstring[30] = {0}; - char slopcmd[100] = "slop -f x%xx%yx%wx%hx "; - int firstchar = 0; - int counter = 0; - - strcat(slopcmd, slopstyle); - FILE *fp = popen(slopcmd, "r"); - - while (fgets(str, 100, fp) != NULL) - strcat(strout, str); - - pclose(fp); - - if (strlen(strout) < 6) - return 0; - - for (i = 0; i < strlen(strout); i++){ - if (!firstchar) { - if (strout[i] == 'x') - firstchar = 1; - continue; - } - - if (strout[i] != 'x') - tmpstring[strlen(tmpstring)] = strout[i]; - else { - riodimensions[counter] = atoi(tmpstring); - counter++; - memset(tmpstring,0,strlen(tmpstring)); - } - } - - if (riodimensions[0] <= -40 || riodimensions[1] <= -40 || riodimensions[2] <= 50 || riodimensions[3] <= 50) { - riodimensions[3] = -1; - return 0; - } - - if (c) { - rioposition(c, riodimensions[0], riodimensions[1], riodimensions[2], riodimensions[3]); - return 0; - } - - return 1; -} - -void -rioposition(Client *c, int x, int y, int w, int h) -{ - Monitor *m; - if ((m = recttomon(x, y, w, h)) && m != c->mon) { - detach(c); - detachstack(c); - arrange(c->mon); - c->mon = m; - c->tags = m->tagset[m->seltags]; - attach(c); - attachstack(c); - selmon = m; - focus(c); - } - - c->isfloating = 1; - if (riodraw_borders) - resizeclient(c, x, y, w - (c->bw * 2), h - (c->bw * 2)); - else - resizeclient(c, x - c->bw, y - c->bw, w, h); - drawbar(c->mon); - arrange(c->mon); - - riodimensions[3] = -1; - riopid = 0; -} - -/* drag out an area using slop and resize the selected window to it */ -void -rioresize(const Arg *arg) -{ - Client *c = (arg && arg->v ? (Client*)arg->v : selmon->sel); - if (c) - riodraw(c, slopresizestyle); -} - -/* Spawn a new window and drag out an area using slop to position it while the window is - * initialising in the background. */ -void -riospawn(const Arg *arg) -{ - riopid = spawncmd(arg); - riodraw(NULL, slopspawnstyle); -} - -void -riospawnsync(const Arg *arg) -{ - if (riodraw(NULL, slopspawnstyle)) - riopid = spawncmd(arg); -} - diff --git a/dwm/.dwm.old/patch/riodraw.h b/dwm/.dwm.old/patch/riodraw.h deleted file mode 100644 index 7756aeb..0000000 --- a/dwm/.dwm.old/patch/riodraw.h +++ /dev/null @@ -1,6 +0,0 @@ -static int riodraw(Client *c, const char slopstyle[]); -static void rioposition(Client *c, int x, int y, int w, int h); -static void rioresize(const Arg *arg); -static void riospawn(const Arg *arg); -static void riospawnsync(const Arg *arg); - diff --git a/dwm/.dwm.old/patch/rotatestack.c b/dwm/.dwm.old/patch/rotatestack.c deleted file mode 100644 index 41df8b1..0000000 --- a/dwm/.dwm.old/patch/rotatestack.c +++ /dev/null @@ -1,53 +0,0 @@ -void -enqueue(Client *c) -{ - Client *l; - for (l = c->mon->clients; l && l->next; l = l->next); - if (l) { - l->next = c; - c->next = NULL; - } -} - -void -enqueuestack(Client *c) -{ - Client *l; - for (l = c->mon->stack; l && l->snext; l = l->snext); - if (l) { - l->snext = c; - c->snext = NULL; - } -} - -void -rotatestack(const Arg *arg) -{ - Client *c = NULL, *f; - - if (!selmon->sel) - return; - f = selmon->sel; - if (arg->i > 0) { - for (c = nexttiled(selmon->clients); c && nexttiled(c->next); c = nexttiled(c->next)); - if (c){ - detach(c); - attach(c); - detachstack(c); - attachstack(c); - } - } else { - if ((c = nexttiled(selmon->clients))){ - detach(c); - enqueue(c); - detachstack(c); - enqueuestack(c); - } - } - if (c){ - arrange(selmon); - focus(f); - restack(selmon); - } -} - diff --git a/dwm/.dwm.old/patch/rotatestack.h b/dwm/.dwm.old/patch/rotatestack.h deleted file mode 100644 index ea64e68..0000000 --- a/dwm/.dwm.old/patch/rotatestack.h +++ /dev/null @@ -1,4 +0,0 @@ -static void enqueue(Client *c); -static void enqueuestack(Client *c); -static void rotatestack(const Arg *arg); - diff --git a/dwm/.dwm.old/patch/roundedcorners.c b/dwm/.dwm.old/patch/roundedcorners.c deleted file mode 100644 index c6a1bbb..0000000 --- a/dwm/.dwm.old/patch/roundedcorners.c +++ /dev/null @@ -1,53 +0,0 @@ -#include - -void drawroundedcorners(Client *c) -{ - XWindowAttributes win_attr; - Pixmap mask; - XGCValues xgcv; - GC shape_gc; - int dia, w, h; - - if (corner_radius <= 0 || !c) - return; - - /* Clear window shape if fullscreen */ - if (c->w == c->mon->mw && c->h == c->mon->mh) { - XRectangle rect = { .x = 0, .y = 0, .width = c->w, .height = c->h }; - XShapeCombineRectangles(dpy, c->win, ShapeBounding, 0, 0, &rect, 1, ShapeSet, 1); - return; - } - - if (!XGetWindowAttributes(dpy, c->win, &win_attr)) - return; - - dia = 2 * corner_radius; - w = c->w + 2 * c->bw; - h = c->h + 2 * c->bw; - if (w < dia || h < dia) - return; - - mask = XCreatePixmap(dpy, c->win, w, h, 1); - if (!mask) - return; - - shape_gc = XCreateGC(dpy, mask, 0, &xgcv); - if (!shape_gc) { - XFreePixmap(dpy, mask); - free(shape_gc); - return; - } - - XSetForeground(dpy, shape_gc, 0); - XFillRectangle(dpy, mask, shape_gc, 0, 0, w, h); - XSetForeground(dpy, shape_gc, 1); - XFillArc(dpy, mask, shape_gc, 0, 0, dia, dia, 0, 23040); - XFillArc(dpy, mask, shape_gc, w-dia-1, 0, dia, dia, 0, 23040); - XFillArc(dpy, mask, shape_gc, 0, h-dia-1, dia, dia, 0, 23040); - XFillArc(dpy, mask, shape_gc, w-dia-1, h-dia-1, dia, dia, 0, 23040); - XFillRectangle(dpy, mask, shape_gc, corner_radius, 0, w-dia, h); - XFillRectangle(dpy, mask, shape_gc, 0, corner_radius, w, h-dia); - XShapeCombineMask(dpy, c->win, ShapeBounding, -c->bw, -c->bw, mask, ShapeSet); - XFreePixmap(dpy, mask); - XFreeGC(dpy, shape_gc); -} diff --git a/dwm/.dwm.old/patch/roundedcorners.h b/dwm/.dwm.old/patch/roundedcorners.h deleted file mode 100644 index 31a1f31..0000000 --- a/dwm/.dwm.old/patch/roundedcorners.h +++ /dev/null @@ -1,2 +0,0 @@ -static void drawroundedcorners(Client *c); - diff --git a/dwm/.dwm.old/patch/scratchpad.c b/dwm/.dwm.old/patch/scratchpad.c deleted file mode 100644 index 9e24ff6..0000000 --- a/dwm/.dwm.old/patch/scratchpad.c +++ /dev/null @@ -1,77 +0,0 @@ -void -removescratch(const Arg *arg) -{ - Client *c = selmon->sel; - if (!c) - return; - unsigned int scratchtag = SPTAG(arg->ui); - c->tags = c->mon->tagset[c->mon->seltags] ^ scratchtag; - arrange(c->mon); -} - -void -setscratch(const Arg *arg) -{ - Client *c = selmon->sel; - if (!c) - return; - unsigned int scratchtag = SPTAG(arg->ui); - c->tags = scratchtag; - arrange(c->mon); -} - -void -togglescratch(const Arg *arg) -{ - Client *c = NULL, *next = NULL, *found = NULL; - Monitor *mon; - unsigned int scratchtag = SPTAG(arg->ui); - unsigned int newtagset = 0; - int nh = 0, nw = 0; - Arg sparg = {.v = scratchpads[arg->ui].cmd}; - - for (mon = mons; mon; mon = mon->next) { - for (c = mon->clients; c; c = next) { - next = c->next; - if (!(c->tags & scratchtag)) - continue; - - found = c; - - if (HIDDEN(c)) { - XMapWindow(dpy, c->win); - setclientstate(c, NormalState); - newtagset = 0; - } else - newtagset = selmon->tagset[selmon->seltags] ^ scratchtag; - - if (c->mon != selmon) { - if (c->mon->tagset[c->mon->seltags] & SPTAGMASK) - c->mon->tagset[c->mon->seltags] ^= scratchtag; - if (c->w > selmon->ww) - nw = selmon->ww - c->bw * 2; - if (c->h > selmon->wh) - nh = selmon->wh - c->bw * 2; - if (nw > 0 || nh > 0) - resizeclient(c, c->x, c->y, nw ? nw : c->w, nh ? nh : c->h); - sendmon(c, selmon); - } - } - } - - if (found) { - if (newtagset) { - selmon->tagset[selmon->seltags] = newtagset; - focus(NULL); - arrange(selmon); - } - if (ISVISIBLE(found)) { - focus(found); - restack(selmon); - } - } else { - selmon->tagset[selmon->seltags] |= scratchtag; - spawn(&sparg); - } -} - diff --git a/dwm/.dwm.old/patch/scratchpad.h b/dwm/.dwm.old/patch/scratchpad.h deleted file mode 100644 index 6230266..0000000 --- a/dwm/.dwm.old/patch/scratchpad.h +++ /dev/null @@ -1,9 +0,0 @@ -typedef struct { - const char *name; - const void *cmd; -} Sp; - -static void removescratch(const Arg *arg); -static void setscratch(const Arg *arg); -static void togglescratch(const Arg *arg); - diff --git a/dwm/.dwm.old/patch/scratchpad_alt_1.c b/dwm/.dwm.old/patch/scratchpad_alt_1.c deleted file mode 100644 index 6724d5c..0000000 --- a/dwm/.dwm.old/patch/scratchpad_alt_1.c +++ /dev/null @@ -1,72 +0,0 @@ -static Client * scratchpad_last_showed = NULL; - -void -scratchpad_hide() -{ - if (selmon->sel) { - selmon->sel->tags = SCRATCHPAD_MASK; - selmon->sel->isfloating = 1; - focus(NULL); - arrange(selmon); - } -} - -_Bool -scratchpad_last_showed_is_killed(void) -{ - Client *c; - for (c = selmon->clients; c && c != scratchpad_last_showed; c = c->next); - return (c == NULL); -} - -void -scratchpad_remove() -{ - if (selmon->sel && scratchpad_last_showed != NULL && selmon->sel == scratchpad_last_showed) - scratchpad_last_showed = NULL; -} - -void -scratchpad_show() -{ - if (scratchpad_last_showed == NULL || scratchpad_last_showed_is_killed()) { - scratchpad_show_first(); - return; - } - - if (scratchpad_last_showed->tags != SCRATCHPAD_MASK) { - scratchpad_last_showed->tags = SCRATCHPAD_MASK; - focus(NULL); - arrange(selmon); - return; - } - - Client *c; - - for (c = selmon->clients; c && c != scratchpad_last_showed; c = c->next); - for (c = (c ? c->next : NULL); c && c->tags != SCRATCHPAD_MASK; c = c->next); - - if (c) - scratchpad_show_client(c); - else - scratchpad_show_first(); -} - -void -scratchpad_show_client(Client* c) -{ - scratchpad_last_showed = c; - c->tags = selmon->tagset[selmon->seltags]; - focus(c); - arrange(selmon); -} - -void -scratchpad_show_first(void) -{ - Client *c; - for (c = selmon->clients; c && c->tags != SCRATCHPAD_MASK; c = c->next); - if (c) - scratchpad_show_client(c); -} - diff --git a/dwm/.dwm.old/patch/scratchpad_alt_1.h b/dwm/.dwm.old/patch/scratchpad_alt_1.h deleted file mode 100644 index 4e25f11..0000000 --- a/dwm/.dwm.old/patch/scratchpad_alt_1.h +++ /dev/null @@ -1,9 +0,0 @@ -#define SCRATCHPAD_MASK (1u << NUMTAGS) - -static void scratchpad_hide(); -static _Bool scratchpad_last_showed_is_killed(void); -static void scratchpad_remove(); -static void scratchpad_show(); -static void scratchpad_show_client(Client *c); -static void scratchpad_show_first(void); - diff --git a/dwm/.dwm.old/patch/seamless_restart.c b/dwm/.dwm.old/patch/seamless_restart.c deleted file mode 100644 index 2be269e..0000000 --- a/dwm/.dwm.old/patch/seamless_restart.c +++ /dev/null @@ -1,478 +0,0 @@ -void -persistmonitorstate(Monitor *m) -{ - Client *c; - unsigned int i; - - setmonitortags(m); - setmonitorfields(m); - - /* Set client atoms */ - for (i = 1, c = m->clients; c; c = c->next, ++i) { - c->idx = i; - persistclientstate(c); - #if SWALLOW_PATCH - if (c->swallowing) { - c->swallowing->idx = i; - persistclientstate(c->swallowing); - } - #endif // SWALLOW_PATCH - } -} - -int -restoremonitorstate(Monitor *m) -{ - return getmonitortags(m) | getmonitorfields(m); -} - -void -persistclientstate(Client *c) -{ - setclienttags(c); - setclientfields(c); - #if SAVEFLOATS_PATCH - savewindowfloatposition(c, c->mon); - #endif // SAVEFLOATS_PATCH -} - -int -restoreclientstate(Client *c) -{ - return getclienttags(c) - | getclientfields(c) - #if SAVEFLOATS_PATCH - | restorewindowfloatposition(c, c->mon ? c->mon : selmon) - #endif // SAVEFLOATS_PATCH - ; -} - -void setmonitorfields(Monitor *m) -{ - #if PERTAG_PATCH - unsigned int i; - #endif // PERTAG_PATCH - char atom[22] = {0}; - Atom monitor_fields; - #if FLEXTILE_DELUXE_LAYOUT - unsigned int flextile_deluxe_bitmask; - #endif // FLEXTILE_DELUXE_LAYOUT - - sprintf(atom, "_DWM_MONITOR_FIELDS_%u", m->num); - monitor_fields = XInternAtom(dpy, atom, False); - - /* Perists workspace information in 32 bits laid out like this: - * - * |0|0000|0|0000|0000|0000|0000|0000|000|000 - * | | | | | | | | | |-- nmaster - * | | | | | | | | |-- nstack - * | | | | | | | |-- layout - * | | | | | | |-- flextile LAYOUT (split) - * | | | | | |-- flextile MASTER - * | | | | |-- flextile STACK1 - * | | | |-- flextile STACK2 - * | | |-- flextile mirror layout (indicated by negative layout) - * | | - * | |-- reserved - * |-- showbar - */ - #if PERTAG_PATCH - for (i = 0; i <= NUMTAGS; i++) { - #if FLEXTILE_DELUXE_LAYOUT - flextile_deluxe_bitmask = (m->pertag->nstacks[i] & 0x7) << 3; - if (m->pertag->ltidxs[i][m->pertag->sellts[i]]->arrange == flextile) { - flextile_deluxe_bitmask |= - (abs(m->pertag->ltaxis[i][LAYOUT]) & 0xF) << 10 | - (m->pertag->ltaxis[i][MASTER] & 0xF) << 14 | - (m->pertag->ltaxis[i][STACK] & 0xF) << 18 | - (m->pertag->ltaxis[i][STACK2] & 0xF) << 22 | - (m->pertag->ltaxis[i][LAYOUT] < 0 ? 1 : 0) << 24; - } - #endif // FLEXTILE_DELUXE_L1AYOUT - uint32_t data[] = { - #if FLEXTILE_DELUXE_LAYOUT - flextile_deluxe_bitmask | - #endif // FLEXTILE_DELUXE_LAYOUT - (m->pertag->nmasters[i] & 0x7) | - (getlayoutindex(m->pertag->ltidxs[i][m->pertag->sellts[i]]) & 0xF) << 6 | - #if PERTAGBAR_PATCH - m->pertag->showbars[i] << 31 - #else - m->showbar << 31 - #endif // PERTAGBAR_PATCH - }; - - XChangeProperty(dpy, root, monitor_fields, XA_CARDINAL, 32, - i ? PropModeAppend : PropModeReplace, (unsigned char *)data, 1); - } - #else // !PERTAG_PATCH - #if FLEXTILE_DELUXE_LAYOUT - flextile_deluxe_bitmask = (m->nstack & 0x7) << 3; - if (m->lt[m->sellt]->arrange == flextile) { - flextile_deluxe_bitmask |= - (abs(m->ltaxis[LAYOUT]) & 0xF) << 10 | - (m->ltaxis[MASTER] & 0xF) << 14 | - (m->ltaxis[STACK] & 0xF) << 18 | - (m->ltaxis[STACK2] & 0xF) << 22 | - (m->ltaxis[LAYOUT] < 0 ? 1 : 0) << 24; - } - #endif // FLEXTILE_DELUXE_L1AYOUT - uint32_t data[] = { - #if FLEXTILE_DELUXE_LAYOUT - flextile_deluxe_bitmask | - #endif // FLEXTILE_DELUXE_LAYOUT - (m->nmaster & 0x7) | - (getlayoutindex(m->lt[m->sellt]) & 0xF) << 6 | - m->showbar << 31 - }; - - XChangeProperty(dpy, root, monitor_fields, XA_CARDINAL, 32, PropModeReplace, - (unsigned char *)data, 1); - #endif // PERTAG_PATCH -} - -int -getlayoutindex(const Layout *layout) -{ - int i; - - for (i = 0; i < LENGTH(layouts) && &layouts[i] != layout; i++); - if (i == LENGTH(layouts)) - i = 0; - return i; -} - -int -getmonitorfields(Monitor *m) -{ - int di, layout_index; - #if PERTAG_PATCH - unsigned int i, restored = 0; - unsigned int tags = m->tagset[m->seltags] << 1; - #endif // PERTAG_PATCH - unsigned long dl, nitems; - unsigned char *p = NULL; - char atom[22] = {0}; - Atom da, state = None; - - sprintf(atom, "_DWM_MONITOR_FIELDS_%u", m->num); - Atom dwm_monitor = XInternAtom(dpy, atom, False); - if (!dwm_monitor) - return 0; - - #if PERTAG_PATCH - for (i = 0; i <= NUMTAGS; i++) { - if (!(XGetWindowProperty(dpy, root, dwm_monitor, i, (NUMTAGS + 1) * sizeof dl, - False, AnyPropertyType, &da, &di, &nitems, &dl, &p) == Success && p)) { - break; - } - - if (!nitems) { - XFree(p); - break; - } - - /* See bit layout in the persistmonitorstate function */ - state = *(Atom *)p; - - m->pertag->nmasters[i] = state & 0x7; - layout_index = (state >> 6) & 0xF; - if (layout_index < LENGTH(layouts)) - m->pertag->ltidxs[i][m->pertag->sellts[i]] = &layouts[layout_index]; - #if FLEXTILE_DELUXE_LAYOUT - m->pertag->nstacks[i] = (state >> 3) & 0x7; - if (m->pertag->ltidxs[i][m->pertag->sellts[i]]->arrange == flextile) { - m->pertag->ltaxis[i][LAYOUT] = (state >> 10) & 0xF; - m->pertag->ltaxis[i][MASTER] = (state >> 14) & 0xF; - m->pertag->ltaxis[i][STACK] = (state >> 18) & 0xF; - m->pertag->ltaxis[i][STACK2] = (state >> 22) & 0xF; - if (state >> 24 & 0x1) { - m->pertag->ltaxis[i][LAYOUT] *= -1; - } - } - #endif // FLEXTILE_DELUXE_LAYOUT - #if PERTAGBAR_PATCH - m->pertag->showbars[i] = (state >> 31) & 0x1; - #endif // PERTAGBAR_PATCH - - if (!restored && i && (tags & (1 << i))) { - m->nmaster = m->pertag->nmasters[i]; - m->sellt = m->pertag->sellts[i]; - m->lt[m->sellt] = m->pertag->ltidxs[i][m->sellt]; - #if FLEXTILE_DELUXE_LAYOUT - m->nstack = m->pertag->nstacks[i]; - if (m->lt[m->sellt]->arrange == flextile) { - m->ltaxis[LAYOUT] = m->pertag->ltaxis[i][LAYOUT]; - m->ltaxis[MASTER] = m->pertag->ltaxis[i][MASTER]; - m->ltaxis[STACK] = m->pertag->ltaxis[i][STACK]; - m->ltaxis[STACK2] = m->pertag->ltaxis[i][STACK2]; - } - #endif // FLEXTILE_DELUXE_LAYOUT - #if PERTAGBAR_PATCH - m->showbar = m->pertag->showbars[i]; - #else - m->showbar = (state >> 31) & 0x1; - #endif // PERTAGBAR_PATCH - restored = 1; - } - - XFree(p); - } - - return restored; - #else // !PERTAG_PATCH - if (!(XGetWindowProperty(dpy, root, dwm_monitor, 0L, sizeof dl, - False, AnyPropertyType, &da, &di, &nitems, &dl, &p) == Success && p)) { - return 0; - } - - if (nitems) { - state = *(Atom *)p; - - /* See bit layout in the persistmonitorstate function */ - m->nmaster = state & 0x7; - #if FLEXTILE_DELUXE_LAYOUT - m->nstack = (state >> 3) & 0x7; - #endif // FLEXTILE_DELUXE_LAYOUT - layout_index = (state >> 6) & 0xF; - if (layout_index < LENGTH(layouts)) - m->lt[m->sellt] = &layouts[layout_index]; - #if FLEXTILE_DELUXE_LAYOUT - if (m->lt[m->sellt]->arrange == flextile) { - m->ltaxis[LAYOUT] = (state >> 10) & 0xF; - m->ltaxis[MASTER] = (state >> 14) & 0xF; - m->ltaxis[STACK] = (state >> 18) & 0xF; - m->ltaxis[STACK2] = (state >> 22) & 0xF; - } - #endif // FLEXTILE_DELUXE_LAYOUT - m->showbar = (state >> 31) & 0x1; - } - - XFree(p); - return 1; - #endif // PERTAG_PATCH -} - -void -setmonitortags(Monitor *m) -{ - char atom[22] = {0}; - Atom monitor_tags; - - sprintf(atom, "_DWM_MONITOR_TAGS_%u", m->num); - monitor_tags = XInternAtom(dpy, atom, False); - - uint32_t data[] = { m->tagset[m->seltags] }; - XChangeProperty(dpy, root, monitor_tags, XA_CARDINAL, 32, PropModeReplace, (unsigned char *)data, 1); -} - -int -getmonitortags(Monitor *m) -{ - int di; - unsigned long dl, nitems; - unsigned char *p = NULL; - char atom[22] = {0}; - Atom da, monitor_tags = None, tags; - - sprintf(atom, "_DWM_MONITOR_TAGS_%u", m->num); - monitor_tags = XInternAtom(dpy, atom, False); - - if (!(XGetWindowProperty(dpy, root, monitor_tags, 0L, sizeof dl, - False, AnyPropertyType, &da, &di, &nitems, &dl, &p) == Success && p)) { - return 0; - } - - if (nitems) { - tags = *(Atom *)p; - m->tagset[m->seltags] = tags & TAGMASK; - } - - XFree(p); - return 1; -} - -void -setclientfields(Client *c) -{ - /* Perists client information in 32 bits laid out like this: - * - * |00000000|00000|0|0|0|0|0|0|0|0|00000000|000 - * | | | | | | | | | | | |-- monitor index - * | | | | | | | | | | |-- client index - * | | | | | | | | | |-- isfloating - * | | | | | | | | |-- ispermanent - * | | | | | | | |-- isterminal - * | | | | | | |-- noswallow - * | | | | | |-- issteam - * | | | | |-- issticky - * | | | |-- fakefullscreen - * | | |-- isfreesize - * | | - * | |-- reserved - * |-- scratchkey (for scratchpads) - */ - uint32_t data[] = { - (c->mon->num & 0x7) - | (c->idx & 0xFF) << 3 - | (c->isfloating & 0x1) << 11 - #if ISPERMANENT_PATCH - | (c->ispermanent & 0x1) << 12 - #endif // ISPERMANENT_PATCH - #if SWALLOW_PATCH - | (c->isterminal & 0x1) << 13 - | (c->noswallow & 0x1) << 14 - #endif // SWALLOW_PATCH - #if STEAM_PATCH - | (c->issteam & 0x1) << 15 - #endif // STEAM_PATCH - #if STICKY_PATCH - | (c->issticky & 0x1) << 16 - #endif // STICKY_PATCH - #if !FAKEFULLSCREEN_PATCH && FAKEFULLSCREEN_CLIENT_PATCH - | (c->fakefullscreen & 0x1) << 17 - #endif // FAKEFULLSCREEN_CLIENT_PATCH - #if SIZEHINTS_ISFREESIZE_PATCH - | (c->isfreesize & 0x1) << 18 - #endif // SIZEHINTS_ISFREESIZE_PATCH - #if RENAMED_SCRATCHPADS_PATCH - | (c->scratchkey & 0xFF) << 24 - #endif // RENAMED_SCRATCHPADS_PATCH - }; - XChangeProperty(dpy, c->win, clientatom[ClientFields], XA_CARDINAL, 32, PropModeReplace, (unsigned char *)data, 1); -} - -int -getclientfields(Client *c) -{ - Monitor *m; - Atom fields = getatomprop(c, clientatom[ClientFields], AnyPropertyType); - if (fields == None) - return 0; - - /* See bit layout in the setclientfields function */ - for (m = mons; m; m = m->next) - if (m->num == (fields & 0x7)) { - c->mon = m; - break; - } - c->idx = (fields >> 3) & 0xFF; - c->isfloating = (fields >> 11) & 0x1; - #if ISPERMANENT_PATCH - c->ispermanent = (fields >> 12) & 0x1; - #endif // ISPERMANENT_PATCH - #if SWALLOW_PATCH - c->isterminal = (fields >> 13) & 0x1; - c->noswallow = (fields >> 14) & 0x1; - #endif // SWALLOW_PATCH - #if STEAM_PATCH - c->issteam = (fields >> 15) & 0x1; - #endif // STEAM_PATCH - #if STICKY_PATCH - c->issticky = (fields >> 16) & 0x1; - #endif // STICKY_PATCH - #if !FAKEFULLSCREEN_PATCH && FAKEFULLSCREEN_CLIENT_PATCH - c->fakefullscreen = (fields >> 17) & 0x1; - #endif // FAKEFULLSCREEN_CLIENT_PATCH - #if SIZEHINTS_ISFREESIZE_PATCH - c->isfreesize = (fields >> 18) & 0x1; - #endif // SIZEHINTS_ISFREESIZE_PATCH - #if RENAMED_SCRATCHPADS_PATCH - c->scratchkey = (fields >> 24) & 0xFF; - #endif // RENAMED_SCRATCHPADS_PATCH - return 1; -} - -void -setclienttags(Client *c) -{ - uint32_t data[] = { c->tags }; - XChangeProperty(dpy, c->win, clientatom[ClientTags], XA_CARDINAL, 32, PropModeReplace, (unsigned char *)data, 1); -} - -int -getclienttags(Client *c) -{ - Atom tags = getatomprop(c, clientatom[ClientTags], AnyPropertyType); - if (tags == None) - return 0; - - c->tags = tags & TAGMASK; - return 1; -} - -#if SAVEFLOATS_PATCH -void -savewindowfloatposition(Client *c, Monitor *m) -{ - char atom[22] = {0}; - if (c->sfx == -9999) - return; - - sprintf(atom, "_DWM_FLOATPOS_%u", m->num); - uint32_t pos[] = { (MAX(c->sfx - m->mx, 0) & 0xffff) | ((MAX(c->sfy - m->my, 0) & 0xffff) << 16) }; - XChangeProperty(dpy, c->win, XInternAtom(dpy, atom, False), XA_CARDINAL, 32, PropModeReplace, (unsigned char *)pos, 1); - - sprintf(atom, "_DWM_FLOATSIZE_%u", m->num); - uint32_t size[] = { (c->sfw & 0xffff) | ((c->sfh & 0xffff) << 16) }; - XChangeProperty(dpy, c->win, XInternAtom(dpy, atom, False), XA_CARDINAL, 32, PropModeReplace, (unsigned char *)size, 1); - - XSync(dpy, False); -} - -int -restorewindowfloatposition(Client *c, Monitor *m) -{ - char atom[22] = {0}; - Atom key, value; - int x, y, w, h; - - if (m == NULL) - return 0; - - sprintf(atom, "_DWM_FLOATPOS_%u", m->num); - - key = XInternAtom(dpy, atom, False); - if (!key) - return 0; - - value = getatomprop(c, key, AnyPropertyType); - if (!value) - return 0; - - x = value & 0xffff; - y = value >> 16; - - sprintf(atom, "_DWM_FLOATSIZE_%u", m->num); - - key = XInternAtom(dpy, atom, False); - if (!key) - return 0; - - value = getatomprop(c, key, AnyPropertyType); - if (!value) - return 0; - - w = value & 0xffff; - h = value >> 16; - - if (w <= 0 || h <= 0) { - fprintf(stderr, "restorewindowfloatposition: bad float values x = %d, y = %d, w = %d, h = %d for client = %s\n", x, y, w, h, c->name); - return 0; - } - - c->sfx = m->mx + x; - c->sfy = m->my + y; - c->sfw = w; - c->sfh = h; - - if (c->isfloating) { - c->x = c->sfx; - c->y = c->sfy; - c->w = c->sfw; - c->h = c->sfh; - } - - return 1; -} -#endif // SAVEFLOATS_PATCH diff --git a/dwm/.dwm.old/patch/seamless_restart.h b/dwm/.dwm.old/patch/seamless_restart.h deleted file mode 100644 index ef29fa7..0000000 --- a/dwm/.dwm.old/patch/seamless_restart.h +++ /dev/null @@ -1,19 +0,0 @@ -#include - -static void persistmonitorstate(Monitor *m); -static int restoremonitorstate(Monitor *m); -static void persistclientstate(Client *c); -static int restoreclientstate(Client *c); -static void setmonitorfields(Monitor *m); -static int getmonitorfields(Monitor *m); -static void setmonitortags(Monitor *m); -static int getmonitortags(Monitor *m); -static void setclientfields(Client *c); -static int getclientfields(Client *c); -static void setclienttags(Client *c); -static int getclienttags(Client *c); -static int getlayoutindex(const Layout *layout); -#if SAVEFLOATS_PATCH -static void savewindowfloatposition(Client *c, Monitor *m); -static int restorewindowfloatposition(Client *c, Monitor *m); -#endif // SAVEFLOATS_PATCH diff --git a/dwm/.dwm.old/patch/selfrestart.c b/dwm/.dwm.old/patch/selfrestart.c deleted file mode 100644 index f733867..0000000 --- a/dwm/.dwm.old/patch/selfrestart.c +++ /dev/null @@ -1,69 +0,0 @@ -#include -#include -#include -#include -#include - -/** - * Magically finds the current's executable path - * - * I'm doing the do{}while(); trick because Linux (what I'm running) is not - * POSIX compilant and so lstat() cannot be trusted on /proc entries - * - * @return char* the path of the current executable - */ -char *get_dwm_path() -{ - struct stat s; - int r, length, rate = 42; - char *path = NULL; - - if (lstat("/proc/self/exe", &s) == -1) { - perror("lstat:"); - return NULL; - } - - length = s.st_size + 1 - rate; - - do - { - length+=rate; - - free(path); - path = malloc(sizeof(char) * length); - - if (path == NULL){ - perror("malloc:"); - return NULL; - } - - r = readlink("/proc/self/exe", path, length); - - if (r == -1){ - perror("readlink:"); - return NULL; - } - } while (r >= length); - - path[r] = '\0'; - - return path; -} - -/** - * self-restart - * - * Initially inspired by: Yu-Jie Lin - * https://sites.google.com/site/yjlnotes/notes/dwm - */ -void self_restart(const Arg *arg) -{ - char *const argv[] = {get_dwm_path(), NULL}; - - if (argv[0] == NULL) { - return; - } - - execv(argv[0], argv); -} - diff --git a/dwm/.dwm.old/patch/selfrestart.h b/dwm/.dwm.old/patch/selfrestart.h deleted file mode 100644 index 3fd0b81..0000000 --- a/dwm/.dwm.old/patch/selfrestart.h +++ /dev/null @@ -1,3 +0,0 @@ -char *get_dwm_path(); -void self_restart(const Arg *arg); - diff --git a/dwm/.dwm.old/patch/setborderpx.c b/dwm/.dwm.old/patch/setborderpx.c deleted file mode 100644 index 6cc0b34..0000000 --- a/dwm/.dwm.old/patch/setborderpx.c +++ /dev/null @@ -1,56 +0,0 @@ -void -setborderpx(const Arg *arg) -{ - Client *c; - 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 = m->bar; bar; bar = bar->next) { - bar->bh = bar->bh - 2 * bar->borderpx + 2 * m->borderpx; - bar->borderpx = m->borderpx; - } - 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 = 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 && !RENAMED_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; - - resizeclient(c, c->x, c->y, c->w - delta, c->h - delta); - } - arrange(m); -} diff --git a/dwm/.dwm.old/patch/setborderpx.h b/dwm/.dwm.old/patch/setborderpx.h deleted file mode 100644 index a92ae0b..0000000 --- a/dwm/.dwm.old/patch/setborderpx.h +++ /dev/null @@ -1,2 +0,0 @@ -static void setborderpx(const Arg *arg); - diff --git a/dwm/.dwm.old/patch/shift.c b/dwm/.dwm.old/patch/shift.c deleted file mode 100644 index 355e645..0000000 --- a/dwm/.dwm.old/patch/shift.c +++ /dev/null @@ -1,46 +0,0 @@ -static Arg -shift(const Arg *arg, int clients) -{ - Arg shifted; - Client *c; - unsigned int tagmask = 0; - - #if SCRATCHPADS_PATCH && !RENAMED_SCRATCHPADS_PATCH - shifted.ui = selmon->tagset[selmon->seltags]; - #else - shifted.ui = selmon->tagset[selmon->seltags]; - #endif // SCRATCHPADS_PATCH - - #if TAGSYNC_PATCH - Monitor *origselmon = selmon; - for (selmon = mons; selmon; selmon = selmon->next) - #endif // TAGSYNC_PATCH - for (c = selmon->clients; c && clients; c = c->next) { - if (c == selmon->sel) - continue; - #if SCRATCHPADS_PATCH && !RENAMED_SCRATCHPADS_PATCH - if (!(c->tags & SPTAGMASK)) - tagmask |= c->tags; - #elif SCRATCHPAD_ALT_1_PATCH - if (!(c->tags & SCRATCHPAD_MASK)) - tagmask |= c->tags; - #else - tagmask |= c->tags; - #endif // SCRATCHPADS_PATCH - } - #if TAGSYNC_PATCH - selmon = origselmon; - #endif // TAGSYNC_PATCH - - do { - if (arg->i > 0) // left circular shift - shifted.ui = (shifted.ui << arg->i) | (shifted.ui >> (NUMTAGS - arg->i)); - else // right circular shift - shifted.ui = (shifted.ui >> -arg->i) | (shifted.ui << (NUMTAGS + arg->i)); - #if SCRATCHPADS_PATCH && !RENAMED_SCRATCHPADS_PATCH - shifted.ui &= ~SPTAGMASK; - #endif // SCRATCHPADS_PATCH - } while (tagmask && !(shifted.ui & tagmask)); - - return shifted; -} diff --git a/dwm/.dwm.old/patch/shift.h b/dwm/.dwm.old/patch/shift.h deleted file mode 100644 index 45f1665..0000000 --- a/dwm/.dwm.old/patch/shift.h +++ /dev/null @@ -1 +0,0 @@ -static Arg shift(const Arg *arg, int clients); diff --git a/dwm/.dwm.old/patch/shiftboth.c b/dwm/.dwm.old/patch/shiftboth.c deleted file mode 100644 index d51d4ac..0000000 --- a/dwm/.dwm.old/patch/shiftboth.c +++ /dev/null @@ -1,7 +0,0 @@ -void -shiftboth(const Arg *arg) -{ - Arg shifted = shift(arg, 0); - tag(&shifted); - view(&shifted); -} diff --git a/dwm/.dwm.old/patch/shiftboth.h b/dwm/.dwm.old/patch/shiftboth.h deleted file mode 100644 index 7a9b8c2..0000000 --- a/dwm/.dwm.old/patch/shiftboth.h +++ /dev/null @@ -1 +0,0 @@ -static void shiftboth(const Arg *arg); diff --git a/dwm/.dwm.old/patch/shiftswaptags.c b/dwm/.dwm.old/patch/shiftswaptags.c deleted file mode 100644 index abf6047..0000000 --- a/dwm/.dwm.old/patch/shiftswaptags.c +++ /dev/null @@ -1,7 +0,0 @@ -/* swaps "tags" (all the clients) with the next/prev tag. */ -void -shiftswaptags(const Arg *arg) -{ - Arg shifted = shift(arg, 0); - swaptags(&shifted); -} diff --git a/dwm/.dwm.old/patch/shiftswaptags.h b/dwm/.dwm.old/patch/shiftswaptags.h deleted file mode 100644 index 1977e36..0000000 --- a/dwm/.dwm.old/patch/shiftswaptags.h +++ /dev/null @@ -1 +0,0 @@ -static void shiftswaptags(const Arg *arg); diff --git a/dwm/.dwm.old/patch/shifttag.c b/dwm/.dwm.old/patch/shifttag.c deleted file mode 100644 index 0f9dcea..0000000 --- a/dwm/.dwm.old/patch/shifttag.c +++ /dev/null @@ -1,7 +0,0 @@ -/* Sends a window to the next/prev tag */ -void -shifttag(const Arg *arg) -{ - Arg shifted = shift(arg, 0); - tag(&shifted); -} diff --git a/dwm/.dwm.old/patch/shifttag.h b/dwm/.dwm.old/patch/shifttag.h deleted file mode 100644 index 624787f..0000000 --- a/dwm/.dwm.old/patch/shifttag.h +++ /dev/null @@ -1 +0,0 @@ -static void shifttag(const Arg *arg); diff --git a/dwm/.dwm.old/patch/shifttagclients.c b/dwm/.dwm.old/patch/shifttagclients.c deleted file mode 100644 index f672395..0000000 --- a/dwm/.dwm.old/patch/shifttagclients.c +++ /dev/null @@ -1,7 +0,0 @@ -/* Sends a window to the next/prev tag that has a client, else it moves it to the next/prev one. */ -void -shifttagclients(const Arg *arg) -{ - Arg shifted = shift(arg, 1); - tag(&shifted); -} diff --git a/dwm/.dwm.old/patch/shifttagclients.h b/dwm/.dwm.old/patch/shifttagclients.h deleted file mode 100644 index 43049a0..0000000 --- a/dwm/.dwm.old/patch/shifttagclients.h +++ /dev/null @@ -1 +0,0 @@ -static void shifttagclients(const Arg *arg); diff --git a/dwm/.dwm.old/patch/shiftview.c b/dwm/.dwm.old/patch/shiftview.c deleted file mode 100644 index d3038d6..0000000 --- a/dwm/.dwm.old/patch/shiftview.c +++ /dev/null @@ -1,6 +0,0 @@ -void -shiftview(const Arg *arg) -{ - Arg shifted = shift(arg, 0); - view(&shifted); -} diff --git a/dwm/.dwm.old/patch/shiftview.h b/dwm/.dwm.old/patch/shiftview.h deleted file mode 100644 index 7bf3a14..0000000 --- a/dwm/.dwm.old/patch/shiftview.h +++ /dev/null @@ -1 +0,0 @@ -static void shiftview(const Arg *arg); diff --git a/dwm/.dwm.old/patch/shiftviewclients.c b/dwm/.dwm.old/patch/shiftviewclients.c deleted file mode 100644 index 7abebb2..0000000 --- a/dwm/.dwm.old/patch/shiftviewclients.c +++ /dev/null @@ -1,6 +0,0 @@ -void -shiftviewclients(const Arg *arg) -{ - Arg shifted = shift(arg, 1); - view(&shifted); -} diff --git a/dwm/.dwm.old/patch/shiftviewclients.h b/dwm/.dwm.old/patch/shiftviewclients.h deleted file mode 100644 index 2f652cd..0000000 --- a/dwm/.dwm.old/patch/shiftviewclients.h +++ /dev/null @@ -1 +0,0 @@ -static void shiftviewclients(const Arg *arg); diff --git a/dwm/.dwm.old/patch/sizehints_ruled.c b/dwm/.dwm.old/patch/sizehints_ruled.c deleted file mode 100644 index 6e97f9e..0000000 --- a/dwm/.dwm.old/patch/sizehints_ruled.c +++ /dev/null @@ -1,39 +0,0 @@ -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 }; - - 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], XA_ATOM); - #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)) - #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); - if (ch.res_name) - XFree(ch.res_name); -} - diff --git a/dwm/.dwm.old/patch/sizehints_ruled.h b/dwm/.dwm.old/patch/sizehints_ruled.h deleted file mode 100644 index 14c6719..0000000 --- a/dwm/.dwm.old/patch/sizehints_ruled.h +++ /dev/null @@ -1,2 +0,0 @@ -static void checkfloatingrules(Client *c); - diff --git a/dwm/.dwm.old/patch/sortscreens.c b/dwm/.dwm.old/patch/sortscreens.c deleted file mode 100644 index 538e2c1..0000000 --- a/dwm/.dwm.old/patch/sortscreens.c +++ /dev/null @@ -1,16 +0,0 @@ -void -sortscreens(XineramaScreenInfo *screens, int n) -{ - int i, j; - XineramaScreenInfo *screen = ecalloc(1, sizeof(XineramaScreenInfo)); - - for (i = 0; i < n; i++) - for (j = i + 1; j < n; j++) - if (RIGHTOF(screens[i], screens[j])) { - memcpy(&screen[0], &screens[i], sizeof(XineramaScreenInfo)); - memcpy(&screens[i], &screens[j], sizeof(XineramaScreenInfo)); - memcpy(&screens[j], &screen[0], sizeof(XineramaScreenInfo)); - } - XFree(screen); -} - diff --git a/dwm/.dwm.old/patch/sortscreens.h b/dwm/.dwm.old/patch/sortscreens.h deleted file mode 100644 index 82915f4..0000000 --- a/dwm/.dwm.old/patch/sortscreens.h +++ /dev/null @@ -1,4 +0,0 @@ -#define RIGHTOF(a,b) (a.y_org > b.y_org) || ((a.y_org == b.y_org) && (a.x_org > b.x_org)) - -static void sortscreens(XineramaScreenInfo *screens, int n); - diff --git a/dwm/.dwm.old/patch/stacker.c b/dwm/.dwm.old/patch/stacker.c deleted file mode 100644 index ed8b76b..0000000 --- a/dwm/.dwm.old/patch/stacker.c +++ /dev/null @@ -1,113 +0,0 @@ -void -focusstack(const Arg *arg) -{ - int i = stackpos(arg); - Client *c, *p; - - if (i < 0) - return; - - #if LOSEFULLSCREEN_PATCH - if (!selmon->sel) - return; - #elif FAKEFULLSCREEN_CLIENT_PATCH - if (!selmon->sel || (selmon->sel->isfullscreen && !selmon->sel->fakefullscreen)) - return; - #else - if (!selmon->sel || selmon->sel->isfullscreen) - return; - #endif // LOSEFULLSCREEN_PATCH - - #if BAR_WINTITLEACTIONS_PATCH - for (p = NULL, c = selmon->clients; c && (i || !ISVISIBLE(c) || HIDDEN(c)); - i -= (ISVISIBLE(c) && !HIDDEN(c) ? 1 : 0), p = c, c = c->next); - #else - for (p = NULL, c = selmon->clients; c && (i || !ISVISIBLE(c)); - i -= (ISVISIBLE(c) ? 1 : 0), p = c, c = c->next); - #endif // BAR_WINTITLEACTIONS_PATCH - focus(c ? c : p); - restack(selmon); -} - -void -pushstack(const Arg *arg) -{ - int i = stackpos(arg); - Client *sel = selmon->sel, *c, *p; - - if (i < 0) - return; - else if (i == 0) { - detach(sel); - attach(sel); - } - else { - for (p = NULL, c = selmon->clients; c; p = c, c = c->next) - #if BAR_WINTITLEACTIONS_PATCH - if (!(i -= (ISVISIBLE(c) && !HIDDEN(c) && c != sel))) - #else - if (!(i -= (ISVISIBLE(c) && c != sel))) - #endif // BAR_WINTITLEACTIONS_PATCH - break; - c = c ? c : p; - detach(sel); - sel->next = c->next; - c->next = sel; - } - arrange(selmon); -} - -int -stackpos(const Arg *arg) -{ - int n, i; - Client *c, *l; - - if (!selmon->clients) - return -1; - - #if BAR_WINTITLEACTIONS_PATCH - if (arg->i == PREVSEL) { - for (l = selmon->stack; l && (!ISVISIBLE(l) || HIDDEN(l) || l == selmon->sel); l = l->snext); - if (!l) - return -1; - for (i = 0, c = selmon->clients; c != l; i += (ISVISIBLE(c) && !HIDDEN(c) ? 1 : 0), c = c->next); - return i; - } - else if (ISINC(arg->i)) { - if (!selmon->sel) - return -1; - for (i = 0, c = selmon->clients; c != selmon->sel; i += (ISVISIBLE(c) && !HIDDEN(c) ? 1 : 0), c = c->next); - for (n = i; c; n += (ISVISIBLE(c) && !HIDDEN(c) ? 1 : 0), c = c->next); - return MOD(i + GETINC(arg->i), n); - } - else if (arg->i < 0) { - for (i = 0, c = selmon->clients; c; i += (ISVISIBLE(c) && !HIDDEN(c) ? 1 : 0), c = c->next); - return MAX(i + arg->i, 0); - } - else - return arg->i; - #else // !BAR_WINTITLEACTIONS_PATCH - if (arg->i == PREVSEL) { - for (l = selmon->stack; l && (!ISVISIBLE(l) || l == selmon->sel); l = l->snext); - if (!l) - return -1; - for (i = 0, c = selmon->clients; c != l; i += (ISVISIBLE(c) ? 1 : 0), c = c->next); - return i; - } - else if (ISINC(arg->i)) { - if (!selmon->sel) - return -1; - for (i = 0, c = selmon->clients; c != selmon->sel; i += (ISVISIBLE(c) ? 1 : 0), c = c->next); - for (n = i; c; n += (ISVISIBLE(c) ? 1 : 0), c = c->next); - return MOD(i + GETINC(arg->i), n); - } - else if (arg->i < 0) { - for (i = 0, c = selmon->clients; c; i += (ISVISIBLE(c) ? 1 : 0), c = c->next); - return MAX(i + arg->i, 0); - } - else - return arg->i; - #endif // BAR_WINTITLEACTIONS_PATCH -} - diff --git a/dwm/.dwm.old/patch/stacker.h b/dwm/.dwm.old/patch/stacker.h deleted file mode 100644 index ee420bd..0000000 --- a/dwm/.dwm.old/patch/stacker.h +++ /dev/null @@ -1,11 +0,0 @@ -#define GETINC(X) ((X) - 2000) -#define INC(X) ((X) + 2000) -#define ISINC(X) ((X) > 1000 && (X) < 3000) -#define PREVSEL 3000 -#define MOD(N,M) ((N)%(M) < 0 ? (N)%(M) + (M) : (N)%(M)) -#define TRUNC(X,A,B) (MAX((A), MIN((X), (B)))) - -static void focusstack(const Arg *arg); -static void pushstack(const Arg *arg); -static int stackpos(const Arg *arg); - diff --git a/dwm/.dwm.old/patch/sticky.c b/dwm/.dwm.old/patch/sticky.c deleted file mode 100644 index 420c3e0..0000000 --- a/dwm/.dwm.old/patch/sticky.c +++ /dev/null @@ -1,9 +0,0 @@ -void -togglesticky(const Arg *arg) -{ - if (!selmon->sel) - return; - selmon->sel->issticky = !selmon->sel->issticky; - arrange(selmon); -} - diff --git a/dwm/.dwm.old/patch/sticky.h b/dwm/.dwm.old/patch/sticky.h deleted file mode 100644 index 277bb34..0000000 --- a/dwm/.dwm.old/patch/sticky.h +++ /dev/null @@ -1,2 +0,0 @@ -static void togglesticky(const Arg *arg); - diff --git a/dwm/.dwm.old/patch/swallow.c b/dwm/.dwm.old/patch/swallow.c deleted file mode 100644 index 8a63cc0..0000000 --- a/dwm/.dwm.old/patch/swallow.c +++ /dev/null @@ -1,228 +0,0 @@ -#include -#include -#ifdef __OpenBSD__ -#include -#include -#endif /* __OpenBSD__ */ - -static int scanner; -static xcb_connection_t *xcon; - -int -swallow(Client *p, Client *c) -{ - Client *s; - XWindowChanges wc; - - if (c->noswallow > 0 || c->isterminal) - return 0; - if (c->noswallow < 0 && !swallowfloating && c->isfloating) - return 0; - - XMapWindow(dpy, c->win); - - detach(c); - detachstack(c); - - setclientstate(c, WithdrawnState); - XUnmapWindow(dpy, p->win); - - p->swallowing = c; - c->mon = p->mon; - - Window w = p->win; - p->win = c->win; - c->win = w; - - XChangeProperty(dpy, c->win, netatom[NetClientList], XA_WINDOW, 32, PropModeReplace, - (unsigned char *) &(p->win), 1); - - #if BAR_WINICON_PATCH - updateicon(p); - #endif - updatetitle(p); - s = scanner ? c : p; - #if BAR_EWMHTAGS_PATCH - setfloatinghint(s); - #endif // BAR_EWMHTAGS_PATCH - - wc.border_width = p->bw; - XConfigureWindow(dpy, p->win, CWBorderWidth, &wc); - XMoveResizeWindow(dpy, p->win, s->x, s->y, s->w, s->h); - #if !BAR_FLEXWINTITLE_PATCH - XSetWindowBorder(dpy, p->win, scheme[SchemeNorm][ColBorder].pixel); - #endif // BAR_FLEXWINTITLE_PATCH - - arrange(p->mon); - configure(p); - updateclientlist(); - - return 1; -} - -void -unswallow(Client *c) -{ - XWindowChanges wc; - c->win = c->swallowing->win; - - free(c->swallowing); - c->swallowing = NULL; - - XDeleteProperty(dpy, c->win, netatom[NetClientList]); - - /* unfullscreen the client */ - setfullscreen(c, 0); - #if BAR_WINICON_PATCH - updateicon(c); - #endif - updatetitle(c); - arrange(c->mon); - XMapWindow(dpy, c->win); - - wc.border_width = c->bw; - XConfigureWindow(dpy, c->win, CWBorderWidth, &wc); - XMoveResizeWindow(dpy, c->win, c->x, c->y, c->w, c->h); - #if !BAR_FLEXWINTITLE_PATCH - XSetWindowBorder(dpy, c->win, scheme[SchemeNorm][ColBorder].pixel); - #endif // BAR_FLEXWINTITLE_PATCH - - #if BAR_EWMHTAGS_PATCH - setfloatinghint(c); - #endif // BAR_EWMHTAGS_PATCH - setclientstate(c, NormalState); - focus(NULL); - arrange(c->mon); -} - -pid_t -winpid(Window w) -{ - pid_t result = 0; - - #ifdef __linux__ - xcb_res_client_id_spec_t spec = {0}; - spec.client = w; - spec.mask = XCB_RES_CLIENT_ID_MASK_LOCAL_CLIENT_PID; - - xcb_generic_error_t *e = NULL; - xcb_res_query_client_ids_cookie_t c = xcb_res_query_client_ids(xcon, 1, &spec); - xcb_res_query_client_ids_reply_t *r = xcb_res_query_client_ids_reply(xcon, c, &e); - - if (!r) - return (pid_t)0; - - xcb_res_client_id_value_iterator_t i = xcb_res_query_client_ids_ids_iterator(r); - for (; i.rem; xcb_res_client_id_value_next(&i)) { - spec = i.data->spec; - if (spec.mask & XCB_RES_CLIENT_ID_MASK_LOCAL_CLIENT_PID) { - uint32_t *t = xcb_res_client_id_value_value(i.data); - result = *t; - break; - } - } - - free(r); - - if (result == (pid_t)-1) - result = 0; - - #endif /* __linux__ */ - #ifdef __OpenBSD__ - Atom type; - int format; - unsigned long len, bytes; - unsigned char *prop; - pid_t ret; - - if (XGetWindowProperty(dpy, w, XInternAtom(dpy, "_NET_WM_PID", 1), 0, 1, False, AnyPropertyType, &type, &format, &len, &bytes, &prop) != Success || !prop) - return 0; - - ret = *(pid_t*)prop; - XFree(prop); - result = ret; - #endif /* __OpenBSD__ */ - - return result; -} - -pid_t -getparentprocess(pid_t p) -{ - unsigned int v = 0; - -#ifdef __linux__ - FILE *f; - char buf[256]; - snprintf(buf, sizeof(buf) - 1, "/proc/%u/stat", (unsigned)p); - - if (!(f = fopen(buf, "r"))) - return (pid_t)0; - - if (fscanf(f, "%*u %*s %*c %u", (unsigned *)&v) != 1) - v = (pid_t)0; - fclose(f); -#endif /* __linux__ */ -#ifdef __OpenBSD__ - int n; - kvm_t *kd; - struct kinfo_proc *kp; - - kd = kvm_openfiles(NULL, NULL, NULL, KVM_NO_FILES, NULL); - if (!kd) - return 0; - - kp = kvm_getprocs(kd, KERN_PROC_PID, p, sizeof(*kp), &n); - v = kp->p_ppid; -#endif /* __OpenBSD__ */ - return (pid_t)v; -} - -int -isdescprocess(pid_t p, pid_t c) -{ - while (p != c && c != 0) - c = getparentprocess(c); - - return (int)c; -} - -Client * -termforwin(const Client *w) -{ - Client *c; - Monitor *m; - - if (!w->pid || w->isterminal) - return NULL; - - c = selmon->sel; - if (c && c->isterminal && !c->swallowing && c->pid && isdescprocess(c->pid, w->pid)) - return c; - - for (m = mons; m; m = m->next) { - for (c = m->clients; c; c = c->next) { - if (c->isterminal && !c->swallowing && c->pid && isdescprocess(c->pid, w->pid)) - return c; - } - } - - return NULL; -} - -Client * -swallowingclient(Window w) -{ - Client *c; - Monitor *m; - - for (m = mons; m; m = m->next) { - for (c = m->clients; c; c = c->next) { - if (c->swallowing && c->swallowing->win == w) - return c; - } - } - - return NULL; -} - diff --git a/dwm/.dwm.old/patch/swallow.h b/dwm/.dwm.old/patch/swallow.h deleted file mode 100644 index 529fea9..0000000 --- a/dwm/.dwm.old/patch/swallow.h +++ /dev/null @@ -1,8 +0,0 @@ -static pid_t getparentprocess(pid_t p); -static int isdescprocess(pid_t p, pid_t c); -static int swallow(Client *p, Client *c); -static Client *swallowingclient(Window w); -static Client *termforwin(const Client *c); -static void unswallow(Client *c); -static pid_t winpid(Window w); - diff --git a/dwm/.dwm.old/patch/swapfocus.c b/dwm/.dwm.old/patch/swapfocus.c deleted file mode 100644 index ec85c2e..0000000 --- a/dwm/.dwm.old/patch/swapfocus.c +++ /dev/null @@ -1,22 +0,0 @@ -void -swapfocus(const Arg *arg) -{ - if (!selmon->sel) - return; - if (selmon->pertag->prevclient[selmon->pertag->curtag] != NULL - && ISVISIBLE(selmon->pertag->prevclient[selmon->pertag->curtag])) { - focus(selmon->pertag->prevclient[selmon->pertag->curtag]); - restack(selmon->pertag->prevclient[selmon->pertag->curtag]->mon); - } - else { - Client *c = NULL; - for (c = selmon->sel->next; c && !ISVISIBLE(c); c = c->next); - if (!c) - for (c = selmon->clients; c && !ISVISIBLE(c); c = c->next); - if (c) { - focus(c); - restack(selmon); - } - } -} - diff --git a/dwm/.dwm.old/patch/swapfocus.h b/dwm/.dwm.old/patch/swapfocus.h deleted file mode 100644 index e547d2f..0000000 --- a/dwm/.dwm.old/patch/swapfocus.h +++ /dev/null @@ -1,2 +0,0 @@ -static void swapfocus(const Arg *arg); - diff --git a/dwm/.dwm.old/patch/swaptags.c b/dwm/.dwm.old/patch/swaptags.c deleted file mode 100644 index d2341ef..0000000 --- a/dwm/.dwm.old/patch/swaptags.c +++ /dev/null @@ -1,30 +0,0 @@ -void -swaptags(const Arg *arg) -{ - Client *c; - unsigned int newtag = arg->ui & TAGMASK; - unsigned int curtag = selmon->tagset[selmon->seltags]; - - if (newtag == curtag || !curtag || (curtag & (curtag-1))) - return; - - #if TAGSYNC_PATCH - Monitor *origselmon = selmon; - for (selmon = mons; selmon; selmon = selmon->next) { - #endif // TAGSYNC_PATCH - - for (c = selmon->clients; c != NULL; c = c->next) { - if ((c->tags & newtag) || (c->tags & curtag)) - c->tags ^= curtag ^ newtag; - - if (!c->tags) - c->tags = newtag; - } - - #if TAGSYNC_PATCH - } - selmon = origselmon; - #endif // TAGSYNC_PATCH - - view(&((Arg) { .ui = newtag })); -} diff --git a/dwm/.dwm.old/patch/swaptags.h b/dwm/.dwm.old/patch/swaptags.h deleted file mode 100644 index fdadf3a..0000000 --- a/dwm/.dwm.old/patch/swaptags.h +++ /dev/null @@ -1,2 +0,0 @@ -static void swaptags(const Arg *arg); - diff --git a/dwm/.dwm.old/patch/switchcol.c b/dwm/.dwm.old/patch/switchcol.c deleted file mode 100644 index 6caf8ba..0000000 --- a/dwm/.dwm.old/patch/switchcol.c +++ /dev/null @@ -1,29 +0,0 @@ -void -switchcol(const Arg *arg) -{ - Client *c, *t; - int col = 0; - int i; - - if (!selmon->sel) - return; - for (i = 0, c = nexttiled(selmon->clients); c ; - c = nexttiled(c->next), i++) { - if (c == selmon->sel) - col = (i + 1) > selmon->nmaster; - } - if (i <= selmon->nmaster) - return; - for (c = selmon->stack; c; c = c->snext) { - if (!ISVISIBLE(c)) - continue; - for (i = 0, t = nexttiled(selmon->clients); t && t != c; - t = nexttiled(t->next), i++); - if (t && (i + 1 > selmon->nmaster) != col) { - focus(c); - restack(selmon); - break; - } - } -} - diff --git a/dwm/.dwm.old/patch/switchcol.h b/dwm/.dwm.old/patch/switchcol.h deleted file mode 100644 index 8c7cded..0000000 --- a/dwm/.dwm.old/patch/switchcol.h +++ /dev/null @@ -1,2 +0,0 @@ -static void switchcol(const Arg *arg); - diff --git a/dwm/.dwm.old/patch/tab.c b/dwm/.dwm.old/patch/tab.c deleted file mode 100644 index 30a14d1..0000000 --- a/dwm/.dwm.old/patch/tab.c +++ /dev/null @@ -1,133 +0,0 @@ -static int th = 0; /* tab bar geometry */ - -void -drawtabs(void) -{ - Monitor *m; - - for (m = mons; m; m = m->next) - drawtab(m); -} - -static int -cmpint(const void *p1, const void *p2) -{ - /* The actual arguments to this function are "pointers to - pointers to char", but strcmp(3) arguments are "pointers - to char", hence the following cast plus dereference */ - return *((int*) p1) > * (int*) p2; -} - -void -drawtab(Monitor *m) -{ - Client *c; - int i; - int itag = -1; - char view_info[50]; - int view_info_w = 0; - int sorted_label_widths[MAXTABS]; - int tot_width; - int maxsize = bh; - int x = 0; - int w = 0; - - // view_info: indicate the tag which is displayed in the view - for (i = 0; i < NUMTAGS; ++i) { - if ((selmon->tagset[selmon->seltags] >> i) & 1) { - if (itag >=0) { // more than one tag selected - itag = -1; - break; - } - itag = i; - } - } - - if (0 <= itag && itag < NUMTAGS) { - snprintf(view_info, sizeof view_info, "[%s]", tagicon(m, itag)); - } else { - strncpy(view_info, "[...]", sizeof view_info); - } - view_info[sizeof(view_info) - 1 ] = 0; - view_info_w = TEXTW(view_info); - tot_width = view_info_w; - - /* Calculates number of labels and their width */ - m->ntabs = 0; - for (c = m->clients; c; c = c->next) { - if (!ISVISIBLE(c) || HIDDEN(c)) - continue; - m->tab_widths[m->ntabs] = TEXTW(c->name); - tot_width += m->tab_widths[m->ntabs]; - ++m->ntabs; - if (m->ntabs >= MAXTABS) - break; - } - - if (tot_width > m->ww) { // not enough space to display the labels, they need to be truncated - memcpy(sorted_label_widths, m->tab_widths, sizeof(int) * m->ntabs); - qsort(sorted_label_widths, m->ntabs, sizeof(int), cmpint); - tot_width = view_info_w; - for (i = 0; i < m->ntabs; ++i) { - if (tot_width + (m->ntabs - i) * sorted_label_widths[i] > m->ww) - break; - tot_width += sorted_label_widths[i]; - } - maxsize = (m->ww - tot_width) / (m->ntabs - i); - } else { - maxsize = m->ww; - } - i = 0; - for (c = m->clients; c; c = c->next) { - if (!ISVISIBLE(c) || HIDDEN(c)) - continue; - if (i >= m->ntabs) - break; - if (m->tab_widths[i] > maxsize) - m->tab_widths[i] = maxsize; - w = m->tab_widths[i]; - drw_setscheme(drw, scheme[(c == m->sel) ? SchemeSel : SchemeNorm]); - drw_text(drw, x, 0, w, th, 0, c->name, 0, False); - x += w; - ++i; - } - - drw_setscheme(drw, scheme[SchemeNorm]); - - /* cleans interspace between window names and current viewed tag label */ - w = m->ww - view_info_w - x; - drw_text(drw, x, 0, w, th, 0, "", 0, False); - - /* view info */ - x += w; - w = view_info_w; - drw_text(drw, x, 0, w, th, 0, view_info, 0, False); - - drw_map(drw, m->tabwin, 0, 0, m->ww, th); -} - -void -focuswin(const Arg* arg) -{ - int iwin = arg->i; - Client* c = NULL; - for (c = selmon->clients; c && (iwin || !ISVISIBLE(c)) ; c = c->next) { - if (ISVISIBLE(c) && !HIDDEN(c)) - --iwin; - }; - if (c) { - focus(c); - restack(selmon); - } -} - -void -tabmode(const Arg *arg) -{ - if (arg && arg->i >= 0) - selmon->showtab = arg->ui % showtab_nmodes; - else - selmon->showtab = (selmon->showtab + 1 ) % showtab_nmodes; - arrange(selmon); -} - diff --git a/dwm/.dwm.old/patch/tab.h b/dwm/.dwm.old/patch/tab.h deleted file mode 100644 index 44161d7..0000000 --- a/dwm/.dwm.old/patch/tab.h +++ /dev/null @@ -1,5 +0,0 @@ -static void drawtab(Monitor *m); -static void drawtabs(void); -static void focuswin(const Arg* arg); -static void tabmode(const Arg *arg); - diff --git a/dwm/.dwm.old/patch/tagall.c b/dwm/.dwm.old/patch/tagall.c deleted file mode 100644 index 7abe7cc..0000000 --- a/dwm/.dwm.old/patch/tagall.c +++ /dev/null @@ -1,26 +0,0 @@ -void -tagall(const Arg *arg) -{ - if (!selmon->clients) - return; - /* if parameter starts with F, just move floating windows */ - int floating_only = (char *)arg->v && ((char *)arg->v)[0] == 'F' ? 1 : 0; - int tag = (char *)arg->v ? atoi(((char *)arg->v) + floating_only) : 0; - int j; - Client* c; - if (tag >= 0 && tag < NUMTAGS) - for (c = selmon->clients; c; c = c->next) - { - if (!floating_only || c->isfloating) - for (j = 0; j < NUMTAGS; j++) - { - if (c->tags & 1 << j && selmon->tagset[selmon->seltags] & 1 << j) - { - c->tags = c->tags ^ (1 << j & TAGMASK); - c->tags = c->tags | 1 << (tag-1); - } - } - } - arrange(selmon); -} - diff --git a/dwm/.dwm.old/patch/tagall.h b/dwm/.dwm.old/patch/tagall.h deleted file mode 100644 index f36c9f8..0000000 --- a/dwm/.dwm.old/patch/tagall.h +++ /dev/null @@ -1,2 +0,0 @@ -static void tagall(const Arg *arg); - diff --git a/dwm/.dwm.old/patch/tagallmon.c b/dwm/.dwm.old/patch/tagallmon.c deleted file mode 100644 index d6b879a..0000000 --- a/dwm/.dwm.old/patch/tagallmon.c +++ /dev/null @@ -1,49 +0,0 @@ -void -tagallmon(const Arg *arg) -{ - Monitor *m; - Client *c, *last, *slast, *next; - - if (!mons->next) - return; - - m = dirtomon(arg->i); - for (last = m->clients; last && last->next; last = last->next); - for (slast = m->stack; slast && slast->snext; slast = slast->snext); - - for (c = selmon->clients; c; c = next) { - next = c->next; - if (!ISVISIBLE(c)) - continue; - unfocus(c, 1, NULL); - detach(c); - detachstack(c); - c->mon = m; - c->tags = m->tagset[m->seltags]; /* assign tags of target monitor */ - c->next = NULL; - c->snext = NULL; - if (last) - last = last->next = c; - else - m->clients = last = c; - if (slast) - slast = slast->snext = c; - else - m->stack = slast = c; - if (c->isfullscreen) { - #if !FAKEFULLSCREEN_PATCH && FAKEFULLSCREEN_CLIENT_PATCH - if (c->fakefullscreen != 1) { - resizeclient(c, c->mon->mx, c->mon->my, c->mon->mw, c->mon->mh); - XRaiseWindow(dpy, c->win); - } - #elif !FAKEFULLSCREEN_PATCH - resizeclient(c, c->mon->mx, c->mon->my, c->mon->mw, c->mon->mh); - XRaiseWindow(dpy, c->win); - #endif // FAKEFULLSCREEN_CLIENT_PATCH - } - } - - focus(NULL); - arrange(NULL); -} - diff --git a/dwm/.dwm.old/patch/tagallmon.h b/dwm/.dwm.old/patch/tagallmon.h deleted file mode 100644 index 9abf535..0000000 --- a/dwm/.dwm.old/patch/tagallmon.h +++ /dev/null @@ -1,2 +0,0 @@ -static void tagallmon(const Arg *arg); - diff --git a/dwm/.dwm.old/patch/tagothermonitor.c b/dwm/.dwm.old/patch/tagothermonitor.c deleted file mode 100644 index d12f6ff..0000000 --- a/dwm/.dwm.old/patch/tagothermonitor.c +++ /dev/null @@ -1,44 +0,0 @@ -#if IPC_PATCH || DWMC_PATCH -void -tagnextmonex(const Arg *arg) -{ - tagnextmon(&((Arg) { .ui = 1 << arg->ui })); -} - -void -tagprevmonex(const Arg *arg) -{ - tagprevmon(&((Arg) { .ui = 1 << arg->ui })); -} -#endif // IPC_PATCH | DWMC_PATCH - -void -tagnextmon(const Arg *arg) -{ - tagothermon(arg, 1); -} - -void -tagprevmon(const Arg *arg) -{ - tagothermon(arg, -1); -} - -void -tagothermon(const Arg *arg, int dir) -{ - Client *sel; - Monitor *newmon; - - if (!selmon->sel || !mons->next) - return; - sel = selmon->sel; - newmon = dirtomon(dir); - sendmon(sel, newmon); - if (arg->ui & TAGMASK) { - sel->tags = arg->ui & TAGMASK; - focus(NULL); - arrange(newmon); - } -} - diff --git a/dwm/.dwm.old/patch/tagothermonitor.h b/dwm/.dwm.old/patch/tagothermonitor.h deleted file mode 100644 index 8ebe975..0000000 --- a/dwm/.dwm.old/patch/tagothermonitor.h +++ /dev/null @@ -1,9 +0,0 @@ -#if IPC_PATCH || DWMC_PATCH -static void tagnextmonex(const Arg *arg); -static void tagprevmonex(const Arg *arg); -#endif // IPC_PATCH | DWMC_PATCH - -static void tagnextmon(const Arg *arg); -static void tagprevmon(const Arg *arg); -static void tagothermon(const Arg *arg, int dir); - diff --git a/dwm/.dwm.old/patch/tagswapmon.c b/dwm/.dwm.old/patch/tagswapmon.c deleted file mode 100644 index 4719b8c..0000000 --- a/dwm/.dwm.old/patch/tagswapmon.c +++ /dev/null @@ -1,75 +0,0 @@ -void -tagswapmon(const Arg *arg) -{ - Monitor *m; - Client *c, *sc = NULL, *mc = NULL, *next; - - if (!mons->next) - return; - - m = dirtomon(arg->i); - - for (c = selmon->clients; c; c = next) { - next = c->next; - if (!ISVISIBLE(c)) - continue; - unfocus(c, 1, NULL); - detach(c); - detachstack(c); - c->next = sc; - sc = c; - } - - for (c = m->clients; c; c = next) { - next = c->next; - if (!ISVISIBLE(c)) - continue; - unfocus(c, 1, NULL); - detach(c); - detachstack(c); - c->next = mc; - mc = c; - } - - for (c = sc; c; c = next) { - next = c->next; - c->mon = m; - c->tags = m->tagset[m->seltags]; /* assign tags of target monitor */ - attach(c); - attachstack(c); - if (c->isfullscreen) { - #if !FAKEFULLSCREEN_PATCH && FAKEFULLSCREEN_CLIENT_PATCH - if (c->fakefullscreen != 1) { - resizeclient(c, c->mon->mx, c->mon->my, c->mon->mw, c->mon->mh); - XRaiseWindow(dpy, c->win); - } - #elif !FAKEFULLSCREEN_PATCH - resizeclient(c, c->mon->mx, c->mon->my, c->mon->mw, c->mon->mh); - XRaiseWindow(dpy, c->win); - #endif // FAKEFULLSCREEN_CLIENT_PATCH - } - } - - for (c = mc; c; c = next) { - next = c->next; - c->mon = selmon; - c->tags = selmon->tagset[selmon->seltags]; /* assign tags of target monitor */ - attach(c); - attachstack(c); - if (c->isfullscreen) { - #if !FAKEFULLSCREEN_PATCH && FAKEFULLSCREEN_CLIENT_PATCH - if (c->fakefullscreen != 1) { - resizeclient(c, c->mon->mx, c->mon->my, c->mon->mw, c->mon->mh); - XRaiseWindow(dpy, c->win); - } - #elif !FAKEFULLSCREEN_PATCH - resizeclient(c, c->mon->mx, c->mon->my, c->mon->mw, c->mon->mh); - XRaiseWindow(dpy, c->win); - #endif // FAKEFULLSCREEN_CLIENT_PATCH - } - } - - focus(NULL); - arrange(NULL); -} - diff --git a/dwm/.dwm.old/patch/tagswapmon.h b/dwm/.dwm.old/patch/tagswapmon.h deleted file mode 100644 index 949f591..0000000 --- a/dwm/.dwm.old/patch/tagswapmon.h +++ /dev/null @@ -1,2 +0,0 @@ -static void tagswapmon(const Arg *arg); - diff --git a/dwm/.dwm.old/patch/tapresize.c b/dwm/.dwm.old/patch/tapresize.c deleted file mode 100644 index c236b5d..0000000 --- a/dwm/.dwm.old/patch/tapresize.c +++ /dev/null @@ -1,39 +0,0 @@ -void -resizemousescroll(const Arg *arg) -{ - int nw, nh; - Client *c; - Monitor *m; - XEvent ev; - int dw = *((int*)arg->v + 1); - int dh = *(int*)arg->v; - - if (!(c = selmon->sel)) - return; - if (c->isfullscreen) /* no support resizing fullscreen windows by mouse */ - return; - restack(selmon); - if (XGrabPointer(dpy, root, False, MOUSEMASK, GrabModeAsync, GrabModeAsync, - None, cursor[CurResize]->cursor, CurrentTime) != GrabSuccess) - return; - nw = MAX(c->w + dw, 1); - nh = MAX(c->h + dh, 1); - if (c->mon->wx + nw >= selmon->wx && c->mon->wx + nw <= selmon->wx + selmon->ww - && c->mon->wy + nh >= selmon->wy && c->mon->wy + nh <= selmon->wy + selmon->wh) - { - if (!c->isfloating && selmon->lt[selmon->sellt]->arrange - && (abs(nw - c->w) > snap || abs(nh - c->h) > snap)) - togglefloating(NULL); - } - if (!selmon->lt[selmon->sellt]->arrange || c->isfloating) - resize(c, c->x, c->y, nw, nh, 1); - XWarpPointer(dpy, None, c->win, 0, 0, 0, 0, c->w + c->bw - 1, c->h + c->bw - 1); - XUngrabPointer(dpy, CurrentTime); - while (XCheckMaskEvent(dpy, EnterWindowMask, &ev)); - if ((m = recttomon(c->x, c->y, c->w, c->h)) != selmon) { - sendmon(c, m); - selmon = m; - focus(NULL); - } -} - diff --git a/dwm/.dwm.old/patch/tapresize.h b/dwm/.dwm.old/patch/tapresize.h deleted file mode 100644 index fe6d227..0000000 --- a/dwm/.dwm.old/patch/tapresize.h +++ /dev/null @@ -1,2 +0,0 @@ -static void resizemousescroll(const Arg *arg); - diff --git a/dwm/.dwm.old/patch/togglefullscreen.c b/dwm/.dwm.old/patch/togglefullscreen.c deleted file mode 100644 index 18857f5..0000000 --- a/dwm/.dwm.old/patch/togglefullscreen.c +++ /dev/null @@ -1,18 +0,0 @@ -void -togglefullscreen(const Arg *arg) -{ - Client *c = selmon->sel; - if (!c) - return; - - #if FAKEFULLSCREEN_CLIENT_PATCH && !FAKEFULLSCREEN_PATCH - if (c->fakefullscreen == 1) { // fake fullscreen --> fullscreen - c->fakefullscreen = 2; - setfullscreen(c, 1); - } else - setfullscreen(c, !c->isfullscreen); - #else - setfullscreen(c, !c->isfullscreen); - #endif // FAKEFULLSCREEN_CLIENT_PATCH -} - diff --git a/dwm/.dwm.old/patch/togglefullscreen.h b/dwm/.dwm.old/patch/togglefullscreen.h deleted file mode 100644 index 96a6770..0000000 --- a/dwm/.dwm.old/patch/togglefullscreen.h +++ /dev/null @@ -1,2 +0,0 @@ -static void togglefullscreen(const Arg *arg); - diff --git a/dwm/.dwm.old/patch/transfer.c b/dwm/.dwm.old/patch/transfer.c deleted file mode 100644 index ce64319..0000000 --- a/dwm/.dwm.old/patch/transfer.c +++ /dev/null @@ -1,34 +0,0 @@ -void -transfer(const Arg *arg) -{ - Client *c, *mtail = selmon->clients, *stail = NULL, *insertafter; - int transfertostack = 0, i, nmasterclients; - - for (i = 0, c = selmon->clients; c; c = c->next) { - if (!ISVISIBLE(c) || c->isfloating) continue; - if (selmon->sel == c) { transfertostack = i < selmon->nmaster && selmon->nmaster != 0; } - if (i < selmon->nmaster) { nmasterclients++; mtail = c; } - stail = c; - i++; - } - if (!selmon->sel || selmon->sel->isfloating || i == 0) { - return; - } else if (transfertostack) { - selmon->nmaster = MIN(i, selmon->nmaster) - 1; - insertafter = stail; - } else { - selmon->nmaster = selmon->nmaster + 1; - insertafter = mtail; - } - if (insertafter != selmon->sel) { - detach(selmon->sel); - if (selmon->nmaster == 1 && !transfertostack) { - attach(selmon->sel); // Head prepend case - } else { - selmon->sel->next = insertafter->next; - insertafter->next = selmon->sel; - } - } - arrange(selmon); -} - diff --git a/dwm/.dwm.old/patch/transfer.h b/dwm/.dwm.old/patch/transfer.h deleted file mode 100644 index e887dae..0000000 --- a/dwm/.dwm.old/patch/transfer.h +++ /dev/null @@ -1,2 +0,0 @@ -static void transfer(const Arg *arg); - diff --git a/dwm/.dwm.old/patch/transferall.c b/dwm/.dwm.old/patch/transferall.c deleted file mode 100644 index ee823b1..0000000 --- a/dwm/.dwm.old/patch/transferall.c +++ /dev/null @@ -1,26 +0,0 @@ -void -transferall(const Arg *arg) -{ - Client *c, *n = selmon->clients, *attachfrom = NULL; - int i = 0, nstackclients = 0; - while (n) { - c = n; - n = c->next; - if (!ISVISIBLE(c) || c->isfloating) continue; - if (i >= selmon->nmaster) { - detach(c); - if (!attachfrom) { - attach(c); - } else { - c->next = attachfrom->next; - attachfrom->next = c; - } - attachfrom = c; - nstackclients++; - } - i++; - } - selmon->nmaster = nstackclients; - arrange(selmon); -} - diff --git a/dwm/.dwm.old/patch/transferall.h b/dwm/.dwm.old/patch/transferall.h deleted file mode 100644 index a424ec8..0000000 --- a/dwm/.dwm.old/patch/transferall.h +++ /dev/null @@ -1,2 +0,0 @@ -static void transferall(const Arg *arg); - diff --git a/dwm/.dwm.old/patch/unfloatvisible.c b/dwm/.dwm.old/patch/unfloatvisible.c deleted file mode 100644 index fb8888f..0000000 --- a/dwm/.dwm.old/patch/unfloatvisible.c +++ /dev/null @@ -1,15 +0,0 @@ -void -unfloatvisible(const Arg *arg) -{ - Client *c; - - for (c = selmon->clients; c; c = c->next) - if (ISVISIBLE(c) && c->isfloating) - c->isfloating = c->isfixed; - - if (arg && arg->v) - setlayout(arg); - else - arrange(selmon); -} - diff --git a/dwm/.dwm.old/patch/unfloatvisible.h b/dwm/.dwm.old/patch/unfloatvisible.h deleted file mode 100644 index f15bc66..0000000 --- a/dwm/.dwm.old/patch/unfloatvisible.h +++ /dev/null @@ -1,2 +0,0 @@ -static void unfloatvisible(const Arg *arg); - diff --git a/dwm/.dwm.old/patch/vanitygaps.c b/dwm/.dwm.old/patch/vanitygaps.c deleted file mode 100644 index 303d4df..0000000 --- a/dwm/.dwm.old/patch/vanitygaps.c +++ /dev/null @@ -1,213 +0,0 @@ -/* Settings */ -#if !PERTAG_VANITYGAPS_PATCH -static int enablegaps = 1; -#endif // PERTAG_VANITYGAPS_PATCH - -static void -setgaps(int oh, int ov, int ih, int iv) -{ - if (oh < 0) oh = 0; - if (ov < 0) ov = 0; - if (ih < 0) ih = 0; - if (iv < 0) iv = 0; - - selmon->gappoh = oh; - selmon->gappov = ov; - selmon->gappih = ih; - selmon->gappiv = iv; - - #if PERTAG_VANITYGAPS_PATCH && PERTAG_PATCH - selmon->pertag->gaps[selmon->pertag->curtag] = - ((oh & 0xFF) << 0) | ((ov & 0xFF) << 8) | ((ih & 0xFF) << 16) | ((iv & 0xFF) << 24); - #endif // PERTAG_VANITYGAPS_PATCH - - arrange(selmon); -} - -#if IPC_PATCH || DWMC_PATCH -/* External function that takes one integer and splits it - * into four gap values: - * - outer horizontal (oh) - * - outer vertical (ov) - * - inner horizontal (ih) - * - inner vertical (iv) - * - * Each value is represented as one byte with the uppermost - * bit of each byte indicating whether or not to keep the - * current value. - * - * Example: - * - * 10000000 10000000 00001111 00001111 - * | | | | - * + keep oh + keep ov + ih 15px + iv 15px - * - * This gives an int of: - * 10000000100000000000111100001111 = 2155876111 - * - * Thus this command should set inner gaps to 15: - * xsetroot -name "fsignal:setgaps i 2155876111" - */ -static void -setgapsex(const Arg *arg) -{ - int oh = selmon->gappoh; - int ov = selmon->gappov; - int ih = selmon->gappih; - int iv = selmon->gappiv; - - if (!(arg->i & (1 << 31))) - oh = (arg->i & 0x7f000000) >> 24; - if (!(arg->i & (1 << 23))) - ov = (arg->i & 0x7f0000) >> 16; - if (!(arg->i & (1 << 15))) - ih = (arg->i & 0x7f00) >> 8; - if (!(arg->i & (1 << 7))) - iv = (arg->i & 0x7f); - - /* Auto enable gaps if disabled */ - #if PERTAG_VANITYGAPS_PATCH && PERTAG_PATCH - if (!selmon->pertag->enablegaps[selmon->pertag->curtag]) - selmon->pertag->enablegaps[selmon->pertag->curtag] = 1; - #else - if (!enablegaps) - enablegaps = 1; - #endif // PERTAG_VANITYGAPS_PATCH - - setgaps(oh, ov, ih, iv); -} -#endif // IPC_PATCH | DWMC_PATCH - -static void -togglegaps(const Arg *arg) -{ - #if PERTAG_VANITYGAPS_PATCH && PERTAG_PATCH - selmon->pertag->enablegaps[selmon->pertag->curtag] = !selmon->pertag->enablegaps[selmon->pertag->curtag]; - #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 - #if PERTAG_VANITYGAPS_PATCH && PERTAG_PATCH - arrange(selmon); - #else - arrange(NULL); - #endif // PERTAG_VANITYGAPS_PATCH -} - -static void -defaultgaps(const Arg *arg) -{ - setgaps(gappoh, gappov, gappih, gappiv); -} - -static void -incrgaps(const Arg *arg) -{ - setgaps( - selmon->gappoh + arg->i, - selmon->gappov + arg->i, - selmon->gappih + arg->i, - selmon->gappiv + arg->i - ); -} - -static void -incrigaps(const Arg *arg) -{ - setgaps( - selmon->gappoh, - selmon->gappov, - selmon->gappih + arg->i, - selmon->gappiv + arg->i - ); -} - -static void -incrogaps(const Arg *arg) -{ - setgaps( - selmon->gappoh + arg->i, - selmon->gappov + arg->i, - selmon->gappih, - selmon->gappiv - ); -} - -static void -incrohgaps(const Arg *arg) -{ - setgaps( - selmon->gappoh + arg->i, - selmon->gappov, - selmon->gappih, - selmon->gappiv - ); -} - -static void -incrovgaps(const Arg *arg) -{ - setgaps( - selmon->gappoh, - selmon->gappov + arg->i, - selmon->gappih, - selmon->gappiv - ); -} - -static void -incrihgaps(const Arg *arg) -{ - setgaps( - selmon->gappoh, - selmon->gappov, - selmon->gappih + arg->i, - selmon->gappiv - ); -} - -static void -incrivgaps(const Arg *arg) -{ - setgaps( - selmon->gappoh, - selmon->gappov, - selmon->gappih, - selmon->gappiv + arg->i - ); -} - -#if DRAGMFACT_PATCH || CENTEREDMASTER_LAYOUT || CENTEREDFLOATINGMASTER_LAYOUT || COLUMNS_LAYOUT || DECK_LAYOUT || FIBONACCI_DWINDLE_LAYOUT || FIBONACCI_SPIRAL_LAYOUT || GAPPLESSGRID_LAYOUT || NROWGRID_LAYOUT || HORIZGRID_LAYOUT || BSTACK_LAYOUT || BSTACKHORIZ_LAYOUT || GRIDMODE_LAYOUT || FLEXTILE_DELUXE_LAYOUT || TILE_LAYOUT || (VANITYGAPS_MONOCLE_PATCH && MONOCLE_LAYOUT) -static void -getgaps(Monitor *m, int *oh, int *ov, int *ih, int *iv, unsigned int *nc) -{ - unsigned int n, oe, ie; - #if PERTAG_VANITYGAPS_PATCH && PERTAG_PATCH - oe = ie = m->pertag->enablegaps[m->pertag->curtag]; - #else - oe = ie = enablegaps; - #endif // PERTAG_VANITYGAPS_PATCH - Client *c; - - for (n = 0, c = nexttiled(m->clients); c; c = nexttiled(c->next), n++); - if (n == 1) { - oe *= smartgaps_fact; // outer gaps disabled or multiplied when only one client - } - - *oh = m->gappoh*oe; // outer horizontal gap - *ov = m->gappov*oe; // outer vertical gap - *ih = m->gappih*ie; // inner horizontal gap - *iv = m->gappiv*ie; // inner vertical gap - *nc = n; // number of clients -} -#endif - diff --git a/dwm/.dwm.old/patch/vanitygaps.h b/dwm/.dwm.old/patch/vanitygaps.h deleted file mode 100644 index b8f2109..0000000 --- a/dwm/.dwm.old/patch/vanitygaps.h +++ /dev/null @@ -1,20 +0,0 @@ -/* Key binding functions */ -static void defaultgaps(const Arg *arg); -static void incrgaps(const Arg *arg); -static void incrigaps(const Arg *arg); -static void incrogaps(const Arg *arg); -static void incrohgaps(const Arg *arg); -static void incrovgaps(const Arg *arg); -static void incrihgaps(const Arg *arg); -static void incrivgaps(const Arg *arg); -static void togglegaps(const Arg *arg); - -/* Internals */ -#if DRAGMFACT_PATCH || CENTEREDMASTER_LAYOUT || CENTEREDFLOATINGMASTER_LAYOUT || COLUMNS_LAYOUT || DECK_LAYOUT || FIBONACCI_DWINDLE_LAYOUT || FIBONACCI_SPIRAL_LAYOUT || GAPPLESSGRID_LAYOUT || NROWGRID_LAYOUT || HORIZGRID_LAYOUT || BSTACK_LAYOUT || BSTACKHORIZ_LAYOUT || GRIDMODE_LAYOUT || FLEXTILE_DELUXE_LAYOUT || TILE_LAYOUT || (VANITYGAPS_MONOCLE_PATCH && MONOCLE_LAYOUT) -static void getgaps(Monitor *m, int *oh, int *ov, int *ih, int *iv, unsigned int *nc); -#endif -static void setgaps(int oh, int ov, int ih, int iv); -#if IPC_PATCH || DWMC_PATCH -static void setgapsex(const Arg *arg); -#endif // IPC_PATCH | DWMC_PATCH - diff --git a/dwm/.dwm.old/patch/warp.c b/dwm/.dwm.old/patch/warp.c deleted file mode 100644 index 16f1605..0000000 --- a/dwm/.dwm.old/patch/warp.c +++ /dev/null @@ -1,38 +0,0 @@ -void -warp(const Client *c) -{ - Monitor *m; - Bar *bar; - int x, y; - - if (ignore_warp) - return; - - if (!c) { - XWarpPointer(dpy, None, root, 0, 0, 0, 0, selmon->wx + selmon->ww / 2, selmon->wy + selmon->wh / 2); - return; - } - - if (!getrootptr(&x, &y)) - return; - - if (!force_warp && - (x > c->x - c->bw && - y > c->y - c->bw && - x < c->x + c->w + c->bw*2 && - y < c->y + c->h + c->bw*2)) - return; - - force_warp = 0; - - for (m = mons; m; m = m->next) - for (bar = m->bar; bar; bar = bar->next) - if (x > bar->bx && - x < bar->bx + bar->bw && - y > bar->by && - y < bar->by + bar->bh) - return; - - XWarpPointer(dpy, None, c->win, 0, 0, 0, 0, c->w / 2, c->h / 2); -} - diff --git a/dwm/.dwm.old/patch/warp.h b/dwm/.dwm.old/patch/warp.h deleted file mode 100644 index d79d75f..0000000 --- a/dwm/.dwm.old/patch/warp.h +++ /dev/null @@ -1,2 +0,0 @@ -static void warp(const Client *c); - diff --git a/dwm/.dwm.old/patch/winview.c b/dwm/.dwm.old/patch/winview.c deleted file mode 100644 index f54c20c..0000000 --- a/dwm/.dwm.old/patch/winview.c +++ /dev/null @@ -1,21 +0,0 @@ -/* Selects for the view of the focused window. The list of tags */ -/* to be displayed is matched to the focused window tag list. */ -void -winview(const Arg* arg) -{ - Window win, win_r, win_p, *win_c; - unsigned nc; - int unused; - Client* c; - Arg a; - - if (!XGetInputFocus(dpy, &win, &unused)) return; - while (XQueryTree(dpy, win, &win_r, &win_p, &win_c, &nc) - && win_p != win_r) win = win_p; - - if (!(c = wintoclient(win))) return; - - a.ui = c->tags; - view(&a); -} - diff --git a/dwm/.dwm.old/patch/winview.h b/dwm/.dwm.old/patch/winview.h deleted file mode 100644 index 9c2ec97..0000000 --- a/dwm/.dwm.old/patch/winview.h +++ /dev/null @@ -1,2 +0,0 @@ -static void winview(const Arg* arg); - diff --git a/dwm/.dwm.old/patch/xkb.c b/dwm/.dwm.old/patch/xkb.c deleted file mode 100644 index d779733..0000000 --- a/dwm/.dwm.old/patch/xkb.c +++ /dev/null @@ -1,68 +0,0 @@ -static XkbInfo xkbGlobal; -static XkbInfo *xkbSaved = NULL; - -static XkbInfo * -createxkb(Window w) -{ - XkbInfo *xkb; - - xkb = malloc(sizeof *xkb); - if (xkb == NULL) - die("fatal: could not malloc() %u bytes\n", sizeof *xkb); - xkb->group = xkbGlobal.group; - xkb->w = w; - xkb->next = xkbSaved; - if (xkbSaved != NULL) - xkbSaved->prev = xkb; - xkb->prev = NULL; - xkbSaved = xkb; - - return xkb; -} - -XkbInfo * -findxkb(Window w) -{ - XkbInfo *xkb; - for (xkb = xkbSaved; xkb != NULL; xkb = xkb->next) - if (xkb->w == w) - return xkb; - return NULL; -} - -void -xkbeventnotify(XEvent *e) -{ - XkbEvent *ev; - - ev = (XkbEvent *) e; - switch (ev->any.xkb_type) { - case XkbStateNotify: - xkbGlobal.group = ev->state.locked_group; - if (selmon != NULL && selmon->sel != NULL) - selmon->sel->xkb->group = xkbGlobal.group; - drawbars(); - break; - } -} - -/* xkb bar module */ -int -width_xkb(Bar *bar, BarArg *a) -{ - return TEXTW(xkb_layouts[xkbGlobal.group]); -} - -int -draw_xkb(Bar *bar, BarArg *a) -{ - drw_text(drw, a->x, a->y, a->w, a->h, lrpad / 2, xkb_layouts[xkbGlobal.group], 0, False); - return 1; -} - -int -click_xkb(Bar *bar, Arg *arg, BarArg *a) -{ - return ClkXKB; -} - diff --git a/dwm/.dwm.old/patch/xkb.h b/dwm/.dwm.old/patch/xkb.h deleted file mode 100644 index 2c6d33a..0000000 --- a/dwm/.dwm.old/patch/xkb.h +++ /dev/null @@ -1,8 +0,0 @@ -static XkbInfo *createxkb(Window w); -static XkbInfo *findxkb(Window w); -static void xkbeventnotify(XEvent *e); - -static int width_xkb(Bar *bar, BarArg *a); -static int draw_xkb(Bar *bar, BarArg *a); -static int click_xkb(Bar *bar, Arg *arg, BarArg *a); - diff --git a/dwm/.dwm.old/patch/xrdb.c b/dwm/.dwm.old/patch/xrdb.c deleted file mode 100644 index aa32854..0000000 --- a/dwm/.dwm.old/patch/xrdb.c +++ /dev/null @@ -1,138 +0,0 @@ -void -loadxrdb() -{ - Display *display; - char * resm; - XrmDatabase xrdb; - char *type; - XrmValue value; - - display = XOpenDisplay(NULL); - - if (display != NULL) { - resm = XResourceManagerString(display); - - if (resm != NULL) { - xrdb = XrmGetStringDatabase(resm); - - if (xrdb != NULL) { - XRDB_LOAD_COLOR("dwm.normfgcolor", normfgcolor); - XRDB_LOAD_COLOR("dwm.normbgcolor", normbgcolor); - XRDB_LOAD_COLOR("dwm.normbordercolor", normbordercolor); - XRDB_LOAD_COLOR("dwm.normfloatcolor", normfloatcolor); - XRDB_LOAD_COLOR("dwm.selfgcolor", selfgcolor); - XRDB_LOAD_COLOR("dwm.selbgcolor", selbgcolor); - XRDB_LOAD_COLOR("dwm.selbordercolor", selbordercolor); - XRDB_LOAD_COLOR("dwm.selfloatcolor", selfloatcolor); - XRDB_LOAD_COLOR("dwm.titlenormfgcolor", titlenormfgcolor); - XRDB_LOAD_COLOR("dwm.titlenormbgcolor", titlenormbgcolor); - XRDB_LOAD_COLOR("dwm.titlenormbordercolor", titlenormbordercolor); - XRDB_LOAD_COLOR("dwm.titlenormfloatcolor", titlenormfloatcolor); - XRDB_LOAD_COLOR("dwm.titleselfgcolor", titleselfgcolor); - XRDB_LOAD_COLOR("dwm.titleselbgcolor", titleselbgcolor); - XRDB_LOAD_COLOR("dwm.titleselbordercolor", titleselbordercolor); - XRDB_LOAD_COLOR("dwm.titleselfloatcolor", titleselfloatcolor); - XRDB_LOAD_COLOR("dwm.tagsnormfgcolor", tagsnormfgcolor); - XRDB_LOAD_COLOR("dwm.tagsnormbgcolor", tagsnormbgcolor); - XRDB_LOAD_COLOR("dwm.tagsnormbordercolor", tagsnormbordercolor); - XRDB_LOAD_COLOR("dwm.tagsnormfloatcolor", tagsnormfloatcolor); - XRDB_LOAD_COLOR("dwm.tagsselfgcolor", tagsselfgcolor); - XRDB_LOAD_COLOR("dwm.tagsselbgcolor", tagsselbgcolor); - XRDB_LOAD_COLOR("dwm.tagsselbordercolor", tagsselbordercolor); - XRDB_LOAD_COLOR("dwm.tagsselfloatcolor", tagsselfloatcolor); - XRDB_LOAD_COLOR("dwm.hidnormfgcolor", hidnormfgcolor); - XRDB_LOAD_COLOR("dwm.hidnormbgcolor", hidnormbgcolor); - XRDB_LOAD_COLOR("dwm.hidselfgcolor", hidselfgcolor); - XRDB_LOAD_COLOR("dwm.hidselbgcolor", hidselbgcolor); - XRDB_LOAD_COLOR("dwm.urgfgcolor", urgfgcolor); - XRDB_LOAD_COLOR("dwm.urgbgcolor", urgbgcolor); - XRDB_LOAD_COLOR("dwm.urgbordercolor", urgbordercolor); - XRDB_LOAD_COLOR("dwm.urgfloatcolor", urgfloatcolor); - #if RENAMED_SCRATCHPADS_PATCH - XRDB_LOAD_COLOR("dwm.scratchselfgcolor", scratchselfgcolor); - XRDB_LOAD_COLOR("dwm.scratchselbgcolor", scratchselbgcolor); - XRDB_LOAD_COLOR("dwm.scratchselbordercolor", scratchselbordercolor); - XRDB_LOAD_COLOR("dwm.scratchselfloatcolor", scratchselfloatcolor); - XRDB_LOAD_COLOR("dwm.scratchnormfgcolor", scratchnormfgcolor); - XRDB_LOAD_COLOR("dwm.scratchnormbgcolor", scratchnormbgcolor); - XRDB_LOAD_COLOR("dwm.scratchnormbordercolor", scratchnormbordercolor); - XRDB_LOAD_COLOR("dwm.scratchnormfloatcolor", scratchnormfloatcolor); - #endif // RENAMED_SCRATCHPADS_PATCH - #if BAR_FLEXWINTITLE_PATCH - XRDB_LOAD_COLOR("dwm.normTTBbgcolor", normTTBbgcolor); - XRDB_LOAD_COLOR("dwm.normLTRbgcolor", normLTRbgcolor); - XRDB_LOAD_COLOR("dwm.normMONObgcolor", normMONObgcolor); - XRDB_LOAD_COLOR("dwm.normGRIDbgcolor", normGRIDbgcolor); - XRDB_LOAD_COLOR("dwm.normGRD1bgcolor", normGRD1bgcolor); - XRDB_LOAD_COLOR("dwm.normGRD2bgcolor", normGRD2bgcolor); - XRDB_LOAD_COLOR("dwm.normGRDMbgcolor", normGRDMbgcolor); - XRDB_LOAD_COLOR("dwm.normHGRDbgcolor", normHGRDbgcolor); - XRDB_LOAD_COLOR("dwm.normDWDLbgcolor", normDWDLbgcolor); - XRDB_LOAD_COLOR("dwm.normSPRLbgcolor", normSPRLbgcolor); - XRDB_LOAD_COLOR("dwm.normfloatbgcolor", normfloatbgcolor); - XRDB_LOAD_COLOR("dwm.actTTBbgcolor", actTTBbgcolor); - XRDB_LOAD_COLOR("dwm.actLTRbgcolor", actLTRbgcolor); - XRDB_LOAD_COLOR("dwm.actMONObgcolor", actMONObgcolor); - XRDB_LOAD_COLOR("dwm.actGRIDbgcolor", actGRIDbgcolor); - XRDB_LOAD_COLOR("dwm.actGRD1bgcolor", actGRD1bgcolor); - XRDB_LOAD_COLOR("dwm.actGRD2bgcolor", actGRD2bgcolor); - XRDB_LOAD_COLOR("dwm.actGRDMbgcolor", actGRDMbgcolor); - XRDB_LOAD_COLOR("dwm.actHGRDbgcolor", actHGRDbgcolor); - XRDB_LOAD_COLOR("dwm.actDWDLbgcolor", actDWDLbgcolor); - XRDB_LOAD_COLOR("dwm.actSPRLbgcolor", actSPRLbgcolor); - XRDB_LOAD_COLOR("dwm.actfloatbgcolor", actfloatbgcolor); - XRDB_LOAD_COLOR("dwm.selTTBbgcolor", selTTBbgcolor); - XRDB_LOAD_COLOR("dwm.selLTRbgcolor", selLTRbgcolor); - XRDB_LOAD_COLOR("dwm.selMONObgcolor", selMONObgcolor); - XRDB_LOAD_COLOR("dwm.selGRIDbgcolor", selGRIDbgcolor); - XRDB_LOAD_COLOR("dwm.selGRD1bgcolor", selGRD1bgcolor); - XRDB_LOAD_COLOR("dwm.selGRD2bgcolor", selGRD2bgcolor); - XRDB_LOAD_COLOR("dwm.selGRDMbgcolor", selGRDMbgcolor); - XRDB_LOAD_COLOR("dwm.selHGRDbgcolor", selHGRDbgcolor); - XRDB_LOAD_COLOR("dwm.selDWDLbgcolor", selDWDLbgcolor); - XRDB_LOAD_COLOR("dwm.selSPRLbgcolor", selSPRLbgcolor); - XRDB_LOAD_COLOR("dwm.selfloatbgcolor", selfloatbgcolor); - #endif // BAR_FLEXWINTITLE_PATCH - #if BAR_STATUS2D_XRDB_TERMCOLORS_PATCH && BAR_STATUS2D_PATCH - XRDB_LOAD_COLOR("color0", termcol0); - XRDB_LOAD_COLOR("color1", termcol1); - XRDB_LOAD_COLOR("color2", termcol2); - XRDB_LOAD_COLOR("color3", termcol3); - XRDB_LOAD_COLOR("color4", termcol4); - XRDB_LOAD_COLOR("color5", termcol5); - XRDB_LOAD_COLOR("color6", termcol6); - XRDB_LOAD_COLOR("color7", termcol7); - XRDB_LOAD_COLOR("color8", termcol8); - XRDB_LOAD_COLOR("color9", termcol9); - XRDB_LOAD_COLOR("color10", termcol10); - XRDB_LOAD_COLOR("color11", termcol11); - XRDB_LOAD_COLOR("color12", termcol12); - XRDB_LOAD_COLOR("color13", termcol13); - XRDB_LOAD_COLOR("color14", termcol14); - XRDB_LOAD_COLOR("color15", termcol15); - #endif // BAR_STATUS2D_XRDB_TERMCOLORS_PATCH - - XrmDestroyDatabase(xrdb); - } - } - } - - XCloseDisplay(display); -} - -void -xrdb(const Arg *arg) -{ - loadxrdb(); - int i; - for (i = 0; i < LENGTH(colors); i++) - scheme[i] = drw_scm_create(drw, colors[i], - #if BAR_ALPHA_PATCH - alphas[i], - #endif // BAR_ALPHA_PATCH - ColCount - ); - focus(NULL); - arrange(NULL); -} - diff --git a/dwm/.dwm.old/patch/xrdb.h b/dwm/.dwm.old/patch/xrdb.h deleted file mode 100644 index 3787bec..0000000 --- a/dwm/.dwm.old/patch/xrdb.h +++ /dev/null @@ -1,22 +0,0 @@ -#include - -#define XRDB_LOAD_COLOR(R,V) if (XrmGetResource(xrdb, R, NULL, &type, &value) == True) { \ - if (value.addr != NULL && strnlen(value.addr, 8) == 7 && value.addr[0] == '#') { \ - int i = 1; \ - for (; i <= 6; i++) { \ - if (value.addr[i] < 48) break; \ - if (value.addr[i] > 57 && value.addr[i] < 65) break; \ - if (value.addr[i] > 70 && value.addr[i] < 97) break; \ - if (value.addr[i] > 102) break; \ - } \ - if (i == 7) { \ - strncpy(V, value.addr, 7); \ - V[7] = '\0'; \ - } \ - } \ - } - -static void loadxrdb(void); -static void xrdb(const Arg *arg); - - diff --git a/dwm/.dwm.old/patch/zoomswap.c b/dwm/.dwm.old/patch/zoomswap.c deleted file mode 100644 index 58ee9d4..0000000 --- a/dwm/.dwm.old/patch/zoomswap.c +++ /dev/null @@ -1,14 +0,0 @@ - -#if !PERTAG_PATCH -static Client *prevzoom = NULL; -#endif // PERTAG_PATCH - -Client * -findbefore(Client *c) { - Client *p; - if (!c || c == c->mon->clients) - return NULL; - for (p = c->mon->clients; p && p->next != c; p = p->next); - return p; -} - diff --git a/dwm/.dwm.old/patch/zoomswap.h b/dwm/.dwm.old/patch/zoomswap.h deleted file mode 100644 index 22c752a..0000000 --- a/dwm/.dwm.old/patch/zoomswap.h +++ /dev/null @@ -1,2 +0,0 @@ -static Client *findbefore(Client *c); - diff --git a/dwm/.dwm.old/patches.def.h b/dwm/.dwm.old/patches.def.h deleted file mode 100644 index f06399e..0000000 --- a/dwm/.dwm.old/patches.def.h +++ /dev/null @@ -1,1453 +0,0 @@ -/* - * This file contains patch control flags. - * - * In principle you should be able to mix and match any patches - * you may want. In cases where patches are logically incompatible - * one patch may take precedence over the other as noted in the - * relevant descriptions. - * - * Although layouts typically come as patches they are differentiated - * here for grouping purposes. - */ - -/** - * Bar modules - */ - -/* Enhanced taskbar that shows the titles of all visible windows in the status bar - * and allows focus / hiding / unhiding of windows by clicking on the status bar. - * Awesomebar takes precedence over fancybar. - * https://dwm.suckless.org/patches/awesomebar/ - */ -#define BAR_AWESOMEBAR_PATCH 1 - -/* This patch depends on statuscmd patch and adds integration with a (patched) - * dwmblocks instance to give a clickable status bar. One must not necessarily - * have to use dwmblocks for this feature, any status updater that has support - * for real-time signals (SIGRTMIN) can be used. - * - * dwmblocks: https://github.com/torrinfail/dwmblocks - * https://dwm.suckless.org/patches/statuscmd/ - */ -#define BAR_DWMBLOCKS_PATCH 0 - -/* Originally the dwmblocks + statuscmd patch used a user defined signal (SIGUSR1) - * for communicating with dwmblocks to indicate update signal and what button was - * pressed. The signalling was later changed to SIGRTMIN instead. - * - * Ultimately this makes dwmblocks instances that were patched with the old patch - * are incompatible with the new dwm patch and vice versa. - * - * This is a compatibility patch that makes dwm use SIGUSR1 instead of SIGRTMIN so - * if button clicks are not working then you may want to try enabling this. - * - * If dwmblocks happen to die like this when clicking on a status - * - * [1] 54355 user-defined signal 1 dwmblocks - * - * then it suggests that dwmblocks does not support user defined signals and this - * patch should be left disabled. - * - * Patch: https://gist.github.com/danbyl/54f7c1d57fc6507242a95b71c3d8fdea - * https://dwm.suckless.org/patches/statuscmd/ - */ -#define BAR_DWMBLOCKS_SIGUSR1_PATCH 0 - -/* This patch shows the titles of all visible windows in the status bar - * (as opposed to showing only the selected one). - * Awesomebar takes precedence over fancybar. Fancybar takes precedence over - * the centeredwindowname patch. - * https://dwm.suckless.org/patches/fancybar/ - */ -#define BAR_FANCYBAR_PATCH 0 - -/* Being an evolution of the bartabgroups patch the flexwintitle patch specifically - * taps into the many layout options that flextile-deluxe offers to produce a window - * title section in the bar that is representative of what is shown on screen. - */ -#define BAR_FLEXWINTITLE_PATCH 0 - -/* This patch adds a context menu for layout switching. - * - xmenu needs to be installed. - * - Edit layoutmenu.sh with the installed layouts and with correct indexes. - * - Place layoutmenu.sh in PATH. - * - The text of the menu items is for display only. Name them however you want. - * https://dwm.suckless.org/patches/layoutmenu/ - */ -#define BAR_LAYOUTMENU_PATCH 0 - -/* Show layout symbol in bar */ -#define BAR_LTSYMBOL_PATCH 1 - -/* Adds powerline arrows for the status. - * This uses statuscolors logic for choosing colors for the powerline. As these markers - * are also control characters there is no explicit statuscmd support for this patch. - * - * Powerline separators are defined as: - * |\xXX (creates a hard edge) - * <\xXX (creates a less than arrow) - * /\xXX (creates a diagonal line) - * - * Examples: - * xsetroot -name "$(echo -e '<\x01a<\x02b<\x03c')" - * xsetroot -name "$(echo -e '/\x01d/\x02e/\x03f')" - * - * https://gitlab.com/udiboy1209-suckless/dwm/-/commit/071f5063e8ac4280666828179f92788d893eea40#4b1a539194be7467cefbda22f675a3b7c19ceca7 - * https://dwm.suckless.org/patches/statuscolors/ - */ -#define BAR_POWERLINE_STATUS_PATCH 0 - -/* Adds powerline arrows for the tags. - * https://gitlab.com/udiboy1209-suckless/dwm/-/commit/071f5063e8ac4280666828179f92788d893eea40#4b1a539194be7467cefbda22f675a3b7c19ceca7 - */ -#define BAR_POWERLINE_TAGS_PATCH 0 - -/* Alters the tags powerline to use forward slash instead of arrows */ -#define BAR_POWERLINE_TAGS_SLASH_PATCH 0 - -/* This patch turns the titlebar area into a mfact-respecting tabbar showing each client's title. - * https://dwm.suckless.org/patches/bartabgroups/ - */ -#define BAR_TABGROUPS_PATCH 0 - -/* This patch adds an option to place tags in rows like in many other window managers. - * https://dwm.suckless.org/patches/taggrid/ - */ -#define BAR_TAGGRID_PATCH 0 - -/* Hover tag icons to see a preview of the windows on that tag. - * - * The patch depends on Imlib2 for icon scaling. - * You need to uncomment the corresponding line in config.mk to use the -lImlib2 library - * - * Arch Linux: - * sudo pacman -S imlib2 - * Debian: - * sudo apt install libimlib2-dev - * - * As with the winicon patch you may want to consider adding the compiler flags of -O3 and - * -march=native to enable auto loop vectorize for better performance. - * - * https://dwm.suckless.org/patches/tag-previews/ - */ -#define BAR_TAGPREVIEW_PATCH 0 - -/* Show status in bar */ -#define BAR_STATUS_PATCH 1 - -/* This patch adds a clickable button to the left hand side of the statusbar. - * https://dwm.suckless.org/patches/statusbutton/ - */ -#define BAR_STATUSBUTTON_PATCH 0 - -/* This patch adds the ability to execute shell commands based on the mouse button and position - * when clicking the status bar. Refer to the website for usage. - * https://dwm.suckless.org/patches/statuscmd/ - */ -#define BAR_STATUSCMD_PATCH 0 - -/* Status2d allows colors and rectangle drawing in your dwm status bar. - * This patch is incompatible with the statuscolors patch which takes precedence. - * This patch is incompatible with the extrabar patch. - * https://dwm.suckless.org/patches/status2d/ - */ -#define BAR_STATUS2D_PATCH 1 - -/* Supplementary patch should you want to disable alpha for the status2d section */ -#define BAR_STATUS2D_NO_ALPHA_PATCH 0 - -/* Addition to the status2d patch that allows the use of terminal colors (color0 through color15) - * from xrdb in the status, allowing programs like pywal to change statusbar colors. - * This adds the C and B codes to use terminal foreground and background colors respectively. - * E.g. ^B5^ would use color5 as the background color. - * https://dwm.suckless.org/patches/status2d/ - */ -#define BAR_STATUS2D_XRDB_TERMCOLORS_PATCH 0 - -/* The systray patch adds systray for the status bar. - * https://dwm.suckless.org/patches/systray/ - */ -#define BAR_SYSTRAY_PATCH 1 - -/* Show tag symbols in the bar. */ -#define BAR_TAGS_PATCH 1 - -/* Show tag symbols + class of master window in the bar. - * https://dwm.suckless.org/patches/taglabels/ - */ -#define BAR_TAGLABELS_PATCH 0 - -/* This patch underlines the selected tag, or optionally all tags. - * https://dwm.suckless.org/patches/underlinetags/ - */ -#define BAR_UNDERLINETAGS_PATCH 1 - -/* This patch adds the window icon next to the window title in the bar. - * - * The patch depends on Imlib2 for icon scaling. - * You need to uncomment the corresponding line in config.mk to use the -lImlib2 library - * - * Arch Linux: - * sudo pacman -S imlib2 - * Debian: - * sudo apt install libimlib2-dev - * - * The author recommends adding the compiler flags of -O3 and -march=native to enable auto loop - * vectorize for better performance. - * - * https://github.com/AdamYuan/dwm-winicon - * https://dwm.suckless.org/patches/winicon - */ -#define BAR_WINICON_PATCH 0 - -/* Show window title in bar */ -#define BAR_WINTITLE_PATCH 1 - -/* Shows window titles in the bar, but only for floating clients. - * This depends on code from the flexwintitle patch. - * Note that the configuration in config.def.h for this is merely an example. If combined - * with the corresponding hidden patch then these two will overlap unless the width of the - * modules are controlled. - */ -#define BAR_WINTITLE_FLOATING_PATCH 0 - -/* Shows window titles in the bar, but only for floating clients. - * This depends on code from the flexwintitle patch. - * Note that the configuration in config.def.h for this is merely an example. If combined - * with the corresponding floating patch then these two will overlap unless the width of the - * modules are controlled. - */ -#define BAR_WINTITLE_HIDDEN_PATCH 0 - -/* Title bar modules such as wintitle (default), fancybar and awesomebar - * do not by default add left and/or right padding as they take up the - * remaining space. These options allow you explicitly add padding should - * you need it. - */ -#define BAR_TITLE_RIGHT_PAD_PATCH 0 -#define BAR_TITLE_LEFT_PAD_PATCH 0 - -/** - * Bar options - */ - -/* This patch changes the rectangle indicating if a tag is used by a client into a bar - * above the tag name for better visibility. - * Set the tagindicatortype variable in config.h to INDICATOR_TOP_BAR to enable this. - * https://dwm.suckless.org/patches/activetagindicatorbar/ - */ -#define BAR_ACTIVETAGINDICATORBAR_PATCH N/A - -/* Alternative patch to the activetagindicatorbar patch, adds the bar below the tag - * icon rather than above. - * Set the tagindicatortype variable in config.h to INDICATOR_BOTTOM_BAR to enable this. - */ -#define BAR_ACTIVETAGINDICATORBAR_ALT1_PATCH N/A - -/* The alpha patch adds transparency for the status bar. - * You need to uncomment the corresponding line in config.mk to use the -lXrender library - * when including this patch. - * https://dwm.suckless.org/patches/alpha/ - */ -#define BAR_ALPHA_PATCH 0 - -/* This patch introduces alternative tags which can be switched on the fly for the - * sole purpose of providing visual aid. - * https://dwm.suckless.org/patches/alternativetags/ - */ -#define BAR_ALTERNATIVE_TAGS_PATCH 0 - -/* This patches provides the ability to use alternative text for tags which contain at - * least one window. - * https://dwm.suckless.org/patches/alttagsdecoration/ - */ -#define BAR_ALTTAGSDECORATION_PATCH 0 - -/* This patch 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. - * - * NB: Unless you want both anybar + dwm bar(s) then the recommendation is to disable all - * bar modules and have { -2 } in the barrules. - * - * https://dwm.suckless.org/patches/anybar/ - */ -#define BAR_ANYBAR_PATCH 0 - -/* Anybar option to place the next bar depending on previous bar's position (top or bottom) */ -#define BAR_ANYBAR_TOP_AND_BOTTOM_BARS_PATCH 0 - -/* Anybar option to let dwm manage the width of the bar */ -#define BAR_ANYBAR_MANAGE_WIDTH_PATCH 0 - -/* This patch adds a border around the status bar(s) just like the border of client windows. - * https://codemadness.org/paste/dwm-border-bar.patch - */ -#define BAR_BORDER_PATCH 0 - -/* This patch centers the WM_NAME of the currently selected window on the status bar. - * This is compatible with the wintitle, bartabgroups, flexwintitle and awesomebar bar - * modules. - * https://dwm.suckless.org/patches/centeredwindowname/ - */ -#define BAR_CENTEREDWINDOWNAME_PATCH 1 - -/* Draws a dot indicator overlayed on each tag icon for each client. The selected client - * is drawn as a larger horizontal line. - * Set the tagindicatortype variable in config.h to INDICATOR_CLIENT_DOTS to enable this. - * https://dwm.suckless.org/patches/clientindicators/ - */ -#define BAR_CLIENTINDICATOR_PATCH N/A - -/* 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://dwm.suckless.org/patches/dmenumatchtop - */ -#define BAR_DMENUMATCHTOP_PATCH 0 - -/* Originally this was the extrabar patch, but as the handling of extra bars is now built-in - * only the splitting of the status by a designated separator remains. As such this has been - * renamed to more accurately reflect what it does - creating an extra status. - * https://dwm.suckless.org/patches/extrabar/ - */ -#define BAR_EXTRASTATUS_PATCH 0 - -/* 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. For example polybar's xworkspaces module. - * - * This patch also includes support for adding the _IS_FLOATING property for floating windows - * allowing for compositors to treat floating windows differently to tiled windows. - * - * E.g. this setting makes picom only render shadows for floating windows: - * - * shadow-exclude = [ "! _IS_FLOATING@:32c = 1" ]; - * - * https://github.com/bakkeby/dwm-flexipatch/issues/50 (_IS_FLOATING patch) - * https://dwm.suckless.org/patches/ewmhtags/ - */ -#define BAR_EWMHTAGS_PATCH 0 - -/* Allows the bar height to be explicitly set rather than being derived from font. - * https://dwm.suckless.org/patches/bar_height/ - */ -#define BAR_HEIGHT_PATCH 1 - -/* This patch prevents dwm from drawing tags with no clients (i.e. vacant) on the bar. - * https://dwm.suckless.org/patches/hide_vacant_tags/ - */ -#define BAR_HIDEVACANTTAGS_PATCH 0 - -/* With this patch dwm's built-in status bar is only shown when HOLDKEY is pressed - * and the bar will now overlay the display. - * http://dwm.suckless.org/patches/holdbar/ - */ -#define BAR_HOLDBAR_PATCH 0 - -/* 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. - * https://groups.google.com/forum/m/#!topic/wmii/7bncCahYIww - * https://docs.google.com/viewer?a=v&pid=forums&srcid=MDAwODA2MTg0MDQyMjE0OTgzMzMBMDQ3ODQzODkyMTU3NTAyMTMxNTYBX2RUMVNtOUtDQUFKATAuMQEBdjI&authuser=0 - */ -#define BAR_IGNORE_XFT_ERRORS_WHEN_DRAWING_TEXT_PATCH 0 - -/* This patch adds back in the workaround for a BadLength error in the Xft library when color - * glyphs are used. This is for systems that do not have an updated version of the Xft library - * (or generally prefer monochrome fonts). - */ -#define BAR_NO_COLOR_EMOJI_PATCH 0 - -/* This patch adds vertical and horizontal space between the statusbar and the edge of the screen. - * https://dwm.suckless.org/patches/barpadding/ - */ -#define BAR_PADDING_PATCH 0 - -/* Same as barpadding patch but specifically tailored for the vanitygaps patch in that the outer - * bar padding is derived from the vanitygaps settings. In addition to this the bar padding is - * toggled in unison when vanitygaps are toggled. Increasing or decreasing gaps during runtime - * will not affect the bar padding. - */ -#define BAR_PADDING_VANITYGAPS_PATCH 1 - -/* This patch adds simple markup for status messages using pango markup. - * This depends on the pango library v1.44 or greater. - * You need to uncomment the corresponding lines in config.mk to use the pango libraries - * when including this patch. - * - * Note that the pango patch does not protect against the BadLength error from Xft - * when color glyphs are used, which means that dwm will crash if color emoji is used. - * - * If you need color emoji then you may want to install this patched library from the AUR: - * https://aur.archlinux.org/packages/libxft-bgra/ - * - * A long term fix for the libXft library is pending approval of this pull request: - * https://gitlab.freedesktop.org/xorg/lib/libxft/-/merge_requests/1 - * - * Also see: - * https://developer.gnome.org/pygtk/stable/pango-markup-language.html - * https://lists.suckless.org/hackers/2004/17285.html - * https://dwm.suckless.org/patches/pango/ - */ -#define BAR_PANGO_PATCH 0 - -/* This patch allows the status text to be fixed to the bar on a specific - * monitor rather than being drawn on the focused monitor. - * The statusallmons patch takes precedence over this patch. - * https://dwm.suckless.org/patches/staticstatus/ - */ -#define BAR_STATICSTATUS_PATCH 0 - -/* This patch draws and updates the statusbar on all monitors. - * https://dwm.suckless.org/patches/statusallmons/ - */ -#define BAR_STATUSALLMONS_PATCH 1 - -/* This patch enables colored text in the status bar. It changes the way colors are defined - * in config.h allowing multiple color combinations for use in the status script. - * This patch is incompatible with and takes precedence over the status2d patch. - * - * This patch is compatible with the statuscmd patch with the caveat that the first 16 markers - * are reserved for status colors restricting block signals to 17 through 31. - * - * https://dwm.suckless.org/patches/statuscolors/ - */ -#define BAR_STATUSCOLORS_PATCH 0 - -/* This patch adds configuration options for horizontal and vertical padding in the status bar. - * https://dwm.suckless.org/patches/statuspadding/ - */ -#define BAR_STATUSPADDING_PATCH 0 - -/* This patch adds the ability for dwm to read colors from the linux virtual console. - * /sys/module/vt/parameters/default_{red,grn,blu} - * Essentially this way the colors you use in your regular tty is "mirrored" to dwm. - * https://dwm.suckless.org/patches/vtcolors/ - */ -#define BAR_VTCOLORS_PATCH 0 - -/* This patch allows client windows to be hidden. This code was originally part of awesomebar, - * but has been separated out so that other bar modules can take advantage of it. - * Both awesomebar and bartabgroups patches depend on this patch and it will be auto-enabled - * during compile time if it is needed. Note that if using flexipatch-finalizer this must be - * explicitly enabled. - * https://github.com/bakkeby/patches/blob/master/dwm/dwm-barmodules-wintitleactions-6.2.diff - */ -#define BAR_WINTITLEACTIONS_PATCH BAR_AWESOMEBAR_PATCH || BAR_TABGROUPS_PATCH || BAR_FLEXWINTITLE_PATCH - -/*** - * Other patches - */ - -/* Adds a window task switcher toggled using alt-tab. - * https://dwm.suckless.org/patches/alt-tab/ - */ -#define ALT_TAB_PATCH 1 - -/* All floating windows are centered, like the center patch, but without a rule. - * The center patch takes precedence over this patch. - * This patch interferes with the center transient windows patches. - * https://dwm.suckless.org/patches/alwayscenter/ - */ -#define ALWAYSCENTER_PATCH 0 - -/* This patch allows windows to be resized with its aspect ratio remaining constant. - * https://dwm.suckless.org/patches/aspectresize/ - */ -#define ASPECTRESIZE_PATCH 0 - -/* This patch adds new clients above the selected client, instead of always - * becoming the new master. This behaviour is known from Xmonad. - * This patch takes precedence over ATTACHASIDE_PATCH. - * https://dwm.suckless.org/patches/attachabove/ - */ -#define ATTACHABOVE_PATCH 0 - -/* This patch adds new clients on top of the stack. - * This patch takes precedence over ATTACHBELOW_PATCH. - * https://dwm.suckless.org/patches/attachaside/ - */ -#define ATTACHASIDE_PATCH 1 - -/* This patch adds new clients below the selected client. - * This patch takes precedence over ATTACHBOTTOM_PATCH. - * https://dwm.suckless.org/patches/attachbelow/ - */ -#define ATTACHBELOW_PATCH 1 - -/* This patch adds new clients at the bottom of the stack. - * https://dwm.suckless.org/patches/attachbottom/ - */ -#define ATTACHBOTTOM_PATCH 0 - -/* This patch will make dwm run "~/.local/share/dwm/autostart_blocking.sh" and - * "~/.local/share/dwm/autostart.sh &" before entering the handler loop. One or - * both of these files can be ommited. Note the path inside .local/share rather - * than the original ~/.dwm folder. - * https://dwm.suckless.org/patches/autostart/ - */ -#define AUTOSTART_PATCH 0 - -/* By default, windows that are not visible when requesting a resize/move will not - * get resized/moved. With this patch, they will. - * https://dwm.suckless.org/patches/autoresize/ - */ -#define AUTORESIZE_PATCH 0 - -/* This patch adds proper support for Right-To-Left languages. (such as Farsi, Arabic or Hebrew). - * - * You need to uncomment the corresponding lines in config.mk to use the -lfribidi library - * when including this patch. - * - * This patch depends on the following additional library: - * - fribidi - * - * https://dwm.suckless.org/patches/bidi/ - */ -#define BIDI_PATCH 0 - -/* This patch adds an iscentered rule to automatically center clients on the current monitor. - * This patch takes precedence over centeredwindowname, alwayscenter and fancybar patches. - * https://dwm.suckless.org/patches/center/ - */ -#define CENTER_PATCH 1 - -/* A transient window is one that is meant to be short lived and is usually raised by a - * parent window. Such windows are typically dialog boxes and the like. - * It should be noted that in dwm transient windows are not subject to normal client rules - * and they are always floating by default. - * This patch centers transient windows on the screen like the center patch does. Note that - * the 6.2 center patch piggy-backed on the updatewindowtype function to ensure that all - * dialog boxes were centered, transient or not. This function was removed in relation to - * adding wintype as a client rule filter, hence this no longer works out of the box. This - * patch restores previous behaviour with the center patch. - */ -#define CENTER_TRANSIENT_WINDOWS_PATCH 0 - -/* As above, except that the transient window is centered within the position of the parent - * window, rather than at the center of the screen. This takes precedence over the above patch. - */ -#define CENTER_TRANSIENT_WINDOWS_BY_PARENT_PATCH 0 - -/* This patch provides the ability to assign different weights to clients in their - * respective stack in tiled layout. - * https://dwm.suckless.org/patches/cfacts/ - */ -#define CFACTS_PATCH 0 - -/* This patch allows color attributes to be set through the command line. - * https://dwm.suckless.org/patches/cmdcustomize/ - */ -#define CMDCUSTOMIZE_PATCH 0 - -/* This patch tweaks the tagging interface so that you can select multiple tags for tag - * or view by pressing all the right keys as a combo. For example to view tags 1 and 3, - * hold MOD and then press and hold 1 and 3 together. - * https://dwm.suckless.org/patches/combo/ - */ -#define COMBO_PATCH 0 - -/* Allow dwm to execute commands from autostart array in your config.h file. When dwm exits - * then all processes from autostart array will be killed. - * https://dwm.suckless.org/patches/cool_autostart/ - */ -#define COOL_AUTOSTART_PATCH 0 - -/* The cyclelayouts patch lets you cycle through all your layouts. - * https://dwm.suckless.org/patches/cyclelayouts/ - */ -#define CYCLELAYOUTS_PATCH 1 - -/* 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/decoration_hints/ - */ -#define DECORATION_HINTS_PATCH 1 - -/* This feature distributes all clients on the current monitor evenly across all tags. - * It is a variant of the reorganizetags patch. - * https://dwm.suckless.org/patches/reorganizetags/ - */ -#define DISTRIBUTETAGS_PATCH 0 - -/* Similarly to the dragmfact patch this allows you to click and drag clients to change the - * cfact to adjust the client's size in the stack. This patch depends on the cfacts patch. - */ -#define DRAGCFACT_PATCH 0 - -/* This patch lets you resize the split in the tile layout (i.e. modify mfact) by holding - * the modkey and dragging the mouse. - * This patch can be a bit wonky with other layouts, but generally works. - * https://dwm.suckless.org/patches/dragmfact/ - */ -#define DRAGMFACT_PATCH 0 - -/* Simple dwmc client using a fork of fsignal to communicate with dwm. - * To use this either copy the patch/dwmc shell script to somewhere in your path or - * uncomment the following line in Makefile: - * #cp -f patch/dwmc ${DESTDIR}${PREFIX}/bin - * http://dwm.suckless.org/patches/dwmc/ - */ -#define DWMC_PATCH 0 - -/* This patch allows no tag at all to be selected. The result is that dwm will start with - * no tag selected and when you start a client with no tag rule and no tag selected then - * it will be opened on the first tag. - * https://dwm.suckless.org/patches/emptyview/ - */ -#define EMPTYVIEW_PATCH 0 - -/* 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/exresize/ - */ -#define EXRESIZE_PATCH 0 - -/* 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. - * This patch takes precedence over the fakefullscreen client patch below. - * https://dwm.suckless.org/patches/fakefullscreen/ - */ -#define FAKEFULLSCREEN_PATCH 0 - -/* Similarly to the fakefullscreen patch this patch only allows clients to "fullscreen" into - * the space currently given to them. - * The "twist" with this patch is that fake fullscreen can be toggled on a per client basis - * rather than applying to all clients globally. - * Also see the selectivefakefullscreen option that adds a rule option to enabled this on client - * startup. - */ -#define FAKEFULLSCREEN_CLIENT_PATCH 1 - -/* This patch adds a float rule allowing the size and position of floating windows to be specified - * It also allows the size and position of floating windows to be controlled similar to the - * exresize, moveresize, and moveplace patches. - * The size and position can be specified using absolute, relative or fixed co-ordinates and - * https://github.com/bakkeby/patches/wiki/floatpos/ - */ -#define FLOATPOS_PATCH 0 - -/* Add-on functionality for the above: make the float positions respect outer (vanity)gaps. */ -#define FLOATPOS_RESPECT_GAPS_PATCH 0 - -/* This patch 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. - * http://dwm.suckless.org/patches/focusadjacenttag/ - */ -#define FOCUSADJACENTTAG_PATCH 0 - -/* Allows focusing on clients based on direction (up, down, left, right) instead of client order. - * https://github.com/bakkeby/patches/wiki/focusdir/ - */ -#define FOCUSDIR_PATCH 0 - -/* A simple patch that just puts focus back to the master client. - * https://dwm.suckless.org/patches/focusmaster/ - */ -#define FOCUSMASTER_PATCH 0 - -/* Switch focus only by mouse click and not sloppy (focus follows mouse pointer). - * https://dwm.suckless.org/patches/focusonclick/ - */ -#define FOCUSONCLICK_PATCH 0 - -/* Selects the next window having the urgent flag regardless of the tag it is on. - * The urgent flag can be artificially set with the following xdotool command on any window: - * xdotool selectwindow -- set_window --urgency 1 - * https://dwm.suckless.org/patches/focusurgent/ - */ -#define FOCUSURGENT_PATCH 0 - -/* 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/focusonnetactive/ - */ -#define FOCUSONNETACTIVE_PATCH 0 - -/* Send "fake signals" to dwm for handling, using xsetroot. This will not conflict with the - * status bar, which also is managed using xsetroot. - * Also see the dwmc patch, which takes precedence over this patch. - * https://dwm.suckless.org/patches/fsignal/ - */ -#define FSIGNAL_PATCH 0 - -/* 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/fullscreen/ - */ -#define FULLSCREEN_PATCH 1 - -/* This patch provides a keybinding to rotate all clients in the currently selected - * area (master or stack) without affecting the other area. - * https://dwm.suckless.org/patches/inplacerotate/ - */ -#define INPLACEROTATE_PATCH 0 - -/* This patch lets you define custom insets from each edge of the screen. One use case would be - * to arrange space for an external bar. - * https://dwm.suckless.org/patches/insets/ - */ -#define INSETS_PATCH 0 - -/* This patch (v1.5.7) implements inter-process communication through a UNIX socket for dwm. This - * 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. - * - * You need to uncomment the corresponding lines in config.mk to use the -lyajl library - * when including this patch. - * This patch depends on the following additional library: - * - yajl - * - * https://github.com/mihirlad55/dwm-ipc - * https://dwm.suckless.org/patches/ipc/ - */ -#define IPC_PATCH 0 - -/* Adds rule option for clients to avoid accidental termination by killclient for sticky windows. - * https://dwm.suckless.org/patches/ispermanent/ - */ -#define ISPERMANENT_PATCH 0 - -/* This patch adds key modes (like in vim or emacs) where chains of keyboard shortcuts - * can be performed. - * https://dwm.suckless.org/patches/keymodes/ - */ -#define KEYMODES_PATCH 0 - -/* This patch adds a keybinding to kills all visible clients that are not selected. - * https://dwm.suckless.org/patches/killunsel/ - */ -#define KILLUNSEL_PATCH 0 - -/* This 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. - */ -#define LG3D_PATCH 0 - -/* 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://github.com/bakkeby/patches/blob/master/dwm/dwm-losefullscreen-6.2.diff - */ -#define LOSEFULLSCREEN_PATCH 1 - -/* This patch adds helper functions for maximizing, horizontally and vertically, floating - * windows using keybindings. - * https://dwm.suckless.org/patches/maximize/ - */ -#define MAXIMIZE_PATCH 0 - -/* Control Music Player Daemon via keybinds. - * You need to uncomment the corresponding line in config.mk to use the -lmpdclient library - * when including this patch. - * This patch depends on the following additional library: - * - libmpdclient - * https://dwm.suckless.org/patches/mpdcontrol/ - */ -#define MPDCONTROL_PATCH 0 - -/* 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. E.g. normal vertical split for main monitor and - * horizontal split for the second. - */ -#define MONITOR_RULES_PATCH 0 - -/* Always display the 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/monoclesymbol/ - */ -#define MONOCLESYMBOL_PATCH 0 - -/* Makes a window floating and 1/3rd the height and 1/3rd the width of the screen and is - * positioned in either the center or one of the 8 cardinal directions depending on which - * key is pressed. - * https://dwm.suckless.org/patches/moveplace/ - */ -#define MOVEPLACE_PATCH 0 - -/* This patch allows you to move and resize dwm's clients using keyboard bindings. - * https://dwm.suckless.org/patches/moveresize/ - */ -#define MOVERESIZE_PATCH 0 - -/* This patch allows you to move clients around in the stack and swap them with the master. - * https://dwm.suckless.org/patches/movestack/ - */ -#define MOVESTACK_PATCH 0 - -/* This patch allows you to change the names of tags during runtime. - * - * This is a bespoke version implemented specifically in relation to tagicons, which is integrated - * into dwm-flexipatch. By default it uses dmenu to retrieve the new name, but this can be - * customised via config along with the maximum text length and the format string. - * - * Special behaviour: - * - if more than one tag is selected then the name change applies to all selected tags - * - if tagicons is configured to have unique tags per monitor then the change only applies - * for the current monitor - * - the name change applies to the tag set that is active for the current tag: - * * if used in combination with BAR_ALTTAGSDECORATION_PATCH and there are clients on the - * given tag then the name change only applies to the ALT_TAGS_DECORATION tag set - * * if used in combination with the BAR_ALTERNATIVE_TAGS_PATCH and alternative tags are - * shown then the name change only applies to the ALTERNATIVE_TAGS tag set - * * if used in combination with both then BAR_ALTTAGSDECORATION_PATCH takes precedence - * * otherwise the name change applies to the DEFAULT_TAGS tag set - * - * https://dwm.suckless.org/patches/nametag/ - */ -#define NAMETAG_PATCH 0 - -/* Variant of the above which prepends the tag number to the given string. - * The toggle does nothing on its own and need to be enabled in combination with the above. */ -#define NAMETAG_PREPEND_PATCH 0 - -/* Adds support for the _NET_CLIENT_LIST_STACKING atom, needed by certain applications like the - * Zoom video conferencing application. - * https://github.com/bakkeby/patches/wiki/netclientliststacking/ - */ -#define NET_CLIENT_LIST_STACKING_PATCH 0 - -/* Removes the border when there is only one window visible. - * https://dwm.suckless.org/patches/noborder/ - */ -#define NOBORDER_PATCH 1 - -/* Enable modifying or removing dmenu in config.def.h which resulted previously in a - * compilation error because two lines of code hardcode dmenu into dwm. - * https://dwm.suckless.org/patches/nodmenu/ - */ -#define NODMENU_PATCH 0 - -/* This patch 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. This can be practical if you have extra buttons on your mouse. - * While you can use button bindings with no modifiers without this patch in a bare dwm, - * those buttons are then unavailable for use within the application itself so being able to - * toggle these on and off can be necessary in certain situations (e.g. being able to use - * back and forward buttons in a browser). - - * Example bindings: - * { ClkClientWin, 0, Button8, movemouse, {0} }, - * { ClkClientWin, 0, Button9, resizemouse, {0} }, - */ -#define NO_MOD_BUTTONS_PATCH 0 - -/* 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/szatanjl/dwm/commit/1529909466206016f2101457bbf37c67195714c8 - * https://dwm.suckless.org/patches/alpha/dwm-fixborders-6.2.diff - */ -#define NO_TRANSPARENT_BORDERS_PATCH 0 - -/* Port of InstantWM's on_empty_keys functionality allowing keybindings that apply only when - * a tag is empty. An example use case is being able to launch applications with first hand - * keys like "f" to launch firefox. - * - * https://github.com/instantOS/instantWM/ - * https://github.com/bakkeby/dwm-flexipatch/issues/51 - */ -#define ON_EMPTY_KEYS_PATCH 0 - -/* Minor patch that prevents more than one rule being matched for a given client. */ -#define ONLY_ONE_RULE_MATCH_PATCH 0 - -/* This patch makes it so dwm will only exit via quit() if no windows are open. - * This is to prevent you accidentally losing all your work. - * https://dwm.suckless.org/patches/onlyquitonempty/ - */ -#define ONLYQUITONEMPTY_PATCH 0 - -/* The pertag patch adds nmaster, mfacts and layouts per tag rather than per - * monitor (default). - * https://dwm.suckless.org/patches/pertag/ - */ -#define PERTAG_PATCH 0 - -/* Option to enable gaps on a per tag basis rather than globally. - * Depends on both pertag and vanitygaps patches being enabled. - */ -#define PERTAG_VANITYGAPS_PATCH 0 - -/* This controls whether or not to also store bar position on a per - * tag basis, or leave it as one bar per monitor. - */ -#define PERTAGBAR_PATCH 0 - -/* This patch lets you change the position of a client in the stack using the mouse. - * https://github.com/bakkeby/patches/wiki/placemouse - */ -#define PLACEMOUSE_PATCH 0 - -/* This patch provides a way to move clients up and down inside the client list. - * https://dwm.suckless.org/patches/push/ - */ -#define PUSH_PATCH 0 - -/* This patch provides a way to move clients up and down inside the client list, - * but does not push up or down into the master area (except that it does not take - * nmaster into account). - * This takes precedence over the push patch above. - * https://dwm.suckless.org/patches/push/ - */ -#define PUSH_NO_MASTER_PATCH 0 - -/* Variant of the named scratchpads patch allowing scratch keys to be added or removed - * on demand, allowing multiple scratchpad windows to be toggled into and out of view - * in unison, as well as including multi-monitor support. - * - * https://github.com/bakkeby/patches/wiki/renamedscratchpads - */ -#define RENAMED_SCRATCHPADS_PATCH 0 - -/* Renamed scratchpads option to auto-hide scratchpads when moving to a different tag. - * This behaviour is similar to that of the (multiple) scratchpads patch. */ -#define RENAMED_SCRATCHPADS_AUTO_HIDE_PATCH 0 - -/* Shifts all clients per tag to leftmost unoccupied tags. - * - * For example, if clients A, B, C are tagged on tags 1, 5, 9 respectively, when - * this function is called, they will now be on 1, 2, and 3. The focused client - * will also remain focused. - * - * Clients on multiple tags will be treated as if they only were only on their - * leftmost tag, and will be reduced to one tag after the operation is complete. - * https://dwm.suckless.org/patches/reorganizetags/ - */ -#define REORGANIZETAGS_PATCH 0 - -/* 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://dwm.suckless.org/patches/resizecorners/ - */ -#define RESIZECORNERS_PATCH 0 - -/* Practically the same as resizecorners, but the cursor does not warp to corners. - * This takes precedence over the resizecorners patch. - * https://github.com/bakkeby/patches/blob/master/dwm/dwm-resizepoint-6.2.diff - */ -#define RESIZEPOINT_PATCH 0 - -/* 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://dwm.suckless.org/patches/restartsig/ - */ -#define RESTARTSIG_PATCH 1 - -/* Adds rio-like drawing to resize the selected client. - * This depends on an external tool slop being installed. - * This patch was backported from instantWM. - * https://github.com/bakkeby/patches/blob/master/dwm/dwm-riodraw-6.2.diff - */ -#define RIODRAW_PATCH 0 - -/* This patch let's you rotate through the stack using keyboard shortcuts. - * https://dwm.suckless.org/patches/rotatestack/ - */ -#define ROTATESTACK_PATCH 0 - -/* This patch adds rounded corners to client windows in dwm. - * You need to uncomment the corresponding line in config.mk to use the -lXext library - * when including this patch. You will also want to set "borderpx = 0;" in your config.h. - * https://github.com/mitchweaver/suckless/blob/master/dwm/patches/mitch-06-rounded_corners-f04cac6d6e39cd9e3fc4fae526e3d1e8df5e34b2.patch - */ -#define ROUNDED_CORNERS_PATCH 0 - -/* This patch 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/save_floats/ - */ -#define SAVEFLOATS_PATCH 0 - -/* The scratchpad patch allows you to spawn or restore floating terminal windows. - * It is typically useful when one need to do some short typing. - * - * Note that this patch changes TAGMASK to make room for special scratchpad tags, - * so ~0 does more than select all tags with this patch. Code that relies on ~0 to - * represent all tags should use ~SPTAGMASK instead. - * - * Upgraded to Christian Tenllado's multiple scratchpad version. - * https://lists.suckless.org/hackers/2004/17205.html - * https://dwm.suckless.org/patches/scratchpads/ - */ -#define SCRATCHPADS_PATCH 1 - -/* Minor alteration of the above allowing clients to keep their size and position when shown */ -#define SCRATCHPADS_KEEP_POSITION_AND_SIZE_PATCH 1 - -/* This alternative patch enables a scratchpad feature in dwm similar to the scratchpad - * feature in i3wm. - * https://github.com/GasparVardanyan/dwm-scratchpad - */ -#define SCRATCHPAD_ALT_1_PATCH 0 - -/* This patch persists some settings across window manager restarts. These include but are not - * limited to: - * - client's assigned tag(s) on which monitor - * - the order of clients - * - nmaster - * - selected layout - * - plus various additions depending on what other patches are used - * - * The above is not persisted across reboots, however. - */ -#define SEAMLESS_RESTART_PATCH 1 - -/* As opposed to the original patch this only adds a rule option allowing fake fullscreen - * to be enabled for applications when they start. This is intended to be used in combination - * with the fakefullscreenclient patch and offers no practical functionality without it. - * https://dwm.suckless.org/patches/selectivefakefullscreen/ - */ -#define SELECTIVEFAKEFULLSCREEN_PATCH 0 - -/* Allows restarting dwm without the dependency of an external script. - * https://dwm.suckless.org/patches/selfrestart/ - */ -#define SELFRESTART_PATCH 0 - -/* This patch allow clients to keep focus when being sent to another monitor. - * https://github.com/bakkeby/patches/blob/master/dwm/dwm-sendmon_keepfocus-6.2.diff - */ -#define SENDMON_KEEPFOCUS_PATCH 0 - -/* This patch allows border pixels to be changed during runtime. - * https://dwm.suckless.org/patches/setborderpx/ - */ -#define SETBORDERPX_PATCH 0 - -/* Combines shifttag and shiftview. Basically moves the window to the next/prev tag and follows it. - * Also see the focusadjacenttag patch. - * https://dwm.suckless.org/patches/shift-tools/ - */ -#define SHIFTBOTH_PATCH 0 - -/* Swaps all the clients on the current tag with all the client on the next/prev tag. - * Depends on the swaptags patch. - * https://dwm.suckless.org/patches/shift-tools/ - */ -#define SHIFTSWAPTAGS_PATCH 0 - -/* Moves the current selected client to the adjacent tag. - * Also see the focusadjacenttag patch. - * https://dwm.suckless.org/patches/shift-tools/ - */ -#define SHIFTTAG_PATCH 0 - -/* Moves the current selected client to the adjacent tag that has at least one client, if none - * then it acts as shifttag. - * https://dwm.suckless.org/patches/shift-tools/ - */ -#define SHIFTTAGCLIENTS_PATCH 0 - -/* This patch adds keybindings for left and right circular shift through tags. - * https://github.com/chau-bao-long/dotfiles/blob/master/suckless/dwm/shiftview.diff - */ -#define SHIFTVIEW_PATCH 0 - -/* This variant of the shiftview patch adds left and right circular shift through tags, - * but skips tags where there are no clients. - */ -#define SHIFTVIEW_CLIENTS_PATCH 0 - -/* This patch makes dwm obey even "soft" sizehints for new clients. Any window - * that requests a specific initial size will be floated and set to that size. - * Unlike with "fixed size" windows, you are able to resize and/or unfloat these - * windows freely - only the initial state is affected. - * This version of the patch is honestly of limited utility since there are many - * clients that will abuse it. - * https://dwm.suckless.org/patches/sizehints/ - */ -#define SIZEHINTS_PATCH 0 - -/* This patch makes dwm obey even "soft" sizehints for new clients. This ruled - * version is essentially the same patch except it obeys the "isfloating" rule - * if it is available in config.h for the given client. - * https://dwm.suckless.org/patches/sizehints/ - */ -#define SIZEHINTS_RULED_PATCH 0 - -/* This patch makes dwm obey even "soft" sizehints for new clients. The isfreesize - * version is similar to the sizehints ruled patch except it allows you to specify - * via client rules which clients this should apply to. Soft sizehints applies by - * default to clients that are not ruled, and will be disabled by default for clients - * that are. - * - * Example client rule enabling soft sizehints: - * - RULE(.wintype = WTYPE "DIALOG", .isfloating = 1, .isfreesize = 1) - * - * https://dwm.suckless.org/patches/sizehints/ - */ -#define SIZEHINTS_ISFREESIZE_PATCH 0 - -/* In a multi-head setup monitor 0 is by default the primary screen, with the left and right - * screen being monitor 1 and 2 respectively. This patch sorts screens left to right (or - * top to bottom in a vertical layout) which aims to address some inconsistencies when it - * comes to focusmon, tagmon and similar functionality. - * https://www.mail-archive.com/hackers@suckless.org/msg09400.html - */ -#define SORTSCREENS_PATCH 0 - -/* Spawns programs from currently focused client's working directory. - * https://dwm.suckless.org/patches/spawn_cwd/ - */ -#define SPAWNCMD_PATCH 0 - -/* This patch provides comprehensive utilities for managing the client stack, providing - * keyboard shortcuts for focusing or placing a client at specific positions in the stack. - * Note that the default keybindings for this patch have been changed in dwm-flexipatch - * due to the many conflicts with other patches. As it provides similar functionality to the - * swapfocus patch it also uses the MOD+s shortcut to focus the previously selected client, - * thus note a conflict between these two patches. - * https://dwm.suckless.org/patches/stacker/ - */ -#define STACKER_PATCH 0 - -/* Steam, and steam windows (games), trigger a ConfigureNotify request every time the window - * gets focus. More so, the configure event passed along from Steam tends to have the wrong - * x and y co-ordinates which can make the window, if floating, jump around the screen. - * - * This patch works around this age-old issue by ignoring the x and y co-ordinates for - * ConfigureNotify requests relating to Steam windows. - * - * https://github.com/bakkeby/patches/wiki/steam - */ -#define STEAM_PATCH 1 - -/* Adds toggleable keyboard shortcut to make a client 'sticky', i.e. visible on all tags. - * https://dwm.suckless.org/patches/sticky/ - */ -#define STICKY_PATCH 0 - -/* 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. - * - * This patch depends on the following additional libraries: - * - libxcb - * - Xlib-libxcb - * - xcb-res - * - * You need to uncomment the corresponding line in config.mk to use the above libraries when - * including this patch. - * - * https://dwm.suckless.org/patches/swallow/ - */ -#define SWALLOW_PATCH 0 - -/* 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/swapfocus/ - */ -#define SWAPFOCUS_PATCH 0 - -/* This patch allows swapping the contents of the currently selected tag with another tag using - * keyboard shortcuts. - * https://dwm.suckless.org/patches/swaptags/ - */ -#define SWAPTAGS_PATCH 0 - -/* Switch focus between the master and stack columns using a single keybinding. - * https://dwm.suckless.org/patches/switchcol/ - */ -#define SWITCHCOL_PATCH 0 - -/* By default dwm allow you to set application specific rules so that you can have your browser, - * for example, start up on tag 9 optionally on a given monitor when you open your browser it is - * then automatically moved to the configured tag, but you have to manually enable the tag to see - * the newly opened application. - * This patch adds an extra configuration option for individual rules where: - * 0 is default behaviour - * 1 automatically moves you to the tag of the newly opened application and - * 2 enables the tag of the newly opened application in addition to your existing enabled tags - * 3 as 1, but closing that window reverts the view back to what it was previously (*) - * 4 as 2, but closing that window reverts the view back to what it was previously (*) - * - * (*) except if the client has been moved between tags or to another monitor - * - * https://github.com/bakkeby/patches/blob/master/dwm/dwm-switchtag-6.2.diff - * Also see https://dwm.suckless.org/patches/switchtotag - */ -#define SWITCHTAG_PATCH 0 - -/* This patch transforms the monocle layout into a "tabbed" layout if more than one window is - * present on the monocle view. This 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/tab/ - */ -#define TAB_PATCH 0 - -/* Adds keyboard shortcuts to move all (or only floating) windows from one tag to another. - * https://dwm.suckless.org/patches/tagall/ - */ -#define TAGALL_PATCH 0 - -/* This patch allows you to move all visible windows on a monitor to an adjacent monitor. - * https://github.com/bakkeby/patches/blob/master/dwm/dwm-tagallmon-6.2.diff - */ -#define TAGALLMON_PATCH 0 - -/* This patch 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. - * The allmaster patch will cause all clients in the master area to be left alone. This patch - * takes precedence over the onemaster tagintostack patch. - * https://dwm.suckless.org/patches/tagintostack/ - */ -#define TAGINTOSTACK_ALLMASTER_PATCH 0 - -/* This patch 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. - * The onemaster patch will cause the first client in the master area to be left alone. - * https://dwm.suckless.org/patches/tagintostack/ - */ -#define TAGINTOSTACK_ONEMASTER_PATCH 0 - -/* If you try to send a fullscreen window to an adjacent monitor using tagmon then - * the window is moved behind the scenes, but it remains in fullscreen on the original - * monitor until you exit fullscreen view (at which point it will appear on the adjacent - * monitor). This patch allows a fullscreen window to be moved to an adjacent monitor - * while remaining in fullscreen. - * https://github.com/bakkeby/patches/blob/master/dwm/dwm-tagmonfixfs-6.2.diff - */ -#define TAGMONFIXFS_PATCH 0 - -/* Add functions and keybindings to tag a window to a desired tag on the next (right) - * or previous (left) monitor from the currently selected monitor. - * https://dwm.suckless.org/patches/tagothermonitor/ - */ -#define TAGOTHERMONITOR_PATCH 0 - -/* This patch allows you to swap all visible windows on one monitor with those of an - * adjacent monitor. - * https://github.com/bakkeby/patches/blob/master/dwm/dwm-tagswapmon-6.2.diff - */ -#define TAGSWAPMON_PATCH 1 - -/* Sync tag actions across all monitors. - * This is comparable to a sort of pseudo-desktop environment. - * Also refer to the desktop patch: - * https://github.com/bakkeby/patches/blob/master/dwm/dwm-desktop-6.3.diff - */ -#define TAGSYNC_PATCH 0 - -/* This patch can be useful to the touchpad users because it allows to - * resize windows using Mod + two-finger scroll. It is useful when - * two-finger scrolling is configured in libinput. - * https://dwm.suckless.org/patches/tapresize/ - */ -#define TAPRESIZE_PATCH 0 - -/* This patch allows you to toggle fullscreen on and off using a single shortcut key. - * https://github.com/bakkeby/patches/blob/master/dwm/dwm-togglefullscreen-6.2.diff - */ -#define TOGGLEFULLSCREEN_PATCH 0 - -/* Minor patch that lets you use the same keyboard shortcut to toggle to the previous layout if the - * designated layout is already active. - * - * This allows you to use e.g. MOD+m to change to the monocle layout and use the same keybinding to - * toggle back to what it was previously. The default behaviour in dwm forces you to use either - * MOD+space or MOD+t to change back to tiled layout. - * - * https://github.com/bakkeby/patches/wiki/togglelayout - */ - -#define TOGGLELAYOUT_PATCH 0 - -/* Minor patch that lets you use the same keyboard shortcut to toggle to the previous tag if the - * designated tag is already active. - * - * This allows you to use e.g. MOD+4 to quickly view the 4th tag and use the same keybinding to - * toggle back to what it was previously. The default behaviour in dwm forces you to use either - * MOD+tab or MOD+1 to change back to the previous tag. - * - * Idea ref. - * https://www.reddit.com/r/suckless/comments/ik27vd/key_toggle_between_next_and_previous_tag_dwm/ - * https://github.com/bakkeby/patches/wiki/toggletag - */ -#define TOGGLETAG_PATCH 0 - -/* 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/ - */ -#define TRANSFER_PATCH 0 - -/* 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/transfer/ - */ -#define TRANSFER_ALL_PATCH 0 - -/* This patch resets isfloating on any visible windows that have it set. - * Optionally also applies a layout. - * https://dwm.suckless.org/patches/unfloatvisible/ - */ -#define UNFLOATVISIBLE_PATCH 0 - -/* This patch adds configurable gaps between windows differentiating between outer, inner, - * horizontal and vertical gaps. - * https://github.com/bakkeby/patches/blob/master/dwm/dwm-vanitygaps-6.2.diff - * https://github.com/bakkeby/patches/blob/master/dwm/dwm-cfacts-vanitygaps-6.2.diff - */ -#define VANITYGAPS_PATCH 1 - -/* This patch adds outer gaps for the monocle layout. - * Most gaps patches tries to avoid gaps on the monocle layout, as it is often used as a - * fullscreen mode, hence this is enabled separately from the main vanitygaps patch. - */ -#define VANITYGAPS_MONOCLE_PATCH 0 - -/* By default MOD+Tab will take the user back to the previous tag only. If the user keeps - * using MOD+Tab then the view will switch back and forth between the current and previous tag. - * This patch allows dwm to keep a longer history of previous tag changes such that MOD+Tab can - * be pressed multiple times to go further back to earlier tag selections. - * - * The number of history elements is defined by the NUMVIEWHIST macro in dwm.c and defaults to - * the number of tags in the system. - */ -#define VIEW_HISTORY_PATCH 0 - -/* Follow a window to the tag it is being moved to. - * https://dwm.suckless.org/patches/viewontag/ - */ -#define VIEWONTAG_PATCH 0 - -/* This patch 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/warp/ - */ -#define WARP_PATCH 0 - -/* 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". - * https://github.com/bakkeby/patches/blob/master/dwm/dwm-windowrolerule-6.2.diff - */ -#define WINDOWROLERULE_PATCH 0 - -/* The winview patch allows switching the view to that of a given client from the all-window - * view (Mod-0) using a keyboard shortcut. - * http://dwm.suckless.org/patches/winview/ - */ -#define WINVIEW_PATCH 0 - -/* Remember keyboard layout per client. - * It is recommended that you configure xkb before using this patch as described in - * https://www.x.org/archive/X11R7.5/doc/input/XKB-Config.html - * https://dwm.suckless.org/patches/xkb/ - */ -#define XKB_PATCH 0 - -/* Allows dwm to read colors from xrdb (.Xresources) during runtime. Compatible with - * the float border color, awesomebar, urgentborder and titlecolor patches. - * https://dwm.suckless.org/patches/xrdb/ - */ -#define XRDB_PATCH 0 - -/* Simple patch that allows floating windows to be zoomed into the master stack position. - * https://www.reddit.com/r/suckless/comments/ie5fe3/zoomfloating_my_own_simple_original_patch/ - */ -#define ZOOMFLOATING_PATCH 0 - -/* The zoomswap patch allows a master and a stack window to swap places - * rather than every window on the screen changing position. - * https://dwm.suckless.org/patches/zoomswap/ - */ -#define ZOOMSWAP_PATCH 0 - -/** - * Layouts - */ - -/* Bottomstack layout. - * https://dwm.suckless.org/patches/bottomstack/ - */ -#define BSTACK_LAYOUT 1 - -/* Bottomstack horizontal layout. - * https://dwm.suckless.org/patches/bottomstack/ - */ -#define BSTACKHORIZ_LAYOUT 0 - -/* Centered master layout. - * https://dwm.suckless.org/patches/centeredmaster/ - */ -#define CENTEREDMASTER_LAYOUT 1 - -/* Centered floating master layout. - * https://dwm.suckless.org/patches/centeredmaster/ - */ -#define CENTEREDFLOATINGMASTER_LAYOUT 0 - -/* Same as the default tile layout except clients in the master area are arranged in - * columns (i.e. left to right). - * https://dwm.suckless.org/patches/columns/ - */ -#define COLUMNS_LAYOUT 0 - -/* Deck layout. - * https://dwm.suckless.org/patches/deck/ - */ -#define DECK_LAYOUT 0 - -/* Fibonacci dwindle layout. - * https://dwm.suckless.org/patches/fibonacci/ - */ -#define FIBONACCI_DWINDLE_LAYOUT 1 - -/* Fibonacci spiral layout. - * https://dwm.suckless.org/patches/fibonacci/ - */ -#define FIBONACCI_SPIRAL_LAYOUT 0 - -/* Flextile deluxe layout. - * A revamped, more flexible, and over-the-top version of the original flextile layout. - * https://dwm.suckless.org/patches/flextile/ (original) - */ -#define FLEXTILE_DELUXE_LAYOUT 0 - -/* Gappless grid layout. - * https://dwm.suckless.org/patches/gaplessgrid/ - */ -#define GAPPLESSGRID_LAYOUT 0 - -/* Gridmode (grid) layout. - * https://dwm.suckless.org/patches/gridmode/ - */ -#define GRIDMODE_LAYOUT 1 - -/* Horizontal grid (horizgrid) layout. - * https://dwm.suckless.org/patches/horizgrid/ - */ -#define HORIZGRID_LAYOUT 0 - -/* Grid layout where nmaster controls the number of rows. - * https://dwm.suckless.org/patches/nrowgrid/ - */ -#define NROWGRID_LAYOUT 0 - -/* The default tile layout. - * This can be optionally disabled in favour of other layouts. - */ -#define TILE_LAYOUT 1 - -/* Monocle layout (default). - * This can be optionally disabled in favour of other layouts. - */ -#define MONOCLE_LAYOUT 1 diff --git a/dwm/.dwm.old/recompile b/dwm/.dwm.old/recompile deleted file mode 100755 index 2793a9a..0000000 --- a/dwm/.dwm.old/recompile +++ /dev/null @@ -1,4 +0,0 @@ -#!/bin/bash - -rm -f ./config.h ./patches.h -sudo make clean install diff --git a/dwm/.dwm.old/transient.c b/dwm/.dwm.old/transient.c deleted file mode 100644 index 158460f..0000000 --- a/dwm/.dwm.old/transient.c +++ /dev/null @@ -1,43 +0,0 @@ -/* cc transient.c -o transient -lX11 */ - -#include -#include -#include -#include - -int main(void) { - Display *d; - Window r, f, t = None; - XSizeHints h; - XEvent e; - - d = XOpenDisplay(NULL); - if (!d) - exit(1); - r = DefaultRootWindow(d); - - f = XCreateSimpleWindow(d, r, 100, 100, 400, 400, 0, 0, 0); - h.min_width = h.max_width = h.min_height = h.max_height = 400; - h.flags = PMinSize | PMaxSize; - XSetWMNormalHints(d, f, &h); - XStoreName(d, f, "floating"); - XMapWindow(d, f); - - XSelectInput(d, f, ExposureMask); - while (1) { - XNextEvent(d, &e); - - if (t == None) { - sleep(5); - t = XCreateSimpleWindow(d, r, 50, 50, 100, 100, 0, 0, 0); - XSetTransientForHint(d, t, f); - XStoreName(d, t, "transient"); - XMapWindow(d, t); - XSelectInput(d, t, ExposureMask); - } - } - - XCloseDisplay(d); - exit(0); -} - diff --git a/dwm/.dwm.old/util.c b/dwm/.dwm.old/util.c deleted file mode 100644 index 96b82c9..0000000 --- a/dwm/.dwm.old/util.c +++ /dev/null @@ -1,36 +0,0 @@ -/* See LICENSE file for copyright and license details. */ -#include -#include -#include -#include - -#include "util.h" - -void -die(const char *fmt, ...) -{ - va_list ap; - - va_start(ap, fmt); - vfprintf(stderr, fmt, ap); - va_end(ap); - - if (fmt[0] && fmt[strlen(fmt)-1] == ':') { - fputc(' ', stderr); - perror(NULL); - } else { - fputc('\n', stderr); - } - - exit(1); -} - -void * -ecalloc(size_t nmemb, size_t size) -{ - void *p; - - if (!(p = calloc(nmemb, size))) - die("calloc:"); - return p; -} diff --git a/dwm/.dwm.old/util.h b/dwm/.dwm.old/util.h deleted file mode 100644 index 1e3cf9a..0000000 --- a/dwm/.dwm.old/util.h +++ /dev/null @@ -1,19 +0,0 @@ -/* See LICENSE file for copyright and license details. */ - -#ifndef MAX -#define MAX(A, B) ((A) > (B) ? (A) : (B)) -#endif -#ifndef MIN -#define MIN(A, B) ((A) < (B) ? (A) : (B)) -#endif -#define BETWEEN(X, A, B) ((A) <= (X) && (X) <= (B)) - -#ifdef _DEBUG -#define DEBUG(...) fprintf(stderr, __VA_ARGS__) -#else -#define DEBUG(...) -#endif - -void die(const char *fmt, ...); -void *ecalloc(size_t nmemb, size_t size); - diff --git a/gtk/.config/gtk-3.0/settings.ini b/gtk/.config/gtk-3.0/settings.ini index e69131d..8f585b8 100644 --- a/gtk/.config/gtk-3.0/settings.ini +++ b/gtk/.config/gtk-3.0/settings.ini @@ -1,8 +1,8 @@ [Settings] -gtk-theme-name=Catppuccin-Macchiato-Standard-Red-Dark -gtk-icon-theme-name=ePapirus-Dark +gtk-theme-name=Catppuccin-Macchiato-Standard-Lavender-Dark +gtk-icon-theme-name=Papirus-Dark gtk-font-name=Cantarell 11 -gtk-cursor-theme-name=Adwaita +gtk-cursor-theme-name=Catppuccin-Macchiato-Blue-Cursors gtk-cursor-theme-size=0 gtk-toolbar-style=GTK_TOOLBAR_BOTH gtk-toolbar-icon-size=GTK_ICON_SIZE_LARGE_TOOLBAR diff --git a/kvantum/.config/Kvantum/Catppuccin-Macchiato-Blue/Catppuccin-Macchiato-Blue.kvconfig b/kvantum/.config/Kvantum/Catppuccin-Macchiato-Blue/Catppuccin-Macchiato-Blue.kvconfig new file mode 100644 index 0000000..818f928 --- /dev/null +++ b/kvantum/.config/Kvantum/Catppuccin-Macchiato-Blue/Catppuccin-Macchiato-Blue.kvconfig @@ -0,0 +1,464 @@ +[%General] +author=elkrien based on Arc Dark style +comment=Catppuccin-Macchiato-Blue +spread_menuitems=true +left_tabs=true +mirror_doc_tabs=true +scroll_width=8 +attach_active_tab=true +composite=true +menu_shadow_depth=7 +tooltip_shadow_depth=0 +splitter_width=7 +check_size=16 +slider_width=4 +slider_handle_width=18 +slider_handle_length=18 +textless_progressbar=false +menubar_mouse_tracking=true +slim_toolbars=false +toolbutton_style=1 +x11drag=menubar_and_primary_toolbar +double_click=false +translucent_windows=false +blurring=false +popup_blurring=true +opaque=kaffeine,kmplayer,subtitlecomposer,kdenlive,vlc,smplayer,smplayer2,avidemux,avidemux2_qt4,avidemux3_qt4,avidemux3_qt5,kamoso,QtCreator,VirtualBox,trojita,dragon,digikam,qmplay2 +group_toolbar_buttons=false +vertical_spin_indicators=false +fill_rubberband=false +spread_progressbar=true +merge_menubar_with_toolbar=true +small_icon_size=16 +large_icon_size=32 +button_icon_size=16 +scroll_arrows=false +iconless_pushbutton=true +toolbar_icon_size=16 +combo_as_lineedit=true +button_contents_shift=false +groupbox_top_label=true +inline_spin_indicators=true +joined_inactive_tabs=false +layout_spacing=2 +submenu_overlap=0 +tooltip_delay=-1 +animate_states=false +transient_scrollbar=true +alt_mnemonic=true +combo_menu=true +layout_margin=4 +no_window_pattern=false +respect_DE=true +scroll_min_extent=36 +scrollable_menu=false +scrollbar_in_view=false +spin_button_width=16 +submenu_delay=250 +tree_branch_line=true +progressbar_thickness=8 +click_behavior=0 +contrast=1.00 +dialog_button_layout=0 +drag_from_buttons=false +hide_combo_checkboxes=false +intensity=1.00 +no_inactiveness=false +reduce_menu_opacity=0 +reduce_window_opacity=10 +saturation=1.00 +shadowless_popup=false +transient_groove=false + +[GeneralColors] +window.color=#24273A +base.color=#1E2030 +alt.base.color=#1E2030 +button.color=#363A4F +light.color=#494D64 +mid.light.color=#494D64 +dark.color=#1E2030 +mid.color=#1E2030 +highlight.color=#8AADF4 +inactive.highlight.color=#8AADF4 +text.color=#CAD3F5 +window.text.color=#CAD3F5 +button.text.color=#CAD3F5 +disabled.text.color=#5B6078 +tooltip.text.color=#CAD3F5 +highlight.text.color=#1E2030 +link.color=#F4DBD6 +link.visited.color=#8AADF4 + +[ItemView] +inherits=PanelButtonCommand +frame.element=itemview +interior.element=itemview +frame=true +interior=true +text.iconspacing=3 +text.toggle.color=#1E2030 + +[RadioButton] +inherits=PanelButtonCommand +frame=false +interior.element=radio + +[CheckBox] +inherits=PanelButtonCommand +frame=false +interior.element=checkbox + +[TreeExpander] +indicator.element=tree +indicator.size=8 + +[ToolTip] +frame.top=4 +frame.right=4 +frame.bottom=4 +frame.left=4 +frame=true + +[PanelButtonCommand] +inherits=PanelButtonCommand +interior.element=button +frame.element=button +text.normal.color=#CAD3F5 +text.focus.color=#CAD3F5 +text.press.color=#1E2030 +text.toggle.color=#1E2030 + +[PanelButtonTool] +inherits=PanelButtonCommand + +[DockTitle] +inherits=PanelButtonCommand +interior=false +frame=false +text.margin.top=5 +text.margin.bottom=5 +text.margin.left=5 +text.margin.right=5 +indicator.size=0 + +[Dock] +interior.element=toolbar +frame.element=toolbar +frame=true +interior=true + +[GroupBox] +inherits=PanelButtonCommand +interior.element=tabframe +interior=true +frame=false + +[Focus] +inherits=PanelButtonCommand +frame=true +frame.element=focus +frame.top=1 +frame.bottom=1 +frame.left=1 +frame.right=1 +frame.patternsize=20 + +[GenericFrame] +inherits=PanelButtonCommand +frame.element=common +frame.top=1 +frame.bottom=1 +frame.left=1 +frame.right=1 + +[Slider] +inherits=PanelButtonCommand +interior=true +frame.element=slider +interior.element=slider +frame.top=3 +frame.bottom=3 +frame.left=3 +frame.right=3 +focusFrame=true + +[SliderCursor] +inherits=PanelButtonCommand +interior=true +interior.element=slidercursor +frame=false + +[LineEdit] +inherits=PanelButtonCommand +frame.element=lineedit +interior.element=lineedit + +[IndicatorSpinBox] +inherits=LineEdit +frame.element=lineedit +interior.element=lineedit +frame.top=0 +frame.bottom=2 +frame.left=2 +frame.right=2 +indicator.size=8 + +[DropDownButton] +inherits=PanelButtonCommand +frame.top=2 +frame.bottom=2 +frame.left=0 +frame.right=1 +indicator.size=8 + +[ToolboxTab] +inherits=PanelButtonCommand +frame.element=tabframe +frame.top=1 +frame.bottom=1 +frame.left=1 +frame.right=1 + +[Tab] +inherits=PanelButtonCommand +interior.element=tab +frame.element=tab +frame.top=2 +frame.bottom=3 +frame.left=3 +frame.right=3 +indicator.size=10 +text.normal.color=#5B6078 +text.focus.color=#CAD3F5 +text.press.color=#CAD3F5 +text.toggle.color=#CAD3F5 +focusFrame=true + +[TabBarFrame] +inherits=GenericFrame +frame=true +frame.element=tabBarFrame +interior=false +frame.top=4 +frame.bottom=4 +frame.left=4 +frame.right=4 + +[TabFrame] +inherits=PanelButtonCommand +frame.element=tabframe +interior.element=tabframe + +[Dialog] +inherits=TabBarFrame +frame.element=tabframe +interior=false +frame=false +frame.top=1 +frame.bottom=1 +frame.left=1 +frame.right=1 + +[HeaderSection] +inherits=PanelButtonCommand +interior.element=header +frame.element=header +frame.top=0 +frame.bottom=1 +frame.left=1 +frame.right=1 +frame.expansion=0 +text.normal.color=#CAD3F5 +text.focus.color=#8AADF4 +text.press.color=#CAD3F5 +text.toggle.color=#CAD3F5 +indicator.element=harrow + +[SizeGrip] +inherits=PanelButtonCommand +frame=false +interior=false +indicator.element=resize-grip +indicator.size=0 + +[Toolbar] +inherits=PanelButtonCommand +interior.element=menubar +frame.element=menubar +frame=true +frame.bottom=4 +frame.left=4 +frame.right=4 +text.normal.color=#CAD3F5 +text.focus.color=#CAD3F5 +text.press.color=#8AADF4 +text.toggle.color=#8AADF4 +text.bold=false + +[MenuBar] +inherits=PanelButtonCommand +frame.element=menubar +interior.element=menubar +frame.bottom=0 +text.normal.color=#CAD3F5 +frame.expansion=0 +text.bold=false + +[ToolbarButton] +frame.element=tbutton +interior.element=tbutton +indicator.element=arrow +text.normal.color=#CAD3F5 +text.focus.color=#CAD3F5 +text.press.color=#1E2030 +text.toggle.color=#1E2030 +text.bold=false + +[Scrollbar] +inherits=PanelButtonCommand +indicator.size=0 +interior=false +frame=false + +[ScrollbarGroove] +inherits=PanelButtonCommand +interior=false +frame=false + +[ScrollbarSlider] +inherits=PanelButtonCommand +interior=false +frame.element=scrollbarslider +frame.top=4 +frame.bottom=4 +frame.left=4 +frame.right=4 + +[ProgressbarContents] +inherits=PanelButtonCommand +frame=true +frame.element=progress-pattern +interior.element=progress-pattern +frame.top=2 +frame.bottom=2 +frame.left=2 +frame.right=2 + +[Progressbar] +inherits=PanelButtonCommand +frame.element=progress +interior.element=progress +frame.top=2 +frame.bottom=2 +frame.left=2 +frame.right=2 +text.margin=0 +text.normal.color=#CAD3F5 +text.focus.color=#CAD3F5 +text.press.color=#1E2030 +text.toggle.color=#1E2030 +text.bold=false +frame.expansion=18 + +[RadioButton] +inherits=PanelButtonCommand + +[Menu] +frame.element=menu +interior.element=menu +inherits=PanelButtonCommand +text.press.color=#1E2030 +text.toggle.color=#1E2030 +text.bold=false +frame.top=3 +frame.bottom=3 +frame.left=3 +frame.right=3 + +[MenuItem] +inherits=PanelButtonCommand +interior.element=menuitem +indicator.size=8 +text.focus.color=#CAD3F5 +text.press.color=#CAD3F5 + +[MenuBarItem] +inherits=PanelButtonCommand +interior.element=menubaritem +frame=false +text.margin.top=3 +text.margin.bottom=3 +text.margin.left=5 +text.margin.right=5 + +[StatusBar] +inherits=Toolbar +frame.element=toolbar +font.bold=true +text.normal.color=#CAD3F5 +frame=true +frame.top=0 +frame.bottom=0 + +[TitleBar] +inherits=PanelButtonCommand +frame=false +interior=false +text.margin.top=2 +text.margin.bottom=2 +text.margin.left=3 +text.margin.right=3 + +[ComboBox] +inherits=PanelButtonCommand +indicator.size=8 +frame.top=3 +frame.bottom=3 +frame.left=3 +frame.right=3 +text.margin.top=1 +text.margin.bottom=1 +text.margin.left=3 +text.margin.right=3 +text.toggle.color=#CAD3F5 + +[ToolboxTab] +inherits=PanelButtonCommand +text.normal.color=#CAD3F5 +text.press.color=#CAD3F5 +text.focus.color=#CAD3F5 + +[Hacks] +transparent_dolphin_view=false +blur_konsole=true +transparent_ktitle_label=true +transparent_menutitle=true +respect_darkness=true +kcapacitybar_as_progressbar=true +force_size_grip=false +iconless_pushbutton=true +iconless_menu=false +disabled_icon_opacity=100 +lxqtmainmenu_iconsize=0 +normal_default_pushbutton=true +single_top_toolbar=false +tint_on_mouseover=0 +transparent_pcmanfm_sidepane=true +transparent_pcmanfm_view=false +blur_translucent=true +centered_forms=false +kinetic_scrolling=false +middle_click_scroll=false +no_selection_tint=false +noninteger_translucency=false +style_vertical_toolbars=false +blur_only_active_window=false + +[Window] +interior=true +interior.element=window +frame.top=0 +frame.bottom=0 +frame.left=0 +frame.right=0 diff --git a/kvantum/.config/Kvantum/Catppuccin-Macchiato-Blue/Catppuccin-Macchiato-Blue.svg b/kvantum/.config/Kvantum/Catppuccin-Macchiato-Blue/Catppuccin-Macchiato-Blue.svg new file mode 100644 index 0000000..c054966 --- /dev/null +++ b/kvantum/.config/Kvantum/Catppuccin-Macchiato-Blue/Catppuccin-Macchiato-Blue.svg @@ -0,0 +1,1958 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/kvantum/.config/Kvantum/Catppuccin-Macchiato-Flamingo/Catppuccin-Macchiato-Flamingo.kvconfig b/kvantum/.config/Kvantum/Catppuccin-Macchiato-Flamingo/Catppuccin-Macchiato-Flamingo.kvconfig new file mode 100644 index 0000000..25e7b88 --- /dev/null +++ b/kvantum/.config/Kvantum/Catppuccin-Macchiato-Flamingo/Catppuccin-Macchiato-Flamingo.kvconfig @@ -0,0 +1,464 @@ +[%General] +author=elkrien based on Arc Dark style +comment=Catppuccin-Macchiato-Flamingo +spread_menuitems=true +left_tabs=true +mirror_doc_tabs=true +scroll_width=8 +attach_active_tab=true +composite=true +menu_shadow_depth=7 +tooltip_shadow_depth=0 +splitter_width=7 +check_size=16 +slider_width=4 +slider_handle_width=18 +slider_handle_length=18 +textless_progressbar=false +menubar_mouse_tracking=true +slim_toolbars=false +toolbutton_style=1 +x11drag=menubar_and_primary_toolbar +double_click=false +translucent_windows=false +blurring=false +popup_blurring=true +opaque=kaffeine,kmplayer,subtitlecomposer,kdenlive,vlc,smplayer,smplayer2,avidemux,avidemux2_qt4,avidemux3_qt4,avidemux3_qt5,kamoso,QtCreator,VirtualBox,trojita,dragon,digikam,qmplay2 +group_toolbar_buttons=false +vertical_spin_indicators=false +fill_rubberband=false +spread_progressbar=true +merge_menubar_with_toolbar=true +small_icon_size=16 +large_icon_size=32 +button_icon_size=16 +scroll_arrows=false +iconless_pushbutton=true +toolbar_icon_size=16 +combo_as_lineedit=true +button_contents_shift=false +groupbox_top_label=true +inline_spin_indicators=true +joined_inactive_tabs=false +layout_spacing=2 +submenu_overlap=0 +tooltip_delay=-1 +animate_states=false +transient_scrollbar=true +alt_mnemonic=true +combo_menu=true +layout_margin=4 +no_window_pattern=false +respect_DE=true +scroll_min_extent=36 +scrollable_menu=false +scrollbar_in_view=false +spin_button_width=16 +submenu_delay=250 +tree_branch_line=true +progressbar_thickness=8 +click_behavior=0 +contrast=1.00 +dialog_button_layout=0 +drag_from_buttons=false +hide_combo_checkboxes=false +intensity=1.00 +no_inactiveness=false +reduce_menu_opacity=0 +reduce_window_opacity=10 +saturation=1.00 +shadowless_popup=false +transient_groove=false + +[GeneralColors] +window.color=#24273A +base.color=#1E2030 +alt.base.color=#1E2030 +button.color=#363A4F +light.color=#494D64 +mid.light.color=#494D64 +dark.color=#1E2030 +mid.color=#1E2030 +highlight.color=#F0C6C6 +inactive.highlight.color=#F0C6C6 +text.color=#CAD3F5 +window.text.color=#CAD3F5 +button.text.color=#CAD3F5 +disabled.text.color=#5B6078 +tooltip.text.color=#CAD3F5 +highlight.text.color=#1E2030 +link.color=#F4DBD6 +link.visited.color=#8AADF4 + +[ItemView] +inherits=PanelButtonCommand +frame.element=itemview +interior.element=itemview +frame=true +interior=true +text.iconspacing=3 +text.toggle.color=#1E2030 + +[RadioButton] +inherits=PanelButtonCommand +frame=false +interior.element=radio + +[CheckBox] +inherits=PanelButtonCommand +frame=false +interior.element=checkbox + +[TreeExpander] +indicator.element=tree +indicator.size=8 + +[ToolTip] +frame.top=4 +frame.right=4 +frame.bottom=4 +frame.left=4 +frame=true + +[PanelButtonCommand] +inherits=PanelButtonCommand +interior.element=button +frame.element=button +text.normal.color=#CAD3F5 +text.focus.color=#CAD3F5 +text.press.color=#1E2030 +text.toggle.color=#1E2030 + +[PanelButtonTool] +inherits=PanelButtonCommand + +[DockTitle] +inherits=PanelButtonCommand +interior=false +frame=false +text.margin.top=5 +text.margin.bottom=5 +text.margin.left=5 +text.margin.right=5 +indicator.size=0 + +[Dock] +interior.element=toolbar +frame.element=toolbar +frame=true +interior=true + +[GroupBox] +inherits=PanelButtonCommand +interior.element=tabframe +interior=true +frame=false + +[Focus] +inherits=PanelButtonCommand +frame=true +frame.element=focus +frame.top=1 +frame.bottom=1 +frame.left=1 +frame.right=1 +frame.patternsize=20 + +[GenericFrame] +inherits=PanelButtonCommand +frame.element=common +frame.top=1 +frame.bottom=1 +frame.left=1 +frame.right=1 + +[Slider] +inherits=PanelButtonCommand +interior=true +frame.element=slider +interior.element=slider +frame.top=3 +frame.bottom=3 +frame.left=3 +frame.right=3 +focusFrame=true + +[SliderCursor] +inherits=PanelButtonCommand +interior=true +interior.element=slidercursor +frame=false + +[LineEdit] +inherits=PanelButtonCommand +frame.element=lineedit +interior.element=lineedit + +[IndicatorSpinBox] +inherits=LineEdit +frame.element=lineedit +interior.element=lineedit +frame.top=0 +frame.bottom=2 +frame.left=2 +frame.right=2 +indicator.size=8 + +[DropDownButton] +inherits=PanelButtonCommand +frame.top=2 +frame.bottom=2 +frame.left=0 +frame.right=1 +indicator.size=8 + +[ToolboxTab] +inherits=PanelButtonCommand +frame.element=tabframe +frame.top=1 +frame.bottom=1 +frame.left=1 +frame.right=1 + +[Tab] +inherits=PanelButtonCommand +interior.element=tab +frame.element=tab +frame.top=2 +frame.bottom=3 +frame.left=3 +frame.right=3 +indicator.size=10 +text.normal.color=#5B6078 +text.focus.color=#CAD3F5 +text.press.color=#CAD3F5 +text.toggle.color=#CAD3F5 +focusFrame=true + +[TabBarFrame] +inherits=GenericFrame +frame=true +frame.element=tabBarFrame +interior=false +frame.top=4 +frame.bottom=4 +frame.left=4 +frame.right=4 + +[TabFrame] +inherits=PanelButtonCommand +frame.element=tabframe +interior.element=tabframe + +[Dialog] +inherits=TabBarFrame +frame.element=tabframe +interior=false +frame=false +frame.top=1 +frame.bottom=1 +frame.left=1 +frame.right=1 + +[HeaderSection] +inherits=PanelButtonCommand +interior.element=header +frame.element=header +frame.top=0 +frame.bottom=1 +frame.left=1 +frame.right=1 +frame.expansion=0 +text.normal.color=#CAD3F5 +text.focus.color=#F0C6C6 +text.press.color=#CAD3F5 +text.toggle.color=#CAD3F5 +indicator.element=harrow + +[SizeGrip] +inherits=PanelButtonCommand +frame=false +interior=false +indicator.element=resize-grip +indicator.size=0 + +[Toolbar] +inherits=PanelButtonCommand +interior.element=menubar +frame.element=menubar +frame=true +frame.bottom=4 +frame.left=4 +frame.right=4 +text.normal.color=#CAD3F5 +text.focus.color=#CAD3F5 +text.press.color=#F0C6C6 +text.toggle.color=#F0C6C6 +text.bold=false + +[MenuBar] +inherits=PanelButtonCommand +frame.element=menubar +interior.element=menubar +frame.bottom=0 +text.normal.color=#CAD3F5 +frame.expansion=0 +text.bold=false + +[ToolbarButton] +frame.element=tbutton +interior.element=tbutton +indicator.element=arrow +text.normal.color=#CAD3F5 +text.focus.color=#CAD3F5 +text.press.color=#1E2030 +text.toggle.color=#1E2030 +text.bold=false + +[Scrollbar] +inherits=PanelButtonCommand +indicator.size=0 +interior=false +frame=false + +[ScrollbarGroove] +inherits=PanelButtonCommand +interior=false +frame=false + +[ScrollbarSlider] +inherits=PanelButtonCommand +interior=false +frame.element=scrollbarslider +frame.top=4 +frame.bottom=4 +frame.left=4 +frame.right=4 + +[ProgressbarContents] +inherits=PanelButtonCommand +frame=true +frame.element=progress-pattern +interior.element=progress-pattern +frame.top=2 +frame.bottom=2 +frame.left=2 +frame.right=2 + +[Progressbar] +inherits=PanelButtonCommand +frame.element=progress +interior.element=progress +frame.top=2 +frame.bottom=2 +frame.left=2 +frame.right=2 +text.margin=0 +text.normal.color=#CAD3F5 +text.focus.color=#CAD3F5 +text.press.color=#1E2030 +text.toggle.color=#1E2030 +text.bold=false +frame.expansion=18 + +[RadioButton] +inherits=PanelButtonCommand + +[Menu] +frame.element=menu +interior.element=menu +inherits=PanelButtonCommand +text.press.color=#1E2030 +text.toggle.color=#1E2030 +text.bold=false +frame.top=3 +frame.bottom=3 +frame.left=3 +frame.right=3 + +[MenuItem] +inherits=PanelButtonCommand +interior.element=menuitem +indicator.size=8 +text.focus.color=#CAD3F5 +text.press.color=#CAD3F5 + +[MenuBarItem] +inherits=PanelButtonCommand +interior.element=menubaritem +frame=false +text.margin.top=3 +text.margin.bottom=3 +text.margin.left=5 +text.margin.right=5 + +[StatusBar] +inherits=Toolbar +frame.element=toolbar +font.bold=true +text.normal.color=#CAD3F5 +frame=true +frame.top=0 +frame.bottom=0 + +[TitleBar] +inherits=PanelButtonCommand +frame=false +interior=false +text.margin.top=2 +text.margin.bottom=2 +text.margin.left=3 +text.margin.right=3 + +[ComboBox] +inherits=PanelButtonCommand +indicator.size=8 +frame.top=3 +frame.bottom=3 +frame.left=3 +frame.right=3 +text.margin.top=1 +text.margin.bottom=1 +text.margin.left=3 +text.margin.right=3 +text.toggle.color=#CAD3F5 + +[ToolboxTab] +inherits=PanelButtonCommand +text.normal.color=#CAD3F5 +text.press.color=#CAD3F5 +text.focus.color=#CAD3F5 + +[Hacks] +transparent_dolphin_view=false +blur_konsole=true +transparent_ktitle_label=true +transparent_menutitle=true +respect_darkness=true +kcapacitybar_as_progressbar=true +force_size_grip=false +iconless_pushbutton=true +iconless_menu=false +disabled_icon_opacity=100 +lxqtmainmenu_iconsize=0 +normal_default_pushbutton=true +single_top_toolbar=false +tint_on_mouseover=0 +transparent_pcmanfm_sidepane=true +transparent_pcmanfm_view=false +blur_translucent=true +centered_forms=false +kinetic_scrolling=false +middle_click_scroll=false +no_selection_tint=false +noninteger_translucency=false +style_vertical_toolbars=false +blur_only_active_window=false + +[Window] +interior=true +interior.element=window +frame.top=0 +frame.bottom=0 +frame.left=0 +frame.right=0 diff --git a/kvantum/.config/Kvantum/Catppuccin-Macchiato-Flamingo/Catppuccin-Macchiato-Flamingo.svg b/kvantum/.config/Kvantum/Catppuccin-Macchiato-Flamingo/Catppuccin-Macchiato-Flamingo.svg new file mode 100644 index 0000000..c17a61a --- /dev/null +++ b/kvantum/.config/Kvantum/Catppuccin-Macchiato-Flamingo/Catppuccin-Macchiato-Flamingo.svg @@ -0,0 +1,1958 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/kvantum/.config/Kvantum/Catppuccin-Macchiato-Green/Catppuccin-Macchiato-Green.kvconfig b/kvantum/.config/Kvantum/Catppuccin-Macchiato-Green/Catppuccin-Macchiato-Green.kvconfig new file mode 100644 index 0000000..fcb0823 --- /dev/null +++ b/kvantum/.config/Kvantum/Catppuccin-Macchiato-Green/Catppuccin-Macchiato-Green.kvconfig @@ -0,0 +1,464 @@ +[%General] +author=elkrien based on Arc Dark style +comment=Catppuccin-Macchiato-Green +spread_menuitems=true +left_tabs=true +mirror_doc_tabs=true +scroll_width=8 +attach_active_tab=true +composite=true +menu_shadow_depth=7 +tooltip_shadow_depth=0 +splitter_width=7 +check_size=16 +slider_width=4 +slider_handle_width=18 +slider_handle_length=18 +textless_progressbar=false +menubar_mouse_tracking=true +slim_toolbars=false +toolbutton_style=1 +x11drag=menubar_and_primary_toolbar +double_click=false +translucent_windows=false +blurring=false +popup_blurring=true +opaque=kaffeine,kmplayer,subtitlecomposer,kdenlive,vlc,smplayer,smplayer2,avidemux,avidemux2_qt4,avidemux3_qt4,avidemux3_qt5,kamoso,QtCreator,VirtualBox,trojita,dragon,digikam,qmplay2 +group_toolbar_buttons=false +vertical_spin_indicators=false +fill_rubberband=false +spread_progressbar=true +merge_menubar_with_toolbar=true +small_icon_size=16 +large_icon_size=32 +button_icon_size=16 +scroll_arrows=false +iconless_pushbutton=true +toolbar_icon_size=16 +combo_as_lineedit=true +button_contents_shift=false +groupbox_top_label=true +inline_spin_indicators=true +joined_inactive_tabs=false +layout_spacing=2 +submenu_overlap=0 +tooltip_delay=-1 +animate_states=false +transient_scrollbar=true +alt_mnemonic=true +combo_menu=true +layout_margin=4 +no_window_pattern=false +respect_DE=true +scroll_min_extent=36 +scrollable_menu=false +scrollbar_in_view=false +spin_button_width=16 +submenu_delay=250 +tree_branch_line=true +progressbar_thickness=8 +click_behavior=0 +contrast=1.00 +dialog_button_layout=0 +drag_from_buttons=false +hide_combo_checkboxes=false +intensity=1.00 +no_inactiveness=false +reduce_menu_opacity=0 +reduce_window_opacity=10 +saturation=1.00 +shadowless_popup=false +transient_groove=false + +[GeneralColors] +window.color=#24273A +base.color=#1E2030 +alt.base.color=#1E2030 +button.color=#363A4F +light.color=#494D64 +mid.light.color=#494D64 +dark.color=#1E2030 +mid.color=#1E2030 +highlight.color=#A6DA95 +inactive.highlight.color=#A6DA95 +text.color=#CAD3F5 +window.text.color=#CAD3F5 +button.text.color=#CAD3F5 +disabled.text.color=#5B6078 +tooltip.text.color=#CAD3F5 +highlight.text.color=#1E2030 +link.color=#F4DBD6 +link.visited.color=#8AADF4 + +[ItemView] +inherits=PanelButtonCommand +frame.element=itemview +interior.element=itemview +frame=true +interior=true +text.iconspacing=3 +text.toggle.color=#1E2030 + +[RadioButton] +inherits=PanelButtonCommand +frame=false +interior.element=radio + +[CheckBox] +inherits=PanelButtonCommand +frame=false +interior.element=checkbox + +[TreeExpander] +indicator.element=tree +indicator.size=8 + +[ToolTip] +frame.top=4 +frame.right=4 +frame.bottom=4 +frame.left=4 +frame=true + +[PanelButtonCommand] +inherits=PanelButtonCommand +interior.element=button +frame.element=button +text.normal.color=#CAD3F5 +text.focus.color=#CAD3F5 +text.press.color=#1E2030 +text.toggle.color=#1E2030 + +[PanelButtonTool] +inherits=PanelButtonCommand + +[DockTitle] +inherits=PanelButtonCommand +interior=false +frame=false +text.margin.top=5 +text.margin.bottom=5 +text.margin.left=5 +text.margin.right=5 +indicator.size=0 + +[Dock] +interior.element=toolbar +frame.element=toolbar +frame=true +interior=true + +[GroupBox] +inherits=PanelButtonCommand +interior.element=tabframe +interior=true +frame=false + +[Focus] +inherits=PanelButtonCommand +frame=true +frame.element=focus +frame.top=1 +frame.bottom=1 +frame.left=1 +frame.right=1 +frame.patternsize=20 + +[GenericFrame] +inherits=PanelButtonCommand +frame.element=common +frame.top=1 +frame.bottom=1 +frame.left=1 +frame.right=1 + +[Slider] +inherits=PanelButtonCommand +interior=true +frame.element=slider +interior.element=slider +frame.top=3 +frame.bottom=3 +frame.left=3 +frame.right=3 +focusFrame=true + +[SliderCursor] +inherits=PanelButtonCommand +interior=true +interior.element=slidercursor +frame=false + +[LineEdit] +inherits=PanelButtonCommand +frame.element=lineedit +interior.element=lineedit + +[IndicatorSpinBox] +inherits=LineEdit +frame.element=lineedit +interior.element=lineedit +frame.top=0 +frame.bottom=2 +frame.left=2 +frame.right=2 +indicator.size=8 + +[DropDownButton] +inherits=PanelButtonCommand +frame.top=2 +frame.bottom=2 +frame.left=0 +frame.right=1 +indicator.size=8 + +[ToolboxTab] +inherits=PanelButtonCommand +frame.element=tabframe +frame.top=1 +frame.bottom=1 +frame.left=1 +frame.right=1 + +[Tab] +inherits=PanelButtonCommand +interior.element=tab +frame.element=tab +frame.top=2 +frame.bottom=3 +frame.left=3 +frame.right=3 +indicator.size=10 +text.normal.color=#5B6078 +text.focus.color=#CAD3F5 +text.press.color=#CAD3F5 +text.toggle.color=#CAD3F5 +focusFrame=true + +[TabBarFrame] +inherits=GenericFrame +frame=true +frame.element=tabBarFrame +interior=false +frame.top=4 +frame.bottom=4 +frame.left=4 +frame.right=4 + +[TabFrame] +inherits=PanelButtonCommand +frame.element=tabframe +interior.element=tabframe + +[Dialog] +inherits=TabBarFrame +frame.element=tabframe +interior=false +frame=false +frame.top=1 +frame.bottom=1 +frame.left=1 +frame.right=1 + +[HeaderSection] +inherits=PanelButtonCommand +interior.element=header +frame.element=header +frame.top=0 +frame.bottom=1 +frame.left=1 +frame.right=1 +frame.expansion=0 +text.normal.color=#CAD3F5 +text.focus.color=#A6DA95 +text.press.color=#CAD3F5 +text.toggle.color=#CAD3F5 +indicator.element=harrow + +[SizeGrip] +inherits=PanelButtonCommand +frame=false +interior=false +indicator.element=resize-grip +indicator.size=0 + +[Toolbar] +inherits=PanelButtonCommand +interior.element=menubar +frame.element=menubar +frame=true +frame.bottom=4 +frame.left=4 +frame.right=4 +text.normal.color=#CAD3F5 +text.focus.color=#CAD3F5 +text.press.color=#A6DA95 +text.toggle.color=#A6DA95 +text.bold=false + +[MenuBar] +inherits=PanelButtonCommand +frame.element=menubar +interior.element=menubar +frame.bottom=0 +text.normal.color=#CAD3F5 +frame.expansion=0 +text.bold=false + +[ToolbarButton] +frame.element=tbutton +interior.element=tbutton +indicator.element=arrow +text.normal.color=#CAD3F5 +text.focus.color=#CAD3F5 +text.press.color=#1E2030 +text.toggle.color=#1E2030 +text.bold=false + +[Scrollbar] +inherits=PanelButtonCommand +indicator.size=0 +interior=false +frame=false + +[ScrollbarGroove] +inherits=PanelButtonCommand +interior=false +frame=false + +[ScrollbarSlider] +inherits=PanelButtonCommand +interior=false +frame.element=scrollbarslider +frame.top=4 +frame.bottom=4 +frame.left=4 +frame.right=4 + +[ProgressbarContents] +inherits=PanelButtonCommand +frame=true +frame.element=progress-pattern +interior.element=progress-pattern +frame.top=2 +frame.bottom=2 +frame.left=2 +frame.right=2 + +[Progressbar] +inherits=PanelButtonCommand +frame.element=progress +interior.element=progress +frame.top=2 +frame.bottom=2 +frame.left=2 +frame.right=2 +text.margin=0 +text.normal.color=#CAD3F5 +text.focus.color=#CAD3F5 +text.press.color=#1E2030 +text.toggle.color=#1E2030 +text.bold=false +frame.expansion=18 + +[RadioButton] +inherits=PanelButtonCommand + +[Menu] +frame.element=menu +interior.element=menu +inherits=PanelButtonCommand +text.press.color=#1E2030 +text.toggle.color=#1E2030 +text.bold=false +frame.top=3 +frame.bottom=3 +frame.left=3 +frame.right=3 + +[MenuItem] +inherits=PanelButtonCommand +interior.element=menuitem +indicator.size=8 +text.focus.color=#CAD3F5 +text.press.color=#CAD3F5 + +[MenuBarItem] +inherits=PanelButtonCommand +interior.element=menubaritem +frame=false +text.margin.top=3 +text.margin.bottom=3 +text.margin.left=5 +text.margin.right=5 + +[StatusBar] +inherits=Toolbar +frame.element=toolbar +font.bold=true +text.normal.color=#CAD3F5 +frame=true +frame.top=0 +frame.bottom=0 + +[TitleBar] +inherits=PanelButtonCommand +frame=false +interior=false +text.margin.top=2 +text.margin.bottom=2 +text.margin.left=3 +text.margin.right=3 + +[ComboBox] +inherits=PanelButtonCommand +indicator.size=8 +frame.top=3 +frame.bottom=3 +frame.left=3 +frame.right=3 +text.margin.top=1 +text.margin.bottom=1 +text.margin.left=3 +text.margin.right=3 +text.toggle.color=#CAD3F5 + +[ToolboxTab] +inherits=PanelButtonCommand +text.normal.color=#CAD3F5 +text.press.color=#CAD3F5 +text.focus.color=#CAD3F5 + +[Hacks] +transparent_dolphin_view=false +blur_konsole=true +transparent_ktitle_label=true +transparent_menutitle=true +respect_darkness=true +kcapacitybar_as_progressbar=true +force_size_grip=false +iconless_pushbutton=true +iconless_menu=false +disabled_icon_opacity=100 +lxqtmainmenu_iconsize=0 +normal_default_pushbutton=true +single_top_toolbar=false +tint_on_mouseover=0 +transparent_pcmanfm_sidepane=true +transparent_pcmanfm_view=false +blur_translucent=true +centered_forms=false +kinetic_scrolling=false +middle_click_scroll=false +no_selection_tint=false +noninteger_translucency=false +style_vertical_toolbars=false +blur_only_active_window=false + +[Window] +interior=true +interior.element=window +frame.top=0 +frame.bottom=0 +frame.left=0 +frame.right=0 diff --git a/kvantum/.config/Kvantum/Catppuccin-Macchiato-Green/Catppuccin-Macchiato-Green.svg b/kvantum/.config/Kvantum/Catppuccin-Macchiato-Green/Catppuccin-Macchiato-Green.svg new file mode 100644 index 0000000..bfe8db4 --- /dev/null +++ b/kvantum/.config/Kvantum/Catppuccin-Macchiato-Green/Catppuccin-Macchiato-Green.svg @@ -0,0 +1,1958 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/kvantum/.config/Kvantum/Catppuccin-Macchiato-Lavender/Catppuccin-Macchiato-Lavender.kvconfig b/kvantum/.config/Kvantum/Catppuccin-Macchiato-Lavender/Catppuccin-Macchiato-Lavender.kvconfig new file mode 100644 index 0000000..0852df1 --- /dev/null +++ b/kvantum/.config/Kvantum/Catppuccin-Macchiato-Lavender/Catppuccin-Macchiato-Lavender.kvconfig @@ -0,0 +1,464 @@ +[%General] +author=elkrien based on Arc Dark style +comment=Catppuccin-Macchiato-Lavender +spread_menuitems=true +left_tabs=true +mirror_doc_tabs=true +scroll_width=8 +attach_active_tab=true +composite=true +menu_shadow_depth=7 +tooltip_shadow_depth=0 +splitter_width=7 +check_size=16 +slider_width=4 +slider_handle_width=18 +slider_handle_length=18 +textless_progressbar=false +menubar_mouse_tracking=true +slim_toolbars=false +toolbutton_style=1 +x11drag=menubar_and_primary_toolbar +double_click=false +translucent_windows=false +blurring=false +popup_blurring=true +opaque=kaffeine,kmplayer,subtitlecomposer,kdenlive,vlc,smplayer,smplayer2,avidemux,avidemux2_qt4,avidemux3_qt4,avidemux3_qt5,kamoso,QtCreator,VirtualBox,trojita,dragon,digikam,qmplay2 +group_toolbar_buttons=false +vertical_spin_indicators=false +fill_rubberband=false +spread_progressbar=true +merge_menubar_with_toolbar=true +small_icon_size=16 +large_icon_size=32 +button_icon_size=16 +scroll_arrows=false +iconless_pushbutton=true +toolbar_icon_size=16 +combo_as_lineedit=true +button_contents_shift=false +groupbox_top_label=true +inline_spin_indicators=true +joined_inactive_tabs=false +layout_spacing=2 +submenu_overlap=0 +tooltip_delay=-1 +animate_states=false +transient_scrollbar=true +alt_mnemonic=true +combo_menu=true +layout_margin=4 +no_window_pattern=false +respect_DE=true +scroll_min_extent=36 +scrollable_menu=false +scrollbar_in_view=false +spin_button_width=16 +submenu_delay=250 +tree_branch_line=true +progressbar_thickness=8 +click_behavior=0 +contrast=1.00 +dialog_button_layout=0 +drag_from_buttons=false +hide_combo_checkboxes=false +intensity=1.00 +no_inactiveness=false +reduce_menu_opacity=0 +reduce_window_opacity=10 +saturation=1.00 +shadowless_popup=false +transient_groove=false + +[GeneralColors] +window.color=#24273A +base.color=#1E2030 +alt.base.color=#1E2030 +button.color=#363A4F +light.color=#494D64 +mid.light.color=#494D64 +dark.color=#1E2030 +mid.color=#1E2030 +highlight.color=#B7BDF8 +inactive.highlight.color=#B7BDF8 +text.color=#CAD3F5 +window.text.color=#CAD3F5 +button.text.color=#CAD3F5 +disabled.text.color=#5B6078 +tooltip.text.color=#CAD3F5 +highlight.text.color=#1E2030 +link.color=#F4DBD6 +link.visited.color=#8AADF4 + +[ItemView] +inherits=PanelButtonCommand +frame.element=itemview +interior.element=itemview +frame=true +interior=true +text.iconspacing=3 +text.toggle.color=#1E2030 + +[RadioButton] +inherits=PanelButtonCommand +frame=false +interior.element=radio + +[CheckBox] +inherits=PanelButtonCommand +frame=false +interior.element=checkbox + +[TreeExpander] +indicator.element=tree +indicator.size=8 + +[ToolTip] +frame.top=4 +frame.right=4 +frame.bottom=4 +frame.left=4 +frame=true + +[PanelButtonCommand] +inherits=PanelButtonCommand +interior.element=button +frame.element=button +text.normal.color=#CAD3F5 +text.focus.color=#CAD3F5 +text.press.color=#1E2030 +text.toggle.color=#1E2030 + +[PanelButtonTool] +inherits=PanelButtonCommand + +[DockTitle] +inherits=PanelButtonCommand +interior=false +frame=false +text.margin.top=5 +text.margin.bottom=5 +text.margin.left=5 +text.margin.right=5 +indicator.size=0 + +[Dock] +interior.element=toolbar +frame.element=toolbar +frame=true +interior=true + +[GroupBox] +inherits=PanelButtonCommand +interior.element=tabframe +interior=true +frame=false + +[Focus] +inherits=PanelButtonCommand +frame=true +frame.element=focus +frame.top=1 +frame.bottom=1 +frame.left=1 +frame.right=1 +frame.patternsize=20 + +[GenericFrame] +inherits=PanelButtonCommand +frame.element=common +frame.top=1 +frame.bottom=1 +frame.left=1 +frame.right=1 + +[Slider] +inherits=PanelButtonCommand +interior=true +frame.element=slider +interior.element=slider +frame.top=3 +frame.bottom=3 +frame.left=3 +frame.right=3 +focusFrame=true + +[SliderCursor] +inherits=PanelButtonCommand +interior=true +interior.element=slidercursor +frame=false + +[LineEdit] +inherits=PanelButtonCommand +frame.element=lineedit +interior.element=lineedit + +[IndicatorSpinBox] +inherits=LineEdit +frame.element=lineedit +interior.element=lineedit +frame.top=0 +frame.bottom=2 +frame.left=2 +frame.right=2 +indicator.size=8 + +[DropDownButton] +inherits=PanelButtonCommand +frame.top=2 +frame.bottom=2 +frame.left=0 +frame.right=1 +indicator.size=8 + +[ToolboxTab] +inherits=PanelButtonCommand +frame.element=tabframe +frame.top=1 +frame.bottom=1 +frame.left=1 +frame.right=1 + +[Tab] +inherits=PanelButtonCommand +interior.element=tab +frame.element=tab +frame.top=2 +frame.bottom=3 +frame.left=3 +frame.right=3 +indicator.size=10 +text.normal.color=#5B6078 +text.focus.color=#CAD3F5 +text.press.color=#CAD3F5 +text.toggle.color=#CAD3F5 +focusFrame=true + +[TabBarFrame] +inherits=GenericFrame +frame=true +frame.element=tabBarFrame +interior=false +frame.top=4 +frame.bottom=4 +frame.left=4 +frame.right=4 + +[TabFrame] +inherits=PanelButtonCommand +frame.element=tabframe +interior.element=tabframe + +[Dialog] +inherits=TabBarFrame +frame.element=tabframe +interior=false +frame=false +frame.top=1 +frame.bottom=1 +frame.left=1 +frame.right=1 + +[HeaderSection] +inherits=PanelButtonCommand +interior.element=header +frame.element=header +frame.top=0 +frame.bottom=1 +frame.left=1 +frame.right=1 +frame.expansion=0 +text.normal.color=#CAD3F5 +text.focus.color=#B7BDF8 +text.press.color=#CAD3F5 +text.toggle.color=#CAD3F5 +indicator.element=harrow + +[SizeGrip] +inherits=PanelButtonCommand +frame=false +interior=false +indicator.element=resize-grip +indicator.size=0 + +[Toolbar] +inherits=PanelButtonCommand +interior.element=menubar +frame.element=menubar +frame=true +frame.bottom=4 +frame.left=4 +frame.right=4 +text.normal.color=#CAD3F5 +text.focus.color=#CAD3F5 +text.press.color=#B7BDF8 +text.toggle.color=#B7BDF8 +text.bold=false + +[MenuBar] +inherits=PanelButtonCommand +frame.element=menubar +interior.element=menubar +frame.bottom=0 +text.normal.color=#CAD3F5 +frame.expansion=0 +text.bold=false + +[ToolbarButton] +frame.element=tbutton +interior.element=tbutton +indicator.element=arrow +text.normal.color=#CAD3F5 +text.focus.color=#CAD3F5 +text.press.color=#1E2030 +text.toggle.color=#1E2030 +text.bold=false + +[Scrollbar] +inherits=PanelButtonCommand +indicator.size=0 +interior=false +frame=false + +[ScrollbarGroove] +inherits=PanelButtonCommand +interior=false +frame=false + +[ScrollbarSlider] +inherits=PanelButtonCommand +interior=false +frame.element=scrollbarslider +frame.top=4 +frame.bottom=4 +frame.left=4 +frame.right=4 + +[ProgressbarContents] +inherits=PanelButtonCommand +frame=true +frame.element=progress-pattern +interior.element=progress-pattern +frame.top=2 +frame.bottom=2 +frame.left=2 +frame.right=2 + +[Progressbar] +inherits=PanelButtonCommand +frame.element=progress +interior.element=progress +frame.top=2 +frame.bottom=2 +frame.left=2 +frame.right=2 +text.margin=0 +text.normal.color=#CAD3F5 +text.focus.color=#CAD3F5 +text.press.color=#1E2030 +text.toggle.color=#1E2030 +text.bold=false +frame.expansion=18 + +[RadioButton] +inherits=PanelButtonCommand + +[Menu] +frame.element=menu +interior.element=menu +inherits=PanelButtonCommand +text.press.color=#1E2030 +text.toggle.color=#1E2030 +text.bold=false +frame.top=3 +frame.bottom=3 +frame.left=3 +frame.right=3 + +[MenuItem] +inherits=PanelButtonCommand +interior.element=menuitem +indicator.size=8 +text.focus.color=#CAD3F5 +text.press.color=#CAD3F5 + +[MenuBarItem] +inherits=PanelButtonCommand +interior.element=menubaritem +frame=false +text.margin.top=3 +text.margin.bottom=3 +text.margin.left=5 +text.margin.right=5 + +[StatusBar] +inherits=Toolbar +frame.element=toolbar +font.bold=true +text.normal.color=#CAD3F5 +frame=true +frame.top=0 +frame.bottom=0 + +[TitleBar] +inherits=PanelButtonCommand +frame=false +interior=false +text.margin.top=2 +text.margin.bottom=2 +text.margin.left=3 +text.margin.right=3 + +[ComboBox] +inherits=PanelButtonCommand +indicator.size=8 +frame.top=3 +frame.bottom=3 +frame.left=3 +frame.right=3 +text.margin.top=1 +text.margin.bottom=1 +text.margin.left=3 +text.margin.right=3 +text.toggle.color=#CAD3F5 + +[ToolboxTab] +inherits=PanelButtonCommand +text.normal.color=#CAD3F5 +text.press.color=#CAD3F5 +text.focus.color=#CAD3F5 + +[Hacks] +transparent_dolphin_view=false +blur_konsole=true +transparent_ktitle_label=true +transparent_menutitle=true +respect_darkness=true +kcapacitybar_as_progressbar=true +force_size_grip=false +iconless_pushbutton=true +iconless_menu=false +disabled_icon_opacity=100 +lxqtmainmenu_iconsize=0 +normal_default_pushbutton=true +single_top_toolbar=false +tint_on_mouseover=0 +transparent_pcmanfm_sidepane=true +transparent_pcmanfm_view=false +blur_translucent=true +centered_forms=false +kinetic_scrolling=false +middle_click_scroll=false +no_selection_tint=false +noninteger_translucency=false +style_vertical_toolbars=false +blur_only_active_window=false + +[Window] +interior=true +interior.element=window +frame.top=0 +frame.bottom=0 +frame.left=0 +frame.right=0 diff --git a/kvantum/.config/Kvantum/Catppuccin-Macchiato-Lavender/Catppuccin-Macchiato-Lavender.svg b/kvantum/.config/Kvantum/Catppuccin-Macchiato-Lavender/Catppuccin-Macchiato-Lavender.svg new file mode 100644 index 0000000..e2a62be --- /dev/null +++ b/kvantum/.config/Kvantum/Catppuccin-Macchiato-Lavender/Catppuccin-Macchiato-Lavender.svg @@ -0,0 +1,1958 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/kvantum/.config/Kvantum/Catppuccin-Macchiato-Maroon/Catppuccin-Macchiato-Maroon.kvconfig b/kvantum/.config/Kvantum/Catppuccin-Macchiato-Maroon/Catppuccin-Macchiato-Maroon.kvconfig new file mode 100644 index 0000000..2b7430c --- /dev/null +++ b/kvantum/.config/Kvantum/Catppuccin-Macchiato-Maroon/Catppuccin-Macchiato-Maroon.kvconfig @@ -0,0 +1,464 @@ +[%General] +author=elkrien based on Arc Dark style +comment=Catppuccin-Macchiato-Maroon +spread_menuitems=true +left_tabs=true +mirror_doc_tabs=true +scroll_width=8 +attach_active_tab=true +composite=true +menu_shadow_depth=7 +tooltip_shadow_depth=0 +splitter_width=7 +check_size=16 +slider_width=4 +slider_handle_width=18 +slider_handle_length=18 +textless_progressbar=false +menubar_mouse_tracking=true +slim_toolbars=false +toolbutton_style=1 +x11drag=menubar_and_primary_toolbar +double_click=false +translucent_windows=false +blurring=false +popup_blurring=true +opaque=kaffeine,kmplayer,subtitlecomposer,kdenlive,vlc,smplayer,smplayer2,avidemux,avidemux2_qt4,avidemux3_qt4,avidemux3_qt5,kamoso,QtCreator,VirtualBox,trojita,dragon,digikam,qmplay2 +group_toolbar_buttons=false +vertical_spin_indicators=false +fill_rubberband=false +spread_progressbar=true +merge_menubar_with_toolbar=true +small_icon_size=16 +large_icon_size=32 +button_icon_size=16 +scroll_arrows=false +iconless_pushbutton=true +toolbar_icon_size=16 +combo_as_lineedit=true +button_contents_shift=false +groupbox_top_label=true +inline_spin_indicators=true +joined_inactive_tabs=false +layout_spacing=2 +submenu_overlap=0 +tooltip_delay=-1 +animate_states=false +transient_scrollbar=true +alt_mnemonic=true +combo_menu=true +layout_margin=4 +no_window_pattern=false +respect_DE=true +scroll_min_extent=36 +scrollable_menu=false +scrollbar_in_view=false +spin_button_width=16 +submenu_delay=250 +tree_branch_line=true +progressbar_thickness=8 +click_behavior=0 +contrast=1.00 +dialog_button_layout=0 +drag_from_buttons=false +hide_combo_checkboxes=false +intensity=1.00 +no_inactiveness=false +reduce_menu_opacity=0 +reduce_window_opacity=10 +saturation=1.00 +shadowless_popup=false +transient_groove=false + +[GeneralColors] +window.color=#24273A +base.color=#1E2030 +alt.base.color=#1E2030 +button.color=#363A4F +light.color=#494D64 +mid.light.color=#494D64 +dark.color=#1E2030 +mid.color=#1E2030 +highlight.color=#EE99A0 +inactive.highlight.color=#EE99A0 +text.color=#CAD3F5 +window.text.color=#CAD3F5 +button.text.color=#CAD3F5 +disabled.text.color=#5B6078 +tooltip.text.color=#CAD3F5 +highlight.text.color=#1E2030 +link.color=#F4DBD6 +link.visited.color=#8AADF4 + +[ItemView] +inherits=PanelButtonCommand +frame.element=itemview +interior.element=itemview +frame=true +interior=true +text.iconspacing=3 +text.toggle.color=#1E2030 + +[RadioButton] +inherits=PanelButtonCommand +frame=false +interior.element=radio + +[CheckBox] +inherits=PanelButtonCommand +frame=false +interior.element=checkbox + +[TreeExpander] +indicator.element=tree +indicator.size=8 + +[ToolTip] +frame.top=4 +frame.right=4 +frame.bottom=4 +frame.left=4 +frame=true + +[PanelButtonCommand] +inherits=PanelButtonCommand +interior.element=button +frame.element=button +text.normal.color=#CAD3F5 +text.focus.color=#CAD3F5 +text.press.color=#1E2030 +text.toggle.color=#1E2030 + +[PanelButtonTool] +inherits=PanelButtonCommand + +[DockTitle] +inherits=PanelButtonCommand +interior=false +frame=false +text.margin.top=5 +text.margin.bottom=5 +text.margin.left=5 +text.margin.right=5 +indicator.size=0 + +[Dock] +interior.element=toolbar +frame.element=toolbar +frame=true +interior=true + +[GroupBox] +inherits=PanelButtonCommand +interior.element=tabframe +interior=true +frame=false + +[Focus] +inherits=PanelButtonCommand +frame=true +frame.element=focus +frame.top=1 +frame.bottom=1 +frame.left=1 +frame.right=1 +frame.patternsize=20 + +[GenericFrame] +inherits=PanelButtonCommand +frame.element=common +frame.top=1 +frame.bottom=1 +frame.left=1 +frame.right=1 + +[Slider] +inherits=PanelButtonCommand +interior=true +frame.element=slider +interior.element=slider +frame.top=3 +frame.bottom=3 +frame.left=3 +frame.right=3 +focusFrame=true + +[SliderCursor] +inherits=PanelButtonCommand +interior=true +interior.element=slidercursor +frame=false + +[LineEdit] +inherits=PanelButtonCommand +frame.element=lineedit +interior.element=lineedit + +[IndicatorSpinBox] +inherits=LineEdit +frame.element=lineedit +interior.element=lineedit +frame.top=0 +frame.bottom=2 +frame.left=2 +frame.right=2 +indicator.size=8 + +[DropDownButton] +inherits=PanelButtonCommand +frame.top=2 +frame.bottom=2 +frame.left=0 +frame.right=1 +indicator.size=8 + +[ToolboxTab] +inherits=PanelButtonCommand +frame.element=tabframe +frame.top=1 +frame.bottom=1 +frame.left=1 +frame.right=1 + +[Tab] +inherits=PanelButtonCommand +interior.element=tab +frame.element=tab +frame.top=2 +frame.bottom=3 +frame.left=3 +frame.right=3 +indicator.size=10 +text.normal.color=#5B6078 +text.focus.color=#CAD3F5 +text.press.color=#CAD3F5 +text.toggle.color=#CAD3F5 +focusFrame=true + +[TabBarFrame] +inherits=GenericFrame +frame=true +frame.element=tabBarFrame +interior=false +frame.top=4 +frame.bottom=4 +frame.left=4 +frame.right=4 + +[TabFrame] +inherits=PanelButtonCommand +frame.element=tabframe +interior.element=tabframe + +[Dialog] +inherits=TabBarFrame +frame.element=tabframe +interior=false +frame=false +frame.top=1 +frame.bottom=1 +frame.left=1 +frame.right=1 + +[HeaderSection] +inherits=PanelButtonCommand +interior.element=header +frame.element=header +frame.top=0 +frame.bottom=1 +frame.left=1 +frame.right=1 +frame.expansion=0 +text.normal.color=#CAD3F5 +text.focus.color=#EE99A0 +text.press.color=#CAD3F5 +text.toggle.color=#CAD3F5 +indicator.element=harrow + +[SizeGrip] +inherits=PanelButtonCommand +frame=false +interior=false +indicator.element=resize-grip +indicator.size=0 + +[Toolbar] +inherits=PanelButtonCommand +interior.element=menubar +frame.element=menubar +frame=true +frame.bottom=4 +frame.left=4 +frame.right=4 +text.normal.color=#CAD3F5 +text.focus.color=#CAD3F5 +text.press.color=#EE99A0 +text.toggle.color=#EE99A0 +text.bold=false + +[MenuBar] +inherits=PanelButtonCommand +frame.element=menubar +interior.element=menubar +frame.bottom=0 +text.normal.color=#CAD3F5 +frame.expansion=0 +text.bold=false + +[ToolbarButton] +frame.element=tbutton +interior.element=tbutton +indicator.element=arrow +text.normal.color=#CAD3F5 +text.focus.color=#CAD3F5 +text.press.color=#1E2030 +text.toggle.color=#1E2030 +text.bold=false + +[Scrollbar] +inherits=PanelButtonCommand +indicator.size=0 +interior=false +frame=false + +[ScrollbarGroove] +inherits=PanelButtonCommand +interior=false +frame=false + +[ScrollbarSlider] +inherits=PanelButtonCommand +interior=false +frame.element=scrollbarslider +frame.top=4 +frame.bottom=4 +frame.left=4 +frame.right=4 + +[ProgressbarContents] +inherits=PanelButtonCommand +frame=true +frame.element=progress-pattern +interior.element=progress-pattern +frame.top=2 +frame.bottom=2 +frame.left=2 +frame.right=2 + +[Progressbar] +inherits=PanelButtonCommand +frame.element=progress +interior.element=progress +frame.top=2 +frame.bottom=2 +frame.left=2 +frame.right=2 +text.margin=0 +text.normal.color=#CAD3F5 +text.focus.color=#CAD3F5 +text.press.color=#1E2030 +text.toggle.color=#1E2030 +text.bold=false +frame.expansion=18 + +[RadioButton] +inherits=PanelButtonCommand + +[Menu] +frame.element=menu +interior.element=menu +inherits=PanelButtonCommand +text.press.color=#1E2030 +text.toggle.color=#1E2030 +text.bold=false +frame.top=3 +frame.bottom=3 +frame.left=3 +frame.right=3 + +[MenuItem] +inherits=PanelButtonCommand +interior.element=menuitem +indicator.size=8 +text.focus.color=#CAD3F5 +text.press.color=#CAD3F5 + +[MenuBarItem] +inherits=PanelButtonCommand +interior.element=menubaritem +frame=false +text.margin.top=3 +text.margin.bottom=3 +text.margin.left=5 +text.margin.right=5 + +[StatusBar] +inherits=Toolbar +frame.element=toolbar +font.bold=true +text.normal.color=#CAD3F5 +frame=true +frame.top=0 +frame.bottom=0 + +[TitleBar] +inherits=PanelButtonCommand +frame=false +interior=false +text.margin.top=2 +text.margin.bottom=2 +text.margin.left=3 +text.margin.right=3 + +[ComboBox] +inherits=PanelButtonCommand +indicator.size=8 +frame.top=3 +frame.bottom=3 +frame.left=3 +frame.right=3 +text.margin.top=1 +text.margin.bottom=1 +text.margin.left=3 +text.margin.right=3 +text.toggle.color=#CAD3F5 + +[ToolboxTab] +inherits=PanelButtonCommand +text.normal.color=#CAD3F5 +text.press.color=#CAD3F5 +text.focus.color=#CAD3F5 + +[Hacks] +transparent_dolphin_view=false +blur_konsole=true +transparent_ktitle_label=true +transparent_menutitle=true +respect_darkness=true +kcapacitybar_as_progressbar=true +force_size_grip=false +iconless_pushbutton=true +iconless_menu=false +disabled_icon_opacity=100 +lxqtmainmenu_iconsize=0 +normal_default_pushbutton=true +single_top_toolbar=false +tint_on_mouseover=0 +transparent_pcmanfm_sidepane=true +transparent_pcmanfm_view=false +blur_translucent=true +centered_forms=false +kinetic_scrolling=false +middle_click_scroll=false +no_selection_tint=false +noninteger_translucency=false +style_vertical_toolbars=false +blur_only_active_window=false + +[Window] +interior=true +interior.element=window +frame.top=0 +frame.bottom=0 +frame.left=0 +frame.right=0 diff --git a/kvantum/.config/Kvantum/Catppuccin-Macchiato-Maroon/Catppuccin-Macchiato-Maroon.svg b/kvantum/.config/Kvantum/Catppuccin-Macchiato-Maroon/Catppuccin-Macchiato-Maroon.svg new file mode 100644 index 0000000..b1650dc --- /dev/null +++ b/kvantum/.config/Kvantum/Catppuccin-Macchiato-Maroon/Catppuccin-Macchiato-Maroon.svg @@ -0,0 +1,1958 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/kvantum/.config/Kvantum/Catppuccin-Macchiato-Mauve/Catppuccin-Macchiato-Mauve.kvconfig b/kvantum/.config/Kvantum/Catppuccin-Macchiato-Mauve/Catppuccin-Macchiato-Mauve.kvconfig new file mode 100644 index 0000000..f22841d --- /dev/null +++ b/kvantum/.config/Kvantum/Catppuccin-Macchiato-Mauve/Catppuccin-Macchiato-Mauve.kvconfig @@ -0,0 +1,464 @@ +[%General] +author=elkrien based on Arc Dark style +comment=Catppuccin-Macchiato-Mauve +spread_menuitems=true +left_tabs=true +mirror_doc_tabs=true +scroll_width=8 +attach_active_tab=true +composite=true +menu_shadow_depth=7 +tooltip_shadow_depth=0 +splitter_width=7 +check_size=16 +slider_width=4 +slider_handle_width=18 +slider_handle_length=18 +textless_progressbar=false +menubar_mouse_tracking=true +slim_toolbars=false +toolbutton_style=1 +x11drag=menubar_and_primary_toolbar +double_click=false +translucent_windows=false +blurring=false +popup_blurring=true +opaque=kaffeine,kmplayer,subtitlecomposer,kdenlive,vlc,smplayer,smplayer2,avidemux,avidemux2_qt4,avidemux3_qt4,avidemux3_qt5,kamoso,QtCreator,VirtualBox,trojita,dragon,digikam,qmplay2 +group_toolbar_buttons=false +vertical_spin_indicators=false +fill_rubberband=false +spread_progressbar=true +merge_menubar_with_toolbar=true +small_icon_size=16 +large_icon_size=32 +button_icon_size=16 +scroll_arrows=false +iconless_pushbutton=true +toolbar_icon_size=16 +combo_as_lineedit=true +button_contents_shift=false +groupbox_top_label=true +inline_spin_indicators=true +joined_inactive_tabs=false +layout_spacing=2 +submenu_overlap=0 +tooltip_delay=-1 +animate_states=false +transient_scrollbar=true +alt_mnemonic=true +combo_menu=true +layout_margin=4 +no_window_pattern=false +respect_DE=true +scroll_min_extent=36 +scrollable_menu=false +scrollbar_in_view=false +spin_button_width=16 +submenu_delay=250 +tree_branch_line=true +progressbar_thickness=8 +click_behavior=0 +contrast=1.00 +dialog_button_layout=0 +drag_from_buttons=false +hide_combo_checkboxes=false +intensity=1.00 +no_inactiveness=false +reduce_menu_opacity=0 +reduce_window_opacity=10 +saturation=1.00 +shadowless_popup=false +transient_groove=false + +[GeneralColors] +window.color=#24273A +base.color=#1E2030 +alt.base.color=#1E2030 +button.color=#363A4F +light.color=#494D64 +mid.light.color=#494D64 +dark.color=#1E2030 +mid.color=#1E2030 +highlight.color=#C6A0F6 +inactive.highlight.color=#C6A0F6 +text.color=#CAD3F5 +window.text.color=#CAD3F5 +button.text.color=#CAD3F5 +disabled.text.color=#5B6078 +tooltip.text.color=#CAD3F5 +highlight.text.color=#1E2030 +link.color=#F4DBD6 +link.visited.color=#8AADF4 + +[ItemView] +inherits=PanelButtonCommand +frame.element=itemview +interior.element=itemview +frame=true +interior=true +text.iconspacing=3 +text.toggle.color=#1E2030 + +[RadioButton] +inherits=PanelButtonCommand +frame=false +interior.element=radio + +[CheckBox] +inherits=PanelButtonCommand +frame=false +interior.element=checkbox + +[TreeExpander] +indicator.element=tree +indicator.size=8 + +[ToolTip] +frame.top=4 +frame.right=4 +frame.bottom=4 +frame.left=4 +frame=true + +[PanelButtonCommand] +inherits=PanelButtonCommand +interior.element=button +frame.element=button +text.normal.color=#CAD3F5 +text.focus.color=#CAD3F5 +text.press.color=#1E2030 +text.toggle.color=#1E2030 + +[PanelButtonTool] +inherits=PanelButtonCommand + +[DockTitle] +inherits=PanelButtonCommand +interior=false +frame=false +text.margin.top=5 +text.margin.bottom=5 +text.margin.left=5 +text.margin.right=5 +indicator.size=0 + +[Dock] +interior.element=toolbar +frame.element=toolbar +frame=true +interior=true + +[GroupBox] +inherits=PanelButtonCommand +interior.element=tabframe +interior=true +frame=false + +[Focus] +inherits=PanelButtonCommand +frame=true +frame.element=focus +frame.top=1 +frame.bottom=1 +frame.left=1 +frame.right=1 +frame.patternsize=20 + +[GenericFrame] +inherits=PanelButtonCommand +frame.element=common +frame.top=1 +frame.bottom=1 +frame.left=1 +frame.right=1 + +[Slider] +inherits=PanelButtonCommand +interior=true +frame.element=slider +interior.element=slider +frame.top=3 +frame.bottom=3 +frame.left=3 +frame.right=3 +focusFrame=true + +[SliderCursor] +inherits=PanelButtonCommand +interior=true +interior.element=slidercursor +frame=false + +[LineEdit] +inherits=PanelButtonCommand +frame.element=lineedit +interior.element=lineedit + +[IndicatorSpinBox] +inherits=LineEdit +frame.element=lineedit +interior.element=lineedit +frame.top=0 +frame.bottom=2 +frame.left=2 +frame.right=2 +indicator.size=8 + +[DropDownButton] +inherits=PanelButtonCommand +frame.top=2 +frame.bottom=2 +frame.left=0 +frame.right=1 +indicator.size=8 + +[ToolboxTab] +inherits=PanelButtonCommand +frame.element=tabframe +frame.top=1 +frame.bottom=1 +frame.left=1 +frame.right=1 + +[Tab] +inherits=PanelButtonCommand +interior.element=tab +frame.element=tab +frame.top=2 +frame.bottom=3 +frame.left=3 +frame.right=3 +indicator.size=10 +text.normal.color=#5B6078 +text.focus.color=#CAD3F5 +text.press.color=#CAD3F5 +text.toggle.color=#CAD3F5 +focusFrame=true + +[TabBarFrame] +inherits=GenericFrame +frame=true +frame.element=tabBarFrame +interior=false +frame.top=4 +frame.bottom=4 +frame.left=4 +frame.right=4 + +[TabFrame] +inherits=PanelButtonCommand +frame.element=tabframe +interior.element=tabframe + +[Dialog] +inherits=TabBarFrame +frame.element=tabframe +interior=false +frame=false +frame.top=1 +frame.bottom=1 +frame.left=1 +frame.right=1 + +[HeaderSection] +inherits=PanelButtonCommand +interior.element=header +frame.element=header +frame.top=0 +frame.bottom=1 +frame.left=1 +frame.right=1 +frame.expansion=0 +text.normal.color=#CAD3F5 +text.focus.color=#C6A0F6 +text.press.color=#CAD3F5 +text.toggle.color=#CAD3F5 +indicator.element=harrow + +[SizeGrip] +inherits=PanelButtonCommand +frame=false +interior=false +indicator.element=resize-grip +indicator.size=0 + +[Toolbar] +inherits=PanelButtonCommand +interior.element=menubar +frame.element=menubar +frame=true +frame.bottom=4 +frame.left=4 +frame.right=4 +text.normal.color=#CAD3F5 +text.focus.color=#CAD3F5 +text.press.color=#C6A0F6 +text.toggle.color=#C6A0F6 +text.bold=false + +[MenuBar] +inherits=PanelButtonCommand +frame.element=menubar +interior.element=menubar +frame.bottom=0 +text.normal.color=#CAD3F5 +frame.expansion=0 +text.bold=false + +[ToolbarButton] +frame.element=tbutton +interior.element=tbutton +indicator.element=arrow +text.normal.color=#CAD3F5 +text.focus.color=#CAD3F5 +text.press.color=#1E2030 +text.toggle.color=#1E2030 +text.bold=false + +[Scrollbar] +inherits=PanelButtonCommand +indicator.size=0 +interior=false +frame=false + +[ScrollbarGroove] +inherits=PanelButtonCommand +interior=false +frame=false + +[ScrollbarSlider] +inherits=PanelButtonCommand +interior=false +frame.element=scrollbarslider +frame.top=4 +frame.bottom=4 +frame.left=4 +frame.right=4 + +[ProgressbarContents] +inherits=PanelButtonCommand +frame=true +frame.element=progress-pattern +interior.element=progress-pattern +frame.top=2 +frame.bottom=2 +frame.left=2 +frame.right=2 + +[Progressbar] +inherits=PanelButtonCommand +frame.element=progress +interior.element=progress +frame.top=2 +frame.bottom=2 +frame.left=2 +frame.right=2 +text.margin=0 +text.normal.color=#CAD3F5 +text.focus.color=#CAD3F5 +text.press.color=#1E2030 +text.toggle.color=#1E2030 +text.bold=false +frame.expansion=18 + +[RadioButton] +inherits=PanelButtonCommand + +[Menu] +frame.element=menu +interior.element=menu +inherits=PanelButtonCommand +text.press.color=#1E2030 +text.toggle.color=#1E2030 +text.bold=false +frame.top=3 +frame.bottom=3 +frame.left=3 +frame.right=3 + +[MenuItem] +inherits=PanelButtonCommand +interior.element=menuitem +indicator.size=8 +text.focus.color=#CAD3F5 +text.press.color=#CAD3F5 + +[MenuBarItem] +inherits=PanelButtonCommand +interior.element=menubaritem +frame=false +text.margin.top=3 +text.margin.bottom=3 +text.margin.left=5 +text.margin.right=5 + +[StatusBar] +inherits=Toolbar +frame.element=toolbar +font.bold=true +text.normal.color=#CAD3F5 +frame=true +frame.top=0 +frame.bottom=0 + +[TitleBar] +inherits=PanelButtonCommand +frame=false +interior=false +text.margin.top=2 +text.margin.bottom=2 +text.margin.left=3 +text.margin.right=3 + +[ComboBox] +inherits=PanelButtonCommand +indicator.size=8 +frame.top=3 +frame.bottom=3 +frame.left=3 +frame.right=3 +text.margin.top=1 +text.margin.bottom=1 +text.margin.left=3 +text.margin.right=3 +text.toggle.color=#CAD3F5 + +[ToolboxTab] +inherits=PanelButtonCommand +text.normal.color=#CAD3F5 +text.press.color=#CAD3F5 +text.focus.color=#CAD3F5 + +[Hacks] +transparent_dolphin_view=false +blur_konsole=true +transparent_ktitle_label=true +transparent_menutitle=true +respect_darkness=true +kcapacitybar_as_progressbar=true +force_size_grip=false +iconless_pushbutton=true +iconless_menu=false +disabled_icon_opacity=100 +lxqtmainmenu_iconsize=0 +normal_default_pushbutton=true +single_top_toolbar=false +tint_on_mouseover=0 +transparent_pcmanfm_sidepane=true +transparent_pcmanfm_view=false +blur_translucent=true +centered_forms=false +kinetic_scrolling=false +middle_click_scroll=false +no_selection_tint=false +noninteger_translucency=false +style_vertical_toolbars=false +blur_only_active_window=false + +[Window] +interior=true +interior.element=window +frame.top=0 +frame.bottom=0 +frame.left=0 +frame.right=0 diff --git a/kvantum/.config/Kvantum/Catppuccin-Macchiato-Mauve/Catppuccin-Macchiato-Mauve.svg b/kvantum/.config/Kvantum/Catppuccin-Macchiato-Mauve/Catppuccin-Macchiato-Mauve.svg new file mode 100644 index 0000000..e5b7c76 --- /dev/null +++ b/kvantum/.config/Kvantum/Catppuccin-Macchiato-Mauve/Catppuccin-Macchiato-Mauve.svg @@ -0,0 +1,1958 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/kvantum/.config/Kvantum/Catppuccin-Macchiato-Peach/Catppuccin-Macchiato-Peach.kvconfig b/kvantum/.config/Kvantum/Catppuccin-Macchiato-Peach/Catppuccin-Macchiato-Peach.kvconfig new file mode 100644 index 0000000..d49537d --- /dev/null +++ b/kvantum/.config/Kvantum/Catppuccin-Macchiato-Peach/Catppuccin-Macchiato-Peach.kvconfig @@ -0,0 +1,464 @@ +[%General] +author=elkrien based on Arc Dark style +comment=Catppuccin-Macchiato-Peach +spread_menuitems=true +left_tabs=true +mirror_doc_tabs=true +scroll_width=8 +attach_active_tab=true +composite=true +menu_shadow_depth=7 +tooltip_shadow_depth=0 +splitter_width=7 +check_size=16 +slider_width=4 +slider_handle_width=18 +slider_handle_length=18 +textless_progressbar=false +menubar_mouse_tracking=true +slim_toolbars=false +toolbutton_style=1 +x11drag=menubar_and_primary_toolbar +double_click=false +translucent_windows=false +blurring=false +popup_blurring=true +opaque=kaffeine,kmplayer,subtitlecomposer,kdenlive,vlc,smplayer,smplayer2,avidemux,avidemux2_qt4,avidemux3_qt4,avidemux3_qt5,kamoso,QtCreator,VirtualBox,trojita,dragon,digikam,qmplay2 +group_toolbar_buttons=false +vertical_spin_indicators=false +fill_rubberband=false +spread_progressbar=true +merge_menubar_with_toolbar=true +small_icon_size=16 +large_icon_size=32 +button_icon_size=16 +scroll_arrows=false +iconless_pushbutton=true +toolbar_icon_size=16 +combo_as_lineedit=true +button_contents_shift=false +groupbox_top_label=true +inline_spin_indicators=true +joined_inactive_tabs=false +layout_spacing=2 +submenu_overlap=0 +tooltip_delay=-1 +animate_states=false +transient_scrollbar=true +alt_mnemonic=true +combo_menu=true +layout_margin=4 +no_window_pattern=false +respect_DE=true +scroll_min_extent=36 +scrollable_menu=false +scrollbar_in_view=false +spin_button_width=16 +submenu_delay=250 +tree_branch_line=true +progressbar_thickness=8 +click_behavior=0 +contrast=1.00 +dialog_button_layout=0 +drag_from_buttons=false +hide_combo_checkboxes=false +intensity=1.00 +no_inactiveness=false +reduce_menu_opacity=0 +reduce_window_opacity=10 +saturation=1.00 +shadowless_popup=false +transient_groove=false + +[GeneralColors] +window.color=#24273A +base.color=#1E2030 +alt.base.color=#1E2030 +button.color=#363A4F +light.color=#494D64 +mid.light.color=#494D64 +dark.color=#1E2030 +mid.color=#1E2030 +highlight.color=#F5A97F +inactive.highlight.color=#F5A97F +text.color=#CAD3F5 +window.text.color=#CAD3F5 +button.text.color=#CAD3F5 +disabled.text.color=#5B6078 +tooltip.text.color=#CAD3F5 +highlight.text.color=#1E2030 +link.color=#F4DBD6 +link.visited.color=#8AADF4 + +[ItemView] +inherits=PanelButtonCommand +frame.element=itemview +interior.element=itemview +frame=true +interior=true +text.iconspacing=3 +text.toggle.color=#1E2030 + +[RadioButton] +inherits=PanelButtonCommand +frame=false +interior.element=radio + +[CheckBox] +inherits=PanelButtonCommand +frame=false +interior.element=checkbox + +[TreeExpander] +indicator.element=tree +indicator.size=8 + +[ToolTip] +frame.top=4 +frame.right=4 +frame.bottom=4 +frame.left=4 +frame=true + +[PanelButtonCommand] +inherits=PanelButtonCommand +interior.element=button +frame.element=button +text.normal.color=#CAD3F5 +text.focus.color=#CAD3F5 +text.press.color=#1E2030 +text.toggle.color=#1E2030 + +[PanelButtonTool] +inherits=PanelButtonCommand + +[DockTitle] +inherits=PanelButtonCommand +interior=false +frame=false +text.margin.top=5 +text.margin.bottom=5 +text.margin.left=5 +text.margin.right=5 +indicator.size=0 + +[Dock] +interior.element=toolbar +frame.element=toolbar +frame=true +interior=true + +[GroupBox] +inherits=PanelButtonCommand +interior.element=tabframe +interior=true +frame=false + +[Focus] +inherits=PanelButtonCommand +frame=true +frame.element=focus +frame.top=1 +frame.bottom=1 +frame.left=1 +frame.right=1 +frame.patternsize=20 + +[GenericFrame] +inherits=PanelButtonCommand +frame.element=common +frame.top=1 +frame.bottom=1 +frame.left=1 +frame.right=1 + +[Slider] +inherits=PanelButtonCommand +interior=true +frame.element=slider +interior.element=slider +frame.top=3 +frame.bottom=3 +frame.left=3 +frame.right=3 +focusFrame=true + +[SliderCursor] +inherits=PanelButtonCommand +interior=true +interior.element=slidercursor +frame=false + +[LineEdit] +inherits=PanelButtonCommand +frame.element=lineedit +interior.element=lineedit + +[IndicatorSpinBox] +inherits=LineEdit +frame.element=lineedit +interior.element=lineedit +frame.top=0 +frame.bottom=2 +frame.left=2 +frame.right=2 +indicator.size=8 + +[DropDownButton] +inherits=PanelButtonCommand +frame.top=2 +frame.bottom=2 +frame.left=0 +frame.right=1 +indicator.size=8 + +[ToolboxTab] +inherits=PanelButtonCommand +frame.element=tabframe +frame.top=1 +frame.bottom=1 +frame.left=1 +frame.right=1 + +[Tab] +inherits=PanelButtonCommand +interior.element=tab +frame.element=tab +frame.top=2 +frame.bottom=3 +frame.left=3 +frame.right=3 +indicator.size=10 +text.normal.color=#5B6078 +text.focus.color=#CAD3F5 +text.press.color=#CAD3F5 +text.toggle.color=#CAD3F5 +focusFrame=true + +[TabBarFrame] +inherits=GenericFrame +frame=true +frame.element=tabBarFrame +interior=false +frame.top=4 +frame.bottom=4 +frame.left=4 +frame.right=4 + +[TabFrame] +inherits=PanelButtonCommand +frame.element=tabframe +interior.element=tabframe + +[Dialog] +inherits=TabBarFrame +frame.element=tabframe +interior=false +frame=false +frame.top=1 +frame.bottom=1 +frame.left=1 +frame.right=1 + +[HeaderSection] +inherits=PanelButtonCommand +interior.element=header +frame.element=header +frame.top=0 +frame.bottom=1 +frame.left=1 +frame.right=1 +frame.expansion=0 +text.normal.color=#CAD3F5 +text.focus.color=#F5A97F +text.press.color=#CAD3F5 +text.toggle.color=#CAD3F5 +indicator.element=harrow + +[SizeGrip] +inherits=PanelButtonCommand +frame=false +interior=false +indicator.element=resize-grip +indicator.size=0 + +[Toolbar] +inherits=PanelButtonCommand +interior.element=menubar +frame.element=menubar +frame=true +frame.bottom=4 +frame.left=4 +frame.right=4 +text.normal.color=#CAD3F5 +text.focus.color=#CAD3F5 +text.press.color=#F5A97F +text.toggle.color=#F5A97F +text.bold=false + +[MenuBar] +inherits=PanelButtonCommand +frame.element=menubar +interior.element=menubar +frame.bottom=0 +text.normal.color=#CAD3F5 +frame.expansion=0 +text.bold=false + +[ToolbarButton] +frame.element=tbutton +interior.element=tbutton +indicator.element=arrow +text.normal.color=#CAD3F5 +text.focus.color=#CAD3F5 +text.press.color=#1E2030 +text.toggle.color=#1E2030 +text.bold=false + +[Scrollbar] +inherits=PanelButtonCommand +indicator.size=0 +interior=false +frame=false + +[ScrollbarGroove] +inherits=PanelButtonCommand +interior=false +frame=false + +[ScrollbarSlider] +inherits=PanelButtonCommand +interior=false +frame.element=scrollbarslider +frame.top=4 +frame.bottom=4 +frame.left=4 +frame.right=4 + +[ProgressbarContents] +inherits=PanelButtonCommand +frame=true +frame.element=progress-pattern +interior.element=progress-pattern +frame.top=2 +frame.bottom=2 +frame.left=2 +frame.right=2 + +[Progressbar] +inherits=PanelButtonCommand +frame.element=progress +interior.element=progress +frame.top=2 +frame.bottom=2 +frame.left=2 +frame.right=2 +text.margin=0 +text.normal.color=#CAD3F5 +text.focus.color=#CAD3F5 +text.press.color=#1E2030 +text.toggle.color=#1E2030 +text.bold=false +frame.expansion=18 + +[RadioButton] +inherits=PanelButtonCommand + +[Menu] +frame.element=menu +interior.element=menu +inherits=PanelButtonCommand +text.press.color=#1E2030 +text.toggle.color=#1E2030 +text.bold=false +frame.top=3 +frame.bottom=3 +frame.left=3 +frame.right=3 + +[MenuItem] +inherits=PanelButtonCommand +interior.element=menuitem +indicator.size=8 +text.focus.color=#CAD3F5 +text.press.color=#CAD3F5 + +[MenuBarItem] +inherits=PanelButtonCommand +interior.element=menubaritem +frame=false +text.margin.top=3 +text.margin.bottom=3 +text.margin.left=5 +text.margin.right=5 + +[StatusBar] +inherits=Toolbar +frame.element=toolbar +font.bold=true +text.normal.color=#CAD3F5 +frame=true +frame.top=0 +frame.bottom=0 + +[TitleBar] +inherits=PanelButtonCommand +frame=false +interior=false +text.margin.top=2 +text.margin.bottom=2 +text.margin.left=3 +text.margin.right=3 + +[ComboBox] +inherits=PanelButtonCommand +indicator.size=8 +frame.top=3 +frame.bottom=3 +frame.left=3 +frame.right=3 +text.margin.top=1 +text.margin.bottom=1 +text.margin.left=3 +text.margin.right=3 +text.toggle.color=#CAD3F5 + +[ToolboxTab] +inherits=PanelButtonCommand +text.normal.color=#CAD3F5 +text.press.color=#CAD3F5 +text.focus.color=#CAD3F5 + +[Hacks] +transparent_dolphin_view=false +blur_konsole=true +transparent_ktitle_label=true +transparent_menutitle=true +respect_darkness=true +kcapacitybar_as_progressbar=true +force_size_grip=false +iconless_pushbutton=true +iconless_menu=false +disabled_icon_opacity=100 +lxqtmainmenu_iconsize=0 +normal_default_pushbutton=true +single_top_toolbar=false +tint_on_mouseover=0 +transparent_pcmanfm_sidepane=true +transparent_pcmanfm_view=false +blur_translucent=true +centered_forms=false +kinetic_scrolling=false +middle_click_scroll=false +no_selection_tint=false +noninteger_translucency=false +style_vertical_toolbars=false +blur_only_active_window=false + +[Window] +interior=true +interior.element=window +frame.top=0 +frame.bottom=0 +frame.left=0 +frame.right=0 diff --git a/kvantum/.config/Kvantum/Catppuccin-Macchiato-Peach/Catppuccin-Macchiato-Peach.svg b/kvantum/.config/Kvantum/Catppuccin-Macchiato-Peach/Catppuccin-Macchiato-Peach.svg new file mode 100644 index 0000000..78cbc49 --- /dev/null +++ b/kvantum/.config/Kvantum/Catppuccin-Macchiato-Peach/Catppuccin-Macchiato-Peach.svg @@ -0,0 +1,1958 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/kvantum/.config/Kvantum/Catppuccin-Macchiato-Pink/Catppuccin-Macchiato-Pink.kvconfig b/kvantum/.config/Kvantum/Catppuccin-Macchiato-Pink/Catppuccin-Macchiato-Pink.kvconfig new file mode 100644 index 0000000..a7927c6 --- /dev/null +++ b/kvantum/.config/Kvantum/Catppuccin-Macchiato-Pink/Catppuccin-Macchiato-Pink.kvconfig @@ -0,0 +1,464 @@ +[%General] +author=elkrien based on Arc Dark style +comment=Catppuccin-Macchiato-Pink +spread_menuitems=true +left_tabs=true +mirror_doc_tabs=true +scroll_width=8 +attach_active_tab=true +composite=true +menu_shadow_depth=7 +tooltip_shadow_depth=0 +splitter_width=7 +check_size=16 +slider_width=4 +slider_handle_width=18 +slider_handle_length=18 +textless_progressbar=false +menubar_mouse_tracking=true +slim_toolbars=false +toolbutton_style=1 +x11drag=menubar_and_primary_toolbar +double_click=false +translucent_windows=false +blurring=false +popup_blurring=true +opaque=kaffeine,kmplayer,subtitlecomposer,kdenlive,vlc,smplayer,smplayer2,avidemux,avidemux2_qt4,avidemux3_qt4,avidemux3_qt5,kamoso,QtCreator,VirtualBox,trojita,dragon,digikam,qmplay2 +group_toolbar_buttons=false +vertical_spin_indicators=false +fill_rubberband=false +spread_progressbar=true +merge_menubar_with_toolbar=true +small_icon_size=16 +large_icon_size=32 +button_icon_size=16 +scroll_arrows=false +iconless_pushbutton=true +toolbar_icon_size=16 +combo_as_lineedit=true +button_contents_shift=false +groupbox_top_label=true +inline_spin_indicators=true +joined_inactive_tabs=false +layout_spacing=2 +submenu_overlap=0 +tooltip_delay=-1 +animate_states=false +transient_scrollbar=true +alt_mnemonic=true +combo_menu=true +layout_margin=4 +no_window_pattern=false +respect_DE=true +scroll_min_extent=36 +scrollable_menu=false +scrollbar_in_view=false +spin_button_width=16 +submenu_delay=250 +tree_branch_line=true +progressbar_thickness=8 +click_behavior=0 +contrast=1.00 +dialog_button_layout=0 +drag_from_buttons=false +hide_combo_checkboxes=false +intensity=1.00 +no_inactiveness=false +reduce_menu_opacity=0 +reduce_window_opacity=10 +saturation=1.00 +shadowless_popup=false +transient_groove=false + +[GeneralColors] +window.color=#24273A +base.color=#1E2030 +alt.base.color=#1E2030 +button.color=#363A4F +light.color=#494D64 +mid.light.color=#494D64 +dark.color=#1E2030 +mid.color=#1E2030 +highlight.color=#F5BDE6 +inactive.highlight.color=#F5BDE6 +text.color=#CAD3F5 +window.text.color=#CAD3F5 +button.text.color=#CAD3F5 +disabled.text.color=#5B6078 +tooltip.text.color=#CAD3F5 +highlight.text.color=#1E2030 +link.color=#F4DBD6 +link.visited.color=#8AADF4 + +[ItemView] +inherits=PanelButtonCommand +frame.element=itemview +interior.element=itemview +frame=true +interior=true +text.iconspacing=3 +text.toggle.color=#1E2030 + +[RadioButton] +inherits=PanelButtonCommand +frame=false +interior.element=radio + +[CheckBox] +inherits=PanelButtonCommand +frame=false +interior.element=checkbox + +[TreeExpander] +indicator.element=tree +indicator.size=8 + +[ToolTip] +frame.top=4 +frame.right=4 +frame.bottom=4 +frame.left=4 +frame=true + +[PanelButtonCommand] +inherits=PanelButtonCommand +interior.element=button +frame.element=button +text.normal.color=#CAD3F5 +text.focus.color=#CAD3F5 +text.press.color=#1E2030 +text.toggle.color=#1E2030 + +[PanelButtonTool] +inherits=PanelButtonCommand + +[DockTitle] +inherits=PanelButtonCommand +interior=false +frame=false +text.margin.top=5 +text.margin.bottom=5 +text.margin.left=5 +text.margin.right=5 +indicator.size=0 + +[Dock] +interior.element=toolbar +frame.element=toolbar +frame=true +interior=true + +[GroupBox] +inherits=PanelButtonCommand +interior.element=tabframe +interior=true +frame=false + +[Focus] +inherits=PanelButtonCommand +frame=true +frame.element=focus +frame.top=1 +frame.bottom=1 +frame.left=1 +frame.right=1 +frame.patternsize=20 + +[GenericFrame] +inherits=PanelButtonCommand +frame.element=common +frame.top=1 +frame.bottom=1 +frame.left=1 +frame.right=1 + +[Slider] +inherits=PanelButtonCommand +interior=true +frame.element=slider +interior.element=slider +frame.top=3 +frame.bottom=3 +frame.left=3 +frame.right=3 +focusFrame=true + +[SliderCursor] +inherits=PanelButtonCommand +interior=true +interior.element=slidercursor +frame=false + +[LineEdit] +inherits=PanelButtonCommand +frame.element=lineedit +interior.element=lineedit + +[IndicatorSpinBox] +inherits=LineEdit +frame.element=lineedit +interior.element=lineedit +frame.top=0 +frame.bottom=2 +frame.left=2 +frame.right=2 +indicator.size=8 + +[DropDownButton] +inherits=PanelButtonCommand +frame.top=2 +frame.bottom=2 +frame.left=0 +frame.right=1 +indicator.size=8 + +[ToolboxTab] +inherits=PanelButtonCommand +frame.element=tabframe +frame.top=1 +frame.bottom=1 +frame.left=1 +frame.right=1 + +[Tab] +inherits=PanelButtonCommand +interior.element=tab +frame.element=tab +frame.top=2 +frame.bottom=3 +frame.left=3 +frame.right=3 +indicator.size=10 +text.normal.color=#5B6078 +text.focus.color=#CAD3F5 +text.press.color=#CAD3F5 +text.toggle.color=#CAD3F5 +focusFrame=true + +[TabBarFrame] +inherits=GenericFrame +frame=true +frame.element=tabBarFrame +interior=false +frame.top=4 +frame.bottom=4 +frame.left=4 +frame.right=4 + +[TabFrame] +inherits=PanelButtonCommand +frame.element=tabframe +interior.element=tabframe + +[Dialog] +inherits=TabBarFrame +frame.element=tabframe +interior=false +frame=false +frame.top=1 +frame.bottom=1 +frame.left=1 +frame.right=1 + +[HeaderSection] +inherits=PanelButtonCommand +interior.element=header +frame.element=header +frame.top=0 +frame.bottom=1 +frame.left=1 +frame.right=1 +frame.expansion=0 +text.normal.color=#CAD3F5 +text.focus.color=#F5BDE6 +text.press.color=#CAD3F5 +text.toggle.color=#CAD3F5 +indicator.element=harrow + +[SizeGrip] +inherits=PanelButtonCommand +frame=false +interior=false +indicator.element=resize-grip +indicator.size=0 + +[Toolbar] +inherits=PanelButtonCommand +interior.element=menubar +frame.element=menubar +frame=true +frame.bottom=4 +frame.left=4 +frame.right=4 +text.normal.color=#CAD3F5 +text.focus.color=#CAD3F5 +text.press.color=#F5BDE6 +text.toggle.color=#F5BDE6 +text.bold=false + +[MenuBar] +inherits=PanelButtonCommand +frame.element=menubar +interior.element=menubar +frame.bottom=0 +text.normal.color=#CAD3F5 +frame.expansion=0 +text.bold=false + +[ToolbarButton] +frame.element=tbutton +interior.element=tbutton +indicator.element=arrow +text.normal.color=#CAD3F5 +text.focus.color=#CAD3F5 +text.press.color=#1E2030 +text.toggle.color=#1E2030 +text.bold=false + +[Scrollbar] +inherits=PanelButtonCommand +indicator.size=0 +interior=false +frame=false + +[ScrollbarGroove] +inherits=PanelButtonCommand +interior=false +frame=false + +[ScrollbarSlider] +inherits=PanelButtonCommand +interior=false +frame.element=scrollbarslider +frame.top=4 +frame.bottom=4 +frame.left=4 +frame.right=4 + +[ProgressbarContents] +inherits=PanelButtonCommand +frame=true +frame.element=progress-pattern +interior.element=progress-pattern +frame.top=2 +frame.bottom=2 +frame.left=2 +frame.right=2 + +[Progressbar] +inherits=PanelButtonCommand +frame.element=progress +interior.element=progress +frame.top=2 +frame.bottom=2 +frame.left=2 +frame.right=2 +text.margin=0 +text.normal.color=#CAD3F5 +text.focus.color=#CAD3F5 +text.press.color=#1E2030 +text.toggle.color=#1E2030 +text.bold=false +frame.expansion=18 + +[RadioButton] +inherits=PanelButtonCommand + +[Menu] +frame.element=menu +interior.element=menu +inherits=PanelButtonCommand +text.press.color=#1E2030 +text.toggle.color=#1E2030 +text.bold=false +frame.top=3 +frame.bottom=3 +frame.left=3 +frame.right=3 + +[MenuItem] +inherits=PanelButtonCommand +interior.element=menuitem +indicator.size=8 +text.focus.color=#CAD3F5 +text.press.color=#CAD3F5 + +[MenuBarItem] +inherits=PanelButtonCommand +interior.element=menubaritem +frame=false +text.margin.top=3 +text.margin.bottom=3 +text.margin.left=5 +text.margin.right=5 + +[StatusBar] +inherits=Toolbar +frame.element=toolbar +font.bold=true +text.normal.color=#CAD3F5 +frame=true +frame.top=0 +frame.bottom=0 + +[TitleBar] +inherits=PanelButtonCommand +frame=false +interior=false +text.margin.top=2 +text.margin.bottom=2 +text.margin.left=3 +text.margin.right=3 + +[ComboBox] +inherits=PanelButtonCommand +indicator.size=8 +frame.top=3 +frame.bottom=3 +frame.left=3 +frame.right=3 +text.margin.top=1 +text.margin.bottom=1 +text.margin.left=3 +text.margin.right=3 +text.toggle.color=#CAD3F5 + +[ToolboxTab] +inherits=PanelButtonCommand +text.normal.color=#CAD3F5 +text.press.color=#CAD3F5 +text.focus.color=#CAD3F5 + +[Hacks] +transparent_dolphin_view=false +blur_konsole=true +transparent_ktitle_label=true +transparent_menutitle=true +respect_darkness=true +kcapacitybar_as_progressbar=true +force_size_grip=false +iconless_pushbutton=true +iconless_menu=false +disabled_icon_opacity=100 +lxqtmainmenu_iconsize=0 +normal_default_pushbutton=true +single_top_toolbar=false +tint_on_mouseover=0 +transparent_pcmanfm_sidepane=true +transparent_pcmanfm_view=false +blur_translucent=true +centered_forms=false +kinetic_scrolling=false +middle_click_scroll=false +no_selection_tint=false +noninteger_translucency=false +style_vertical_toolbars=false +blur_only_active_window=false + +[Window] +interior=true +interior.element=window +frame.top=0 +frame.bottom=0 +frame.left=0 +frame.right=0 diff --git a/kvantum/.config/Kvantum/Catppuccin-Macchiato-Pink/Catppuccin-Macchiato-Pink.svg b/kvantum/.config/Kvantum/Catppuccin-Macchiato-Pink/Catppuccin-Macchiato-Pink.svg new file mode 100644 index 0000000..f7b8339 --- /dev/null +++ b/kvantum/.config/Kvantum/Catppuccin-Macchiato-Pink/Catppuccin-Macchiato-Pink.svg @@ -0,0 +1,1958 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/kvantum/.config/Kvantum/Catppuccin-Macchiato-Red/Catppuccin-Macchiato-Red.kvconfig b/kvantum/.config/Kvantum/Catppuccin-Macchiato-Red/Catppuccin-Macchiato-Red.kvconfig index 603b2ab..38183bb 100644 --- a/kvantum/.config/Kvantum/Catppuccin-Macchiato-Red/Catppuccin-Macchiato-Red.kvconfig +++ b/kvantum/.config/Kvantum/Catppuccin-Macchiato-Red/Catppuccin-Macchiato-Red.kvconfig @@ -69,8 +69,6 @@ reduce_window_opacity=10 saturation=1.00 shadowless_popup=false transient_groove=false -menu_blur_radius=0 -tooltip_blur_radius=0 [GeneralColors] window.color=#24273A @@ -450,7 +448,7 @@ transparent_pcmanfm_sidepane=true transparent_pcmanfm_view=false blur_translucent=true centered_forms=false -kinetic_scrolling=true +kinetic_scrolling=false middle_click_scroll=false no_selection_tint=false noninteger_translucency=false diff --git a/kvantum/.config/Kvantum/Catppuccin-Macchiato-Rosewater/Catppuccin-Macchiato-Rosewater.kvconfig b/kvantum/.config/Kvantum/Catppuccin-Macchiato-Rosewater/Catppuccin-Macchiato-Rosewater.kvconfig new file mode 100644 index 0000000..620f09b --- /dev/null +++ b/kvantum/.config/Kvantum/Catppuccin-Macchiato-Rosewater/Catppuccin-Macchiato-Rosewater.kvconfig @@ -0,0 +1,464 @@ +[%General] +author=elkrien based on Arc Dark style +comment=Catppuccin-Macchiato-Rosewater +spread_menuitems=true +left_tabs=true +mirror_doc_tabs=true +scroll_width=8 +attach_active_tab=true +composite=true +menu_shadow_depth=7 +tooltip_shadow_depth=0 +splitter_width=7 +check_size=16 +slider_width=4 +slider_handle_width=18 +slider_handle_length=18 +textless_progressbar=false +menubar_mouse_tracking=true +slim_toolbars=false +toolbutton_style=1 +x11drag=menubar_and_primary_toolbar +double_click=false +translucent_windows=false +blurring=false +popup_blurring=true +opaque=kaffeine,kmplayer,subtitlecomposer,kdenlive,vlc,smplayer,smplayer2,avidemux,avidemux2_qt4,avidemux3_qt4,avidemux3_qt5,kamoso,QtCreator,VirtualBox,trojita,dragon,digikam,qmplay2 +group_toolbar_buttons=false +vertical_spin_indicators=false +fill_rubberband=false +spread_progressbar=true +merge_menubar_with_toolbar=true +small_icon_size=16 +large_icon_size=32 +button_icon_size=16 +scroll_arrows=false +iconless_pushbutton=true +toolbar_icon_size=16 +combo_as_lineedit=true +button_contents_shift=false +groupbox_top_label=true +inline_spin_indicators=true +joined_inactive_tabs=false +layout_spacing=2 +submenu_overlap=0 +tooltip_delay=-1 +animate_states=false +transient_scrollbar=true +alt_mnemonic=true +combo_menu=true +layout_margin=4 +no_window_pattern=false +respect_DE=true +scroll_min_extent=36 +scrollable_menu=false +scrollbar_in_view=false +spin_button_width=16 +submenu_delay=250 +tree_branch_line=true +progressbar_thickness=8 +click_behavior=0 +contrast=1.00 +dialog_button_layout=0 +drag_from_buttons=false +hide_combo_checkboxes=false +intensity=1.00 +no_inactiveness=false +reduce_menu_opacity=0 +reduce_window_opacity=10 +saturation=1.00 +shadowless_popup=false +transient_groove=false + +[GeneralColors] +window.color=#24273A +base.color=#1E2030 +alt.base.color=#1E2030 +button.color=#363A4F +light.color=#494D64 +mid.light.color=#494D64 +dark.color=#1E2030 +mid.color=#1E2030 +highlight.color=#F4DBD6 +inactive.highlight.color=#F4DBD6 +text.color=#CAD3F5 +window.text.color=#CAD3F5 +button.text.color=#CAD3F5 +disabled.text.color=#5B6078 +tooltip.text.color=#CAD3F5 +highlight.text.color=#1E2030 +link.color=#F4DBD6 +link.visited.color=#8AADF4 + +[ItemView] +inherits=PanelButtonCommand +frame.element=itemview +interior.element=itemview +frame=true +interior=true +text.iconspacing=3 +text.toggle.color=#1E2030 + +[RadioButton] +inherits=PanelButtonCommand +frame=false +interior.element=radio + +[CheckBox] +inherits=PanelButtonCommand +frame=false +interior.element=checkbox + +[TreeExpander] +indicator.element=tree +indicator.size=8 + +[ToolTip] +frame.top=4 +frame.right=4 +frame.bottom=4 +frame.left=4 +frame=true + +[PanelButtonCommand] +inherits=PanelButtonCommand +interior.element=button +frame.element=button +text.normal.color=#CAD3F5 +text.focus.color=#CAD3F5 +text.press.color=#1E2030 +text.toggle.color=#1E2030 + +[PanelButtonTool] +inherits=PanelButtonCommand + +[DockTitle] +inherits=PanelButtonCommand +interior=false +frame=false +text.margin.top=5 +text.margin.bottom=5 +text.margin.left=5 +text.margin.right=5 +indicator.size=0 + +[Dock] +interior.element=toolbar +frame.element=toolbar +frame=true +interior=true + +[GroupBox] +inherits=PanelButtonCommand +interior.element=tabframe +interior=true +frame=false + +[Focus] +inherits=PanelButtonCommand +frame=true +frame.element=focus +frame.top=1 +frame.bottom=1 +frame.left=1 +frame.right=1 +frame.patternsize=20 + +[GenericFrame] +inherits=PanelButtonCommand +frame.element=common +frame.top=1 +frame.bottom=1 +frame.left=1 +frame.right=1 + +[Slider] +inherits=PanelButtonCommand +interior=true +frame.element=slider +interior.element=slider +frame.top=3 +frame.bottom=3 +frame.left=3 +frame.right=3 +focusFrame=true + +[SliderCursor] +inherits=PanelButtonCommand +interior=true +interior.element=slidercursor +frame=false + +[LineEdit] +inherits=PanelButtonCommand +frame.element=lineedit +interior.element=lineedit + +[IndicatorSpinBox] +inherits=LineEdit +frame.element=lineedit +interior.element=lineedit +frame.top=0 +frame.bottom=2 +frame.left=2 +frame.right=2 +indicator.size=8 + +[DropDownButton] +inherits=PanelButtonCommand +frame.top=2 +frame.bottom=2 +frame.left=0 +frame.right=1 +indicator.size=8 + +[ToolboxTab] +inherits=PanelButtonCommand +frame.element=tabframe +frame.top=1 +frame.bottom=1 +frame.left=1 +frame.right=1 + +[Tab] +inherits=PanelButtonCommand +interior.element=tab +frame.element=tab +frame.top=2 +frame.bottom=3 +frame.left=3 +frame.right=3 +indicator.size=10 +text.normal.color=#5B6078 +text.focus.color=#CAD3F5 +text.press.color=#CAD3F5 +text.toggle.color=#CAD3F5 +focusFrame=true + +[TabBarFrame] +inherits=GenericFrame +frame=true +frame.element=tabBarFrame +interior=false +frame.top=4 +frame.bottom=4 +frame.left=4 +frame.right=4 + +[TabFrame] +inherits=PanelButtonCommand +frame.element=tabframe +interior.element=tabframe + +[Dialog] +inherits=TabBarFrame +frame.element=tabframe +interior=false +frame=false +frame.top=1 +frame.bottom=1 +frame.left=1 +frame.right=1 + +[HeaderSection] +inherits=PanelButtonCommand +interior.element=header +frame.element=header +frame.top=0 +frame.bottom=1 +frame.left=1 +frame.right=1 +frame.expansion=0 +text.normal.color=#CAD3F5 +text.focus.color=#F4DBD6 +text.press.color=#CAD3F5 +text.toggle.color=#CAD3F5 +indicator.element=harrow + +[SizeGrip] +inherits=PanelButtonCommand +frame=false +interior=false +indicator.element=resize-grip +indicator.size=0 + +[Toolbar] +inherits=PanelButtonCommand +interior.element=menubar +frame.element=menubar +frame=true +frame.bottom=4 +frame.left=4 +frame.right=4 +text.normal.color=#CAD3F5 +text.focus.color=#CAD3F5 +text.press.color=#F4DBD6 +text.toggle.color=#F4DBD6 +text.bold=false + +[MenuBar] +inherits=PanelButtonCommand +frame.element=menubar +interior.element=menubar +frame.bottom=0 +text.normal.color=#CAD3F5 +frame.expansion=0 +text.bold=false + +[ToolbarButton] +frame.element=tbutton +interior.element=tbutton +indicator.element=arrow +text.normal.color=#CAD3F5 +text.focus.color=#CAD3F5 +text.press.color=#1E2030 +text.toggle.color=#1E2030 +text.bold=false + +[Scrollbar] +inherits=PanelButtonCommand +indicator.size=0 +interior=false +frame=false + +[ScrollbarGroove] +inherits=PanelButtonCommand +interior=false +frame=false + +[ScrollbarSlider] +inherits=PanelButtonCommand +interior=false +frame.element=scrollbarslider +frame.top=4 +frame.bottom=4 +frame.left=4 +frame.right=4 + +[ProgressbarContents] +inherits=PanelButtonCommand +frame=true +frame.element=progress-pattern +interior.element=progress-pattern +frame.top=2 +frame.bottom=2 +frame.left=2 +frame.right=2 + +[Progressbar] +inherits=PanelButtonCommand +frame.element=progress +interior.element=progress +frame.top=2 +frame.bottom=2 +frame.left=2 +frame.right=2 +text.margin=0 +text.normal.color=#CAD3F5 +text.focus.color=#CAD3F5 +text.press.color=#1E2030 +text.toggle.color=#1E2030 +text.bold=false +frame.expansion=18 + +[RadioButton] +inherits=PanelButtonCommand + +[Menu] +frame.element=menu +interior.element=menu +inherits=PanelButtonCommand +text.press.color=#1E2030 +text.toggle.color=#1E2030 +text.bold=false +frame.top=3 +frame.bottom=3 +frame.left=3 +frame.right=3 + +[MenuItem] +inherits=PanelButtonCommand +interior.element=menuitem +indicator.size=8 +text.focus.color=#CAD3F5 +text.press.color=#CAD3F5 + +[MenuBarItem] +inherits=PanelButtonCommand +interior.element=menubaritem +frame=false +text.margin.top=3 +text.margin.bottom=3 +text.margin.left=5 +text.margin.right=5 + +[StatusBar] +inherits=Toolbar +frame.element=toolbar +font.bold=true +text.normal.color=#CAD3F5 +frame=true +frame.top=0 +frame.bottom=0 + +[TitleBar] +inherits=PanelButtonCommand +frame=false +interior=false +text.margin.top=2 +text.margin.bottom=2 +text.margin.left=3 +text.margin.right=3 + +[ComboBox] +inherits=PanelButtonCommand +indicator.size=8 +frame.top=3 +frame.bottom=3 +frame.left=3 +frame.right=3 +text.margin.top=1 +text.margin.bottom=1 +text.margin.left=3 +text.margin.right=3 +text.toggle.color=#CAD3F5 + +[ToolboxTab] +inherits=PanelButtonCommand +text.normal.color=#CAD3F5 +text.press.color=#CAD3F5 +text.focus.color=#CAD3F5 + +[Hacks] +transparent_dolphin_view=false +blur_konsole=true +transparent_ktitle_label=true +transparent_menutitle=true +respect_darkness=true +kcapacitybar_as_progressbar=true +force_size_grip=false +iconless_pushbutton=true +iconless_menu=false +disabled_icon_opacity=100 +lxqtmainmenu_iconsize=0 +normal_default_pushbutton=true +single_top_toolbar=false +tint_on_mouseover=0 +transparent_pcmanfm_sidepane=true +transparent_pcmanfm_view=false +blur_translucent=true +centered_forms=false +kinetic_scrolling=false +middle_click_scroll=false +no_selection_tint=false +noninteger_translucency=false +style_vertical_toolbars=false +blur_only_active_window=false + +[Window] +interior=true +interior.element=window +frame.top=0 +frame.bottom=0 +frame.left=0 +frame.right=0 diff --git a/kvantum/.config/Kvantum/Catppuccin-Macchiato-Rosewater/Catppuccin-Macchiato-Rosewater.svg b/kvantum/.config/Kvantum/Catppuccin-Macchiato-Rosewater/Catppuccin-Macchiato-Rosewater.svg new file mode 100644 index 0000000..f287bf6 --- /dev/null +++ b/kvantum/.config/Kvantum/Catppuccin-Macchiato-Rosewater/Catppuccin-Macchiato-Rosewater.svg @@ -0,0 +1,1958 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/kvantum/.config/Kvantum/Catppuccin-Macchiato-Sapphire/Catppuccin-Macchiato-Sapphire.kvconfig b/kvantum/.config/Kvantum/Catppuccin-Macchiato-Sapphire/Catppuccin-Macchiato-Sapphire.kvconfig new file mode 100644 index 0000000..3637580 --- /dev/null +++ b/kvantum/.config/Kvantum/Catppuccin-Macchiato-Sapphire/Catppuccin-Macchiato-Sapphire.kvconfig @@ -0,0 +1,464 @@ +[%General] +author=elkrien based on Arc Dark style +comment=Catppuccin-Macchiato-Sapphire +spread_menuitems=true +left_tabs=true +mirror_doc_tabs=true +scroll_width=8 +attach_active_tab=true +composite=true +menu_shadow_depth=7 +tooltip_shadow_depth=0 +splitter_width=7 +check_size=16 +slider_width=4 +slider_handle_width=18 +slider_handle_length=18 +textless_progressbar=false +menubar_mouse_tracking=true +slim_toolbars=false +toolbutton_style=1 +x11drag=menubar_and_primary_toolbar +double_click=false +translucent_windows=false +blurring=false +popup_blurring=true +opaque=kaffeine,kmplayer,subtitlecomposer,kdenlive,vlc,smplayer,smplayer2,avidemux,avidemux2_qt4,avidemux3_qt4,avidemux3_qt5,kamoso,QtCreator,VirtualBox,trojita,dragon,digikam,qmplay2 +group_toolbar_buttons=false +vertical_spin_indicators=false +fill_rubberband=false +spread_progressbar=true +merge_menubar_with_toolbar=true +small_icon_size=16 +large_icon_size=32 +button_icon_size=16 +scroll_arrows=false +iconless_pushbutton=true +toolbar_icon_size=16 +combo_as_lineedit=true +button_contents_shift=false +groupbox_top_label=true +inline_spin_indicators=true +joined_inactive_tabs=false +layout_spacing=2 +submenu_overlap=0 +tooltip_delay=-1 +animate_states=false +transient_scrollbar=true +alt_mnemonic=true +combo_menu=true +layout_margin=4 +no_window_pattern=false +respect_DE=true +scroll_min_extent=36 +scrollable_menu=false +scrollbar_in_view=false +spin_button_width=16 +submenu_delay=250 +tree_branch_line=true +progressbar_thickness=8 +click_behavior=0 +contrast=1.00 +dialog_button_layout=0 +drag_from_buttons=false +hide_combo_checkboxes=false +intensity=1.00 +no_inactiveness=false +reduce_menu_opacity=0 +reduce_window_opacity=10 +saturation=1.00 +shadowless_popup=false +transient_groove=false + +[GeneralColors] +window.color=#24273A +base.color=#1E2030 +alt.base.color=#1E2030 +button.color=#363A4F +light.color=#494D64 +mid.light.color=#494D64 +dark.color=#1E2030 +mid.color=#1E2030 +highlight.color=#7DC4E4 +inactive.highlight.color=#7DC4E4 +text.color=#CAD3F5 +window.text.color=#CAD3F5 +button.text.color=#CAD3F5 +disabled.text.color=#5B6078 +tooltip.text.color=#CAD3F5 +highlight.text.color=#1E2030 +link.color=#F4DBD6 +link.visited.color=#8AADF4 + +[ItemView] +inherits=PanelButtonCommand +frame.element=itemview +interior.element=itemview +frame=true +interior=true +text.iconspacing=3 +text.toggle.color=#1E2030 + +[RadioButton] +inherits=PanelButtonCommand +frame=false +interior.element=radio + +[CheckBox] +inherits=PanelButtonCommand +frame=false +interior.element=checkbox + +[TreeExpander] +indicator.element=tree +indicator.size=8 + +[ToolTip] +frame.top=4 +frame.right=4 +frame.bottom=4 +frame.left=4 +frame=true + +[PanelButtonCommand] +inherits=PanelButtonCommand +interior.element=button +frame.element=button +text.normal.color=#CAD3F5 +text.focus.color=#CAD3F5 +text.press.color=#1E2030 +text.toggle.color=#1E2030 + +[PanelButtonTool] +inherits=PanelButtonCommand + +[DockTitle] +inherits=PanelButtonCommand +interior=false +frame=false +text.margin.top=5 +text.margin.bottom=5 +text.margin.left=5 +text.margin.right=5 +indicator.size=0 + +[Dock] +interior.element=toolbar +frame.element=toolbar +frame=true +interior=true + +[GroupBox] +inherits=PanelButtonCommand +interior.element=tabframe +interior=true +frame=false + +[Focus] +inherits=PanelButtonCommand +frame=true +frame.element=focus +frame.top=1 +frame.bottom=1 +frame.left=1 +frame.right=1 +frame.patternsize=20 + +[GenericFrame] +inherits=PanelButtonCommand +frame.element=common +frame.top=1 +frame.bottom=1 +frame.left=1 +frame.right=1 + +[Slider] +inherits=PanelButtonCommand +interior=true +frame.element=slider +interior.element=slider +frame.top=3 +frame.bottom=3 +frame.left=3 +frame.right=3 +focusFrame=true + +[SliderCursor] +inherits=PanelButtonCommand +interior=true +interior.element=slidercursor +frame=false + +[LineEdit] +inherits=PanelButtonCommand +frame.element=lineedit +interior.element=lineedit + +[IndicatorSpinBox] +inherits=LineEdit +frame.element=lineedit +interior.element=lineedit +frame.top=0 +frame.bottom=2 +frame.left=2 +frame.right=2 +indicator.size=8 + +[DropDownButton] +inherits=PanelButtonCommand +frame.top=2 +frame.bottom=2 +frame.left=0 +frame.right=1 +indicator.size=8 + +[ToolboxTab] +inherits=PanelButtonCommand +frame.element=tabframe +frame.top=1 +frame.bottom=1 +frame.left=1 +frame.right=1 + +[Tab] +inherits=PanelButtonCommand +interior.element=tab +frame.element=tab +frame.top=2 +frame.bottom=3 +frame.left=3 +frame.right=3 +indicator.size=10 +text.normal.color=#5B6078 +text.focus.color=#CAD3F5 +text.press.color=#CAD3F5 +text.toggle.color=#CAD3F5 +focusFrame=true + +[TabBarFrame] +inherits=GenericFrame +frame=true +frame.element=tabBarFrame +interior=false +frame.top=4 +frame.bottom=4 +frame.left=4 +frame.right=4 + +[TabFrame] +inherits=PanelButtonCommand +frame.element=tabframe +interior.element=tabframe + +[Dialog] +inherits=TabBarFrame +frame.element=tabframe +interior=false +frame=false +frame.top=1 +frame.bottom=1 +frame.left=1 +frame.right=1 + +[HeaderSection] +inherits=PanelButtonCommand +interior.element=header +frame.element=header +frame.top=0 +frame.bottom=1 +frame.left=1 +frame.right=1 +frame.expansion=0 +text.normal.color=#CAD3F5 +text.focus.color=#7DC4E4 +text.press.color=#CAD3F5 +text.toggle.color=#CAD3F5 +indicator.element=harrow + +[SizeGrip] +inherits=PanelButtonCommand +frame=false +interior=false +indicator.element=resize-grip +indicator.size=0 + +[Toolbar] +inherits=PanelButtonCommand +interior.element=menubar +frame.element=menubar +frame=true +frame.bottom=4 +frame.left=4 +frame.right=4 +text.normal.color=#CAD3F5 +text.focus.color=#CAD3F5 +text.press.color=#7DC4E4 +text.toggle.color=#7DC4E4 +text.bold=false + +[MenuBar] +inherits=PanelButtonCommand +frame.element=menubar +interior.element=menubar +frame.bottom=0 +text.normal.color=#CAD3F5 +frame.expansion=0 +text.bold=false + +[ToolbarButton] +frame.element=tbutton +interior.element=tbutton +indicator.element=arrow +text.normal.color=#CAD3F5 +text.focus.color=#CAD3F5 +text.press.color=#1E2030 +text.toggle.color=#1E2030 +text.bold=false + +[Scrollbar] +inherits=PanelButtonCommand +indicator.size=0 +interior=false +frame=false + +[ScrollbarGroove] +inherits=PanelButtonCommand +interior=false +frame=false + +[ScrollbarSlider] +inherits=PanelButtonCommand +interior=false +frame.element=scrollbarslider +frame.top=4 +frame.bottom=4 +frame.left=4 +frame.right=4 + +[ProgressbarContents] +inherits=PanelButtonCommand +frame=true +frame.element=progress-pattern +interior.element=progress-pattern +frame.top=2 +frame.bottom=2 +frame.left=2 +frame.right=2 + +[Progressbar] +inherits=PanelButtonCommand +frame.element=progress +interior.element=progress +frame.top=2 +frame.bottom=2 +frame.left=2 +frame.right=2 +text.margin=0 +text.normal.color=#CAD3F5 +text.focus.color=#CAD3F5 +text.press.color=#1E2030 +text.toggle.color=#1E2030 +text.bold=false +frame.expansion=18 + +[RadioButton] +inherits=PanelButtonCommand + +[Menu] +frame.element=menu +interior.element=menu +inherits=PanelButtonCommand +text.press.color=#1E2030 +text.toggle.color=#1E2030 +text.bold=false +frame.top=3 +frame.bottom=3 +frame.left=3 +frame.right=3 + +[MenuItem] +inherits=PanelButtonCommand +interior.element=menuitem +indicator.size=8 +text.focus.color=#CAD3F5 +text.press.color=#CAD3F5 + +[MenuBarItem] +inherits=PanelButtonCommand +interior.element=menubaritem +frame=false +text.margin.top=3 +text.margin.bottom=3 +text.margin.left=5 +text.margin.right=5 + +[StatusBar] +inherits=Toolbar +frame.element=toolbar +font.bold=true +text.normal.color=#CAD3F5 +frame=true +frame.top=0 +frame.bottom=0 + +[TitleBar] +inherits=PanelButtonCommand +frame=false +interior=false +text.margin.top=2 +text.margin.bottom=2 +text.margin.left=3 +text.margin.right=3 + +[ComboBox] +inherits=PanelButtonCommand +indicator.size=8 +frame.top=3 +frame.bottom=3 +frame.left=3 +frame.right=3 +text.margin.top=1 +text.margin.bottom=1 +text.margin.left=3 +text.margin.right=3 +text.toggle.color=#CAD3F5 + +[ToolboxTab] +inherits=PanelButtonCommand +text.normal.color=#CAD3F5 +text.press.color=#CAD3F5 +text.focus.color=#CAD3F5 + +[Hacks] +transparent_dolphin_view=false +blur_konsole=true +transparent_ktitle_label=true +transparent_menutitle=true +respect_darkness=true +kcapacitybar_as_progressbar=true +force_size_grip=false +iconless_pushbutton=true +iconless_menu=false +disabled_icon_opacity=100 +lxqtmainmenu_iconsize=0 +normal_default_pushbutton=true +single_top_toolbar=false +tint_on_mouseover=0 +transparent_pcmanfm_sidepane=true +transparent_pcmanfm_view=false +blur_translucent=true +centered_forms=false +kinetic_scrolling=false +middle_click_scroll=false +no_selection_tint=false +noninteger_translucency=false +style_vertical_toolbars=false +blur_only_active_window=false + +[Window] +interior=true +interior.element=window +frame.top=0 +frame.bottom=0 +frame.left=0 +frame.right=0 diff --git a/kvantum/.config/Kvantum/Catppuccin-Macchiato-Sapphire/Catppuccin-Macchiato-Sapphire.svg b/kvantum/.config/Kvantum/Catppuccin-Macchiato-Sapphire/Catppuccin-Macchiato-Sapphire.svg new file mode 100644 index 0000000..81f261e --- /dev/null +++ b/kvantum/.config/Kvantum/Catppuccin-Macchiato-Sapphire/Catppuccin-Macchiato-Sapphire.svg @@ -0,0 +1,1958 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/kvantum/.config/Kvantum/Catppuccin-Macchiato-Sky/Catppuccin-Macchiato-Sky.kvconfig b/kvantum/.config/Kvantum/Catppuccin-Macchiato-Sky/Catppuccin-Macchiato-Sky.kvconfig new file mode 100644 index 0000000..bffee49 --- /dev/null +++ b/kvantum/.config/Kvantum/Catppuccin-Macchiato-Sky/Catppuccin-Macchiato-Sky.kvconfig @@ -0,0 +1,464 @@ +[%General] +author=elkrien based on Arc Dark style +comment=Catppuccin-Macchiato-Sky +spread_menuitems=true +left_tabs=true +mirror_doc_tabs=true +scroll_width=8 +attach_active_tab=true +composite=true +menu_shadow_depth=7 +tooltip_shadow_depth=0 +splitter_width=7 +check_size=16 +slider_width=4 +slider_handle_width=18 +slider_handle_length=18 +textless_progressbar=false +menubar_mouse_tracking=true +slim_toolbars=false +toolbutton_style=1 +x11drag=menubar_and_primary_toolbar +double_click=false +translucent_windows=false +blurring=false +popup_blurring=true +opaque=kaffeine,kmplayer,subtitlecomposer,kdenlive,vlc,smplayer,smplayer2,avidemux,avidemux2_qt4,avidemux3_qt4,avidemux3_qt5,kamoso,QtCreator,VirtualBox,trojita,dragon,digikam,qmplay2 +group_toolbar_buttons=false +vertical_spin_indicators=false +fill_rubberband=false +spread_progressbar=true +merge_menubar_with_toolbar=true +small_icon_size=16 +large_icon_size=32 +button_icon_size=16 +scroll_arrows=false +iconless_pushbutton=true +toolbar_icon_size=16 +combo_as_lineedit=true +button_contents_shift=false +groupbox_top_label=true +inline_spin_indicators=true +joined_inactive_tabs=false +layout_spacing=2 +submenu_overlap=0 +tooltip_delay=-1 +animate_states=false +transient_scrollbar=true +alt_mnemonic=true +combo_menu=true +layout_margin=4 +no_window_pattern=false +respect_DE=true +scroll_min_extent=36 +scrollable_menu=false +scrollbar_in_view=false +spin_button_width=16 +submenu_delay=250 +tree_branch_line=true +progressbar_thickness=8 +click_behavior=0 +contrast=1.00 +dialog_button_layout=0 +drag_from_buttons=false +hide_combo_checkboxes=false +intensity=1.00 +no_inactiveness=false +reduce_menu_opacity=0 +reduce_window_opacity=10 +saturation=1.00 +shadowless_popup=false +transient_groove=false + +[GeneralColors] +window.color=#24273A +base.color=#1E2030 +alt.base.color=#1E2030 +button.color=#363A4F +light.color=#494D64 +mid.light.color=#494D64 +dark.color=#1E2030 +mid.color=#1E2030 +highlight.color=#91D7E3 +inactive.highlight.color=#91D7E3 +text.color=#CAD3F5 +window.text.color=#CAD3F5 +button.text.color=#CAD3F5 +disabled.text.color=#5B6078 +tooltip.text.color=#CAD3F5 +highlight.text.color=#1E2030 +link.color=#F4DBD6 +link.visited.color=#8AADF4 + +[ItemView] +inherits=PanelButtonCommand +frame.element=itemview +interior.element=itemview +frame=true +interior=true +text.iconspacing=3 +text.toggle.color=#1E2030 + +[RadioButton] +inherits=PanelButtonCommand +frame=false +interior.element=radio + +[CheckBox] +inherits=PanelButtonCommand +frame=false +interior.element=checkbox + +[TreeExpander] +indicator.element=tree +indicator.size=8 + +[ToolTip] +frame.top=4 +frame.right=4 +frame.bottom=4 +frame.left=4 +frame=true + +[PanelButtonCommand] +inherits=PanelButtonCommand +interior.element=button +frame.element=button +text.normal.color=#CAD3F5 +text.focus.color=#CAD3F5 +text.press.color=#1E2030 +text.toggle.color=#1E2030 + +[PanelButtonTool] +inherits=PanelButtonCommand + +[DockTitle] +inherits=PanelButtonCommand +interior=false +frame=false +text.margin.top=5 +text.margin.bottom=5 +text.margin.left=5 +text.margin.right=5 +indicator.size=0 + +[Dock] +interior.element=toolbar +frame.element=toolbar +frame=true +interior=true + +[GroupBox] +inherits=PanelButtonCommand +interior.element=tabframe +interior=true +frame=false + +[Focus] +inherits=PanelButtonCommand +frame=true +frame.element=focus +frame.top=1 +frame.bottom=1 +frame.left=1 +frame.right=1 +frame.patternsize=20 + +[GenericFrame] +inherits=PanelButtonCommand +frame.element=common +frame.top=1 +frame.bottom=1 +frame.left=1 +frame.right=1 + +[Slider] +inherits=PanelButtonCommand +interior=true +frame.element=slider +interior.element=slider +frame.top=3 +frame.bottom=3 +frame.left=3 +frame.right=3 +focusFrame=true + +[SliderCursor] +inherits=PanelButtonCommand +interior=true +interior.element=slidercursor +frame=false + +[LineEdit] +inherits=PanelButtonCommand +frame.element=lineedit +interior.element=lineedit + +[IndicatorSpinBox] +inherits=LineEdit +frame.element=lineedit +interior.element=lineedit +frame.top=0 +frame.bottom=2 +frame.left=2 +frame.right=2 +indicator.size=8 + +[DropDownButton] +inherits=PanelButtonCommand +frame.top=2 +frame.bottom=2 +frame.left=0 +frame.right=1 +indicator.size=8 + +[ToolboxTab] +inherits=PanelButtonCommand +frame.element=tabframe +frame.top=1 +frame.bottom=1 +frame.left=1 +frame.right=1 + +[Tab] +inherits=PanelButtonCommand +interior.element=tab +frame.element=tab +frame.top=2 +frame.bottom=3 +frame.left=3 +frame.right=3 +indicator.size=10 +text.normal.color=#5B6078 +text.focus.color=#CAD3F5 +text.press.color=#CAD3F5 +text.toggle.color=#CAD3F5 +focusFrame=true + +[TabBarFrame] +inherits=GenericFrame +frame=true +frame.element=tabBarFrame +interior=false +frame.top=4 +frame.bottom=4 +frame.left=4 +frame.right=4 + +[TabFrame] +inherits=PanelButtonCommand +frame.element=tabframe +interior.element=tabframe + +[Dialog] +inherits=TabBarFrame +frame.element=tabframe +interior=false +frame=false +frame.top=1 +frame.bottom=1 +frame.left=1 +frame.right=1 + +[HeaderSection] +inherits=PanelButtonCommand +interior.element=header +frame.element=header +frame.top=0 +frame.bottom=1 +frame.left=1 +frame.right=1 +frame.expansion=0 +text.normal.color=#CAD3F5 +text.focus.color=#91D7E3 +text.press.color=#CAD3F5 +text.toggle.color=#CAD3F5 +indicator.element=harrow + +[SizeGrip] +inherits=PanelButtonCommand +frame=false +interior=false +indicator.element=resize-grip +indicator.size=0 + +[Toolbar] +inherits=PanelButtonCommand +interior.element=menubar +frame.element=menubar +frame=true +frame.bottom=4 +frame.left=4 +frame.right=4 +text.normal.color=#CAD3F5 +text.focus.color=#CAD3F5 +text.press.color=#91D7E3 +text.toggle.color=#91D7E3 +text.bold=false + +[MenuBar] +inherits=PanelButtonCommand +frame.element=menubar +interior.element=menubar +frame.bottom=0 +text.normal.color=#CAD3F5 +frame.expansion=0 +text.bold=false + +[ToolbarButton] +frame.element=tbutton +interior.element=tbutton +indicator.element=arrow +text.normal.color=#CAD3F5 +text.focus.color=#CAD3F5 +text.press.color=#1E2030 +text.toggle.color=#1E2030 +text.bold=false + +[Scrollbar] +inherits=PanelButtonCommand +indicator.size=0 +interior=false +frame=false + +[ScrollbarGroove] +inherits=PanelButtonCommand +interior=false +frame=false + +[ScrollbarSlider] +inherits=PanelButtonCommand +interior=false +frame.element=scrollbarslider +frame.top=4 +frame.bottom=4 +frame.left=4 +frame.right=4 + +[ProgressbarContents] +inherits=PanelButtonCommand +frame=true +frame.element=progress-pattern +interior.element=progress-pattern +frame.top=2 +frame.bottom=2 +frame.left=2 +frame.right=2 + +[Progressbar] +inherits=PanelButtonCommand +frame.element=progress +interior.element=progress +frame.top=2 +frame.bottom=2 +frame.left=2 +frame.right=2 +text.margin=0 +text.normal.color=#CAD3F5 +text.focus.color=#CAD3F5 +text.press.color=#1E2030 +text.toggle.color=#1E2030 +text.bold=false +frame.expansion=18 + +[RadioButton] +inherits=PanelButtonCommand + +[Menu] +frame.element=menu +interior.element=menu +inherits=PanelButtonCommand +text.press.color=#1E2030 +text.toggle.color=#1E2030 +text.bold=false +frame.top=3 +frame.bottom=3 +frame.left=3 +frame.right=3 + +[MenuItem] +inherits=PanelButtonCommand +interior.element=menuitem +indicator.size=8 +text.focus.color=#CAD3F5 +text.press.color=#CAD3F5 + +[MenuBarItem] +inherits=PanelButtonCommand +interior.element=menubaritem +frame=false +text.margin.top=3 +text.margin.bottom=3 +text.margin.left=5 +text.margin.right=5 + +[StatusBar] +inherits=Toolbar +frame.element=toolbar +font.bold=true +text.normal.color=#CAD3F5 +frame=true +frame.top=0 +frame.bottom=0 + +[TitleBar] +inherits=PanelButtonCommand +frame=false +interior=false +text.margin.top=2 +text.margin.bottom=2 +text.margin.left=3 +text.margin.right=3 + +[ComboBox] +inherits=PanelButtonCommand +indicator.size=8 +frame.top=3 +frame.bottom=3 +frame.left=3 +frame.right=3 +text.margin.top=1 +text.margin.bottom=1 +text.margin.left=3 +text.margin.right=3 +text.toggle.color=#CAD3F5 + +[ToolboxTab] +inherits=PanelButtonCommand +text.normal.color=#CAD3F5 +text.press.color=#CAD3F5 +text.focus.color=#CAD3F5 + +[Hacks] +transparent_dolphin_view=false +blur_konsole=true +transparent_ktitle_label=true +transparent_menutitle=true +respect_darkness=true +kcapacitybar_as_progressbar=true +force_size_grip=false +iconless_pushbutton=true +iconless_menu=false +disabled_icon_opacity=100 +lxqtmainmenu_iconsize=0 +normal_default_pushbutton=true +single_top_toolbar=false +tint_on_mouseover=0 +transparent_pcmanfm_sidepane=true +transparent_pcmanfm_view=false +blur_translucent=true +centered_forms=false +kinetic_scrolling=false +middle_click_scroll=false +no_selection_tint=false +noninteger_translucency=false +style_vertical_toolbars=false +blur_only_active_window=false + +[Window] +interior=true +interior.element=window +frame.top=0 +frame.bottom=0 +frame.left=0 +frame.right=0 diff --git a/kvantum/.config/Kvantum/Catppuccin-Macchiato-Sky/Catppuccin-Macchiato-Sky.svg b/kvantum/.config/Kvantum/Catppuccin-Macchiato-Sky/Catppuccin-Macchiato-Sky.svg new file mode 100644 index 0000000..2c998ac --- /dev/null +++ b/kvantum/.config/Kvantum/Catppuccin-Macchiato-Sky/Catppuccin-Macchiato-Sky.svg @@ -0,0 +1,1958 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/kvantum/.config/Kvantum/Catppuccin-Macchiato-Teal/Catppuccin-Macchiato-Teal.kvconfig b/kvantum/.config/Kvantum/Catppuccin-Macchiato-Teal/Catppuccin-Macchiato-Teal.kvconfig new file mode 100644 index 0000000..ba2416b --- /dev/null +++ b/kvantum/.config/Kvantum/Catppuccin-Macchiato-Teal/Catppuccin-Macchiato-Teal.kvconfig @@ -0,0 +1,464 @@ +[%General] +author=elkrien based on Arc Dark style +comment=Catppuccin-Macchiato-Teal +spread_menuitems=true +left_tabs=true +mirror_doc_tabs=true +scroll_width=8 +attach_active_tab=true +composite=true +menu_shadow_depth=7 +tooltip_shadow_depth=0 +splitter_width=7 +check_size=16 +slider_width=4 +slider_handle_width=18 +slider_handle_length=18 +textless_progressbar=false +menubar_mouse_tracking=true +slim_toolbars=false +toolbutton_style=1 +x11drag=menubar_and_primary_toolbar +double_click=false +translucent_windows=false +blurring=false +popup_blurring=true +opaque=kaffeine,kmplayer,subtitlecomposer,kdenlive,vlc,smplayer,smplayer2,avidemux,avidemux2_qt4,avidemux3_qt4,avidemux3_qt5,kamoso,QtCreator,VirtualBox,trojita,dragon,digikam,qmplay2 +group_toolbar_buttons=false +vertical_spin_indicators=false +fill_rubberband=false +spread_progressbar=true +merge_menubar_with_toolbar=true +small_icon_size=16 +large_icon_size=32 +button_icon_size=16 +scroll_arrows=false +iconless_pushbutton=true +toolbar_icon_size=16 +combo_as_lineedit=true +button_contents_shift=false +groupbox_top_label=true +inline_spin_indicators=true +joined_inactive_tabs=false +layout_spacing=2 +submenu_overlap=0 +tooltip_delay=-1 +animate_states=false +transient_scrollbar=true +alt_mnemonic=true +combo_menu=true +layout_margin=4 +no_window_pattern=false +respect_DE=true +scroll_min_extent=36 +scrollable_menu=false +scrollbar_in_view=false +spin_button_width=16 +submenu_delay=250 +tree_branch_line=true +progressbar_thickness=8 +click_behavior=0 +contrast=1.00 +dialog_button_layout=0 +drag_from_buttons=false +hide_combo_checkboxes=false +intensity=1.00 +no_inactiveness=false +reduce_menu_opacity=0 +reduce_window_opacity=10 +saturation=1.00 +shadowless_popup=false +transient_groove=false + +[GeneralColors] +window.color=#24273A +base.color=#1E2030 +alt.base.color=#1E2030 +button.color=#363A4F +light.color=#494D64 +mid.light.color=#494D64 +dark.color=#1E2030 +mid.color=#1E2030 +highlight.color=#8BD5CA +inactive.highlight.color=#8BD5CA +text.color=#CAD3F5 +window.text.color=#CAD3F5 +button.text.color=#CAD3F5 +disabled.text.color=#5B6078 +tooltip.text.color=#CAD3F5 +highlight.text.color=#1E2030 +link.color=#F4DBD6 +link.visited.color=#8AADF4 + +[ItemView] +inherits=PanelButtonCommand +frame.element=itemview +interior.element=itemview +frame=true +interior=true +text.iconspacing=3 +text.toggle.color=#1E2030 + +[RadioButton] +inherits=PanelButtonCommand +frame=false +interior.element=radio + +[CheckBox] +inherits=PanelButtonCommand +frame=false +interior.element=checkbox + +[TreeExpander] +indicator.element=tree +indicator.size=8 + +[ToolTip] +frame.top=4 +frame.right=4 +frame.bottom=4 +frame.left=4 +frame=true + +[PanelButtonCommand] +inherits=PanelButtonCommand +interior.element=button +frame.element=button +text.normal.color=#CAD3F5 +text.focus.color=#CAD3F5 +text.press.color=#1E2030 +text.toggle.color=#1E2030 + +[PanelButtonTool] +inherits=PanelButtonCommand + +[DockTitle] +inherits=PanelButtonCommand +interior=false +frame=false +text.margin.top=5 +text.margin.bottom=5 +text.margin.left=5 +text.margin.right=5 +indicator.size=0 + +[Dock] +interior.element=toolbar +frame.element=toolbar +frame=true +interior=true + +[GroupBox] +inherits=PanelButtonCommand +interior.element=tabframe +interior=true +frame=false + +[Focus] +inherits=PanelButtonCommand +frame=true +frame.element=focus +frame.top=1 +frame.bottom=1 +frame.left=1 +frame.right=1 +frame.patternsize=20 + +[GenericFrame] +inherits=PanelButtonCommand +frame.element=common +frame.top=1 +frame.bottom=1 +frame.left=1 +frame.right=1 + +[Slider] +inherits=PanelButtonCommand +interior=true +frame.element=slider +interior.element=slider +frame.top=3 +frame.bottom=3 +frame.left=3 +frame.right=3 +focusFrame=true + +[SliderCursor] +inherits=PanelButtonCommand +interior=true +interior.element=slidercursor +frame=false + +[LineEdit] +inherits=PanelButtonCommand +frame.element=lineedit +interior.element=lineedit + +[IndicatorSpinBox] +inherits=LineEdit +frame.element=lineedit +interior.element=lineedit +frame.top=0 +frame.bottom=2 +frame.left=2 +frame.right=2 +indicator.size=8 + +[DropDownButton] +inherits=PanelButtonCommand +frame.top=2 +frame.bottom=2 +frame.left=0 +frame.right=1 +indicator.size=8 + +[ToolboxTab] +inherits=PanelButtonCommand +frame.element=tabframe +frame.top=1 +frame.bottom=1 +frame.left=1 +frame.right=1 + +[Tab] +inherits=PanelButtonCommand +interior.element=tab +frame.element=tab +frame.top=2 +frame.bottom=3 +frame.left=3 +frame.right=3 +indicator.size=10 +text.normal.color=#5B6078 +text.focus.color=#CAD3F5 +text.press.color=#CAD3F5 +text.toggle.color=#CAD3F5 +focusFrame=true + +[TabBarFrame] +inherits=GenericFrame +frame=true +frame.element=tabBarFrame +interior=false +frame.top=4 +frame.bottom=4 +frame.left=4 +frame.right=4 + +[TabFrame] +inherits=PanelButtonCommand +frame.element=tabframe +interior.element=tabframe + +[Dialog] +inherits=TabBarFrame +frame.element=tabframe +interior=false +frame=false +frame.top=1 +frame.bottom=1 +frame.left=1 +frame.right=1 + +[HeaderSection] +inherits=PanelButtonCommand +interior.element=header +frame.element=header +frame.top=0 +frame.bottom=1 +frame.left=1 +frame.right=1 +frame.expansion=0 +text.normal.color=#CAD3F5 +text.focus.color=#8BD5CA +text.press.color=#CAD3F5 +text.toggle.color=#CAD3F5 +indicator.element=harrow + +[SizeGrip] +inherits=PanelButtonCommand +frame=false +interior=false +indicator.element=resize-grip +indicator.size=0 + +[Toolbar] +inherits=PanelButtonCommand +interior.element=menubar +frame.element=menubar +frame=true +frame.bottom=4 +frame.left=4 +frame.right=4 +text.normal.color=#CAD3F5 +text.focus.color=#CAD3F5 +text.press.color=#8BD5CA +text.toggle.color=#8BD5CA +text.bold=false + +[MenuBar] +inherits=PanelButtonCommand +frame.element=menubar +interior.element=menubar +frame.bottom=0 +text.normal.color=#CAD3F5 +frame.expansion=0 +text.bold=false + +[ToolbarButton] +frame.element=tbutton +interior.element=tbutton +indicator.element=arrow +text.normal.color=#CAD3F5 +text.focus.color=#CAD3F5 +text.press.color=#1E2030 +text.toggle.color=#1E2030 +text.bold=false + +[Scrollbar] +inherits=PanelButtonCommand +indicator.size=0 +interior=false +frame=false + +[ScrollbarGroove] +inherits=PanelButtonCommand +interior=false +frame=false + +[ScrollbarSlider] +inherits=PanelButtonCommand +interior=false +frame.element=scrollbarslider +frame.top=4 +frame.bottom=4 +frame.left=4 +frame.right=4 + +[ProgressbarContents] +inherits=PanelButtonCommand +frame=true +frame.element=progress-pattern +interior.element=progress-pattern +frame.top=2 +frame.bottom=2 +frame.left=2 +frame.right=2 + +[Progressbar] +inherits=PanelButtonCommand +frame.element=progress +interior.element=progress +frame.top=2 +frame.bottom=2 +frame.left=2 +frame.right=2 +text.margin=0 +text.normal.color=#CAD3F5 +text.focus.color=#CAD3F5 +text.press.color=#1E2030 +text.toggle.color=#1E2030 +text.bold=false +frame.expansion=18 + +[RadioButton] +inherits=PanelButtonCommand + +[Menu] +frame.element=menu +interior.element=menu +inherits=PanelButtonCommand +text.press.color=#1E2030 +text.toggle.color=#1E2030 +text.bold=false +frame.top=3 +frame.bottom=3 +frame.left=3 +frame.right=3 + +[MenuItem] +inherits=PanelButtonCommand +interior.element=menuitem +indicator.size=8 +text.focus.color=#CAD3F5 +text.press.color=#CAD3F5 + +[MenuBarItem] +inherits=PanelButtonCommand +interior.element=menubaritem +frame=false +text.margin.top=3 +text.margin.bottom=3 +text.margin.left=5 +text.margin.right=5 + +[StatusBar] +inherits=Toolbar +frame.element=toolbar +font.bold=true +text.normal.color=#CAD3F5 +frame=true +frame.top=0 +frame.bottom=0 + +[TitleBar] +inherits=PanelButtonCommand +frame=false +interior=false +text.margin.top=2 +text.margin.bottom=2 +text.margin.left=3 +text.margin.right=3 + +[ComboBox] +inherits=PanelButtonCommand +indicator.size=8 +frame.top=3 +frame.bottom=3 +frame.left=3 +frame.right=3 +text.margin.top=1 +text.margin.bottom=1 +text.margin.left=3 +text.margin.right=3 +text.toggle.color=#CAD3F5 + +[ToolboxTab] +inherits=PanelButtonCommand +text.normal.color=#CAD3F5 +text.press.color=#CAD3F5 +text.focus.color=#CAD3F5 + +[Hacks] +transparent_dolphin_view=false +blur_konsole=true +transparent_ktitle_label=true +transparent_menutitle=true +respect_darkness=true +kcapacitybar_as_progressbar=true +force_size_grip=false +iconless_pushbutton=true +iconless_menu=false +disabled_icon_opacity=100 +lxqtmainmenu_iconsize=0 +normal_default_pushbutton=true +single_top_toolbar=false +tint_on_mouseover=0 +transparent_pcmanfm_sidepane=true +transparent_pcmanfm_view=false +blur_translucent=true +centered_forms=false +kinetic_scrolling=false +middle_click_scroll=false +no_selection_tint=false +noninteger_translucency=false +style_vertical_toolbars=false +blur_only_active_window=false + +[Window] +interior=true +interior.element=window +frame.top=0 +frame.bottom=0 +frame.left=0 +frame.right=0 diff --git a/kvantum/.config/Kvantum/Catppuccin-Macchiato-Teal/Catppuccin-Macchiato-Teal.svg b/kvantum/.config/Kvantum/Catppuccin-Macchiato-Teal/Catppuccin-Macchiato-Teal.svg new file mode 100644 index 0000000..caaf519 --- /dev/null +++ b/kvantum/.config/Kvantum/Catppuccin-Macchiato-Teal/Catppuccin-Macchiato-Teal.svg @@ -0,0 +1,1958 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/kvantum/.config/Kvantum/Catppuccin-Macchiato-Yellow/Catppuccin-Macchiato-Yellow.kvconfig b/kvantum/.config/Kvantum/Catppuccin-Macchiato-Yellow/Catppuccin-Macchiato-Yellow.kvconfig new file mode 100644 index 0000000..b96383e --- /dev/null +++ b/kvantum/.config/Kvantum/Catppuccin-Macchiato-Yellow/Catppuccin-Macchiato-Yellow.kvconfig @@ -0,0 +1,464 @@ +[%General] +author=elkrien based on Arc Dark style +comment=Catppuccin-Macchiato-Yellow +spread_menuitems=true +left_tabs=true +mirror_doc_tabs=true +scroll_width=8 +attach_active_tab=true +composite=true +menu_shadow_depth=7 +tooltip_shadow_depth=0 +splitter_width=7 +check_size=16 +slider_width=4 +slider_handle_width=18 +slider_handle_length=18 +textless_progressbar=false +menubar_mouse_tracking=true +slim_toolbars=false +toolbutton_style=1 +x11drag=menubar_and_primary_toolbar +double_click=false +translucent_windows=false +blurring=false +popup_blurring=true +opaque=kaffeine,kmplayer,subtitlecomposer,kdenlive,vlc,smplayer,smplayer2,avidemux,avidemux2_qt4,avidemux3_qt4,avidemux3_qt5,kamoso,QtCreator,VirtualBox,trojita,dragon,digikam,qmplay2 +group_toolbar_buttons=false +vertical_spin_indicators=false +fill_rubberband=false +spread_progressbar=true +merge_menubar_with_toolbar=true +small_icon_size=16 +large_icon_size=32 +button_icon_size=16 +scroll_arrows=false +iconless_pushbutton=true +toolbar_icon_size=16 +combo_as_lineedit=true +button_contents_shift=false +groupbox_top_label=true +inline_spin_indicators=true +joined_inactive_tabs=false +layout_spacing=2 +submenu_overlap=0 +tooltip_delay=-1 +animate_states=false +transient_scrollbar=true +alt_mnemonic=true +combo_menu=true +layout_margin=4 +no_window_pattern=false +respect_DE=true +scroll_min_extent=36 +scrollable_menu=false +scrollbar_in_view=false +spin_button_width=16 +submenu_delay=250 +tree_branch_line=true +progressbar_thickness=8 +click_behavior=0 +contrast=1.00 +dialog_button_layout=0 +drag_from_buttons=false +hide_combo_checkboxes=false +intensity=1.00 +no_inactiveness=false +reduce_menu_opacity=0 +reduce_window_opacity=10 +saturation=1.00 +shadowless_popup=false +transient_groove=false + +[GeneralColors] +window.color=#24273A +base.color=#1E2030 +alt.base.color=#1E2030 +button.color=#363A4F +light.color=#494D64 +mid.light.color=#494D64 +dark.color=#1E2030 +mid.color=#1E2030 +highlight.color=#EED49F +inactive.highlight.color=#EED49F +text.color=#CAD3F5 +window.text.color=#CAD3F5 +button.text.color=#CAD3F5 +disabled.text.color=#5B6078 +tooltip.text.color=#CAD3F5 +highlight.text.color=#1E2030 +link.color=#F4DBD6 +link.visited.color=#8AADF4 + +[ItemView] +inherits=PanelButtonCommand +frame.element=itemview +interior.element=itemview +frame=true +interior=true +text.iconspacing=3 +text.toggle.color=#1E2030 + +[RadioButton] +inherits=PanelButtonCommand +frame=false +interior.element=radio + +[CheckBox] +inherits=PanelButtonCommand +frame=false +interior.element=checkbox + +[TreeExpander] +indicator.element=tree +indicator.size=8 + +[ToolTip] +frame.top=4 +frame.right=4 +frame.bottom=4 +frame.left=4 +frame=true + +[PanelButtonCommand] +inherits=PanelButtonCommand +interior.element=button +frame.element=button +text.normal.color=#CAD3F5 +text.focus.color=#CAD3F5 +text.press.color=#1E2030 +text.toggle.color=#1E2030 + +[PanelButtonTool] +inherits=PanelButtonCommand + +[DockTitle] +inherits=PanelButtonCommand +interior=false +frame=false +text.margin.top=5 +text.margin.bottom=5 +text.margin.left=5 +text.margin.right=5 +indicator.size=0 + +[Dock] +interior.element=toolbar +frame.element=toolbar +frame=true +interior=true + +[GroupBox] +inherits=PanelButtonCommand +interior.element=tabframe +interior=true +frame=false + +[Focus] +inherits=PanelButtonCommand +frame=true +frame.element=focus +frame.top=1 +frame.bottom=1 +frame.left=1 +frame.right=1 +frame.patternsize=20 + +[GenericFrame] +inherits=PanelButtonCommand +frame.element=common +frame.top=1 +frame.bottom=1 +frame.left=1 +frame.right=1 + +[Slider] +inherits=PanelButtonCommand +interior=true +frame.element=slider +interior.element=slider +frame.top=3 +frame.bottom=3 +frame.left=3 +frame.right=3 +focusFrame=true + +[SliderCursor] +inherits=PanelButtonCommand +interior=true +interior.element=slidercursor +frame=false + +[LineEdit] +inherits=PanelButtonCommand +frame.element=lineedit +interior.element=lineedit + +[IndicatorSpinBox] +inherits=LineEdit +frame.element=lineedit +interior.element=lineedit +frame.top=0 +frame.bottom=2 +frame.left=2 +frame.right=2 +indicator.size=8 + +[DropDownButton] +inherits=PanelButtonCommand +frame.top=2 +frame.bottom=2 +frame.left=0 +frame.right=1 +indicator.size=8 + +[ToolboxTab] +inherits=PanelButtonCommand +frame.element=tabframe +frame.top=1 +frame.bottom=1 +frame.left=1 +frame.right=1 + +[Tab] +inherits=PanelButtonCommand +interior.element=tab +frame.element=tab +frame.top=2 +frame.bottom=3 +frame.left=3 +frame.right=3 +indicator.size=10 +text.normal.color=#5B6078 +text.focus.color=#CAD3F5 +text.press.color=#CAD3F5 +text.toggle.color=#CAD3F5 +focusFrame=true + +[TabBarFrame] +inherits=GenericFrame +frame=true +frame.element=tabBarFrame +interior=false +frame.top=4 +frame.bottom=4 +frame.left=4 +frame.right=4 + +[TabFrame] +inherits=PanelButtonCommand +frame.element=tabframe +interior.element=tabframe + +[Dialog] +inherits=TabBarFrame +frame.element=tabframe +interior=false +frame=false +frame.top=1 +frame.bottom=1 +frame.left=1 +frame.right=1 + +[HeaderSection] +inherits=PanelButtonCommand +interior.element=header +frame.element=header +frame.top=0 +frame.bottom=1 +frame.left=1 +frame.right=1 +frame.expansion=0 +text.normal.color=#CAD3F5 +text.focus.color=#EED49F +text.press.color=#CAD3F5 +text.toggle.color=#CAD3F5 +indicator.element=harrow + +[SizeGrip] +inherits=PanelButtonCommand +frame=false +interior=false +indicator.element=resize-grip +indicator.size=0 + +[Toolbar] +inherits=PanelButtonCommand +interior.element=menubar +frame.element=menubar +frame=true +frame.bottom=4 +frame.left=4 +frame.right=4 +text.normal.color=#CAD3F5 +text.focus.color=#CAD3F5 +text.press.color=#EED49F +text.toggle.color=#EED49F +text.bold=false + +[MenuBar] +inherits=PanelButtonCommand +frame.element=menubar +interior.element=menubar +frame.bottom=0 +text.normal.color=#CAD3F5 +frame.expansion=0 +text.bold=false + +[ToolbarButton] +frame.element=tbutton +interior.element=tbutton +indicator.element=arrow +text.normal.color=#CAD3F5 +text.focus.color=#CAD3F5 +text.press.color=#1E2030 +text.toggle.color=#1E2030 +text.bold=false + +[Scrollbar] +inherits=PanelButtonCommand +indicator.size=0 +interior=false +frame=false + +[ScrollbarGroove] +inherits=PanelButtonCommand +interior=false +frame=false + +[ScrollbarSlider] +inherits=PanelButtonCommand +interior=false +frame.element=scrollbarslider +frame.top=4 +frame.bottom=4 +frame.left=4 +frame.right=4 + +[ProgressbarContents] +inherits=PanelButtonCommand +frame=true +frame.element=progress-pattern +interior.element=progress-pattern +frame.top=2 +frame.bottom=2 +frame.left=2 +frame.right=2 + +[Progressbar] +inherits=PanelButtonCommand +frame.element=progress +interior.element=progress +frame.top=2 +frame.bottom=2 +frame.left=2 +frame.right=2 +text.margin=0 +text.normal.color=#CAD3F5 +text.focus.color=#CAD3F5 +text.press.color=#1E2030 +text.toggle.color=#1E2030 +text.bold=false +frame.expansion=18 + +[RadioButton] +inherits=PanelButtonCommand + +[Menu] +frame.element=menu +interior.element=menu +inherits=PanelButtonCommand +text.press.color=#1E2030 +text.toggle.color=#1E2030 +text.bold=false +frame.top=3 +frame.bottom=3 +frame.left=3 +frame.right=3 + +[MenuItem] +inherits=PanelButtonCommand +interior.element=menuitem +indicator.size=8 +text.focus.color=#CAD3F5 +text.press.color=#CAD3F5 + +[MenuBarItem] +inherits=PanelButtonCommand +interior.element=menubaritem +frame=false +text.margin.top=3 +text.margin.bottom=3 +text.margin.left=5 +text.margin.right=5 + +[StatusBar] +inherits=Toolbar +frame.element=toolbar +font.bold=true +text.normal.color=#CAD3F5 +frame=true +frame.top=0 +frame.bottom=0 + +[TitleBar] +inherits=PanelButtonCommand +frame=false +interior=false +text.margin.top=2 +text.margin.bottom=2 +text.margin.left=3 +text.margin.right=3 + +[ComboBox] +inherits=PanelButtonCommand +indicator.size=8 +frame.top=3 +frame.bottom=3 +frame.left=3 +frame.right=3 +text.margin.top=1 +text.margin.bottom=1 +text.margin.left=3 +text.margin.right=3 +text.toggle.color=#CAD3F5 + +[ToolboxTab] +inherits=PanelButtonCommand +text.normal.color=#CAD3F5 +text.press.color=#CAD3F5 +text.focus.color=#CAD3F5 + +[Hacks] +transparent_dolphin_view=false +blur_konsole=true +transparent_ktitle_label=true +transparent_menutitle=true +respect_darkness=true +kcapacitybar_as_progressbar=true +force_size_grip=false +iconless_pushbutton=true +iconless_menu=false +disabled_icon_opacity=100 +lxqtmainmenu_iconsize=0 +normal_default_pushbutton=true +single_top_toolbar=false +tint_on_mouseover=0 +transparent_pcmanfm_sidepane=true +transparent_pcmanfm_view=false +blur_translucent=true +centered_forms=false +kinetic_scrolling=false +middle_click_scroll=false +no_selection_tint=false +noninteger_translucency=false +style_vertical_toolbars=false +blur_only_active_window=false + +[Window] +interior=true +interior.element=window +frame.top=0 +frame.bottom=0 +frame.left=0 +frame.right=0 diff --git a/kvantum/.config/Kvantum/Catppuccin-Macchiato-Yellow/Catppuccin-Macchiato-Yellow.svg b/kvantum/.config/Kvantum/Catppuccin-Macchiato-Yellow/Catppuccin-Macchiato-Yellow.svg new file mode 100644 index 0000000..1aff0c8 --- /dev/null +++ b/kvantum/.config/Kvantum/Catppuccin-Macchiato-Yellow/Catppuccin-Macchiato-Yellow.svg @@ -0,0 +1,1958 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/kvantum/.config/Kvantum/kvantum.kvconfig b/kvantum/.config/Kvantum/kvantum.kvconfig index f08b369..73895eb 100644 --- a/kvantum/.config/Kvantum/kvantum.kvconfig +++ b/kvantum/.config/Kvantum/kvantum.kvconfig @@ -1,2 +1,2 @@ [General] -theme=Catppuccin-Macchiato-Red +theme=Catppuccin-Macchiato-Blue diff --git a/nitrogen/.config/nitrogen/bg-saved.cfg b/nitrogen/.config/nitrogen/bg-saved.cfg index 22972fa..7f123a8 100644 --- a/nitrogen/.config/nitrogen/bg-saved.cfg +++ b/nitrogen/.config/nitrogen/bg-saved.cfg @@ -1,14 +1,14 @@ [xin_0] -file=/home/mike/.config/nitrogen/z3in53x1r1d81.png +file=/home/mike/.config/nitrogen/pexels-engin-akyurt-1435752.jpg mode=5 bgcolor=#24273a [xin_1] -file=/home/mike/.config/nitrogen/z3in53x1r1d81.png +file=/home/mike/.config/nitrogen/pexels-engin-akyurt-1435752.jpg mode=5 bgcolor=#24273a [xin_2] -file=/home/mike/.config/nitrogen/z3in53x1r1d81.png +file=/home/mike/.config/nitrogen/pexels-engin-akyurt-1435752.jpg mode=5 bgcolor=#24273a diff --git a/nitrogen/.config/nitrogen/nitrogen.cfg b/nitrogen/.config/nitrogen/nitrogen.cfg index 7f24ac5..1c8dec4 100644 --- a/nitrogen/.config/nitrogen/nitrogen.cfg +++ b/nitrogen/.config/nitrogen/nitrogen.cfg @@ -1,8 +1,8 @@ [geometry] -posx=3334 -posy=38 -sizex=1138 -sizey=1394 +posx=1950 +posy=52 +sizex=2500 +sizey=1378 [nitrogen] view=icon diff --git a/nitrogen/.config/nitrogen/pexels-engin-akyurt-1435752.jpg b/nitrogen/.config/nitrogen/pexels-engin-akyurt-1435752.jpg new file mode 100644 index 0000000..791dca2 Binary files /dev/null and b/nitrogen/.config/nitrogen/pexels-engin-akyurt-1435752.jpg differ diff --git a/rofi/.config/rofi/config.rasi b/rofi/.config/rofi/config.rasi index fb503d3..74c3d05 100644 --- a/rofi/.config/rofi/config.rasi +++ b/rofi/.config/rofi/config.rasi @@ -11,6 +11,7 @@ configuration{ display-run: "  Run "; display-window: " 﩯 Window"; display-Network: " 󰤨 Network"; + display-calc: " Calc"; sidebar-mode: true; } diff --git a/rofi/.local/share/rofi/rofi_calc_history b/rofi/.local/share/rofi/rofi_calc_history index 3bcc72a..e69de29 100644 --- a/rofi/.local/share/rofi/rofi_calc_history +++ b/rofi/.local/share/rofi/rofi_calc_history @@ -1,18 +0,0 @@ -((x^2) − 16) = 0 -((x^2) − 16) = 0 -2 + x = x + 2 -45 / 2 = 22 + 1/2 = 22.5 -111 / 11 = 10 + 1/11 ≈ 10.09090909 -1 = 1 -5 + 5 + 5 + 4 + 6 + 4 + 2 + 3 + 4 + 2 + 1 + 6 = 47 -47 / 60 ≈ 0.7833333333 -10.1 + 22.4 + 11.4 + 30 + 18.9 = 92.8 -10.1 + 22.4 + 11.4 + 30 + 18.9 = 92.8 -92.8 / 16 = 5.8 -(5.7 + 6) / 2 = 5.85 -(−9) + 66 + 279 = 336 -(−121) + 242 + 279 = 400 -(8910 − 4590) / 18 = 240 -36 × 3 = 108 -24 / 46 = 12/23 ≈ 0.5217391304 -(36 × pi) − (54 × sqrt(3)) ≈ 19.56659192 \ No newline at end of file diff --git a/rofi/.local/share/rofi/themes/catppuccin-macchiato.rasi b/rofi/.local/share/rofi/themes/catppuccin-macchiato.rasi index 696d769..ab1d7f5 100644 --- a/rofi/.local/share/rofi/themes/catppuccin-macchiato.rasi +++ b/rofi/.local/share/rofi/themes/catppuccin-macchiato.rasi @@ -5,7 +5,7 @@ selected-col: #24273a; blue: #8aadf4; fg-col: #cad3f5; - fg-col2: #ed8796; + fg-col2: #8aadf4; grey: #6e738d; width: 600; diff --git a/zsh/.zshrc b/zsh/.zshrc index 362ca23..541061d 100644 --- a/zsh/.zshrc +++ b/zsh/.zshrc @@ -175,7 +175,7 @@ zinit load zsh-users/zsh-autosuggestions zinit ice wait lucid zinit load 'wfxr/forgit' -zinit snippet ~/.zsh_compl/zoxide +# zinit snippet ~/.zsh_compl/zoxide zinit snippet OMZL::completion.zsh zinit wait lucid for \ @@ -186,6 +186,8 @@ zinit wait lucid for \ atload"!_zsh_autosuggest_start" \ zsh-users/zsh-autosuggestions +eval "$(zoxide init zsh)" + #[ -f ~/.fzf.zsh ] && source ~/.fzf.zsh zinit pack"binary" for fzf # To customize prompt, run `p10k configure` or edit ~/.p10k.zsh.