birdwm

Unnamed repository; edit this file 'description' to name the repository.
Log | Files | Refs | README | LICENSE

commit 0b8c4a1a8041ea8873be27010b58adeeb78ca72e
parent 1f08eefc59b2d32899b5bb7c84be3865a9098a89
Author: grouse <bdmfegys@duck.com>
Date:   Fri,  2 Feb 2024 15:05:03 -0500

alter comments for legacy compiler compatibility

Diffstat:
Mconfig.def.h | 340+++++++++++++++++++++++++++++++++++++++++++------------------------------------
1 file changed, 187 insertions(+), 153 deletions(-)

diff --git a/config.def.h b/config.def.h @@ -1,195 +1,229 @@ /* See LICENSE file for copyright and license details. */ #include <X11/XF86keysym.h> /* appearance */ -static const unsigned int borderpx = 1; /* border pixel of windows */ -static const unsigned int gappx = 7; /* gaps between windows */ -static const unsigned int snap = 32; /* snap pixel */ -static const int showbar = 1; /* 0 means no bar */ -static const int topbar = 1; /* 0 means bottom bar */ -#define ICONSIZE 16 /* icon size */ -#define ICONSPACING 5 /* space between icon and title */ -static const unsigned int systraypinning = 0; /* 0: sloppy systray follows selected monitor, >0: pin systray to monitor X */ -static const unsigned int systrayspacing = 2; /* systray spacing */ -static const int systraypinningfailfirst = 1; /* 1: if pinning fails, display systray on the first monitor, False: display systray on the last monitor */ -static const int showsystray = 1; /* 0 means no systray */ -static const char *fonts[] = { "Inconsolata-ExpandedBold:pixelsize=22" }; -static const char dmenufont[] = "Inconsolata-ExpandedBold:pixelsize=22"; +static const unsigned int borderpx = 1; /* border pixel of windows */ +static const unsigned int gappx = 7; /* gaps between windows */ +static const unsigned int snap = 32; /* snap pixel */ +static const int showbar = 1; /* 0 means no bar */ +static const int topbar = 1; /* 0 means bottom bar */ +#define ICONSIZE 16 /* icon size */ +#define ICONSPACING 5 /* space between icon and title */ +static const unsigned int systraypinning = + 0; /* 0: sloppy systray follows selected monitor, >0: pin systray to monitor + X */ +static const unsigned int systrayspacing = 2; /* systray spacing */ +static const int systraypinningfailfirst = + 1; /* 1: if pinning fails, display systray on the first monitor, False: + display systray on the last monitor */ +static const int showsystray = 1; /* 0 means no systray */ +static const char *fonts[] = {"Inconsolata-ExpandedBold:pixelsize=22"}; +static const char dmenufont[] = "Inconsolata-ExpandedBold:pixelsize=22"; static const unsigned int baralpha = 0x70; static const unsigned int borderalpha = OPAQUE; -static char normbgcolor[] = "#222222"; -static char normbordercolor[] = "#444444"; -static char normfgcolor[] = "#bbbbbb"; -static char selfgcolor[] = "#eeeeee"; -static char selbordercolor[] = "#005577"; -static char selbgcolor[] = "#005577"; +static char normbgcolor[] = "#222222"; +static char normbordercolor[] = "#444444"; +static char normfgcolor[] = "#bbbbbb"; +static char selfgcolor[] = "#eeeeee"; +static char selbordercolor[] = "#005577"; +static char selbgcolor[] = "#005577"; static char *colors[][3] = { - /* fg bg border */ - [SchemeNorm] = { normfgcolor, normbgcolor, normbordercolor }, - [SchemeSel] = { selfgcolor, selbgcolor, selbordercolor }, + /* fg bg border */ + [SchemeNorm] = {normfgcolor, normbgcolor, normbordercolor}, + [SchemeSel] = {selfgcolor, selbgcolor, selbordercolor}, }; typedef struct { - const char *name; - const void *cmd; + const char *name; + const void *cmd; } Sp; -static const char *spcmd1[] = {"birdterm", "-n", "spterm", "-g", "144x41", NULL }; /* regular terminal scratchpad */ -static const char *spcmd2[] = {"birdterm", "-n", "spfm", "-g", "144x41", "-e", "ranger", NULL }; /* file manager scratchpad */ -static const char *spcmd3[] = {"birdterm", "-n", "upgrader", "-g", "144x41", "-e", "upgrader", NULL }; /* upgrade script, change if your script is named differently */ -static const char *spcmd4[] = {"birdterm", "-n", "musicterm", "-g", "144x41", "-e", "mocp", NULL }; /* upgrade script, change if your script is named differently */ +static const char *spcmd1[] = { + "birdterm", "-n", "spterm", + "-g", "144x41", NULL}; /* regular terminal scratchpad */ +static const char *spcmd2[] = { + "birdterm", "-n", "spfm", "-g", + "144x41", "-e", "ranger", NULL}; /* file manager scratchpad */ +static const char *spcmd3[] = { + "birdterm", "-n", "upgrader", "-g", "144x41", + "-e", "upgrader", NULL}; /* upgrade script, change if your script is + named differently */ +static const char *spcmd4[] = { + "birdterm", "-n", "musicterm", "-g", "144x41", + "-e", "mocp", NULL}; /* upgrade script, change if your script is named + differently */ static Sp scratchpads[] = { - /* name cmd */ - {"spterm", spcmd1}, - {"spranger", spcmd2}, - {"upgrader", spcmd3}, - {"musicterm", spcmd4}, + /* name cmd */ + {"spterm", spcmd1}, + {"spranger", spcmd2}, + {"upgrader", spcmd3}, + {"musicterm", spcmd4}, }; -static const unsigned int alphas[][3] = { - /* fg bg border*/ - [SchemeNorm] = { OPAQUE, baralpha, borderalpha }, - [SchemeSel] = { OPAQUE, baralpha, borderalpha }, +static const unsigned int alphas[][3] = { + /* fg bg border*/ + [SchemeNorm] = {OPAQUE, baralpha, borderalpha}, + [SchemeSel] = {OPAQUE, baralpha, borderalpha}, }; #define ALTMONNUM 1 /* tagging */ -static const char *tags[] = { "󰣇", "", "", "", "󰙯", "", }; +static const char *tags[] = { + "󰣇", "", "", "", "󰙯", "", +}; static const Rule rules[] = { - /* xprop(1): - * WM_CLASS(STRING) = instance, class - * WM_NAME(STRING) = title - */ - /* class instance title tags mask isfloating monitor */ - { "Gimp", NULL, NULL, 0, 1, -1 }, // gimp menu floating rule - { NULL, NULL, "Blanket", 0, 1, -1 }, // blanket (ambience program) floating rule + /* xprop(1): + * WM_CLASS(STRING) = instance, class + * WM_NAME(STRING) = title + */ + /* class instance title tags mask isfloating monitor */ + {"Gimp", NULL, NULL, 0, 1, -1}, /* gimp menu floating rule */ + {NULL, NULL, "Blanket", 0, 1, + -1}, /* blanket (ambience program) floating rule */ -/* scratchpad floating rules */ - { NULL, "spterm", NULL, SPTAG(0), 1, -1 }, // scratchpad floating rule - { NULL, "spfm", NULL, SPTAG(1), 1, -1 }, // suckless file manager command - { NULL, "upgrader", NULL, SPTAG(2), 1, -1 }, // upgrade script command floating - { NULL, "musicterm",NULL, SPTAG(3), 1, -1 }, // upgrade script command floating -// { "Alacritty","Alacritty",NULL, 0, 1, -1 }, // alacritty (used for possible switch to alacritty as scratchpad) + /* scratchpad floating rules */ + {NULL, "spterm", NULL, SPTAG(0), 1, -1}, /* scratchpad floating rule */ + {NULL, "spfm", NULL, SPTAG(1), 1, -1}, /* suckless file manager command */ + {NULL, "upgrader", NULL, SPTAG(2), 1, + -1}, /* upgrade script command floating */ + {NULL, "musicterm", NULL, SPTAG(3), 1, + -1}, /* upgrade script command floating */ + /* { "Alacritty","Alacritty",NULL, 0, 1, -1 },*/ /* alacritty (used for possible switch to alacritty as scratchpad) */ -/* end of scratchpad floating rules */ - { "widget", NULL, NULL, 0, 1, -1 }, // used sometimes, for using sww widgets - { "python3", NULL, NULL, 0, 1, -1 }, // i cant remember what this is tbh - { NULL, "Toolkit", NULL, 0, 1, -1 }, // firefox floating media player floating rule - { "steam","steamwebhelper",NULL, 0, 1, -1 }, // just to make the steam menus float + /* end of scratchpad floating rules */ + {"widget", NULL, NULL, 0, 1, + -1}, /* used sometimes, for using sww widgets */ + {"python3", NULL, NULL, 0, 1, -1}, /* i cant remember what this is tbh */ + {NULL, "Toolkit", NULL, 0, 1, + -1}, /* firefox floating media player floating rule */ + {"steam", "steamwebhelper", NULL, 0, 1, + -1}, /* just to make the steam menus float */ -/* all rules below this start on the second monitor */ -// { "VencordDesktop", "vencorddesktop", NULL, 1 << 4, 0, ALTMONNUM }, // starts discord on the discord icon tag - { "vesktop", "vesktop", NULL, 1 << 4, 0, ALTMONNUM }, // starts vesktop discord client on the discord icon tag - { "tutanota-desktop","tutanota-desktop",NULL,1 << 5,0, ALTMONNUM }, // starts tutanota-desktop on the mail tag - { "Cider", "cider", NULL, 1 << 3, 0, ALTMONNUM }, // starts cider on the music tag - { "VSCodium", "vscodium", NULL, 1 << 1, 0, ALTMONNUM }, // starts vscodium by default on the cli/code tag - { "Element", "element", NULL, 1 << 5, 0, ALTMONNUM }, // starts element on the chat tag - { "Signal", "signal", NULL, 1 << 2, 0, ALTMONNUM }, // starts element on the chat tag + /* all rules below this start on the second monitor */ + /* { "VencordDesktop", "vencorddesktop", NULL, 1 << 4, 0, ALTMONNUM },*/ /* starts discord on the discord icon tag */ + {"vesktop", "vesktop", NULL, 1 << 4, 0, + ALTMONNUM}, /* starts vesktop discord client on the discord icon tag */ + {"tutanota-desktop", "tutanota-desktop", NULL, 1 << 5, 0, + ALTMONNUM}, /* starts tutanota-desktop on the mail tag */ + {"Cider", "cider", NULL, 1 << 3, 0, + ALTMONNUM}, /* starts cider on the music tag */ + {"VSCodium", "vscodium", NULL, 1 << 1, 0, + ALTMONNUM}, /* starts vscodium by default on the cli/code tag */ + {"Element", "element", NULL, 1 << 5, 0, + ALTMONNUM}, /* starts element on the chat tag */ + {"Signal", "signal", NULL, 1 << 2, 0, + ALTMONNUM}, /* starts element on the chat tag */ }; /* 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 */ -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 */ +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 */ +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 */ static const Layout layouts[] = { - /* symbol arrange function */ - { "[]=", tile }, /* first entry is default */ - { "><>", NULL }, /* no layout function means floating behavior */ - { "[M]", monocle }, + /* symbol arrange function */ + {"[]=", tile}, /* first entry is default */ + {"><>", NULL}, /* no layout function means floating behavior */ + {"[M]", monocle}, }; /* key definitions */ #define MODKEY Mod1Mask -#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} }, +#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}}, /* helper for spawning shell commands in the pre dwm-5.0 fashion */ -#define SHCMD(cmd) { .v = (const char*[]){ "/bin/sh", "-c", cmd, NULL } } +#define SHCMD(cmd) \ + { \ + .v = (const char *[]) { "/bin/sh", "-c", cmd, NULL } \ + } /* commands */ -static char dmenumon[2] = "0"; /* component of dmenucmd, manipulated in spawn() */ -static const char *dmenucmd[] = { "dmenu_run", "-i", NULL }; -static const char *termcmd[] = { "birdterm", NULL }; -//static const char *wallpaper[] = { "nsxiv", "-t", "/home/tetraonini/Pictures/wallpapers/*.png", NULL }; -//static const char *wallpapergif[] = { "nsxiv", "-t", "/home/tetraonini/Pictures/wallpapers/gif/*.gif", NULL }; -static const char *wallpaper[] = { "xwallpaper" }; /* calling wallpaper picker script, utilizes nsxiv */ -static const char *wallpapergif[] = { "xwallpapergif" }; /* calling gif wallpaper picker script, utilizes nsxiv */ -static const char *restarter[] = { "restarter", NULL}; /* dmenu script for restarting daemons and getting system info through dunst */ +static char dmenumon[2] = + "0"; /* component of dmenucmd, manipulated in spawn() */ +static const char *dmenucmd[] = {"dmenu_run", "-i", NULL}; +static const char *termcmd[] = {"birdterm", NULL}; +// static const char *wallpaper[] = { "nsxiv", "-t", +// "/home/tetraonini/Pictures/wallpapers/*.png", NULL }; static const char +// *wallpapergif[] = { "nsxiv", "-t", +// "/home/tetraonini/Pictures/wallpapers/gif/*.gif", NULL }; +static const char *wallpaper[] = { + "xwallpaper"}; /* calling wallpaper picker script, utilizes nsxiv */ +static const char *wallpapergif[] = { + "xwallpapergif"}; /* calling gif wallpaper picker script, utilizes nsxiv */ +static const char *restarter[] = { + "restarter", NULL}; /* dmenu script for restarting daemons and getting + system info through dunst */ /* pulseaudio script for setting volume, called by XF86 keys */ -static const char *volup[] = { "volume.sh", "up", NULL}; -static const char *voldown[] = { "volume.sh", "down", NULL}; -static const char *volmute[] = { "volume.sh", "mute", NULL}; -static const char *firefox[] = { "net.mullvad.MullvadBrowser", NULL}; /* browser shortcut */ - +static const char *volup[] = {"volume.sh", "up", NULL}; +static const char *voldown[] = {"volume.sh", "down", NULL}; +static const char *volmute[] = {"volume.sh", "mute", NULL}; +static const char *firefox[] = {"net.mullvad.MullvadBrowser", + NULL}; /* browser shortcut */ #include "exitdwm.c" static const Key keys[] = { - /* modifier key function argument */ - { MODKEY, XK_p, spawn, {.v = dmenucmd } }, - { MODKEY|ShiftMask, XK_Return, spawn, {.v = termcmd } }, - { MODKEY, XK_w, spawn, {.v = wallpaper } }, - { MODKEY, XK_g, spawn, {.v = wallpapergif } }, - { MODKEY|ShiftMask, XK_j, spawn, {.v = restarter } }, - { MODKEY, XK_f, spawn, {.v = firefox } }, - { 0, XF86XK_AudioRaiseVolume, spawn, {.v = volup} }, - { 0, XF86XK_AudioLowerVolume, spawn, {.v = voldown} }, - { 0, XF86XK_AudioMute, spawn, {.v = volmute} }, - { MODKEY, XK_b, togglebar, {0} }, - { MODKEY, XK_j, focusstack, {.i = +1 } }, - { MODKEY, XK_k, focusstack, {.i = -1 } }, - { MODKEY, XK_i, incnmaster, {.i = +1 } }, - { MODKEY, XK_d, incnmaster, {.i = -1 } }, - { MODKEY, XK_h, setmfact, {.f = -0.05} }, - { MODKEY, XK_l, setmfact, {.f = +0.05} }, - { MODKEY, XK_Return, zoom, {0} }, - { MODKEY, XK_Tab, view, {0} }, - { MODKEY|ShiftMask, XK_c, killclient, {0} }, - { MODKEY, XK_t, setlayout, {.v = &layouts[0]} }, - { MODKEY, XK_m, setlayout, {.v = &layouts[2]} }, - { MODKEY, XK_space, setlayout, {0} }, - { MODKEY|ShiftMask, XK_space, togglefloating, {0} }, - { MODKEY, XK_0, view, {.ui = ~0 } }, - { MODKEY|ShiftMask, XK_0, tag, {.ui = ~0 } }, - { 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 } }, - { MODKEY, XK_F5, xrdb, {.v = NULL } }, - { MODKEY, XK_y, togglescratch, {.ui = 0 } }, - { MODKEY, XK_u, togglescratch, {.ui = 1 } }, - { MODKEY|ShiftMask, XK_u, togglescratch, {.ui = 2 } }, - { MODKEY|ShiftMask, XK_m, togglescratch, {.ui = 3 } }, - 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) -/* following line is commented out due to exitmenu patch */ -// { MODKEY|ShiftMask, XK_q, quit, {0} }, - { MODKEY|ControlMask|ShiftMask, XK_q, quit, {1} }, - { MODKEY|ShiftMask, XK_e, exitdwm, {0} }, + /* modifier key function argument */ + {MODKEY, XK_p, spawn, {.v = dmenucmd}}, + {MODKEY | ShiftMask, XK_Return, spawn, {.v = termcmd}}, + {MODKEY, XK_w, spawn, {.v = wallpaper}}, + {MODKEY, XK_g, spawn, {.v = wallpapergif}}, + {MODKEY | ShiftMask, XK_j, spawn, {.v = restarter}}, + {MODKEY, XK_f, spawn, {.v = firefox}}, + {0, XF86XK_AudioRaiseVolume, spawn, {.v = volup}}, + {0, XF86XK_AudioLowerVolume, spawn, {.v = voldown}}, + {0, XF86XK_AudioMute, spawn, {.v = volmute}}, + {MODKEY, XK_b, togglebar, {0}}, + {MODKEY, XK_j, focusstack, {.i = +1}}, + {MODKEY, XK_k, focusstack, {.i = -1}}, + {MODKEY, XK_i, incnmaster, {.i = +1}}, + {MODKEY, XK_d, incnmaster, {.i = -1}}, + {MODKEY, XK_h, setmfact, {.f = -0.05}}, + {MODKEY, XK_l, setmfact, {.f = +0.05}}, + {MODKEY, XK_Return, zoom, {0}}, + {MODKEY, XK_Tab, view, {0}}, + {MODKEY | ShiftMask, XK_c, killclient, {0}}, + {MODKEY, XK_t, setlayout, {.v = &layouts[0]}}, + {MODKEY, XK_m, setlayout, {.v = &layouts[2]}}, + {MODKEY, XK_space, setlayout, {0}}, + {MODKEY | ShiftMask, XK_space, togglefloating, {0}}, + {MODKEY, XK_0, view, {.ui = ~0}}, + {MODKEY | ShiftMask, XK_0, tag, {.ui = ~0}}, + {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}}, + {MODKEY, XK_F5, xrdb, {.v = NULL}}, + {MODKEY, XK_y, togglescratch, {.ui = 0}}, + {MODKEY, XK_u, togglescratch, {.ui = 1}}, + {MODKEY | ShiftMask, XK_u, togglescratch, {.ui = 2}}, + {MODKEY | ShiftMask, XK_m, togglescratch, {.ui = 3}}, + 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) + /* following line is commented out due to exitmenu patch */ + /* { MODKEY|ShiftMask, XK_q, quit, {0} }, */ + {MODKEY | ControlMask | ShiftMask, XK_q, quit, {1}}, + {MODKEY | ShiftMask, XK_e, exitdwm, {0}}, }; /* button definitions */ -/* click can be ClkTagBar, ClkLtSymbol, ClkStatusText, ClkWinTitle, ClkClientWin, or ClkRootWin */ +/* click can be ClkTagBar, ClkLtSymbol, ClkStatusText, ClkWinTitle, + * ClkClientWin, or ClkRootWin */ static const Button buttons[] = { - /* click event mask button function argument */ - { ClkLtSymbol, 0, Button1, setlayout, {0} }, - { ClkLtSymbol, 0, Button3, setlayout, {.v = &layouts[2]} }, - { ClkWinTitle, 0, Button2, zoom, {0} }, - { ClkStatusText, 0, Button2, spawn, {.v = termcmd } }, - { ClkClientWin, MODKEY, Button1, movemouse, {0} }, - { ClkClientWin, MODKEY, Button2, togglefloating, {0} }, - { ClkClientWin, MODKEY, Button1, resizemouse, {0} }, - { ClkTagBar, 0, Button1, view, {0} }, - { ClkTagBar, 0, Button3, toggleview, {0} }, - { ClkTagBar, MODKEY, Button1, tag, {0} }, - { ClkTagBar, MODKEY, Button3, toggletag, {0} }, + /* click event mask button function argument */ + {ClkLtSymbol, 0, Button1, setlayout, {0}}, + {ClkLtSymbol, 0, Button3, setlayout, {.v = &layouts[2]}}, + {ClkWinTitle, 0, Button2, zoom, {0}}, + {ClkStatusText, 0, Button2, spawn, {.v = termcmd}}, + {ClkClientWin, MODKEY, Button1, movemouse, {0}}, + {ClkClientWin, MODKEY, Button2, togglefloating, {0}}, + {ClkClientWin, MODKEY, Button1, resizemouse, {0}}, + {ClkTagBar, 0, Button1, view, {0}}, + {ClkTagBar, 0, Button3, toggleview, {0}}, + {ClkTagBar, MODKEY, Button1, tag, {0}}, + {ClkTagBar, MODKEY, Button3, toggletag, {0}}, }; -