My configuration of sxmo fork of suckless dwm.

git clone git://watertao.xyz/programs/sxmo-dwm.git

config.def.h (10523B)


      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 font[]            = "Terminess Nerd Font 10";
      9 static const char dmenufont[]       = "Terminess Nerd Font:size=10";
     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[]        = "#00c1f3";
     15 static const char *colors[][3]      = {
     16 	/*               fg         bg         border   */
     17 	[SchemeNorm] = { col_gray3, col_gray1, col_gray2 },
     18 	[SchemeSel]  = { col_gray1, col_cyan,  col_cyan  },
     19 	[SchemeTabActive]  = { col_gray2, col_gray3,  col_gray2 },
     20 	[SchemeTabInactive]  = { col_gray1, col_gray3,  col_gray1 }
     21 };
     22 
     23 /* 1 means attach after the currently active window */
     24 static const int attachbelow = 1;
     25 
     26 /* tagging */
     27 static const char *tags[] = { "1", "2", "3", "4" };
     28 
     29 static const Rule rules[] = {
     30 	/* class      instance    title       tags mask     isfloating   isterminal noswallow monitor    borderwidth*/
     31 	{ "st",       NULL,       NULL,       0,            0,           1,         1,        -1,  0, -1},
     32 	{ "svkbd",    NULL,       NULL,       TAGMASK,      1,           1,         0,        -1,  1, 0},
     33 };
     34 
     35 /* layout(s) */
     36 static const float mfact     = 0.55; /* factor of master area size [0.05..0.95] */
     37 static const int nmaster     = 1;    /* number of clients in master area */
     38 static const int resizehints = 0;    /* 1 means respect size hints in tiled resizals */
     39 
     40 /* Bartabgroups properties */
     41 #define BARTAB_BORDERS 1       // 0 = off, 1 = on
     42 #define BARTAB_BOTTOMBORDER 1  // 0 = off, 1 = on
     43 #define BARTAB_TAGSINDICATOR 1 // 0 = off, 1 = on if >1 client/view tag, 2 = always on
     44 #define BARTAB_TAGSPX 5        // # pixels for tag grid boxes
     45 #define BARTAB_TAGSROWS 2      // # rows in tag grid (9 tags, e.g. 3x3)
     46 static void (*bartabmonfns[])(Monitor *) = { monocle, bstack };
     47 static void (*bartabfloatfns[])(Monitor *) = { NULL /* , customlayoutfn */ };
     48 
     49 static const Layout ppcyclelayouts[] = {
     50 	/* symbol     arrange function */
     51 	{ "",      bstack },   /* first entry is default */
     52 	{ "",      tile },
     53 	{ "",      monocle },
     54 };
     55 
     56 
     57 static const Layout layouts[] = {
     58 	/* symbol     arrange function */
     59 	{ "",      monocle },   /* first entry is default */
     60 	{ "",      bstack },
     61 	{ "",      tile },
     62 	{ "F",        NULL },
     63 	{ "DD",       deckdouble},
     64 	{ "D",        deck},
     65 };
     66 
     67 /* key definitions */
     68 #define MODKEY Mod1Mask
     69 #define TAGKEYS(KEY,TAG) \
     70 	{ KeyPress, MODKEY,                       KEY,      view,           {.ui = 1 << TAG} }, \
     71 	{ KeyPress, MODKEY|ControlMask,           KEY,      toggleview,     {.ui = 1 << TAG} }, \
     72 	{ KeyPress, MODKEY|ShiftMask,             KEY,      tag,            {.ui = 1 << TAG} },
     73 
     74 /* helper for spawning shell commands in the pre dwm-5.0 fashion */
     75 #define SHCMD(cmd) { .v = (const char*[]){ "/bin/sh", "-c", cmd, NULL } }
     76 
     77 /* commands */
     78 static char dmenumon[2] = "0"; /* component of dmenucmd, manipulated in spawn() */
     79 static const char *dmenucmd[] = { "dmenu_run", "-m", dmenumon, "-fn", dmenufont, "-nb", col_gray1, "-nf", col_gray3, "-sb", col_cyan, "-sf", col_gray4, NULL };
     80 
     81 #include <X11/XF86keysym.h>
     82 static Key keys[] = {
     83 	/* PP */
     84 #ifdef NOBONSAI
     85 	{ KeyPress, 0,  XF86XK_AudioRaiseVolume, spawn, { .v = (const char*[]){ "sxmo_multikey.sh", "volup", "volup_one", "volup_two", "volup_three", NULL } } },
     86 	{ KeyPress, 0,  XF86XK_AudioLowerVolume, spawn, { .v = (const char*[]){ "sxmo_multikey.sh", "voldown", "voldown_one", "voldown_two", "voldown_three", NULL } } },
     87 	{ KeyPress, 0,  XF86XK_PowerOff, spawn, { .v = (const char*[]){ "sxmo_multikey.sh", "powerbutton", "powerbutton_one", "powerbutton_two", "powerbutton_three", NULL } } },
     88 #else
     89 	{ KeyPress, 0,  XF86XK_AudioRaiseVolume, spawn, { .v = (const char*[]){ "bonsaictl", "-e", "volup_pressed", NULL } } },
     90 	{ KeyRelease, 0,  XF86XK_AudioRaiseVolume, spawn, { .v = (const char*[]){ "bonsaictl", "-e", "volup_released", NULL } } },
     91 
     92 	{ KeyPress, 0,  XF86XK_AudioLowerVolume, spawn, { .v = (const char*[]){ "bonsaictl", "-e", "voldown_pressed", NULL } } },
     93 	{ KeyRelease, 0,  XF86XK_AudioLowerVolume, spawn, { .v = (const char*[]){ "bonsaictl", "-e", "voldown_released", NULL } } },
     94 
     95 	{ KeyPress, 0,  XF86XK_PowerOff, spawn, { .v = (const char*[]){ "bonsaictl", "-e", "power_pressed", NULL } } },
     96 	{ KeyRelease, 0,  XF86XK_PowerOff, spawn, { .v = (const char*[]){ "bonsaictl", "-e", "power_released", NULL } } },
     97 #endif
     98 
     99 	/* Used by scripts via xdotool */
    100 	{ KeyPress, MODKEY,  XK_h, shiftview, {.i = -1} },
    101 	{ KeyPress, MODKEY,  XK_l, shiftview, {.i = +1} },
    102 	/*
    103 	{ KeyPress, MODKEY|ShiftMask,  XK_h, clienttagpush, {.i = -1} },
    104 	{ KeyPress, MODKEY|ShiftMask,  XK_l, clienttagpush, {.i = +1} },
    105 	*/
    106 
    107 	/* PBP */
    108 
    109 	{ KeyPress, MODKEY,                    XK_Return, spawn,          SHCMD("sxmo_appmenu.sh main") },
    110 	{ KeyPress, MODKEY,                    XK_a,      spawn,          SHCMD("sxmo_audio.sh") },
    111 	{ KeyPress, MODKEY,                    XK_b,      spawn,          SHCMD("sxmo_bluetoothmenu.sh") },
    112 	{ KeyPress, MODKEY|ShiftMask,          XK_b,      togglebar,      {0} },
    113 	{ KeyPress, MODKEY,                    XK_c,      spawn,          SHCMD("~/l/progs/calcurse_dmenu/calcurse_dmenu.sh") },
    114 	{ KeyPress, MODKEY|ShiftMask,          XK_c,      spawn,          SHCMD("sxmo_contactmenu.sh") },
    115 	{ KeyPress, MODKEY,                    XK_d,      spawn,          SHCMD("sxmo_modemdial.sh") },
    116 	{ KeyPress, MODKEY,                    XK_e,      spawn,          SHCMD("st tao_fetchmail.sh") },
    117 	{ KeyPress, MODKEY,                    XK_f,      spawn,          SHCMD("st lf") },
    118 	{ KeyPress, MODKEY,                    XK_j,      focusstack,     {.i = +1 } },
    119 	{ KeyPress, MODKEY,                    XK_k,      focusstack,     {.i = -1 } },
    120 
    121 	{ KeyPress, MODKEY|ShiftMask,          XK_j,      pushdown,    {.i = +1 } },
    122 	{ KeyPress, MODKEY|ShiftMask,          XK_k,      pushup,    {.i = -1 } },
    123 
    124 	{ KeyPress, MODKEY,                    XK_m,      spawn,          SHCMD("st mutt -y") },
    125 	{ KeyPress, MODKEY,                    XK_n,      spawn,          SHCMD("tao_notes.sh") },
    126 	{ KeyPress, MODKEY,                    XK_o,      spawn,          SHCMD("tao_url.sh -r") },
    127 	{ KeyPress, MODKEY,                    XK_p,      spawn,          SHCMD("sxmo_appmenu.sh power") },
    128 	{ KeyPress, MODKEY,                    XK_r,      spawn,          SHCMD("st newsraft") },
    129 	{ KeyPress, MODKEY,                    XK_s,      spawn,          SHCMD("tao_url.sh -r -q") },
    130 	{ KeyPress, MODKEY,                    XK_t,      spawn,          SHCMD("st") },
    131 	{ KeyPress, MODKEY,                    XK_v,      spawn,          SHCMD("~/.config/sxmo/userscripts/music.sh") },
    132 
    133 	{ KeyPress, MODKEY,                    XK_x,      inplacerotate,    {.i = +2 } },
    134 
    135 	{ KeyPress, MODKEY,                    XK_slash,  spawn,          SHCMD("sxmo_modemtext.sh") },
    136 	{ KeyPress, 0,                         XF86XK_MonBrightnessUp,  spawn, SHCMD("sxmo_brightness.sh up") },
    137 	{ KeyPress, 0,                         XF86XK_MonBrightnessDown,  spawn, SHCMD("sxmo_brightness.sh down") },
    138 	{ KeyPress, MODKEY|ShiftMask,          XK_Down,      spawn,    SHCMD("sxmo_audio.sh vol down") },
    139 	{ KeyPress, MODKEY|ShiftMask,          XK_Up,      spawn,    SHCMD("sxmo_audio.sh vol up") },
    140 
    141 	{ KeyPress, MODKEY,                    XK_i,      incnmaster,     {.i = +1 } },
    142 	{ KeyPress, MODKEY,                    XK_o,      incnmaster,     {.i = -1 } },
    143 	{ KeyPress, MODKEY|ShiftMask,                    XK_h,      setmfact,       {.f = -0.05} },
    144 	{ KeyPress, MODKEY|ShiftMask,                    XK_l,      setmfact,       {.f = +0.05} },
    145 	{ KeyPress, MODKEY|ShiftMask,          XK_Return, zoom,           {0} },
    146 	{ KeyPress, MODKEY,                    XK_Tab,    view,           {0} },
    147 	{ KeyPress, MODKEY,          XK_q,      killclient,     {0} },
    148 
    149 	{ KeyPress, MODKEY|ShiftMask,          XK_q,      killclient,     {0} },
    150 
    151 	{ KeyPress, MODKEY,                       XK_semicolon, switchcol,    {0} },
    152 
    153 	{ KeyPress, MODKEY|ShiftMask,                       XK_s, transfer,    {0} },
    154 	{ KeyPress, MODKEY|ShiftMask,                       XK_s, transferall,    {0} },
    155 
    156 
    157 	/* monocle */
    158 	{ KeyPress, MODKEY|ShiftMask,          XK_m,      setlayout,      {.v = &layouts[3]} },
    159 	/* tile */
    160 	/* { KeyPress, MODKEY,                    XK_slash,  setlayout,      {.v = &layouts[1]} },*/
    161 	/* bstack */
    162 	{ KeyPress, MODKEY|ShiftMask,          XK_slash,  setlayout,      {.v = &layouts[0]} },
    163 
    164 	{ KeyPress, MODKEY|ShiftMask,                       XK_f,  togglefloating, {0} },
    165 	{ KeyPress, MODKEY|ShiftMask|ControlMask,             XK_f,  unfloatvisible, {0} },
    166 
    167 	/* cycle through the layouts in ppcyclelayouts */
    168 	{ KeyPress, MODKEY,                    XK_space,  cyclelayout,    {.i = +1} },
    169 
    170 	{ KeyPress, MODKEY|ShiftMask,          XK_space,  togglefloating, {0} },
    171 	{ KeyPress, MODKEY,                    XK_0,      view,           {.ui = ~0 } },
    172 	{ KeyPress, MODKEY|ShiftMask,          XK_0,      tag,            {.ui = ~0 } },
    173 
    174 	{ KeyPress, MODKEY,                    XK_comma,  focusmon,       {.i = -1 } },
    175 	{ KeyPress, MODKEY,                    XK_period, focusmon,       {.i = +1 } },
    176 	{ KeyPress, MODKEY|ShiftMask,          XK_comma,  tagmon,         {.i = -1 } },
    177 	{ KeyPress, MODKEY|ShiftMask,          XK_period, tagmon,         {.i = +1 } },
    178 
    179 	TAGKEYS(                        XK_1,                      0)
    180 	TAGKEYS(                        XK_2,                      1)
    181 	TAGKEYS(                        XK_3,                      2)
    182 	TAGKEYS(                        XK_4,                      3)
    183 };
    184 
    185 /* button definitions */
    186 /* click can be ClkTagBar, ClkLtSymbol, ClkStatusText, ClkWinTitle, ClkClientWin, or ClkRootWin */
    187 static Button buttons[] = {
    188 	/* click                event mask      button          function        argument */
    189 	{ ClkTagBar,            0,              Button1,        view,           {0} },
    190 	{ ClkLtSymbol,          0,              Button1,        cyclelayout,    {.i = +1} },
    191 	{ ClkClientWin,         MODKEY,         Button1,        movemouse,      {0} },
    192 	{ ClkClientWin,         MODKEY,         Button3,        resizemouse,    {0} },
    193 };
    194