diff options
author | Ethel Morgan <eth@ethulhu.co.uk> | 2020-05-24 20:52:44 +0100 |
---|---|---|
committer | Ethel Morgan <eth@ethulhu.co.uk> | 2020-05-24 20:52:44 +0100 |
commit | 72ceb05070fb2a4aecefbecc6f582b41b9e71b1c (patch) | |
tree | ba89218cef392b088528f2375635681ebaeef429 /pkgs | |
parent | 8096ed8c66f08afa02714f3660f8539d48f08da8 (diff) |
add my dwm setup
Diffstat (limited to 'pkgs')
-rw-r--r-- | pkgs/default.nix | 4 | ||||
-rw-r--r-- | pkgs/dwm/config.h | 134 | ||||
-rw-r--r-- | pkgs/dwm/default.nix | 10 |
3 files changed, 148 insertions, 0 deletions
diff --git a/pkgs/default.nix b/pkgs/default.nix index 5e0d2b8..af5e4f1 100644 --- a/pkgs/default.nix +++ b/pkgs/default.nix @@ -2,6 +2,8 @@ pkgs: super: { eth = { recipesEthMoe = pkgs.callPackage ( builtins.fetchGit { url = "https://github.com/ethulhu/recipes.eth.moe"; } ) {}; + dwm = pkgs.callPackage ./dwm {}; + catbus-lifx = pkgs.callPackage ( builtins.fetchGit { url = "https://github.com/ethulhu/catbus-lifx"; } ) {}; catbus-snapcast = pkgs.callPackage ( builtins.fetchGit { url = "https://github.com/ethulhu/catbus-snapcast"; } ) {}; catbus-web-ui = pkgs.callPackage ( builtins.fetchGit { url = "https://github.com/ethulhu/catbus-web-ui"; } ) {}; @@ -11,5 +13,7 @@ pkgs: super: { libnpupnp = pkgs.callPackage ./libnpupnp { }; libupnpp = pkgs.callPackage ./libupnpp { }; upmpdcli = pkgs.callPackage ./upmpdcli { }; + + reuse = pkgs.callPackage /home/eth/src/nixpkgs/pkgs/tools/package-management/reuse {}; }; } diff --git a/pkgs/dwm/config.h b/pkgs/dwm/config.h new file mode 100644 index 0000000..11a9f01 --- /dev/null +++ b/pkgs/dwm/config.h @@ -0,0 +1,134 @@ +/* See LICENSE file for copyright and license details. */ + +#include <X11/XF86keysym.h> + +/* appearance */ +static const unsigned int borderpx = 1; /* border pixel of windows */ +static const unsigned int snap = 32; /* snap pixel */ +static const int showbar = 1; /* 0 means no bar */ +static const int topbar = 1; /* 0 means bottom bar */ +static const char *fonts[] = { "monospace:size=10" }; +static const char dmenufont[] = "monospace:size=10"; +static const char col_gray1[] = "#222222"; +static const char col_gray2[] = "#444444"; +static const char col_gray3[] = "#bbbbbb"; +static const char col_gray4[] = "#eeeeee"; +static const char col_light_purple[] = "#b19cd9"; +static const char col_dark_purple[] = "#966fd6"; +static const char *colors[][3] = { + /* fg bg border */ + [SchemeNorm] = { col_gray3, col_dark_purple, col_gray2 }, + [SchemeSel] = { col_gray1, col_light_purple, col_light_purple }, +}; + +/* tagging */ +static const char *tags[] = { "1", "2", "3", "4", "5", "6", "7", "8", "9" }; + +static const Rule rules[] = { + /* xprop(1): + * WM_CLASS(STRING) = instance, class + * WM_NAME(STRING) = title + */ + /* class instance title tags mask isfloating monitor */ + { "Gimp", NULL, NULL, 0, 1, -1 }, + { "Firefox", NULL, NULL, 1 << 8, 0, -1 }, +}; + +/* layout(s) */ +static const float mfact = 0.55; /* factor of master area size [0.05..0.95] */ +static const int nmaster = 1; /* number of clients in master area */ +static const int resizehints = 0; /* 1 means respect size hints in tiled resizals */ + +static const Layout layouts[] = { + /* symbol arrange function */ + { "[]=", tile }, /* first entry is default */ + { "><>", NULL }, /* no layout function means floating behavior */ + { "[M]", monocle }, +}; + +/* key definitions */ +#define MODKEY Mod4Mask +#define TAGKEYS(KEY,TAG) \ + { MODKEY, KEY, view, {.ui = 1 << TAG} }, \ + { MODKEY|ControlMask, KEY, toggleview, {.ui = 1 << TAG} }, \ + { MODKEY|ShiftMask, KEY, tag, {.ui = 1 << TAG} }, \ + { MODKEY|ControlMask|ShiftMask, KEY, toggletag, {.ui = 1 << TAG} }, + +/* helper for spawning shell commands in the pre dwm-5.0 fashion */ +#define SHCMD(cmd) { .v = (const char*[]){ "/bin/sh", "-c", cmd, NULL } } + +/* commands */ +static char dmenumon[2] = "0"; /* component of dmenucmd, manipulated in spawn() */ +static const char *dmenucmd[] = { "dmenu_run", "-m", dmenumon, "-fn", dmenufont, "-nb", col_gray1, "-nf", col_gray3, "-sb", col_light_purple, "-sf", col_gray4, NULL }; +static const char *termcmd[] = { "urxvt", NULL }; +static const char *lockcmd[] = { "slock", NULL }; + +// static const char *volupcmd[] = { "amixer", "-c", "0", "set", "Master", "1dB+", NULL }; +// static const char *voldowncmd[] = { "amixer", "-c", "0", "set", "Master", "1dB-", NULL }; +// static const char *mutecmd[] = { "amixer", "set", "Master", "toggle", NULL }; + +// static const char *backlightupcmd[] = { "backlight", "up" }; +// static const char *backlightdowncmd[] = { "backlight", "down" }; + +static Key keys[] = { + /* modifier key function argument */ + { MODKEY, XK_p, spawn, {.v = dmenucmd } }, + { MODKEY|ShiftMask, XK_Return, spawn, {.v = termcmd } }, + { MODKEY|ShiftMask, XK_l, spawn, {.v = lockcmd } }, + { MODKEY, XK_b, togglebar, {0} }, + { MODKEY, XK_j, focusstack, {.i = +1 } }, + { MODKEY, XK_k, focusstack, {.i = -1 } }, + { MODKEY, XK_i, incnmaster, {.i = +1 } }, + { MODKEY, XK_d, incnmaster, {.i = -1 } }, + { MODKEY, XK_h, setmfact, {.f = -0.05} }, + { MODKEY, XK_l, setmfact, {.f = +0.05} }, + { MODKEY, XK_Return, zoom, {0} }, + { MODKEY, XK_Tab, view, {0} }, + { MODKEY|ShiftMask, XK_c, killclient, {0} }, + /* { MODKEY, XK_t, setlayout, {.v = &layouts[0]} }, */ + /* { MODKEY, XK_f, setlayout, {.v = &layouts[1]} }, */ + /* { MODKEY, XK_m, setlayout, {.v = &layouts[2]} }, */ + { MODKEY, XK_space, setlayout, {0} }, + { MODKEY|ShiftMask, XK_space, togglefloating, {0} }, + { MODKEY, XK_0, view, {.ui = ~0 } }, + { MODKEY|ShiftMask, XK_0, tag, {.ui = ~0 } }, + { MODKEY, XK_comma, focusmon, {.i = -1 } }, + { MODKEY, XK_period, focusmon, {.i = +1 } }, + { MODKEY|ShiftMask, XK_comma, tagmon, {.i = -1 } }, + { MODKEY|ShiftMask, XK_period, tagmon, {.i = +1 } }, + TAGKEYS( XK_1, 0) + TAGKEYS( XK_2, 1) + TAGKEYS( XK_3, 2) + TAGKEYS( XK_4, 3) + TAGKEYS( XK_5, 4) + TAGKEYS( XK_6, 5) + TAGKEYS( XK_7, 6) + TAGKEYS( XK_8, 7) + TAGKEYS( XK_9, 8) + { MODKEY|ShiftMask, XK_q, quit, {0} }, + // { MODKEY, XK_Up, spawn, {.v = volupcmd } }, + // { MODKEY, XK_Down, spawn, {.v = voldowncmd } }, + // { 0, XF86XK_AudioRaiseVolume, spawn, {.v = volupcmd } }, + // { 0, XF86XK_AudioLowerVolume, spawn, {.v = voldowncmd } }, + // { 0, XF86XK_AudioMute, spawn, {.v = mutecmd } }, + // { 0, XF86XK_MonBrightnessUp, spawn, {.v = backlightupcmd } }, + // { 0, XF86XK_MonBrightnessDown, spawn, {.v = backlightdowncmd } }, +}; + +/* button definitions */ +/* click can be ClkTagBar, ClkLtSymbol, ClkStatusText, ClkWinTitle, ClkClientWin, or ClkRootWin */ +static Button buttons[] = { + /* click event mask button function argument */ + { ClkLtSymbol, 0, Button1, setlayout, {0} }, + { ClkLtSymbol, 0, Button3, setlayout, {.v = &layouts[2]} }, + { ClkWinTitle, 0, Button2, zoom, {0} }, + { ClkStatusText, 0, Button2, spawn, {.v = termcmd } }, + { ClkClientWin, MODKEY, Button1, movemouse, {0} }, + { ClkClientWin, MODKEY, Button2, togglefloating, {0} }, + { ClkClientWin, MODKEY, Button3, resizemouse, {0} }, + { ClkTagBar, 0, Button1, view, {0} }, + { ClkTagBar, 0, Button3, toggleview, {0} }, + { ClkTagBar, MODKEY, Button1, tag, {0} }, + { ClkTagBar, MODKEY, Button3, toggletag, {0} }, +}; + diff --git a/pkgs/dwm/default.nix b/pkgs/dwm/default.nix new file mode 100644 index 0000000..b6e02c6 --- /dev/null +++ b/pkgs/dwm/default.nix @@ -0,0 +1,10 @@ +{ pkgs ? import <nixpkgs> { } }: + +pkgs.dwm.overrideAttrs (old: rec { + postPatch = '' + cp ${./config.h} ./config.h + ''; + + patches = [ + ]; +}) |