myvxwm

[fork] my vxwm config (optimised for my T480)
git clone https://git.lukeonline.net/repos/myvxwm
Log | Files | Refs | README | LICENSE

config.def.h (14799B)


      1 #pragma once
      2 
      3 /* See LICENSE file for copyright and license details. */
      4 
      5 /* appearance */
      6 static const unsigned int borderpx  = 4;        /* border pixel of windows */
      7 static const unsigned int snap      = 0;       /* snap pixel */
      8 static const int showbar            = 0;        /* 0 means no bar */
      9 static const int topbar             = 1;        /* 0 means bottom bar */
     10 static const char *fonts[]          = { "monospace:size=9" };
     11 static const char dmenufont[]       = "monospace:size=9";
     12 #define COORDINATES_STYLE "%d %d" /* The style of coordinates displayed in bar, do not remove %d. */
     13 
     14 static MAYBE_CONST char normbgcolor[]           = "#ffffff";
     15 static MAYBE_CONST char normbordercolor[]       = "#aaaadd";
     16 static MAYBE_CONST char normfgcolor[]           = "#000000";
     17 static MAYBE_CONST char selfgcolor[]            = "#ffffff";
     18 static MAYBE_CONST char selbordercolor[]        = "#ffffff";
     19 static MAYBE_CONST char selbgcolor[]            = "#000000";
     20 static MAYBE_CONST char *colors[][3] = {
     21        /*               fg           bg           border   */
     22        [SchemeNorm] = { normfgcolor, normbgcolor, normbordercolor },
     23        [SchemeSel]  = { selfgcolor,  selbgcolor,  selbordercolor  },
     24 };
     25 
     26 #define CENTER_NEW_FLOATING_WINDOWS 1 // so, basically, it does what it says. (make 0 to turn off)
     27 #define NEW_FLOATING_WINDOWS_APPEAR_UNDER_CURSOR 0 // so, basically, it does what it says. (make 0 to turn off) 
     28 
     29 #if GAPS
     30 static const unsigned int gappx = 5;
     31 #endif
     32 
     33 #if BAR_HEIGHT
     34 static const int user_bh = 0;
     35 #endif
     36 
     37 #if BAR_PADDING
     38 static const int top_vertpad = 2;          /* top vertical padding of bar */ 
     39 static const int bottom_vertpad = 0;       /* bottom vertical padding of bar */
     40 static const int left_sidepad = 2;         /* left horizontal padding of bar */
     41 static const int right_sidepad = 2;        /* right horizontal padding of bar */
     42 #endif
     43 
     44 #define BAR_ALWAYS_ON_TOP 1 /* Makes internal bar on top of other windows. */
     45 
     46 #if EXTERNAL_BARS
     47 #define EXTERNAL_BARS_ALWAYS_ON_TOP 1 /* Makes external bars on top of other windows. */
     48 #endif
     49 
     50 #if INFINITE_TAGS
     51 #define PINNED_WINDOWS_ALWAYS_ON_TOP 1 /* Makes pinned windows on top of other windows */
     52 #endif
     53 
     54 /* tagging */
     55 static const char *tags[] = { "1", "2", "3" };
     56 
     57 #if OCCUPIED_TAGS_DECORATION
     58 static const char *occupiedtags[] = { "1+", "2+", "3+" };
     59 #endif
     60 
     61 #if INFINITE_TAGS
     62 #define MOVE_CANVAS_STEP 120 /* Defines how many pixel will be jumped when using movecanvas function */
     63 #endif
     64 
     65 #if INFINITE_TAGS && IT_SHOW_COORDINATES_IN_BAR
     66 #define COORDINATES_DIVISOR 10 /* Defines by what number coordinates on the bar will be divided, can be used for making numbers smaller which makes navigation easier */
     67 #endif
     68 
     69 #if MOVE_RESIZE_WITH_KEYBOARD
     70 #define MOVE_WITH_KEYBOARD_STEP 50 /* Defines by how many pixels windows will be resized with keyboard */
     71 #define RESIZE_WITH_KEYBOARD_STEP 100 /* Defines by how many pixels windows will be resized with keyboard */
     72 #endif
     73 
     74 #if AUTOSTART
     75 /* vxwm will execute this on startup (can be skipped with -ignoreautostart vxwm flag). */
     76 
     77 static const char *const autostart[] = {
     78 	"terminator",
     79 	NULL /* must end with NULL */
     80 };
     81 #endif
     82 
     83 static const Rule rules[] = {
     84 	/* xprop(1):
     85 	 *	WM_CLASS(STRING) = instance, class
     86 	 *	WM_NAME(STRING) = title
     87 	 */
     88 	/* class      instance    title       tags mask     isfloating   monitor */
     89 	{ "Gimp",     NULL,       NULL,       0,            1,           -1 },
     90 	{ "Firefox",  NULL,       NULL,       1 << 8,       0,           -1 },
     91 };
     92 
     93 /* layout(s) */
     94 static const float mfact     = 0.55; /* factor of master area size [0.05..0.95] */
     95 static const int nmaster     = 1;    /* number of clients in master area */
     96 static const int resizehints = 1;    /* 1 means respect size hints in tiled resizals */
     97 static const int lockfullscreen = 1; /* 1 will force focus on the fullscreen window */
     98 #if LOCK_MOVE_RESIZE_REFRESH_RATE
     99 static const int refreshrate = 60;  /* refresh rate (per second) for client move/resize, set it to your monitor refresh rate or double of that*/
    100 #endif //LOCK_MOVE_RESIZE_REFRESH_RATE
    101 static const Layout layouts[] = {
    102 	/* symbol     arrange function */
    103   	{ "(f)",      NULL },    /* no layout function means floating behavior */
    104 	{ "(t)",      tile },    /* first entry is default */
    105 	{ "(m)",      monocle },
    106 };
    107 
    108 /* key definitions */
    109 #define MODKEY Mod4Mask
    110 #define ALTERNATE_MODKEY Mod1Mask
    111 
    112 #define SCROLL_UP Button5
    113 #define SCROLL_DOWN Button4
    114 
    115 #define TAGKEYS(KEY,TAG) \
    116 	{ MODKEY,                       KEY,      view,           {.ui = 1 << TAG} }, \
    117 	{ MODKEY|ControlMask,           KEY,      toggleview,     {.ui = 1 << TAG} }, \
    118 	{ Mod1Mask,                     KEY,      tag,            {.ui = 1 << TAG} }, \
    119 	{ MODKEY|ControlMask|ShiftMask, KEY,      toggletag,      {.ui = 1 << TAG} },
    120 
    121 /* helper for spawning shell commands in the pre dwm-5.0 fashion */
    122 #define SHCMD(cmd) { .v = (const char*[]){ "/bin/sh", "-c", cmd, NULL } }
    123 
    124 /* commands */
    125 static char dmenumon[2] = "0"; /* component of dmenucmd, manipulated in spawn() */
    126 static const char *dmenucmd[] = { "dmenu_run_desktop", "-x", "4", "-y", "4", "-z", "320", NULL };
    127 static const char *pmenucmd[] = { "/home/lukep/.lprof/shared/bin/pmenu", NULL };
    128 static const char *termcmd[]  = { "terminator", NULL };
    129 static const char *scrotcmd[]  = { "scrot", "-fs", NULL };
    130 
    131 #if ZOOM
    132 static const char *zoomin[] = { "vcompmgr", "-Z", "+0.15", NULL }; // zoom in
    133 static const char *zoomout[] = { "vcompmgr", "-Z", "-0.15", NULL }; // zoom out
    134 static const char *zoomreset[] = { "vcompmgr", "-Z", "1", NULL }; // set zoom to 1
    135 #endif
    136 
    137 /* Volume controls per T480 Layout */
    138 static const char *volumeupcmd[] = {
    139     "sh", "-c",
    140     "pactl set-sink-volume @DEFAULT_SINK@ +5% && "
    141     "notify-send -a VXWM -h string:x-canonical-private-synchronous:volume "
    142     "'Volume' \"$(pactl get-sink-volume @DEFAULT_SINK@ | head -n1 | grep -o '[0-9]*%' | head -n1)\"",
    143     NULL
    144 };
    145 
    146 static const char *volumedowncmd[] = {
    147     "sh", "-c",
    148     "pactl set-sink-volume @DEFAULT_SINK@ -5% && "
    149     "notify-send -a VXWM -h string:x-canonical-private-synchronous:volume "
    150     "'Volume' \"$(pactl get-sink-volume @DEFAULT_SINK@ | head -n1 | grep -o '[0-9]*%' | head -n1)\"",
    151     NULL
    152 };
    153 
    154 static const char *volumemutecmd[] = {
    155     "sh", "-c",
    156     "pactl set-sink-mute @DEFAULT_SINK@ toggle && "
    157     "notify-send -a VXWM -h string:x-canonical-private-synchronous:volume "
    158     "'Volume' \"$(pactl get-sink-mute @DEFAULT_SINK@ | awk '{print ($2 == \"yes\") ? \"Muted\" : \"Unmuted\"}') — $(pactl get-sink-volume @DEFAULT_SINK@ | head -n1 | grep -o '[0-9]*%' | head -n1)\"",
    159     NULL
    160 };
    161 
    162 static const char *brightnessupcmd[] = {
    163     "sh", "-c",
    164     "brightnessctl set +5% && "
    165     "notify-send -a VXWM -h string:x-canonical-private-synchronous:brightness "
    166     "'Brightness' \"$(brightnessctl -m | cut -d, -f4)\"",
    167     NULL
    168 };
    169 
    170 static const char *brightnessdowncmd[] = {
    171     "sh", "-c",
    172     "brightnessctl set 5%- && "
    173     "notify-send -a VXWM -h string:x-canonical-private-synchronous:brightness "
    174     "'Brightness' \"$(brightnessctl -m | cut -d, -f4)\"",
    175     NULL
    176 };
    177 
    178 static const Key keys[] = {
    179 	/* modifier                     key        function        argument */
    180 	{ MODKEY,                       XK_v,      spawn,          {.v = dmenucmd } },
    181 	{ MODKEY,                       XK_p,      spawn,          {.v = pmenucmd } },
    182 	{ MODKEY|ShiftMask,             XK_Return, spawn,          {.v = termcmd } },
    183 	{ MODKEY,                       XK_b,      togglebar,      {0} },
    184 	{ MODKEY,                       XK_Tab,    focusstack,     {.i = +1 } },
    185 	{ MODKEY|ShiftMask,             XK_Tab,    focusstack,     {.i = -1 } },
    186 	{ MODKEY,                       XK_i,      incnmaster,     {.i = +1 } },
    187 	{ MODKEY,                       XK_d,      incnmaster,     {.i = -1 } },
    188 	{ MODKEY,                       XK_h,      setmfact,       {.f = -0.05} },
    189 	{ MODKEY,                       XK_l,      setmfact,       {.f = +0.05} },
    190 	{ MODKEY,                       XK_Return, swapmaster,     {0} },
    191 	{ MODKEY,                       XK_0,      view,           {0} },
    192 	{ MODKEY|ShiftMask,             XK_c,      killclient,     {0} },
    193 	{ MODKEY,                       XK_space,  setlayout,      {0} },
    194 	{ MODKEY|ShiftMask,             XK_space,  togglefloating, {0} }, //default toggle floating bind.
    195 	{ MODKEY,                       XK_j,      view,           {.ui = ~0 } },
    196 	{ MODKEY|ShiftMask,             XK_0,      tag,            {.ui = ~0 } },
    197 	{ MODKEY,                       XK_comma,  focusmon,       {.i = -1 } },
    198 	{ MODKEY,                       XK_period, focusmon,       {.i = +1 } },
    199 	{ MODKEY|ShiftMask,             XK_comma,  tagmon,         {.i = -1 } },
    200 	{ MODKEY|ShiftMask,             XK_period, tagmon,         {.i = +1 } },
    201 	TAGKEYS(                        XK_1,                      0)
    202 	TAGKEYS(                        XK_2,                      1)
    203 	TAGKEYS(                        XK_3,                      2)
    204 	TAGKEYS(                        XK_4,                      3)
    205 	TAGKEYS(                        XK_5,                      4)
    206 	TAGKEYS(                        XK_6,                      5)
    207 	TAGKEYS(                        XK_7,                      6)
    208 	TAGKEYS(                        XK_8,                      7)
    209 	TAGKEYS(                        XK_9,                      8)
    210 	{ MODKEY|ShiftMask,             XK_q,      quit,           {0} },
    211 #if XRDB
    212   { MODKEY,                       XK_F5,     xrdb,           {.v = NULL } },
    213 #endif
    214 #if FULLSCREEN
    215   { MODKEY|ShiftMask,             XK_f,      togglefullscr,  {0} },
    216 #endif
    217 #if ENHANCED_TOGGLE_FLOATING
    218   { MODKEY,                       XK_q,      enhancedtogglefloating, {0} }, //enhanced toggle floating bind.
    219 #endif
    220 #if GAPS
    221   { MODKEY,                       XK_minus,  setgaps,        {.i = -1 } },
    222   { MODKEY,                       XK_equal,  setgaps,        {.i = +1 } },
    223   { MODKEY|ShiftMask,             XK_equal,  setgaps,        {.i = 0  } },
    224 #endif
    225 #if MOVE_RESIZE_WITH_KEYBOARD
    226   { MODKEY,					              XK_Down,	moveresize,		{.v = (int []){ 0, MOVE_WITH_KEYBOARD_STEP, 0, 0 }}}, // Move window to down
    227   { MODKEY,					              XK_Up,		moveresize,		{.v = (int []){ 0, -MOVE_WITH_KEYBOARD_STEP, 0, 0 }}}, // Move window to up
    228   { MODKEY,					              XK_Right,	moveresize,		{.v = (int []){ MOVE_WITH_KEYBOARD_STEP, 0, 0, 0 }}}, // Move window to right
    229   { MODKEY,					              XK_Left,	moveresize,		{.v = (int []){ -MOVE_WITH_KEYBOARD_STEP, 0, 0, 0 }}}, // Move window to left
    230   { MODKEY|ControlMask,			      XK_Down,	moveresize,		{.v = (int []){ 0, 0, 0, RESIZE_WITH_KEYBOARD_STEP }}}, // Resize window
    231   { MODKEY|ControlMask,			      XK_Up,		moveresize,		{.v = (int []){ 0, 0, 0, -RESIZE_WITH_KEYBOARD_STEP }}}, // Resize window
    232   { MODKEY|ControlMask,			      XK_Right,	moveresize,		{.v = (int []){ 0, 0, RESIZE_WITH_KEYBOARD_STEP, 0 }}}, // Resize window
    233   { MODKEY|ControlMask,			      XK_Left,	moveresize,		{.v = (int []){ 0, 0, -RESIZE_WITH_KEYBOARD_STEP, 0 }}}, // Resize window
    234 #endif
    235 #if INFINITE_TAGS
    236   { MODKEY,                       XK_r,      homecanvas,       {0} }, // Return to x:0, y:0 position
    237   { MODKEY|ShiftMask,             XK_Left,   movecanvas,       {.i = 0} }, // Move your position to left
    238   { MODKEY|ShiftMask,             XK_Right,  movecanvas,       {.i = 1} }, // Move your position to right
    239   { MODKEY|ShiftMask,             XK_Up,     movecanvas,       {.i = 2} }, // Move your position up
    240   { MODKEY|ShiftMask,             XK_Down,   movecanvas,       {.i = 3} }, // Move your position down
    241   { MODKEY|ShiftMask,             XK_d,      centerwindow,     {0} },
    242   { MODKEY|ControlMask,           XK_z,      pinwindow,        {0} },
    243 #endif
    244 #if DIRECTIONAL_FOCUS
    245 	{ ALTERNATE_MODKEY,             XK_Left,   focusdir,       {.i = 0 } }, // left
    246 	{ ALTERNATE_MODKEY,             XK_Right,  focusdir,       {.i = 1 } }, // right
    247 	{ ALTERNATE_MODKEY,             XK_Up,     focusdir,       {.i = 2 } }, // up
    248 	{ ALTERNATE_MODKEY,             XK_Down,   focusdir,       {.i = 3 } }, // down
    249 #endif
    250 #if ZOOM
    251  { ALTERNATE_MODKEY,              XK_r,      spawn,          {.v = zoomreset } },
    252  { MODKEY,                        XK_equal,  spawn,          {.v = zoomin } },
    253  { MODKEY,                        XK_minus,  spawn,          {.v = zoomout } },
    254 #endif
    255 	{ 0, XF86XK_AudioRaiseVolume, spawn, {.v = volumeupcmd } },
    256 	{ 0, XF86XK_AudioLowerVolume, spawn, {.v = volumedowncmd } },
    257 	{ 0, XF86XK_AudioMicMute, spawn, {.v = volumemutecmd } },
    258 	{ 0, XF86XK_MonBrightnessUp, spawn, {.v = brightnessupcmd } },
    259 	{ 0, XF86XK_MonBrightnessDown, spawn, {.v = brightnessdowncmd } },
    260 	{ 0,                       XK_Print,      spawn,          {.v = scrotcmd } },
    261 };
    262 
    263 /* button definitions */
    264 /* click can be ClkTagBar, ClkLtSymbol, ClkStatusText, ClkWinTitle, ClkClientWin, or ClkRootWin */
    265 static const Button buttons[] = {
    266 	/* click                event mask      button          function        argument */
    267 #if INFINITE_TAGS
    268   { ClkRootWin,           MODKEY|ShiftMask,         Button1,        movecanvasmouse,     {.f = 1.5 } }, 
    269   { ClkClientWin,         MODKEY|ShiftMask,         Button1,        movecanvasmouse,     {.f = 1.5 } },
    270   { ClkRootWin,           0,                        Button1,        movecanvasmouse,     {.f = 1.5 } },
    271   /* .f = 1 is moving multiplier, for example if set to 0.5, canvas will move 2 times slower, if set to 2, canvas will move 2 times faster. 
    272      If you want inverted canvas move then set the value to a negative value. */
    273 #endif
    274 #if ZOOM
    275   { ClkRootWin,           MODKEY,         SCROLL_UP,      spawn,          {.v = zoomin } },
    276   { ClkRootWin,           MODKEY,         SCROLL_DOWN,    spawn,          {.v = zoomout } },
    277 
    278   { ClkClientWin,         MODKEY,         SCROLL_UP,      spawn,          {.v = zoomin } },
    279   { ClkClientWin,         MODKEY,         SCROLL_DOWN,    spawn,          {.v = zoomout } },
    280 #endif
    281 	{ ClkLtSymbol,          0,              Button1,        setlayout,      {0} },
    282 	{ ClkLtSymbol,          0,              Button3,        setlayout,      {.v = &layouts[2]} },
    283 	{ ClkWinTitle,          0,              Button2,        swapmaster,     {0} },
    284 	{ ClkStatusText,        0,              Button2,        spawn,          {.v = termcmd } },
    285 	{ ClkClientWin,         MODKEY,         Button1,        movemouse,      {0} },
    286 	{ ClkClientWin,         MODKEY,         Button2,        togglefloating, {0} },
    287 	{ ClkClientWin,         MODKEY,         Button3,        resizemouse,    {0} },
    288 	{ ClkTagBar,            0,              Button1,        view,           {0} },
    289 	{ ClkTagBar,            0,              Button3,        toggleview,     {0} },
    290 	{ ClkTagBar,            MODKEY,         Button1,        tag,            {0} },
    291 	{ ClkTagBar,            MODKEY,         Button3,        toggletag,      {0} },
    292 };
    293