dwm

my dwm build
Log | Files | Refs | LICENSE

config.h (9611B)


      1 /* appearance */
      2 static const uint borderpx     = 3;        /* border pixel of windows */
      3 static const uint snap         = 20;       /* snap pixel */
      4 static const uint gappih       = 4;       /* horiz inner gap between windows */
      5 static const uint gappiv       = 4;       /* vert inner gap between windows */
      6 static const uint gappoh       = 4;       /* horiz outer gap between windows and screen edge */
      7 static const uint gappov       = 4;       /* vert outer gap between windows and screen edge */
      8 static const int showbar       = 0;        /* 0 means no bar */
      9 static const int topbar        = 1;        /* 0 means bottom bar */
     10 static const int vertpad       = 4;       /* vertical padding of bar */
     11 static const int sidepad       = 4;       /* horizontal padding of bar */
     12 static const char* fonts[]     = { "monospace:size=10" };
     13 static const char col_fg[]     = "#454138";
     14 static const char col_bg[]     = "#d1cdb7";
     15 static const char* colors[][3] = {
     16 	/*               fg          bg          border   */
     17 	[SchemeNorm] = { col_bg, col_fg, col_fg },
     18 	[SchemeSel]  = { col_fg, col_bg, col_bg },
     19 };
     20 
     21 static const uint baralpha    = 0xbf;
     22 static const uint borderalpha = 0xff;
     23 
     24 static const unsigned int alphas[][3]      = {
     25 	/*              fg     bg        border     */
     26 	[SchemeNorm] = { 0xff, baralpha, borderalpha },
     27 	[SchemeSel]  = { 0xff, baralpha, borderalpha },
     28 };
     29 
     30 /* tagging */
     31 static const char *tags[] = { "1", "2", "3", "4", "5", "6", "7", "8", "9" };
     32 
     33 static const Rule rules[] = {
     34 	/* xprop(1):
     35 	 *  WM_CLASS(STRING) = instance, class
     36 	 *  WM_NAME(STRING) = title
     37 	 */
     38 	/* class  instance  title           tags mask  isfloating  isterminal  noswallow  monitor */
     39 	{ "st",   NULL,     NULL,           0,          0,         1,          0,         -1 },
     40 	{ NULL,   NULL,     "Event Tester", 0,          0,         0,          1,         -1 }, /* xev */
     41 	{ NULL,   NULL,     "Origin",       0,          1,         0,          0,         -1 },
     42 };
     43 
     44 /* layout(s) */
     45 static const float mfact     = 0.5; /* factor of master area size [0.05..0.95] */
     46 static const int nmaster     = 1;   /* number of clients in master area */
     47 static const int resizehints = 0;   /* 1 means respect size hints in tiled resizals */
     48 static const int lockfullscreen = 1;   /* 1 will force focus on the fullscreen window */
     49 
     50 static const Layout layouts[] = {
     51 	/* symbol  arrange function */
     52 	{ "[\\]",  fibonacci },  /* first entry is default */
     53 	{ NULL,    NULL },
     54 };
     55 
     56 /* key definitions */
     57 #define MOD   Mod4Mask
     58 #define SHIFT ShiftMask
     59 #define CTRL  ControlMask
     60 
     61 #define TAGKEYS(KEY,TAG) \
     62 	{ MOD,            KEY,      view,           {.ui = 1 << TAG} }, \
     63 	{ MOD|CTRL,       KEY,      toggleview,     {.ui = 1 << TAG} }, \
     64 	{ MOD|SHIFT,      KEY,      tag,            {.ui = 1 << TAG} }, \
     65 	{ MOD|CTRL|SHIFT, KEY,      toggletag,      {.ui = 1 << TAG} },
     66 
     67 /* helper for spawning shell commands in the pre dwm-5.0 fashion */
     68 #define SHCMD(cmd) { .v = (const char*[]){ "/bin/sh", "-c", cmd, NULL } }
     69 
     70 /* commands */
     71 static const char* browser[]    = { "browser", NULL };
     72 static const char* caps[]       = { "setxkbmap", "-option", "caps:super", NULL };
     73 static const char* color[]      = { "colorpick", NULL };
     74 static const char* cyclebg[]    = { "cyclebg", NULL };
     75 static const char* cyclewe[]    = { "cyclewe", NULL };
     76 static const char* compositor[] = { "compositor", NULL };
     77 static char        dmenumon[2] = "0"; /* component of dmenucmd, manipulated in spawn() */
     78 static const char* dmenucmd[]   = { "dmenu_run", "-m", dmenumon, NULL };
     79 static const char* games[]      = { "games", NULL };
     80 static const char* lock[]       = { "lock", NULL };
     81 static const char* mict[]       = { "mict", NULL };
     82 static const char* mont[]       = { "mont", NULL };
     83 static const char* news[]       = { "st", "-e", "newsboat", NULL };
     84 static const char* pass[]       = { "passd", NULL };
     85 static const char* paste[]      = { "paste", NULL };
     86 static const char* pscrn[]      = { "pscrn", NULL };
     87 static const char* pscrns[]     = { "pscrn", "-s", NULL };
     88 static const char* pscrnf[]     = { "pscrnf", NULL };
     89 static const char* pscrnfs[]    = { "pscrnf", "-s", NULL };
     90 /* static const char* spkrd[]      = { "pamixer", "-d", "5", NULL }; */
     91 /* static const char* spkri[]      = { "pamixer", "-i", "5", NULL }; */
     92 /* static const char* spkrt[]      = { "pamixer", "-t", NULL }; */
     93 static const char* status[]     = { "status", NULL };
     94 static const char* stopdwm[]    = { "stopdwm", NULL };
     95 static const char* termcmd[]    = { "st", NULL };
     96 static const char* tremc[]      = { "st", "-e", "tremc",  NULL };
     97 
     98 #include <X11/XF86keysym.h>
     99 static Key keys[] = {
    100 	/* modifier       key                      function       argument */
    101 	{ MOD,            XK_w,                    spawn,         {.v = browser } },
    102 	{ CTRL|SHIFT,     XK_Escape,               spawn,         {.v = caps} },
    103 	{ MOD|SHIFT,      XK_i,                    spawn,         {.v = color} },
    104 	{ MOD,            XK_c,                    spawn,         {.v = compositor} },
    105 	{ MOD,            XK_F5,                   spawn,         {.v = cyclebg} },
    106 	{ MOD|SHIFT,      XK_F5,                   spawn,         {.v = cyclewe} },
    107 	{ MOD,            XK_d,                    spawn,         {.v = dmenucmd } },
    108 	{ MOD,            XK_g,                    spawn,         {.v = games} },
    109 	{ MOD,            XK_x,                    spawn,         {.v = lock} },
    110 	{ 0,              XF86XK_ScreenSaver,      spawn,         {.v = lock} },
    111 	{ 0,              XF86XK_Suspend,          spawn,         {.v = lock} },
    112 	{ 0,              XF86XK_Sleep,            spawn,         {.v = lock} },
    113 	{ 0,              XF86XK_Launch1,          spawn,         {.v = mict} },
    114 	{ MOD,            XK_Pause,                spawn,         {.v = mict} },
    115 	{ 0,              XF86XK_Display,          spawn,         {.v = mont} },
    116 	{ MOD,            XK_n,                    spawn,         {.v = news} },
    117 	{ MOD,            XK_o,                    spawn,         {.v = pass} },
    118 	{ MOD|SHIFT,      XK_p,                    spawn,         {.v = paste} },
    119 	{ 0,              XK_Print,                spawn,         {.v = pscrn} },
    120 	{ SHIFT,          XK_Print,                spawn,         {.v = pscrns} },
    121 	{ MOD,            XK_Print,                spawn,         {.v = pscrnf} },
    122 	{ MOD|SHIFT,      XK_Print,                spawn,         {.v = pscrnfs} },
    123 /*	{ 0,              XF86XK_AudioMute,        spawn,         {.v = spkrt} },
    124 	{ MOD,            XK_KP_Multiply,          spawn,         {.v = spkrt} },
    125 	{ 0,              XF86XK_AudioRaiseVolume, spawn,         {.v = spkri} },
    126 	{ MOD,            XK_KP_Add,               spawn,         {.v = spkri} },
    127 	{ 0,              XF86XK_AudioLowerVolume, spawn,         {.v = spkrd} },
    128 	{ MOD,            XK_KP_Subtract,          spawn,         {.v = spkrd} }, */
    129 	{ MOD,            XK_u,                    spawn,         {.v = status} },
    130 	{ MOD,            XK_Return,               spawn,         {.v = termcmd } },
    131 	{ MOD,            XK_t,                    spawn,         {.v = tremc } },
    132 	{ MOD,            XK_b,                    togglebar,     {0} },
    133 	{ MOD,            XK_j,                    focusstack,    {.i =  1 } },
    134 	{ MOD,            XK_k,                    focusstack,    {.i =  0 } },
    135 	{ MOD,            XK_h,                    setmfact,      {.f = -0.05} },
    136 	{ MOD,            XK_l,                    setmfact,      {.f =  0.05} },
    137 	{ MOD,            XK_space,                zoom,          {0} },
    138 	{ MOD,            XK_q,                    killclient,    {0} },
    139 	{ MOD,            XK_0,                    view,          {.ui = ~0 } },
    140 	{ MOD|SHIFT,      XK_0,                    tag,           {.ui = ~0 } },
    141 	{ MOD,            XK_f,                    togglefullscr, {0} },
    142 	{ MOD,            XK_comma,                focusmon,      {.i = -1 } },
    143 	{ MOD,            XK_period,               focusmon,      {.i =  1 } },
    144 	{ MOD|SHIFT,      XK_comma,                tagmon,        {.i = -1 } },
    145 	{ MOD|SHIFT,      XK_period,               tagmon,        {.i =  1 } },
    146 	{ MOD|SHIFT,      XK_q,                    quit,          {0} },
    147 	{ MOD|CTRL|SHIFT, XK_q,                    spawn,         {.v = stopdwm} },
    148 	{ 0,              XK_Super_L,              NULL,          {0} },
    149 	TAGKEYS(          XK_1,                    0)
    150 	TAGKEYS(          XK_2,                    1)
    151 	TAGKEYS(          XK_3,                    2)
    152 	TAGKEYS(          XK_4,                    3)
    153 	TAGKEYS(          XK_5,                    4)
    154 	TAGKEYS(          XK_6,                    5)
    155 	TAGKEYS(          XK_7,                    6)
    156 	TAGKEYS(          XK_8,                    7)
    157 	TAGKEYS(          XK_9,                    8)
    158 };
    159 
    160 /* button definitions */
    161 /* click can be ClkTagBar, ClkLtSymbol, ClkStatusText, ClkWinTitle, ClkClientWin, or ClkRootWin */
    162 static Button buttons[] = {
    163 	/* click         event mask  button   function        argument */
    164 	{ ClkLtSymbol,   0,          Button1, setlayout,      {0} },
    165 	{ ClkLtSymbol,   0,          Button3, setlayout,      {.v = &layouts[2]} },
    166 	{ ClkWinTitle,   0,          Button2, zoom,           {0} },
    167 	{ ClkStatusText, 0,          Button2, spawn,          {.v = termcmd } },
    168 	{ ClkClientWin,  MOD,        Button1, movemouse,      {0} },
    169 	{ ClkClientWin,  MOD,        Button2, togglefloating, {0} },
    170 	{ ClkClientWin,  MOD,        Button3, resizemouse,    {0} },
    171 	{ ClkTagBar,     0,          Button1, view,           {0} },
    172 	{ ClkTagBar,     0,          Button3, toggleview,     {0} },
    173 	{ ClkTagBar,     MOD,        Button1, tag,            {0} },
    174 	{ ClkTagBar,     MOD,        Button3, toggletag,      {0} },
    175 };