2024-06-25 10:29:43 +05:00
/* See LICENSE file for copyright and license details. */
# include <X11/XF86keysym.h>
2024-07-20 13:26:57 +05:00
# include "patches.h"
2024-06-25 10:29:43 +05:00
2024-07-13 12:17:12 +05:00
/* Helper macros for spawning commands */
# define SHCMD(cmd) { .v = (const char*[]){ " / bin / sh", "-c", cmd, NULL } }
# define CMD(...) { .v = (const char*[]){ __VA_ARGS__, NULL } }
2024-06-25 10:29:43 +05:00
/* 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
# if BAR_BORDER_PATCH
/* This allows the bar border size to be explicitly set separately from borderpx.
* If left as 0 then it will default to the borderpx value of the monitor and will
* automatically update with setborderpx . */
static const unsigned int barborderpx = 0 ; /* border pixel of bar */
# endif // BAR_BORDER_PATCH
static const unsigned int snap = 32 ; /* 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 = 0 ; /* 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 = 0 ; /* 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 = 2 ; /* thickness / height of the underline */
static const unsigned int ulinevoffset = 0 ; /* how far above the bottom of the bar the line should appear */
static const int ulineall = 0 ; /* 1 to show underline on all tags, 0 for just the active ones */
# endif // BAR_UNDERLINETAGS_PATCH
# 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_NONE ;
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 10 " ;
# else
static const char * fonts [ ] = { " CaskaydiaCove NF :pixelsize=12 " } ;
# endif // BAR_PANGO_PATCH
static const char dmenufont [ ] = " monospace:size=10 " ;
static char c000000 [ ] = " #000000 " ; // placeholder value
static char normfgcolor [ ] = " #bbbbbb " ;
static char normbgcolor [ ] = " #222222 " ;
static char normbordercolor [ ] = " #444444 " ;
static char normfloatcolor [ ] = " #db8fd9 " ;
static char selfgcolor [ ] = " #eeeeee " ;
static char selbgcolor [ ] = " #005577 " ;
static char selbordercolor [ ] = " #005577 " ;
static char selfloatcolor [ ] = " #005577 " ;
static char titlenormfgcolor [ ] = " #bbbbbb " ;
static char titlenormbgcolor [ ] = " #222222 " ;
static char titlenormbordercolor [ ] = " #444444 " ;
static char titlenormfloatcolor [ ] = " #db8fd9 " ;
static char titleselfgcolor [ ] = " #eeeeee " ;
static char titleselbgcolor [ ] = " #005577 " ;
static char titleselbordercolor [ ] = " #005577 " ;
static char titleselfloatcolor [ ] = " #005577 " ;
static char tagsnormfgcolor [ ] = " #bbbbbb " ;
static char tagsnormbgcolor [ ] = " #222222 " ;
static char tagsnormbordercolor [ ] = " #444444 " ;
static char tagsnormfloatcolor [ ] = " #db8fd9 " ;
static char tagsselfgcolor [ ] = " #eeeeee " ;
static char tagsselbgcolor [ ] = " #005577 " ;
static char tagsselbordercolor [ ] = " #005577 " ;
static char tagsselfloatcolor [ ] = " #005577 " ;
static char hidnormfgcolor [ ] = " #005577 " ;
static char hidselfgcolor [ ] = " #227799 " ;
static char hidnormbgcolor [ ] = " #222222 " ;
static char hidselbgcolor [ ] = " #222222 " ;
static char urgfgcolor [ ] = " #bbbbbb " ;
static char urgbgcolor [ ] = " #222222 " ;
static char urgbordercolor [ ] = " #ff0000 " ;
static char urgfloatcolor [ ] = " #db8fd9 " ;
# 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
2024-07-13 12:17:12 +05:00
# if BAR_LAUNCHER_PATCH
static const Launcher launchers [ ] = {
/* icon to display command */
2024-07-26 10:15:39 +05:00
{ " " , CMD ( " st " ) } ,
{ " " , CMD ( " firefox " ) } ,
{ " " , CMD ( " fuz-launcher " ) } ,
{ " " , CMD ( " st " , " nvim " ) } ,
2024-07-13 12:17:12 +05:00
} ;
# endif // BAR_LAUNCHER_PATCH
2024-06-25 10:29:43 +05:00
# if COOL_AUTOSTART_PATCH
static const char * const autostart [ ] = {
" dwmblocks " , 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 [ ] = { " st " , " -n " , " spterm " , " -g " , " 120x28 " , NULL } ;
const char * spcmd2 [ ] = { " st " , " -n " , " spcalc " , " -g " , " 120x28 " , " -e " , " qalc " , " --color " , " --interactive " , NULL } ;
const char * spcmd3 [ ] = { " qalculate-gtk " , NULL } ;
2024-09-03 15:01:49 +05:00
const char * spcmd4 [ ] = { " st " , " -n " , " spmusic " , " -g " , " 100x25 " , " -e " , " cmus " , NULL } ;
2024-06-25 10:29:43 +05:00
const char * spcmd5 [ ] = { " st " , " -n " , " spnotes " , " -g " , " 120x34 " , " -e " , " spnotes " , NULL } ;
static Sp scratchpads [ ] = {
/* name cmd */
{ " spterm " , spcmd1 } ,
{ " spcalc " , spcmd2 } ,
{ " spcalcgui " , spcmd3 } ,
{ " spmusic " , spcmd4 } ,
{ " spnotes " , spcmd5 } ,
} ;
# 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 = " firefox " , . tags = 1 < < 1 , . switchtag = 1 )
RULE ( . title = " nvim " , . tags = 1 < < 2 , . switchtag = 1 )
RULE ( . title = " lf " , . tags = 1 < < 3 , . switchtag = 1 )
RULE ( . class = " mpv " , . tags = 1 < < 4 , . switchtag = 3 )
RULE ( . title = " newsboat " , . tags = 1 < < 5 , . switchtag = 3 )
RULE ( . class = " Zathura " , . tags = 1 < < 6 , . switchtag = 3 )
RULE ( . title = " nsxiv " , . tags = 1 < < 7 , . switchtag = 3 )
RULE ( . class = " Gimp " , . tags = 1 < < 8 , . switchtag = 3 )
RULE ( . instance = " libreoffice " , . tags = 1 < < 8 , . switchtag = 3 )
RULE ( . instance = " spterm " , . tags = SPTAG ( 0 ) , . isfloating = 1 )
RULE ( . instance = " spcalc " , . tags = SPTAG ( 1 ) , . isfloating = 1 )
RULE ( . class = " Qalculate-gtk " , . tags = SPTAG ( 2 ) , . isfloating = 1 )
RULE ( . instance = " spmusic " , . tags = SPTAG ( 3 ) , . isfloating = 1 )
RULE ( . instance = " spnotes " , . tags = SPTAG ( 4 ) , . isfloating = 1 )
RULE ( . instance = " dictionary " , . isfloating = 1 )
RULE ( . class = " volume-ui " , . isfloating = 1 )
RULE ( . class = " gping-ui " , . isfloating = 1 )
RULE ( . class = " PersepolisDM " , . title = " (None)None " , . isfloating = 1 )
RULE ( . class = " gnuplot_qt " , . isfloating = 1 )
# 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
2024-07-13 12:17:12 +05:00
# if BAR_LAUNCHER_PATCH
{ - 1 , 0 , BAR_ALIGN_LEFT , width_launcher , draw_launcher , click_launcher , NULL , " launcher " } ,
# endif // BAR_LAUNCHER_PATCH
2024-06-25 10:29:43 +05:00
# if BAR_POWERLINE_TAGS_PATCH
{ 0 , 0 , BAR_ALIGN_LEFT , width_pwrl_tags , draw_pwrl_tags , click_pwrl_tags , hover_pwrl_tags , " 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 , hover_taglabels , " 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) */
2024-07-01 13:51:07 +05:00
static const float mfact = 0.55 ; /* factor of master area size [0.05..0.95] */
2024-06-25 10:29:43 +05:00
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
{ " " , 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
# define ALTKEY Mod1Mask
# 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 | Mod4Mask | ShiftMask , KEY , swaptags , { . ui = 1 < < TAG } } , \
{ MODKEY | Mod4Mask , KEY , tagnextmon , { . ui = 1 < < TAG } } , \
{ MODKEY | Mod4Mask | 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 | Mod4Mask | 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 | Mod4Mask , KEY , tagnextmon , { . ui = 1 < < TAG } } , \
{ MODKEY | Mod4Mask | 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 | Mod4Mask | ShiftMask , KEY , swaptags , { . ui = 1 < < TAG } } , \
{ MODKEY | Mod4Mask , KEY , tagnextmon , { . ui = 1 < < TAG } } , \
{ MODKEY | Mod4Mask | 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 | Mod4Mask | 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 | Mod4Mask , KEY , tagnextmon , { . ui = 1 < < TAG } } , \
{ MODKEY | Mod4Mask | 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
/* commands */
# if !NODMENU_PATCH
static char dmenumon [ 2 ] = " 0 " ; /* component of dmenucmd, manipulated in spawn() */
# endif // NODMENU_PATCH
// 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
// };
2024-10-05 07:34:12 +05:00
static const char * dmenu_run_cmd [ ] = { " dmenu_run " , " -bw " , " 2 " , " -i " , " -W " , " 390 " , " -X " , " 8 " , " -Y " , " 420 " , " -l " , " 15 " , " -g " , " 3 " , NULL } ;
static const char * clipmenu_cmd [ ] = { " clipmenu " , " -bw " , " 2 " , " -i " , " -W " , " 290 " , " -X " , " 8 " , " -Y " , " 420 " , " -l " , " 15 " , NULL } ;
2024-06-25 10:29:43 +05:00
static const char * volume_ui_cmd [ ] = { " st " , " -c " , " volume-ui " , " -g=80x15+353+20 " , " -e " , " pulsemixer " , 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 Key on_empty_keys [ ] = {
/* modifier key function argument */
{ 0 , XK_e , spawn , { . v = ( const char * [ ] ) { " fuz-launcher " , NULL } } } ,
{ 0 , XK_f , spawn , { . v = ( const char * [ ] ) { " fuz-launcher " , NULL } } } ,
{ 0 , XK_w , spawn , { . v = ( const char * [ ] ) { " firefox " , NULL } } } ,
{ 0 , XK_grave , spawn , { . v = ( const char * [ ] ) { " dmenunerdsymbols " , NULL } } } ,
{ 0 , XK_BackSpace , spawn , { . v = ( const char * [ ] ) { " sysact " , NULL } } } ,
{ 0 , XK_r , spawn , { . v = ( const char * [ ] ) { " st " , " -e " , " lf " , NULL } } } ,
{ 0 , XK_Return , spawn , { . v = ( const char * [ ] ) { " st " , " -c " , " st-terminal " , NULL } } } ,
{ 0 , XK_d , spawn , { . v = dmenu_run_cmd } } ,
{ 0 , XK_a , spawn , { . v = ( const char * [ ] ) { " dmenu_hub " , NULL } } } ,
{ 0 , XK_space , spawn , { . v = ( const char * [ ] ) { " dmenu_web " , NULL } } } ,
{ 0 , XK_n , spawn , { . v = ( const char * [ ] ) { " st " , " -e " , " nvim " , NULL } } } ,
{ 0 , XK_p , spawn , { . v = ( const char * [ ] ) { " st " , " -c " , " gping-ui " , " -g=80x15+353+20 " , " -e " , " gping " , " duckduckgo.com " , NULL } } } ,
{ 0 , XK_v , spawn , { . v = ( const char * [ ] ) { " st " , " men " , NULL } } } ,
} ;
# endif // ON_EMPTY_KEYS_PATCH
static const Key keys [ ] = {
/* modifier key function argument */
# if KEYMODES_PATCH
{ MODKEY , XK_Escape , setkeymode , { . ui = COMMANDMODE } } ,
# endif // KEYMODES_PATCH
{ 0 , XF86XK_AudioMute , spawn , SHCMD ( " wpctl set-mute @DEFAULT_AUDIO_SINK@ toggle; pkill -RTMIN+8 dwmblocks " ) } ,
{ 0 , XF86XK_AudioRaiseVolume , spawn , SHCMD ( " wpctl set-volume @DEFAULT_AUDIO_SINK@ 0%- && wpctl set-volume @DEFAULT_AUDIO_SINK@ 3%+; pkill -RTMIN+8 dwmblocks " ) } ,
{ 0 , XF86XK_AudioLowerVolume , spawn , SHCMD ( " wpctl set-volume @DEFAULT_AUDIO_SINK@ 0%+ && wpctl set-volume @DEFAULT_AUDIO_SINK@ 3%-; pkill -RTMIN+8 dwmblocks " ) } ,
{ 0 , XF86XK_AudioPrev , spawn , { . v = ( const char * [ ] ) { " mpc " , " prev " , NULL } } } ,
{ 0 , XF86XK_AudioNext , spawn , { . v = ( const char * [ ] ) { " mpc " , " next " , NULL } } } ,
{ 0 , XF86XK_AudioPause , spawn , { . v = ( const char * [ ] ) { " mpc " , " pause " , NULL } } } ,
{ 0 , XF86XK_AudioPlay , spawn , { . v = ( const char * [ ] ) { " mpc " , " play " , NULL } } } ,
{ MODKEY | ShiftMask , XK_F5 , xrdb , { . v = NULL } } ,
{ 0 , XK_F7 , spawn , { . v = clipmenu_cmd } } ,
{ 0 , XF86XK_MonBrightnessUp , spawn , { . v = ( const char * [ ] ) { " xbacklight " , " -inc " , " 15 " , NULL } } } ,
{ 0 , XF86XK_MonBrightnessDown , spawn , { . v = ( const char * [ ] ) { " xbacklight " , " -dec " , " 15 " , NULL } } } ,
{ 0 , XK_Print , spawn , { . v = ( const char * [ ] ) { " maimpick " , NULL } } } ,
{ MODKEY , XK_Print , spawn , { . v = ( const char * [ ] ) { " dmenurecord " , NULL } } } ,
{ MODKEY | ShiftMask , XK_Delete , quit ,