birdwm

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

config.h (13671B)


      1 #define HOME "/home/mrgrouse"
      2 #define WALLPAPERDIR "/home/mrgrouse/Pictures/wallpapers"
      3 #define GIFDIR "/home/mrgrouse/Pictures/wallpapers/gif"
      4 /* See LICENSE file for copyright and license details. */
      5 #include <X11/XF86keysym.h>
      6 /* appearance */
      7 static const unsigned int borderpx  = 0;        /* border pixel of windows */
      8 static const unsigned int gappx     = 7;        /* gaps between windows */
      9 static const unsigned int snap      = 32;       /* snap pixel */
     10 static const int showbar            = 1;        /* 0 means no bar */
     11 static const int topbar             = 1;        /* 0 means bottom bar */
     12 #define ICONSIZE 16                             /* icon size */
     13 #define ICONSPACING 5                           /* space between icon and title */
     14 static const unsigned int systraypinning = 0;   /* 0: sloppy systray follows selected monitor, >0: pin systray to monitor X */
     15 static const unsigned int systrayspacing = 2;   /* systray spacing */
     16 static const int systraypinningfailfirst = 1;   /* 1: if pinning fails, display systray on the first monitor, False: display systray on the last monitor */
     17 static const int showsystray             = 1;   /* 0 means no systray */
     18 static const char *fonts[]          = { "LexendDeca-Bold:pixelsize=18" };
     19 static const char dmenufont[]       = "LexendDeca-Bold:pixelsize=18";
     20 static const unsigned int baralpha = 0xff;
     21 static const unsigned int borderalpha = OPAQUE;
     22 static const unsigned int ALTMONNUM = 1;        /* number of the alt/secondary monitor */
     23 static char normbgcolor[]           = "#222222";
     24 static char normbordercolor[]       = "#444444";
     25 static char normfgcolor[]           = "#bbbbbb";
     26 static char selfgcolor[]            = "#eeeeee";
     27 static char selbordercolor[]        = "#005577";
     28 static char selbgcolor[]            = "#005577";
     29 static char *colors[][3] = {
     30        /*               fg           bg           border   */
     31        [SchemeNorm] = { normfgcolor, normbgcolor, normbordercolor },
     32        [SchemeSel]  = { selfgcolor,  selbgcolor,  selbordercolor  },
     33 };
     34 typedef struct {
     35        const char *name;
     36        const void *cmd;
     37 } Sp;
     38 
     39 //char scratchpadsize[] = "144x41";   /* size of scratchpad (for st/birdterm)*/
     40 char termfm[]         = "nnn";      /* terminal file manager */
     41 char upgradescript[]  = "upgrader.sh"; /* upgrade script */
     42 char musicterm[]      = "kew";    /* tui music player */
     43 char termtop[]        = "htop";     /* htop scratchpad */
     44 
     45 static const char *spcmd1[] = {"kitty", "--name", "spterm",                   };  /* regular terminal scratchpad */
     46 static const char *spcmd2[] = {"kitty", "--name", "spfm",      termfm,        };  /* file manager scratchpad */
     47 static const char *spcmd3[] = {"kitty", "--name", "upgrader",  upgradescript, };  /* upgrade script, change if your script is named differently */
     48 static const char *spcmd4[] = {"kitty", "--name", "musicterm", musicterm,     };  /* scratchpad for tui music clients */
     49 static const char *spcmd5[] = {"kitty", "--name", "termtop",   termtop,       };  /* scratchpad for tui resource monitor */
     50 static Sp scratchpads[] = {
     51   /* name          cmd  */
     52 	{"spterm",      spcmd1},
     53 	{"spfm",        spcmd2},
     54 	{"upgrader",    spcmd3},
     55 	{"musicterm",   spcmd4},
     56 	{"termtop",     spcmd5},
     57 };
     58 
     59 static const unsigned int alphas[][3]      = {
     60 	/*               fg      bg        border*/
     61 	[SchemeNorm] = { OPAQUE, baralpha, borderalpha },
     62 	[SchemeSel]  = { OPAQUE, baralpha, borderalpha },
     63 };
     64 
     65 /* tagging */
     66 static const char *tags[] = { "\uf303", "\uf120", "\uf25f", "\uf001", "\uf1ff", "\uf199", };
     67 static const Rule rules[] = {
     68 	/* xprop(1):
     69 	 *	WM_CLASS(STRING) = instance, class
     70 	 *	WM_NAME(STRING) = title
     71 	 */
     72 	/* class      instance    title       tags mask     isfloating   monitor */
     73 	{ "Gimp",     NULL,       NULL,       0,            1,           -1 }, /* gimp menu floating rule */
     74 	{ NULL,     NULL,       "Signal Desktop Preferences",       0,            1,           -1 }, /* signal settings floating rule */
     75 	{ NULL,       NULL,       "Blanket",  0,            1,           -1 }, /* blanket (ambience program) floating rule */
     76 	{ "python3",  "python3",  NULL,       0,            1,           -1 }, /* blanket (ambience program) floating rule */
     77 
     78 /* scratchpad floating rules */
     79 	{ NULL,       "spterm",   NULL,       SPTAG(0),     1,           -1 }, /* scratchpad floating rule */
     80 	{ NULL,       "spfm",     NULL,       SPTAG(1),     1,           -1 }, /* suckless file manager command */
     81 	{ NULL,       "upgrader", NULL,       SPTAG(2),     1,           -1 }, /* upgrade script command floating */
     82 	{ NULL,       "musicterm",NULL,       SPTAG(3),     1,           -1 }, /* terminal music player scratchpad */
     83 	{ NULL,       "termtop",  NULL,       SPTAG(4),     1,           -1 }, /* htop or other terminal monitor scratchpad */
     84 /*	{ "Alacritty","Alacritty",NULL,       0,            1,           -1 },*/ /* alacritty (used for possible switch to alacritty as scratchpad) */
     85 
     86 /* end of scratchpad floating rules */
     87 	{ "widget",   NULL,       NULL,       0,            1,           -1 }, /* used sometimes, for using sww widgets */
     88 	{ "python3",  NULL,       NULL,       0,            1,           -1 }, /* i cant remember what this is tbh */
     89   { NULL,       NULL,       HOME"/.config/nnn/plugins/preview-tui", 0, 1, -1 },
     90 	{ NULL,       "Toolkit",  NULL,       0,            1,           -1 }, /* browser floating media player floating rule */
     91 	{ "steam","steamwebhelper",NULL,      0,            1,           -1 }, /* just to make the steam menus float */
     92 
     93 /* all rules below this start on the second monitor */
     94 /*	{ "VencordDesktop", "vencorddesktop", NULL, 1 << 4, 0,    ALTMONNUM },*/ /* starts discord on the discord icon tag */
     95 	{ "vesktop",        "vesktop",        NULL, 1 << 4, 0,    ALTMONNUM }, /* starts vesktop discord client on the discord icon tag */
     96 	{ "tutanota-desktop","tutanota-desktop",NULL,1 << 5,0,    ALTMONNUM }, /* starts tutanota-desktop on the mail tag */
     97 	{ "Cider",    "cider",    NULL,       1 << 3,       0,    ALTMONNUM }, /* starts cider on the music tag */
     98 	{ "VSCodium", "vscodium", NULL,	      1 << 1,       0,    ALTMONNUM }, /* starts vscodium by default on the cli/code tag */
     99 	{ "Element",  "element",  NULL,	      1 << 5,	      0,    ALTMONNUM }, /* starts element on the chat tag */
    100 	{ "Signal",   "signal",   NULL,	      1 << 2,	      0,    ALTMONNUM }, /* starts element on the chat tag */
    101 };
    102 
    103 /* layout(s) */
    104 static const float mfact     = 0.55; /* factor of master area size [0.05..0.95] */
    105 static const int nmaster     = 1;    /* number of clients in master area */
    106 static const int resizehints = 0;    /* 1 means respect size hints in tiled resizals */
    107 static const int lockfullscreen = 1; /* 1 will force focus on the fullscreen window */
    108 
    109 static const Layout layouts[] = {
    110 	/* symbol     arrange function */
    111 	{ "[]=",      tile },    /* first entry is default */
    112 	{ "><>",      NULL },    /* no layout function means floating behavior */
    113 	{ "[M]",      monocle },
    114 };
    115 
    116 /* key definitions */
    117 #define MODKEY Mod1Mask
    118 #define WINKEY Mod4Mask
    119 #define TAGKEYS(KEY,TAG) \
    120 	{ MODKEY,                       KEY,      view,           {.ui = 1 << TAG} }, \
    121 	{ MODKEY|ControlMask,           KEY,      toggleview,     {.ui = 1 << TAG} }, \
    122 	{ MODKEY|ShiftMask,             KEY,      tag,            {.ui = 1 << TAG} }, \
    123 	{ MODKEY|ControlMask|ShiftMask, KEY,      toggletag,      {.ui = 1 << TAG} },
    124 
    125 /* helper for spawning shell commands in the pre dwm-5.0 fashion */
    126 //#define SHCMD(cmd) { .v = (const char*[]){ "/bin/sh", "-c", cmd, NULL } }
    127 
    128 /* commands */
    129 static char dmenumon[2] = "0";                                              /* component of dmenucmd, manipulated in spawn() */
    130 static const char *dmenucmd[] =      { "birdmenu_run", "-i", NULL };
    131 static const char *termcmd[]  =      { "kitty", NULL };
    132 static const char *wallpaper[] =     { "nsxiv", "-t", WALLPAPERDIR, NULL };
    133 static const char *wallpapergif[] =  { "nsxiv", "-t", GIFDIR, NULL };       /* calling gif wallpaper picker script, utilizes nsxiv */
    134 static const char *restarter[] =     { "restarter" };                       /* dmenu script for restarting daemons and getting system info through dunst */
    135 static const char *browser[] =       { "io.gitlab.librewolf-community" };   /* browser shortcut */
    136 static const char *screenshot[] =    { "screenshot.sh" };                   /* screenshot script */
    137 static const char *emojiscript[] =   { "dmenu-emoji.sh" };                  /* (bir)dmenu emoji finder */
    138 
    139 /* pulseaudio script for setting volume, called by XF86 keys, found in 'extras' folder */
    140 static const char *volup[] =         { "volume.sh", "up", NULL};
    141 static const char *voldown[] =       { "volume.sh", "down", NULL};
    142 static const char *volmute[] =       { "volume.sh", "mute", NULL};
    143 
    144 
    145 #include "exitdwm.c"
    146 static const Key keys[] = {
    147 	/* modifier                     key        function        argument */
    148 	{ MODKEY,                       XK_p,      spawn,          {.v = dmenucmd } },
    149 	{ MODKEY|ShiftMask,             XK_Return, spawn,          {.v = termcmd } },
    150 	{ MODKEY,                       XK_w,      spawn,          {.v = wallpaper } },
    151 	{ MODKEY,                       XK_g,      spawn,          {.v = wallpapergif } },
    152 	{ MODKEY|ShiftMask,             XK_j,      spawn,          {.v = restarter } },
    153 	{ MODKEY,                       XK_f,      spawn,          {.v = browser } },
    154 	{ MODKEY,                       XK_e,      spawn,          {.v = emojiscript } },
    155 	{ WINKEY|ShiftMask,             XK_s,      spawn,          {.v = screenshot} },
    156 	{ 0,         XF86XK_AudioRaiseVolume,      spawn,          {.v = volup} },
    157 	{ 0,         XF86XK_AudioLowerVolume,      spawn,          {.v = voldown} },
    158 	{ 0,                XF86XK_AudioMute,      spawn,          {.v = volmute} },
    159 	{ MODKEY,                       XK_b,      togglebar,      {0} },
    160 	{ MODKEY,                       XK_j,      focusstack,     {.i = +1 } },
    161 	{ MODKEY,                       XK_k,      focusstack,     {.i = -1 } },
    162 	{ MODKEY,                       XK_i,      incnmaster,     {.i = +1 } },
    163 	{ MODKEY,                       XK_d,      incnmaster,     {.i = -1 } },
    164 	{ MODKEY,                       XK_h,      setmfact,       {.f = -0.05} },
    165 	{ MODKEY,                       XK_l,      setmfact,       {.f = +0.05} },
    166 	{ MODKEY,                       XK_Return, zoom,           {0} },
    167 	{ MODKEY,                       XK_Tab,    view,           {0} },
    168 	{ MODKEY|ShiftMask,             XK_c,      killclient,     {0} },
    169 	{ MODKEY,                       XK_t,      setlayout,      {.v = &layouts[0]} },
    170 	{ MODKEY,                       XK_m,      setlayout,      {.v = &layouts[2]} },
    171 	{ MODKEY,                       XK_space,  setlayout,      {0} },
    172 	{ MODKEY|ShiftMask,             XK_space,  togglefloating, {0} },
    173 	{ MODKEY,                       XK_0,      view,           {.ui = ~0 } },
    174 	{ MODKEY|ShiftMask,             XK_0,      tag,            {.ui = ~0 } },
    175 	{ MODKEY,                       XK_comma,  focusmon,       {.i = -1 } },
    176 	{ MODKEY,                       XK_period, focusmon,       {.i = +1 } },
    177 	{ MODKEY|ShiftMask,             XK_comma,  tagmon,         {.i = -1 } },
    178 	{ MODKEY|ShiftMask,             XK_period, tagmon,         {.i = +1 } },
    179 	{ MODKEY,                       XK_F5,     xrdb,           {.v = NULL } },
    180 	{ MODKEY,                       XK_y,      togglescratch,  {.ui = 0 } },
    181 	{ MODKEY,                       XK_u,      togglescratch,  {.ui = 1 } },
    182 	{ MODKEY|ShiftMask,             XK_u,      togglescratch,  {.ui = 2 } },
    183 	{ MODKEY|ShiftMask,             XK_m,      togglescratch,  {.ui = 3 } },
    184 	{ MODKEY|ShiftMask,             XK_h,      togglescratch,  {.ui = 4 } },
    185 	TAGKEYS(                        XK_1,                      0)
    186 	TAGKEYS(                        XK_2,                      1)
    187 	TAGKEYS(                        XK_3,                      2)
    188 	TAGKEYS(                        XK_4,                      3)
    189 	TAGKEYS(                        XK_5,                      4)
    190 	TAGKEYS(                        XK_6,                      5)
    191 	TAGKEYS(                        XK_7,                      6)
    192 	TAGKEYS(                        XK_8,                      7)
    193 	TAGKEYS(                        XK_9,                      8)
    194 /* following line is commented out due to exitmenu patch */
    195 /*  { MODKEY|ShiftMask,             XK_q,      quit,           {0} }, */
    196 	{ MODKEY|ControlMask|ShiftMask, XK_q,      quit,           {1} },
    197 	{ MODKEY|ShiftMask,             XK_e,      exitdwm,        {0} },
    198 };
    199 
    200 /* button definitions */
    201 /* click can be ClkTagBar, ClkLtSymbol, ClkStatusText, ClkWinTitle, ClkClientWin, or ClkRootWin */
    202 static const Button buttons[] = {
    203 	/* click                event mask      button          function        argument */
    204 	{ ClkLtSymbol,          0,              Button1,        setlayout,      {0} },
    205 	{ ClkLtSymbol,          0,              Button3,        setlayout,      {.v = &layouts[2]} },
    206 	{ ClkWinTitle,          0,              Button2,        zoom,           {0} },
    207 	{ ClkStatusText,        0,              Button2,        spawn,          {.v = termcmd } },
    208 	{ ClkClientWin,         MODKEY,         Button1,        movemouse,      {0} },
    209 	{ ClkClientWin,         MODKEY,         Button2,        togglefloating, {0} },
    210 	{ ClkClientWin,         MODKEY,         Button3,        resizemouse,    {0} },
    211 	{ ClkTagBar,            0,              Button1,        view,           {0} },
    212 	{ ClkTagBar,            0,              Button3,        toggleview,     {0} },
    213 	{ ClkTagBar,            MODKEY,         Button1,        tag,            {0} },
    214 	{ ClkTagBar,            MODKEY,         Button3,        toggletag,      {0} },
    215 };
    216