From 69b29a8dc4fbbd4d4844303c5542a14ec963836c Mon Sep 17 00:00:00 2001 From: Alexis Jhon Gaspar Date: Thu, 5 Oct 2023 18:18:52 +0800 Subject: [PATCH] Modify layout icons to use Nerd Font instead --- dwm-flexipatch/config.def.h | 56 +++++++++++++++--------------- dwm-flexipatch/patch/layout_deck.c | 3 +- dwm-flexipatch/patch/layoutmenu.sh | 56 +++++++++++++++--------------- dwm-flexipatch/patches.def.h | 2 +- scripts/layoutmenu | 56 +++++++++++++++--------------- 5 files changed, 87 insertions(+), 86 deletions(-) diff --git a/dwm-flexipatch/config.def.h b/dwm-flexipatch/config.def.h index aef2c07..ac62add 100644 --- a/dwm-flexipatch/config.def.h +++ b/dwm-flexipatch/config.def.h @@ -679,61 +679,61 @@ static const int scrollargs[][2] = { #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 + { "󰯌", flextile, { -1, -1, SPLIT_VERTICAL, TOP_TO_BOTTOM, TOP_TO_BOTTOM, 0, NULL } }, // default tile layout + { "󱂬", NULL, {0} }, /* no layout function means floating behavior */ + { "󱟱", 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 + { "󰕬", flextile, { -1, -1, FLOATING_MASTER, LEFT_TO_RIGHT, LEFT_TO_RIGHT, 0, NULL } }, // floating master + { "󱒇", flextile, { -1, -1, SPLIT_VERTICAL, TOP_TO_BOTTOM, MONOCLE, 0, NULL } }, // deck + { "󱢈", 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 + { "󰕫", flextile, { -1, -1, SPLIT_CENTERED_VERTICAL, LEFT_TO_RIGHT, TOP_TO_BOTTOM, TOP_TO_BOTTOM, NULL } }, // centeredmaster + { "󰕯", 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 + { "󰡃", flextile, { -1, -1, SPLIT_VERTICAL, LEFT_TO_RIGHT, TATAMI, 0, NULL } }, // tatami mats #if TILE_LAYOUT - { "[]=", tile, {0} }, + { "󰯌", tile, {0} }, #endif #if MONOCLE_LAYOUT - { "[M]", monocle, {0} }, + { "󱟱", monocle, {0} }, #endif #if BSTACK_LAYOUT - { "TTT", bstack, {0} }, + { "󱢈", bstack, {0} }, #endif #if BSTACKHORIZ_LAYOUT - { "===", bstackhoriz, {0} }, + { "󰯋", bstackhoriz, {0} }, #endif #if CENTEREDMASTER_LAYOUT - { "|M|", centeredmaster, {0} }, + { "󰕫", centeredmaster, {0} }, #endif #if CENTEREDFLOATINGMASTER_LAYOUT - { ">M>", centeredfloatingmaster, {0} }, + { "󰕬", centeredfloatingmaster, {0} }, #endif #if COLUMNS_LAYOUT - { "|||", col, {0} }, + { "󰕭", col, {0} }, #endif #if DECK_LAYOUT - { "[D]", deck, {0} }, + { "󱒇", deck, {0} }, #endif #if FIBONACCI_SPIRAL_LAYOUT - { "(@)", spiral, {0} }, + { "󱒎", spiral, {0} }, #endif #if FIBONACCI_DWINDLE_LAYOUT - { "[\\]", dwindle, {0} }, + { "󰕴", dwindle, {0} }, #endif #if GRIDMODE_LAYOUT - { "HHH", grid, {0} }, + { "󰾍", grid, {0} }, #endif #if HORIZGRID_LAYOUT - { "---", horizgrid, {0} }, + { "󱇙", horizgrid, {0} }, #endif #if GAPPLESSGRID_LAYOUT - { ":::", gaplessgrid, {0} }, + { "󰕰", gaplessgrid, {0} }, #endif #if NROWGRID_LAYOUT - { "###", nrowgrid, {0} }, + { "󰕳", nrowgrid, {0} }, #endif }; #else diff --git a/dwm-flexipatch/patch/layout_deck.c b/dwm-flexipatch/patch/layout_deck.c index 1cabf0e..51307bf 100644 --- a/dwm-flexipatch/patch/layout_deck.c +++ b/dwm-flexipatch/patch/layout_deck.c @@ -44,9 +44,10 @@ deck(Monitor *m) #endif // VANITYGAPS_PATCH getfacts(m, mh, sh, &mfacts, &sfacts, &mrest, &srest); - + #if !MONOCLESYMBOL_PATCH if (n - m->nmaster > 0) /* override layout symbol */ snprintf(m->ltsymbol, sizeof m->ltsymbol, "D %d", n - m->nmaster); + #endif // MONOCLESMYBOL_PATCH for (i = 0, c = nexttiled(m->clients); c; c = nexttiled(c->next), i++) if (i < m->nmaster) { diff --git a/dwm-flexipatch/patch/layoutmenu.sh b/dwm-flexipatch/patch/layoutmenu.sh index 1816d3b..208bf86 100755 --- a/dwm-flexipatch/patch/layoutmenu.sh +++ b/dwm-flexipatch/patch/layoutmenu.sh @@ -1,33 +1,33 @@ #!/bin/sh cat <<> (Flextile) Floating 1 -[M] (Flextile) Monocle 2 -||| (Flextile) Columns 3 ->M> (Flextile) Floating Master 4 -[D] (Flextile) Deck 5 -TTT (Flextile) Bottom Stack 6 -=== (Flextile) Bottom Stack Horizontal 7 -|M| (Flextile) Centered Naster 8 --M- (Flextile) Centered Master Horizontal 9 -::: (Flextile) Gapless Grid 10 -[\] (Flextile) Fibonacci Dwindle 11 -(@) (Flextile) Fibonacci Spiral 12 -[T] (Flextile) Tatami Tats 13 -[]= Tiled 14 -[M] Monocle 15 -TTT Bottom Stack 16 -=== Bottom Stack Horizontal 17 -|M| Centered Master 18 ->M> Centered Floating Master 19 -||| Columns 20 -[D] Deck 21 -(@) Fibonacci Spiral 22 -[\\] Fibonacci Dwindle 23 -HHH Grid 24 ---- Horizontal Grid 25 -::: Gapless Grid 26 -### N-row Grid 27 +󰯌 (Flextile) Tiled 0 +󱂬 Floating 1 +󱟱 (Flextile) Monocle 2 +󰕭 (Flextile) Columns 3 +󰕬 (Flextile) Floating Master 4 +󱒇 (Flextile) Deck 5 +󱢈 (Flextile) Bottom Stack 6 +󰯋 (Flextile) Bottom Stack Horizontal 7 +󰕫 (Flextile) Centered Naster 8 +󰕯 (Flextile) Centered Master Horizontal 9 +󰕰 (Flextile) Gapless Grid 10 +󰕴 (Flextile) Fibonacci Dwindle 11 +󱒎 (Flextile) Fibonacci Spiral 12 +󰡃 (Flextile) Tatami Tats 13 +󰯌 Tiled 14 +󱟱 Monocle 15 +󱢈 Bottom Stack 16 +󰯋 Bottom Stack Horizontal 17 +󰕫 Centered Master 18 +󰕬 Centered Floating Master 19 +󰕭 Columns 20 +󱒇 Deck 21 +󰕴 Fibonacci Spiral 22 +󱒎 Fibonacci Dwindle 23 +󰾍 Grid 24 +󱇙 Horizontal Grid 25 +󰕰 Gapless Grid 26 +󰕳 N-row Grid 27 EOF diff --git a/dwm-flexipatch/patches.def.h b/dwm-flexipatch/patches.def.h index 4a1784e..272c959 100644 --- a/dwm-flexipatch/patches.def.h +++ b/dwm-flexipatch/patches.def.h @@ -772,7 +772,7 @@ * is activated. Do not display the number of open clients in the current tag. * https://dwm.suckless.org/patches/monoclesymbol/ */ -#define MONOCLESYMBOL_PATCH 0 +#define MONOCLESYMBOL_PATCH 1 /* 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 diff --git a/scripts/layoutmenu b/scripts/layoutmenu index aa8a47f..8ff941f 100755 --- a/scripts/layoutmenu +++ b/scripts/layoutmenu @@ -1,33 +1,33 @@ #!/bin/sh cat <