dwm

my fork of dwm
Index Commits Files Refs README LICENSE
config.def.h (11895B)
   1 /* See LICENSE file for copyright and license details. */
   2 
   3 /* appearance */
   4 static const unsigned int borderpx  = 3;        /* border pixel of windows */
   5 static const Gap default_gap        = {.isgap = 1, .realgap = 20, .gappx = 20};
   6 static const unsigned int snap      = 16;       /* snap pixel */
   7 static const unsigned int systraypinning = 0;   /* 0: sloppy systray follows selected monitor, >0: pin systray to monitor X */
   8 static const unsigned int systrayonleft = 0;       /* 0: systray in the right corner, >0: systray on left of status text */
   9 static const unsigned int systrayspacing = 2;   /* systray spacing */
  10 static const int systraypinningfailfirst = 1;   /* 1: if pinning fails, display systray on the first monitor, False: display systray on the last monitor*/
  11 static const int showsystray        = 1;     /* 0 means no systray */
  12 static const int showbar            = 1;        /* 0 means no bar */
  13 static const int topbar             = 0;        /* 0 means bottom bar */
  14 static const char *fonts[]          = { "Source Code Pro:style=Regular:size=9", "JoyPixels:style=Regular:size=8:antialias=true:autohint=true", "DejaVu Sans" };
  15 static const char dmenufont[]       = "DejaVuSansMono Nerd Font:style=Regular:size=9";
  16 static const char col_gray1[]       = "#000000";
  17 static const char col_gray2[]       = "#444444";
  18 static const char col_gray3[]       = "#cccccc";
  19 static const char col_gray4[]       = "#eeeeee";
  20 static const char col_gray5[]       = "#111111";
  21 static const char col_darkmagenta[] = "#8B008B";
  22 static const char col1[]            = "#ff0000";
  23 static const char col2[]            = "#00ff00";
  24 static const char col3[]            = "#0000ff";
  25 static const char col4[]            = "#ffff00";
  26 static const char col5[]            = "#ffff00";
  27 static const char col6[]            = "#ffff00";
  28 
  29 enum { SchemeNorm, SchemeCol1, SchemeCol2, SchemeCol3, SchemeCol4,
  30        SchemeCol5, SchemeCol6, SchemeSel, SchemeTitle }; /* color schemes */
  31 
  32 
  33 static const char *colors[][3]      = {
  34     /*               fg         bg         border   */
  35     /* [SchemeNorm] = { col_gray3, col_gray1, col_gray2 }, */
  36     /* [SchemeSel]  = { col_gray4, col_darkmagenta,  col_darkmagenta  }, */
  37     [SchemeNorm]  = { col_gray3, col_gray1, col_gray1 },
  38     [SchemeCol1]  = { col1,      col_gray1, col_gray2 },
  39     [SchemeCol2]  = { col2,      col_gray1, col_gray2 },
  40     [SchemeCol3]  = { col3,      col_gray1, col_gray2 },
  41     [SchemeCol4]  = { col4,      col_gray1, col_gray2 },
  42     [SchemeCol5]  = { col5,      col_gray1, col_gray2 },
  43     [SchemeCol6]  = { col6,      col_gray1, col_gray2 },
  44     [SchemeSel]   = { col_gray4, col_darkmagenta,  "#444444"  },
  45     [SchemeTitle]  = { col_gray4, col_gray5,  col_darkmagenta  },
  46 };
  47 
  48 /* tagging */
  49 static const char *tags[] = { "1", "2", "3", "4", "5", "6", "7", "8", "9", "0" };
  50 static const int initlayouts[] = { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2 };
  51 
  52 static const Rule rules[] = {
  53     /* xprop(1):
  54      *    WM_CLASS(STRING) = instance, class
  55      *    WM_NAME(STRING) = title
  56      */
  57 /*    class                instance        title    tags mask    isfloating    monitor    float x,y,w,h        floatborderpx*/
  58     { "Gimp",             NULL,           NULL,    0,           1,            -1,            50,50,500,500,        2 },
  59     { "Firefox",          NULL,           NULL,    1<<8,         0,            -1,            50,50,500,500,        2 },
  60     { "calculator",     NULL,            NULL,    0,             1,            -1,            80,50,400,300,        2 },
  61     { "floating",        NULL,            NULL,    0,             1,            -1,            80,50,800,600,        0 },
  62     { "scratchpad",        NULL,            NULL,    0,             1,            -1,            80,50,1366,900,        0 },
  63     { "qBittorrent",    "qbittorrent",    NULL,    1<<8,        0,            -1,            80,50,800,600,      0 },
  64     { "Spotify",        "spotify",      NULL,       1<<8,           0,           -1,        80,50,800,600,      0 },
  65     { NULL,             NULL,           "Spotify",  1<<8,           0,           -1,        80,50,800,600,      0 },
  66     { "Spotify",        "spotify",      "Spotify",  1<<8,           0,           -1,        80,50,800,600,      0 },
  67     { NULL,             NULL,           "spotify",  1<<8,           0,           -1,        80,50,800,600,      0 },
  68 
  69 };
  70 
  71 /* layout(s) */
  72 static const float mfact     = 0.5; /* factor of master area size [0.05..0.95] */
  73 static const int nmaster     = 1;    /* number of clients in master area */
  74 static const int resizehints = 1;    /* 1 means respect size hints in tiled resizals */
  75 static const int lockfullscreen = 1; /* 1 will force focus on the fullscreen window */
  76 
  77 #define FORCE_VSPLIT 1  /* nrowgrid layout: force two clients to always split vertically */
  78 
  79 static const Layout layouts[] = {
  80     /* symbol     arrange function */
  81     { "[]=",      tile },    /* first entry is default */
  82     { "><>",      NULL },    /* no layout function means floating behavior */
  83     { "[M]",      monocle },
  84 };
  85 
  86 /* key definitions */
  87 #define MODKEY Mod4Mask
  88 #define MOD2KEY Mod1Mask    /* MOD2KEY to altkey    */
  89 
  90 #define TAGKEYS(KEY,TAG) \
  91     { MODKEY,                       KEY,      view,           {.ui = 1 << TAG} }, \
  92     { MODKEY|ControlMask,           KEY,      toggleview,     {.ui = 1 << TAG} }, \
  93     { MODKEY|ShiftMask,             KEY,      tag,            {.ui = 1 << TAG} }, \
  94     { MODKEY|ControlMask|ShiftMask, KEY,      toggletag,      {.ui = 1 << TAG} },
  95 
  96 /* helper for spawning shell commands in the pre dwm-5.0 fashion */
  97 #define SHCMD(cmd) { .v = (const char*[]){ "/bin/sh", "-c", cmd, NULL } }
  98 
  99 /* commands */
 100 static char dmenumon[2] = "0"; /* component of dmenucmd, manipulated in spawn() */
 101 /* static const char *dmenucmd[] = { "dmenu_run_history", "-h", "16", "-b", "-m", dmenumon, "-fn", dmenufont, "-nb", col_gray1, "-nf", col_gray3, "-sb", col_darkmagenta, "-sf", col_gray4, NULL }; */
 102 static const char *dmenucmd[] = { "dmenu_centered", NULL };
 103 static const char *termcmd[]  = { "kitty", NULL };
 104 static const char *webcmd[]  = { "firefox", NULL };
 105 static const char *ftermcmd[]  = { "kitty", "--class", "floating", NULL };
 106 static const char *filescmd[]  = { "alacritty", "-e", "ranger", NULL };
 107 static const char *gfilescmd[]  = { "dolphin", NULL };
 108 static const char *bookscmd[] = { "openbook", "-nb", col_gray1, "-nf", col_gray3, "-sb", col_darkmagenta, "-sf", col_gray4, NULL };
 109 static const char *spotifycmd[]  = { "spotify", NULL };
 110 static const char *virtualboxcmd[]  = { "virtualbox", NULL };
 111 static const char *calccmd[]  = { "gnome-calculator", NULL };
 112 static const char *lutriscmd[]  = { "lutris", NULL };
 113 static const char *switchkblayout[]  = { "switchkblayout", NULL };
 114 static const char *lockscreen[]  = { "lockscreen", NULL };
 115 
 116 /* static const char scratchpadname[] = "scratchpad"; */
 117 /* static const char *scratchpadcmd[] = { "st", "-t", scratchpadname, "-g", "120x34", NULL }; */
 118 
 119 static const char scratchpadname[] = "scratchpad";
 120 static const char *scratchpadcmd[] = { "kitty", "--title", scratchpadname, "--class", "scratchpad", NULL };
 121 
 122 static Key keys[] = {
 123     /* modifier                     key        function        argument */
 124     { MODKEY,                       XK_d,      spawn,          {.v = dmenucmd } },
 125     { MODKEY,                        XK_Return, spawn,          {.v = termcmd } },
 126     { MODKEY|ShiftMask,                XK_Return, spawn,          {.v = ftermcmd } },
 127     { MODKEY,                        XK_w,       spawn,          {.v = webcmd } },
 128     { MODKEY,                        XK_e,       spawn,          {.v = gfilescmd } },
 129     { MODKEY,                        XK_z,       spawn,          {.v = lutriscmd } },
 130     { MODKEY|ShiftMask,                XK_e,       spawn,          {.v = filescmd } },
 131     { MODKEY,                        XK_v,       spawn,          {.v = virtualboxcmd } },
 132     { MODKEY,                        XK_b,       spawn,          {.v = bookscmd } },
 133     { MODKEY,                        XK_s,       spawn,          {.v = spotifycmd } },
 134     { MODKEY,                        XK_c,       spawn,          {.v = calccmd } },
 135     { MODKEY|MOD2KEY,                XK_l,       spawn,          {.v = switchkblayout } },
 136     { MODKEY,                        XK_x,       spawn,          {.v = lockscreen } },
 137     { MODKEY,                       XK_grave,  togglescratch,  {.v = scratchpadcmd } },
 138     { MODKEY|ShiftMask,             XK_b,      togglebar,      {0} },
 139     { MODKEY,                       XK_j,      focusstack,     {.i = +1 } },
 140     { MODKEY,                       XK_k,      focusstack,     {.i = -1 } },
 141     { MODKEY|ShiftMask,             XK_i,      incnmaster,     {.i = +1 } },
 142     { MODKEY|ShiftMask,             XK_d,      incnmaster,     {.i = -1 } },
 143     { MODKEY,                       XK_h,      setmfact,       {.f = -0.05} },
 144     { MODKEY,                       XK_l,      setmfact,       {.f = +0.05} },
 145     { MODKEY|ShiftMask,             XK_j,      zoom,           {0} },
 146     { MODKEY,                       XK_Tab,    view,           {0} },
 147     { MODKEY,                        XK_q,      killclient,     {0} },
 148     { MODKEY,                       XK_t,      setlayout,      {.v = &layouts[0]} },
 149     { MODKEY,                       XK_f,      setlayout,      {.v = &layouts[1]} },
 150     { MODKEY,                       XK_m,      setlayout,      {.v = &layouts[2]} },
 151     { MODKEY,                       XK_space,  setlayout,      {0} },
 152     { MODKEY|ShiftMask,             XK_space,  togglefloating, {0} },
 153     /* { MODKEY,                       XK_0,      view,           {.ui = ~0 } }, */
 154     { MODKEY|ShiftMask,             XK_0,      tag,            {.ui = ~0 } },
 155     { MODKEY,                       XK_comma,  focusmon,       {.i = -1 } },
 156     { MODKEY,                       XK_period, focusmon,       {.i = +1 } },
 157     { MODKEY|ShiftMask,             XK_comma,  tagmon,         {.i = -1 } },
 158     { MODKEY|ShiftMask,             XK_period, tagmon,         {.i = +1 } },
 159     { MODKEY,                       XK_minus,  setgaps,        {.i = -5 } },
 160     { MODKEY,                       XK_equal,  setgaps,        {.i = +5 } },
 161     { MODKEY|ShiftMask,             XK_minus,  setgaps,        {.i = GAP_RESET } },
 162     { MODKEY|ShiftMask,             XK_equal,  setgaps,        {.i = GAP_TOGGLE} },
 163     TAGKEYS(                        XK_1,                      0)
 164     TAGKEYS(                        XK_2,                      1)
 165     TAGKEYS(                        XK_3,                      2)
 166     TAGKEYS(                        XK_4,                      3)
 167     TAGKEYS(                        XK_5,                      4)
 168     TAGKEYS(                        XK_6,                      5)
 169     TAGKEYS(                        XK_7,                      6)
 170     TAGKEYS(                        XK_8,                      7)
 171     TAGKEYS(                        XK_9,                      8)
 172     TAGKEYS(                        XK_0,                      9)
 173     { MODKEY|ShiftMask,             XK_q,      quit,           {0} },
 174 };
 175 
 176 /* button definitions */
 177 /* click can be ClkTagBar, ClkLtSymbol, ClkStatusText, ClkWinTitle, ClkClientWin, or ClkRootWin */
 178 static Button buttons[] = {
 179     /* click                event mask      button          function        argument */
 180     { ClkLtSymbol,          0,              Button1,        setlayout,      {0} },
 181     { ClkLtSymbol,          0,              Button3,        setlayout,      {.v = &layouts[2]} },
 182     { ClkWinTitle,          0,              Button2,        zoom,           {0} },
 183     { ClkStatusText,        0,              Button1,        sigdwmblocks,   {.i = 1} },
 184     { ClkStatusText,        0,              Button2,        sigdwmblocks,   {.i = 2} },
 185     { ClkStatusText,        0,              Button3,        sigdwmblocks,   {.i = 3} },
 186     { ClkStatusText,        0,              Button4,        sigdwmblocks,   {.i = 4} },
 187     { ClkStatusText,        0,              Button5,        sigdwmblocks,   {.i = 5} },
 188     { ClkClientWin,         MODKEY,         Button1,        movemouse,      {0} },
 189     { ClkClientWin,         MODKEY,         Button2,        togglefloating, {0} },
 190     { ClkClientWin,         MODKEY,         Button3,        resizemouse,    {0} },
 191     { ClkTagBar,            0,              Button1,        view,           {0} },
 192     { ClkTagBar,            0,              Button3,        toggleview,     {0} },
 193     { ClkTagBar,            MODKEY,         Button1,        tag,            {0} },
 194     { ClkTagBar,            MODKEY,         Button3,        toggletag,      {0} },
 195 };