added the layoutmenu patch

This commit is contained in:
matt 2021-01-02 01:26:21 +01:00
parent 44ea8f5cce
commit 5fd83cb76b
5 changed files with 28 additions and 3 deletions

View File

@ -15,6 +15,8 @@ Refer to [https://dwm.suckless.org/](https://dwm.suckless.org/) for details on t
### Changelog: ### Changelog:
2021-01-02 - Added the Layoutmenu patch
2020-10-26 - Added the \_NET\_CLIENT\_LIST\_STACKING 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-29 - Added the on\_empty\_keys patch (ported from InstantOS)

View File

@ -297,6 +297,10 @@ static char *statuscolors[][ColCount] = {
}; };
#endif // BAR_POWERLINE_STATUS_PATCH #endif // BAR_POWERLINE_STATUS_PATCH
#if BAR_LAYOUTMENU_PATCH
static const char *layoutmenu_cmd = "layoutmenu.sh";
#endif
#if COOL_AUTOSTART_PATCH #if COOL_AUTOSTART_PATCH
static const char *const autostart[] = { static const char *const autostart[] = {
"st", NULL, "st", NULL,
@ -1134,8 +1138,12 @@ static Button buttons[] = {
{ ClkButton, 0, Button1, spawn, {.v = dmenucmd } }, { ClkButton, 0, Button1, spawn, {.v = dmenucmd } },
#endif // BAR_STATUSBUTTON_PATCH #endif // BAR_STATUSBUTTON_PATCH
{ ClkLtSymbol, 0, Button1, setlayout, {0} }, { ClkLtSymbol, 0, Button1, setlayout, {0} },
#if BAR_LAYOUTMENU_PATCH
{ ClkLtSymbol, 0, Button3, layoutmenu, {0} },
#else
{ ClkLtSymbol, 0, Button3, setlayout, {.v = &layouts[2]} }, { ClkLtSymbol, 0, Button3, setlayout, {.v = &layouts[2]} },
#if BAR_WINTITLEACTIONS_PATCH #endif // BAR_LAYOUTMENU_PATCH
#if BAR_WINTITLEACTIONS_PATCH
{ ClkWinTitle, 0, Button1, togglewin, {0} }, { ClkWinTitle, 0, Button1, togglewin, {0} },
{ ClkWinTitle, 0, Button3, showhideclient, {0} }, { ClkWinTitle, 0, Button3, showhideclient, {0} },
#endif // BAR_WINTITLEACTIONS_PATCH #endif // BAR_WINTITLEACTIONS_PATCH

View File

@ -83,6 +83,9 @@
#if BAR_WINTITLEACTIONS_PATCH #if BAR_WINTITLEACTIONS_PATCH
#include "bar_wintitleactions.c" #include "bar_wintitleactions.c"
#endif #endif
#if BAR_LAYOUTMENU_PATCH
#include "bar_layoutmenu.c"
#endif
/* Other patches */ /* Other patches */
#if ASPECTRESIZE_PATCH #if ASPECTRESIZE_PATCH
@ -328,4 +331,4 @@
#endif #endif
#if TILE_LAYOUT #if TILE_LAYOUT
#include "layout_tile.c" #include "layout_tile.c"
#endif #endif

View File

@ -80,6 +80,9 @@
#if BAR_WINTITLEACTIONS_PATCH #if BAR_WINTITLEACTIONS_PATCH
#include "bar_wintitleactions.h" #include "bar_wintitleactions.h"
#endif #endif
#if BAR_LAYOUTMENU_PATCH
#include "bar_layoutmenu.h"
#endif
/* Other patches */ /* Other patches */
#if ASPECTRESIZE_PATCH #if ASPECTRESIZE_PATCH
@ -318,4 +321,4 @@
#endif #endif
#if TILE_LAYOUT #if TILE_LAYOUT
#include "layout_tile.h" #include "layout_tile.h"
#endif #endif

View File

@ -42,6 +42,15 @@
*/ */
#define BAR_FLEXWINTITLE_PATCH 0 #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 */ /* Show layout symbol in bar */
#define BAR_LTSYMBOL_PATCH 1 #define BAR_LTSYMBOL_PATCH 1