dotfiles

personal configurations for my systems and programs
git clone git@git.eonndev.com/dotfiles.git
Log | Files | Refs

config.h (7683B)


      1 /* See LICENSE file for copyright and license details. */
      2 
      3 /* appearance */
      4 static const unsigned int borderpx  = 1;        /* border pixel of windows */
      5 static const unsigned int snap      = 32;       /* snap pixel */
      6 static const int showbar            = 1;        /* 0 means no bar */
      7 static const int topbar             = 1;        /* 0 means bottom bar */
      8 static const char *fonts[]          = { "xos4 terminus:size=9" };
      9 static const char dmenufont[]       = "xos4 terminus:size=9";
     10 static const char col_gray1[]       = "#222222";
     11 static const char col_gray2[]       = "#444444";
     12 static const char col_gray3[]       = "#bbbbbb";
     13 static const char col_gray4[]       = "#eeeeee";
     14 static const char col_cyan[]        = "#5961b5";
     15 static const char *colors[][3]      = {
     16 	/*               fg         bg         border   */
     17 	[SchemeNorm] = { col_gray3, col_gray1, col_gray2 },
     18 	[SchemeSel]  = { col_gray4, col_cyan,  col_cyan  },
     19 };
     20 
     21 static const int statmonval = 0;
     22 
     23 /* tagging */
     24 static const char *tags[] = { "1", "2", "3", "4", "5", "6", "7", "8", "9" };
     25 
     26 static const Rule rules[] = {
     27 	 /* xprop(1):
     28 	 *	WM_CLASS(STRING) = instance, class
     29 	 *	WM_NAME(STRING) = title
     30 	 */
     31 	/* class      instance    title       tags mask     isfloating   monitor */
     32  	{ "Gimp",     NULL,       NULL,       0,            1,           -1 },
     33 //	{ "Firefox",  NULL,       NULL,       1 << 8,       0,           -1 },
     34 };
     35 
     36 /* layout(s) */
     37 static const float mfact     = 0.55; /* factor of master area size [0.05..0.95] */
     38 static const int nmaster     = 1;    /* number of clients in master area */
     39 static const int resizehints = 0;    /* 1 means respect size hints in tiled resizals */
     40 
     41 static const Layout layouts[] = {
     42 	/* symbol     arrange function */
     43 	{ "[]=",      tile },    /* first entry is default */
     44 	{ "><>",      NULL },    /* no layout function means floating behavior */
     45 	{ "[M]",      monocle },
     46 };
     47 
     48 /* key definitions */
     49 #define MODKEY Mod4Mask
     50 #define TAGKEYS(KEY,TAG) \
     51 	{ MODKEY,                       KEY,      view,           {.ui = 1 << TAG} }, \
     52 	{ MODKEY|ControlMask,           KEY,      toggleview,     {.ui = 1 << TAG} }, \
     53 	{ MODKEY|ShiftMask,             KEY,      tag,            {.ui = 1 << TAG} }, \
     54 	{ MODKEY|ControlMask|ShiftMask, KEY,      toggletag,      {.ui = 1 << TAG} },
     55 
     56 /* helper for spawning shell commands in the pre dwm-5.0 fashion */
     57 #define SHCMD(cmd) { .v = (const char*[]){ "/bin/sh", "-c", cmd, NULL } }
     58 
     59 /* commands */
     60 static char dmenumon[2] = "0"; /* component of dmenucmd, manipulated in spawn() */
     61 static const char *dmenucmd[] = { "dmenu_run", "-l", "10", "-m", dmenumon, "-sb", col_cyan, "-fn", dmenufont, NULL };
     62 static const char *termcmd[]  = { "st", NULL };
     63 //brightness and sound
     64 static const char *lightup[] = { "light", "-A", "5", NULL };
     65 static const char *lightdown[] = { "light", "-U", "5", NULL };
     66 static const char *soundup[] = { "/usr/local/bin/changeVolume", "+5%", NULL};
     67 static const char *sounddown[] = { "/usr/local/bin/changeVolume", "-5%", NULL};
     68 static const char *soundmute[] = { "/usr/local/bin/changeVolume", "m",  NULL};
     69 static const char *micmute[] = { "/usr/bin/pactl", "set-source-mute", "1", "toggle", NULL};
     70 //others
     71 static const char *colemaktoggle[] = { "/usr/local/bin/colemaktoggle.sh", NULL};
     72 static const char *emojipicker[] = { "/usr/bin/emoji-picker", NULL };
     73 
     74 #include <X11/XF86keysym.h>
     75 static Key keys[] = {
     76 	/* modifier                     key        function        argument */
     77 	// function buttons
     78 	{ 0,				XF86XK_MonBrightnessUp,	   spawn,	   {.v = lightup } },
     79 	{ 0,				XF86XK_MonBrightnessDown,  spawn,	   {.v = lightdown } },
     80 	{ 0,				XF86XK_AudioRaiseVolume,   spawn,	   {.v = soundup } },
     81 	{ 0,				XF86XK_AudioLowerVolume,   spawn,	   {.v = sounddown } },
     82 	{ 0,				XF86XK_AudioMute,	   spawn,          {.v = soundmute } },
     83 	{ 0,				XF86XK_AudioMicMute,	   spawn,	   {.v = micmute } },
     84 	// others
     85 	{ MODKEY,			XK_Print,  spawn,	   SHCMD("sleep 0.2; scrot -s '/home/ian/Pictures/screenshots/%Y-%m-%d_%wx_$h_scrot.png'") },
     86 	{ MODKEY|ShiftMask,		XK_Insert, spawn,	   {.v = colemaktoggle } },
     87 	{ MODKEY,			XK_e,	   spawn,	   {.v = emojipicker } },
     88 	// wm
     89 	{ MODKEY,                       XK_p,      spawn,          {.v = dmenucmd } },
     90 	{ MODKEY|ShiftMask,             XK_Return, spawn,          {.v = termcmd } },
     91 	{ MODKEY,                       XK_b,      togglebar,      {0} },
     92 	{ MODKEY,                       XK_j,      focusstack,     {.i = +1 } },
     93 	{ MODKEY,                       XK_k,      focusstack,     {.i = -1 } },
     94 	{ MODKEY,                       XK_i,      incnmaster,     {.i = +1 } },
     95 	{ MODKEY,                       XK_d,      incnmaster,     {.i = -1 } },
     96 	{ MODKEY,                       XK_h,      setmfact,       {.f = -0.05} },
     97 	{ MODKEY,                       XK_l,      setmfact,       {.f = +0.05} },
     98 	{ MODKEY,                       XK_Return, zoom,           {0} },
     99 	{ MODKEY,                       XK_Tab,    view,           {0} },
    100 	{ MODKEY|ShiftMask,             XK_q,      killclient,     {0} },
    101 	{ MODKEY,                       XK_t,      setlayout,      {.v = &layouts[0]} },
    102 	{ MODKEY,                       XK_f,      setlayout,      {.v = &layouts[1]} },
    103 	{ MODKEY,                       XK_m,      setlayout,      {.v = &layouts[2]} },
    104 	{ MODKEY,                       XK_space,  setlayout,      {0} },
    105 	{ MODKEY|ShiftMask,             XK_space,  togglefloating, {0} },
    106 	{ MODKEY|ShiftMask,		XK_f,	   togglefullscr,  {0} },
    107 	{ MODKEY,                       XK_0,      view,           {.ui = ~0 } },
    108 	{ MODKEY|ShiftMask,             XK_0,      tag,            {.ui = ~0 } },
    109 	{ MODKEY,                       XK_comma,  focusmon,       {.i = -1 } },
    110 	{ MODKEY,                       XK_period, focusmon,       {.i = +1 } },
    111 	{ MODKEY|ShiftMask,             XK_comma,  tagmon,         {.i = -1 } },
    112 	{ MODKEY|ShiftMask,             XK_period, tagmon,         {.i = +1 } },
    113 	TAGKEYS(                        XK_1,                      0)
    114 	TAGKEYS(                        XK_2,                      1)
    115 	TAGKEYS(                        XK_3,                      2)
    116 	TAGKEYS(                        XK_4,                      3)
    117 	TAGKEYS(                        XK_5,                      4)
    118 	TAGKEYS(                        XK_6,                      5)
    119 	TAGKEYS(                        XK_7,                      6)
    120 	TAGKEYS(                        XK_8,                      7)
    121 	TAGKEYS(                        XK_9,                      8)
    122 	{ MODKEY|ShiftMask,             XK_e,      quit,           {0} },
    123 };
    124 
    125 /* button definitions */
    126 /* click can be ClkTagBar, ClkLtSymbol, ClkStatusText, ClkWinTitle, ClkClientWin, or ClkRootWin */
    127 static Button buttons[] = {
    128 	/* click                event mask      button          function        argument */
    129 	{ ClkLtSymbol,          0,              Button1,        setlayout,      {0} },
    130 	{ ClkLtSymbol,          0,              Button3,        setlayout,      {.v = &layouts[2]} },
    131 	{ ClkWinTitle,          0,              Button2,        zoom,           {0} },
    132 	{ ClkStatusText,        0,              Button2,        spawn,          {.v = termcmd } },
    133 	{ ClkClientWin,         MODKEY,         Button1,        movemouse,      {0} },
    134 	{ ClkClientWin,         MODKEY,         Button2,        togglefloating, {0} },
    135 	{ ClkClientWin,         MODKEY,         Button3,        resizemouse,    {0} },
    136 	{ ClkTagBar,            0,              Button1,        view,           {0} },
    137 	{ ClkTagBar,            0,              Button3,        toggleview,     {0} },
    138 	{ ClkTagBar,            MODKEY,         Button1,        tag,            {0} },
    139 	{ ClkTagBar,            MODKEY,         Button3,        toggletag,      {0} },
    140 };
    141