summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorBen Sima <ben@bsima.me>2019-08-27 14:34:49 -0700
committerBen Sima <ben@bsima.me>2019-08-27 14:34:49 -0700
commitf3b91d75d2d3153e9fa4d7414929dcc531779727 (patch)
treec49dc426b64cec2d47dc594a1a5398244ccc4dd0 /lib
parent8c810428d6d93ba718df7e8388615ad7fa3d092c (diff)
reorganize, and some small fixes
Diffstat (limited to 'lib')
-rw-r--r--lib/afew.ini185
-rw-r--r--lib/cfg.def.h98
-rw-r--r--lib/common.nix173
-rw-r--r--lib/config.nix5
-rw-r--r--lib/editorconfig8
-rw-r--r--lib/emacs-packages.nix91
-rw-r--r--lib/email.nix124
-rw-r--r--lib/git-commit-template9
-rw-r--r--lib/mailcap6
-rw-r--r--lib/msmtprc24
-rwxr-xr-xlib/mutt/generate-contacts.sh15
-rw-r--r--lib/mutt/solarized.muttrc146
-rw-r--r--lib/muttrc115
-rw-r--r--lib/packages.nix42
-rw-r--r--lib/tmux66
-rw-r--r--lib/vimrc106
-rw-r--r--lib/xmonad.hs157
17 files changed, 1370 insertions, 0 deletions
diff --git a/lib/afew.ini b/lib/afew.ini
new file mode 100644
index 0000000..48f86c5
--- /dev/null
+++ b/lib/afew.ini
@@ -0,0 +1,185 @@
+[ArchiveSentMailsFilter]
+
+[SpamFilter]
+spam_tag = spam
+
+[InboxFilter]
+
+# This filter looks for the List-Id header, and if it finds it, adds a tag lists
+# and a tag named lists/<list-id>. Run this *after* the InboxFilter.
+[ListMailsFilter]
+
+[Filter.0]
+message = mobile todos
+query = 'from:ben@bsima.me AND to:ben@bsima.me AND subject:TODO'
+tags = +todo;-inbox;+unread
+
+[Filter.1]
+message = logwatch
+query = subject:Logwatch
+tags = +logwatch;-new;-inbox
+
+[Filter.2]
+message = newsletters
+query =
+ from:the-morning-paper@onelanday.co.uk OR
+ subject:'The Reading List Email*' OR
+ from:info@haskellweekly.news OR
+ from:kale@hackernewsletter.com OR
+ from:newsletter@farnamstreetblog.com
+tags = -unread;+newsletters;-inbox
+
+[Filter.3]
+message = job emails
+query =
+ from:linkedin.com OR
+ from:alist.co OR
+ from:angel.co OR
+ from:stackoverflow.com OR
+ from:stackoverflow.email OR
+ from:cdmtechnology.com OR
+ subject:job
+tags = +jobs;-inbox
+
+[Filter.4]
+message = github
+query = from:github.com
+tags = +github;-inbox
+
+[MailMover]
+folders = Important INBOX
+INBOX = 'tag:flagged AND NOT tag:spam':.Important
+Important = 'NOT tag:flagged':.INBOX 'tag:spam':.INBOX
+
+[Filter.5]
+message = remove lists from inbox
+query = tag:lists AND tag:inbox
+tags = -inbox
+
+[Filter.6]
+message = remove rspamd from inbox
+query = from:rspamd
+tags = -inbox
+
+[Filter.7]
+message = banking activity confirmations
+query =
+ (from:discover@service.discover.com AND subject:'Your Scheduled Payment') OR
+ (from:citicards@info6.citi.com AND subject:Confirmation)
+tags = -inbox;+banking
+
+[Filter.8]
+message = receipts
+query = subject:receipt
+tags = +receipts;-inbox
+
+[Filter.9]
+message = stupid social networks
+query = from:messages-noreply@linkedin.com
+tags = -inbox;-unread;+deleted;+spam
+
+[Filter.10]
+message = meetups
+query = from:*@meetup.com
+tags = -inbox;+meetups
+
+[Filter.11]
+message = emacs lists
+query =
+ to:emacs-devel@gnu.org OR to:info-gnu-emacs@gnu.org OR to:help-gnu-emacs@gnu.org OR
+ cc:emacs-devel@gnu.org OR cc:info-gnu-emacs@gnu.org OR cc:help-gnu-emacs@gnu.org
+tags = -inbox;+emacs
+
+[Filter.12]
+message = philosophy lists
+query = to:publish-liv@humanist.kdl.kcl.ac.uk
+tags = -inbox;+philosophy
+
+[Filter.13]
+message = science lists
+query = from:newsletter@fightaging.org
+tags = -inbox;+science
+
+[Filter.14]
+message = work stuff
+query =
+ from:git@undergroundelephant.com OR subject:*HeroOS* OR
+ to:bsima@ue.co OR to:bsima@undergroundelephant.com OR
+ to:ben.sima@heroprojects.io
+tags = +work
+
+[Filter.17]
+message = ai lists
+query = to:scikit-learn@python.org OR to:tensorflow.org
+tags = -inbox;+ai
+
+[Filter.18]
+message = bitcoin lists
+query = to:bitcoin-dev@lists.linuxfoundation.org OR to:bitcoin-discuss@lists.linuxfoundation.org
+tags = -inbox;+bitcoin
+
+[Filter.19]
+message = lobsters
+query = to:lobsters-FTNhzWhnaM@lobste.rs
+tags = -inbox;+lobsters
+
+[Filter.20]
+message = deleuze and guattari
+query = to:deleuze-guattari@lists.driftline.org
+tags = -inbox;+philosophy
+
+[Filter.21]
+message = stupid noreply bots
+query = from:noreply OR from:no-reply
+tags = -inbox;+noreply
+
+[Filter.22]
+message = forkable crap
+query = from:team@forkable.com
+tags = -inbox;+groq;+forkable
+
+[Filter.23]
+message = xfinity crap
+query = from:xfinity.com
+tags = -inbox;+xfinity
+
+[Filter.24]
+message = interactive brokers
+query = from:interactivebrokers.com
+tags = -inbox;+ibkr
+
+[Filter.25]
+message = usps informed delivery crap
+query = from:usps.gov
+tags = -inbox;+usps
+
+[Filter.26]
+message = perfect workout marketing mails
+query = from:admin@theperfectworkout.com
+tags = -inbox;+exercise
+
+[Filter.27]
+message = last bottle wines
+query = from:offer@lastbottlewines.com
+tags = -inbox;+food;+wine
+
+[Filter.28]
+message = docusign notifications
+query = from:docusign.net
+tags = -inbox;+docusign
+
+[Filter.29]
+message = sourcehut stuff
+query = to:sr.ht-*@lists.sr.ht
+tags = +sourcehut
+
+[Filter.30]
+message = urbit stuff
+query = subject:"[urbit-dev]" OR subject:"[urbit/*]"
+tags = +urbit
+
+# In order to unsubscribe I need to know by user/pass, which I do not...
+[Filter.31]
+message = delete all hilton honors stuff
+query = from:honors@h1.hilton.com
+tags = -inbox;+deleted
diff --git a/lib/cfg.def.h b/lib/cfg.def.h
new file mode 100644
index 0000000..7a024b2
--- /dev/null
+++ b/lib/cfg.def.h
@@ -0,0 +1,98 @@
+/*
+
+cmdtree <git.sr.ht/~jb55/cmdtree> configuration file
+
+This gets applied a compile time.
+
+ */
+
+enum position {
+ POSITION_TOP,
+ POSITION_LEFT,
+ POSITION_RIGHT,
+ POSITION_BOTTOM
+};
+
+static int xpad = 6;
+static int ypad = 2;
+
+static enum position position = POSITION_TOP;
+
+static const char *separator = " → ";
+
+/* -fn option overrides fonts[0]; default X11 font or font set */
+static const char *fonts[] = {
+ "monospace:size=12"
+};
+
+#define scheme_bg "#222222"
+
+static struct scheme schemes[SchemeLast] = {
+ [SchemeNorm] = { .bg = scheme_bg,
+ .bind = "#D19A66",
+ .arrow = "#888",
+ .prefix = "",
+ .name = "#bbbbbb"
+ },
+
+ [SchemePrefix] = { .bg = scheme_bg,
+ .bind = "#eeeeee",
+ .arrow = "#888",
+ .prefix = "",
+ .name = "#c678dd"
+ },
+};
+
+struct command volume_commands[] = {
+ DEFCMD("k", "up" , "amixer -q sset Master 2%+")
+ DEFCMD("j", "down", "amixer -q sset Master 2%-")
+ DEFCMD("m", "mute", "amixer -q sset Master toggle")
+};
+
+static struct command system_commands[] = {
+ // DEFPREFIX("c", "copy/sync", sync_commands)
+ DEFCMD("R", "reboot", "reboot")
+ DEFCMD("S", "suspend", "systemctl suspend")
+ DEFCMD("h", "h-m switch", "home-manager switch")
+ DEFCMD("w", "fresh wall", "n wal")
+ DEFCMD("x", "restart xbindkeys", "pkill xbindkeys && xbindkeys")
+
+ DEFCMD("l", "light theme", "xtheme light")
+ DEFCMD("d", "dark theme", "xtheme dark")
+};
+
+static struct command apps[] = {
+ DEFCMD("c", "chromium", "chromium")
+ DEFCMD("d", "dolphin", "dolphin")
+ DEFCMD("f", "firefox", "firefox")
+ DEFCMD("h", "xterm htop", "xterm htop")
+ DEFCMD("k", "keybase", "keybase-gui")
+ DEFCMD("r", "ranger", "xterm ranger")
+ DEFCMD("t", "telegram", "telegram-desktop")
+ DEFCMD("q", "qutebrowser", "qutebrowser")
+};
+
+static struct command mail_commands[] = {
+ DEFCMD("a", "all", "eml all")
+ DEFCMD("i", "in", "n eml in")
+ DEFCMD("n", "new", "n eml new")
+ DEFCMD("o", "out", "n eml out")
+ DEFCMD("t", "tag", "n eml tag")
+};
+
+static struct command play_commands[] = {
+ DEFCMD("m", "morning brew", "mplayer /mnt/lake/ben/youtube/morning/morning-brew-MvlIb8EPq3Y.mp3")
+};
+
+static struct command commands[] = {
+ DEFPREFIX ("a", "apps" , apps)
+ DEFCMD ("e", "emacs" , "emacsclient -c")
+ DEFCMD ("f", "flameshot" , "flameshot gui")
+ DEFPREFIX ("m", "mail" , mail_commands)
+ DEFPREFIX ("p", "play" , play_commands)
+ DEFPREFIX ("s", "system" , system_commands)
+ DEFCMD ("r", "run" , "rofi -sidebar-mode -show run")
+ DEFPREFIX ("v", "volume" , volume_commands)
+ DEFCMD ("w", "windows" , "rofi -sidebar-mode -show window")
+ DEFCMD ("z", "seeme" , "seeme")
+};
diff --git a/lib/common.nix b/lib/common.nix
new file mode 100644
index 0000000..f2fb65d
--- /dev/null
+++ b/lib/common.nix
@@ -0,0 +1,173 @@
+{ pkgs, ... }:
+
+let
+ locale = "en_US.UTF-8";
+ gpgid = "D09299626FA78AF8";
+in
+{
+ home = {
+ packages = import ./packages.nix { inherit pkgs; };
+ sessionVariables = {
+ GPGID = gpgid;
+ EDITOR = "emacsclient";
+ LANG = locale;
+ LANGUAGE = locale;
+ PATH = "\$HOME/bin:\$HOME/.local/bin:$PATH";
+ PAGER = "less";
+ LEDGER_FILE = "\$HOME/.hledger.journal";
+ XTERM_LOCALE = locale;
+ LOCALE_ARCHIVE = "${pkgs.glibcLocales}/lib/locale/locale-archive";
+ };
+
+ # From the command line:
+ # setxkbmap -option caps:ctrl_modifier
+ keyboard.options = [ "caps:ctrl_modifier" ];
+
+ file = {
+ editorconfig = {
+ source = ./editorconfig;
+ target = ".editorconfig";
+ };
+ };
+ };
+
+ programs = {
+ home-manager = {
+ enable = true;
+ path = "\$HOME/cfg/home-manager";
+ };
+
+ tmux = {
+ enable = true;
+ extraConfig = builtins.readFile ./tmux;
+ baseIndex = 0;
+ clock24 = true;
+ customPaneNavigationAndResize = true;
+ keyMode = "vi";
+ shortcut = "'C-a'";
+ terminal = "screen-256color";
+ sensibleOnTop = true;
+ secureSocket = false;
+ };
+
+ ssh = {
+ enable = true;
+ forwardAgent = true;
+ matchBlocks = {
+ "sabten" = {
+ hostname = "142.93.81.26";
+ user = "root";
+ identityFile = [ "\$HOME/.ssh/id_rsa" ];
+ identitiesOnly = true;
+ };
+ "simatime.com" = {
+ hostname = "simatime.com";
+ user = "git";
+ identityFile = [ "\$HOME/.ssh/id_rsa" ];
+ identitiesOnly = true;
+ };
+ gh = {
+ hostname = "github.com";
+ user = "git";
+ identityFile = [ "\$HOME/.ssh/id_rsa" ];
+ identitiesOnly = true;
+ };
+ lithium = {
+ hostname = "69.181.254.154";
+ user = "ben";
+ identityFile = [ "\$HOME/.ssh/hijuj-zupip" ];
+ identitiesOnly = true;
+ };
+ nutin-madaj = {
+ hostname = "159.89.128.69";
+ user = "root";
+ identityFile = [ "\$HOME/.ssh/biz-deploy" ];
+ identitiesOnly = true;
+ };
+ hikuj-zupip = {
+ hostname = "69.181.254.154";
+ user = "root";
+ identityFile = [ "\$HOME/.ssh/biz-deploy" ];
+ identitiesOnly = true;
+ };
+ };
+ };
+
+ direnv = {
+ enable = true;
+ };
+
+ skim = {
+ enable = true;
+ enableBashIntegration = true;
+ };
+
+ vim = {
+ enable = true;
+ plugins = [
+ "ctrlp"
+ "fugitive"
+ "editorconfig-vim"
+ "surround"
+ "vim-colorschemes"
+ ];
+ extraConfig = builtins.readFile ./vimrc;
+ };
+
+ bash = {
+ enable = true;
+ initExtra = ''
+ DIR=~/.nix-profile/etc/profile.d
+ [[ -f "$DIR/nix.sh" ]] && . "$DIR/nix.sh"
+ [[ -f "$DIR/hm-session-vars.sh" ]] && . "$DIR/hm-session-vars.sh"
+ [[ -f "$HOME/.bashrc.local" ]] && . "$HOME/.bashrc.local"
+ function cd() {
+ builtin cd "$@" && ls
+ }
+
+ # my prompt, after much chagrin
+ export PS1='\n\[\e[34m\][\u@\h:\w]\[\e[m\] $(date +%Y.%m.%d..%H.%M) \n$ '
+ '';
+ shellAliases = {
+ add = "git add --ignore-removal";
+ ci = "git commit";
+ day = "date +%a";
+ ddate = "date +%Y.%m.%d";
+ dday = "date +%A";
+ et = "emacs -nw"; # emacs in a terminal
+ fetch = "git fetch";
+ g = "grep -in";
+ ga = "git add -A";
+ gb = "git branch";
+ gc = "git commit";
+ gca = "git commit -a";
+ gco = "git checkout";
+ gd = "git diff";
+ gl = "git pull --prune";
+ glog = ''git log --decorate --all --graph --pretty=format:"%Cred%h%Creset %an: %s - %Creset %C(yellow)%d%Creset %Cgreen(%cr)%Creset" --abbrev-commit --date=relative'';
+ gp = "git push origin HEAD";
+ gs = "git status -sb";
+ hs = "home-manager switch";
+ ll = "ls -l";
+ pull = "git pull";
+ push = "git push";
+ rm = "rm -i";
+ showpath = "echo $PATH | sed 's/:/\n/g'";
+ tdate = "date +%Y.%m.%d..%H.%M";
+ ttime = "date +%H.%M";
+ typeless = "history | tail -n 20000 | sed 's/.* //' | sort | uniq -c | sort -g | tail -n 100";
+ v = "vim";
+ "v." = "vim .";
+ vimdiff = "vim -d";
+ vk = "vim $(sk -m)";
+ vs = "vim $(sk -m)";
+ };
+ };
+
+ emacs = {
+ enable = true;
+ # Disabling for spacemacs
+ #extraPackages = epkgs: import ./emacs-packages.nix { inherit epkgs; };
+ };
+ };
+}
diff --git a/lib/config.nix b/lib/config.nix
new file mode 100644
index 0000000..7bdd27b
--- /dev/null
+++ b/lib/config.nix
@@ -0,0 +1,5 @@
+{
+ allowUnfree = true;
+ allowBroken = true;
+ allowUnsupportedSystem = true;
+}
diff --git a/lib/editorconfig b/lib/editorconfig
new file mode 100644
index 0000000..c977887
--- /dev/null
+++ b/lib/editorconfig
@@ -0,0 +1,8 @@
+root = true
+
+[*]
+trim_trailing_whitespace = true
+insert_final_newline = true
+
+[*.h]
+indent_style = tab \ No newline at end of file
diff --git a/lib/emacs-packages.nix b/lib/emacs-packages.nix
new file mode 100644
index 0000000..1c9606e
--- /dev/null
+++ b/lib/emacs-packages.nix
@@ -0,0 +1,91 @@
+{ epkgs }:
+
+with epkgs;
+
+[
+ace-window
+ace-link
+ag
+avy
+bbdb
+melpaStablePackages.cider
+cheat-sh
+circe
+cl-lib
+clojure-mode
+company
+counsel
+counsel-dash
+counsel-notmuch
+counsel-projectile
+dashboard
+define-word
+deft
+diminish
+dired-narrow
+editorconfig
+evil
+evil-collection
+melpaStablePackages.evil-escape
+evil-magit
+evil-org
+evil-surround
+emojify
+eyebrowse
+general
+git-gutter-plus
+melpaStablePackages.git-timemachine
+haskell-mode
+hindent
+hlint-refactor
+htmlize
+hydra
+ibuffer-vc
+indent-guide
+ivy
+ix
+ledger-mode
+lispy
+magit
+magit-annex
+#magit-stgit # build fails
+markdown-mode
+multiple-cursors
+neotree
+notmuch
+nix-mode
+org-alert
+org-bullets
+org-dashboard
+org-jira
+melpaStablePackages.org-journal
+org-plus-contrib
+org-pomodoro
+org-ref
+org-trello
+org-web-tools
+pass
+pinentry
+popwin
+projectile
+rainbow-mode
+ranger
+restclient
+rotate
+s
+shakespeare-mode
+smart-mode-line
+spacemacs-theme
+spaceline
+swiper
+sx
+twittering-mode
+undo-tree
+use-package
+which-key
+winum
+yaml-mode
+yasnippet
+yasnippet-snippets
+zoom
+]
diff --git a/lib/email.nix b/lib/email.nix
new file mode 100644
index 0000000..811d739
--- /dev/null
+++ b/lib/email.nix
@@ -0,0 +1,124 @@
+{ pkgs, ... }:
+
+let
+ gpgid = "D09299626FA78AF8";
+in
+{
+ accounts = {
+ email = {
+ maildirBasePath = "\$HOME/Mail";
+ accounts = {
+ "ben@bsima.me" = {
+ primary = true;
+ realName = "Ben Sima";
+ address = "ben@bsima.me";
+ userName = "ben@simatime.com";
+ alot.sendMailCommand = "\$HOME/bin/sendmail";
+ folders = {
+ inbox = "INBOX";
+ };
+ imap = {
+ host = "simatime.com";
+ port = 993;
+ };
+ smtp = {
+ host = "simatime.com";
+ port = 587;
+ tls = {
+ enable = true;
+ useStartTls = true;
+ };
+ };
+ gpg = {
+ key = gpgid;
+ signByDefault = true;
+ encryptByDefault = false;
+ };
+ mbsync = {
+ enable = true;
+ create = "both";
+ expunge = "none";
+ };
+ notmuch.enable = true;
+ msmtp.enable = true;
+ passwordCommand = "cat ~/keybase/private/bsima/ben@bsima.me";
+ };
+
+ "ben@simatime.com" = {
+ realName = "Ben Sima";
+ address = "ben@simatime.com";
+ userName = "ben@simatime.com";
+ imap = {
+ host = "simatime.com";
+ port = 993;
+ };
+ smtp = {
+ host = "simatime.com";
+ port = 587;
+ tls = {
+ enable = true;
+ useStartTls = true;
+ };
+
+ };
+ mbsync = {
+ enable = true;
+ create = "both";
+ expunge = "none";
+ };
+ notmuch.enable = true;
+ passwordCommand = "cat ~/keybase/private/bsima/ben@simatime.com";
+ msmtp.enable = true;
+ };
+
+ #"ben.sima@heroprojects.io" = {
+ # flavor = "gmail.com";
+ # realName = "Ben Sima";
+ # address = "ben.sima@heroprojects.io";
+ # userName = "ben.sima@heroprojects.io";
+ # mbsync = {
+ # enable = true;
+ # create = "both";
+ # expunge = "none";
+ # };
+ # notmuch.enable = true;
+ # msmtp.enable = true;
+ # passwordCommand = "pass work/hero/gmail";
+ #};
+ };
+ };
+ };
+
+ programs = {
+ notmuch = {
+ enable = true;
+ new.tags = [ "new" ];
+ hooks = {};
+ extraConfig = {
+ search = {
+ exclude_tags = "deleted;spam;";
+ };
+ };
+ };
+
+ afew = {
+ enable = true;
+ extraConfig = builtins.readFile ./afew.ini;
+ };
+
+ alot = {
+ enable = true;
+ extraConfig = ''
+ theme = solarized_light
+ '';
+ };
+
+ mbsync = {
+ enable = true;
+ };
+
+ msmtp = {
+ enable = true;
+ };
+ };
+}
diff --git a/lib/git-commit-template b/lib/git-commit-template
new file mode 100644
index 0000000..13f37b6
--- /dev/null
+++ b/lib/git-commit-template
@@ -0,0 +1,9 @@
+# If applied, this commit will...
+
+
+# Why was this change made?
+
+
+# Any references to tickets, articles, etc?
+
+
diff --git a/lib/mailcap b/lib/mailcap
new file mode 100644
index 0000000..5cce027
--- /dev/null
+++ b/lib/mailcap
@@ -0,0 +1,6 @@
+text/html; w3m -dump -o document_charset=%{charset} '%s'; nametemplate=%s.html; copiousoutput
+application/pdf; apvlv %s
+image/*; feh %s
+application/msword; antiword %s; copiousoutput
+application/ics; emacs %s
+application/*; xdg-open %s & sleep 5
diff --git a/lib/msmtprc b/lib/msmtprc
new file mode 100644
index 0000000..096525f
--- /dev/null
+++ b/lib/msmtprc
@@ -0,0 +1,24 @@
+account ben@bsima.me
+auth on
+from ben@bsima.me
+host mail.bsima.me
+user ben@bsima.me
+passwordeval pass bnet/helium/mail/ben
+port 587
+
+tls on
+# Get the fingerprint with
+# $ ~/bin/sslfingerprint mail.bsima.me
+tls_fingerprint B8:63:4C:8B:15:05:FC:F3:0B:CD:CF:5C:71:03:69:80:4E:26:AF:5B:B1:B2:F4:32:85:47:FA:7C:FD:8A:AA:E3
+
+account default : ben@bsima.me
+
+account ben@simatime.com
+auth on
+from ben@simatime.com
+host mail.simatime.com
+user ben@simatime.com
+passwordeval pass simatime/mail/ben
+port 587
+tls on
+tls_fingerprint 0B:E4:4B:8E:FD:11:E7:F3:CA:50:91:30:C2:56:34:87:6B:F4:7D:9B:59:2F:2D:55:83:43:A0:23:DB:00:5B:44 \ No newline at end of file
diff --git a/lib/mutt/generate-contacts.sh b/lib/mutt/generate-contacts.sh
new file mode 100755
index 0000000..ab3cacb
--- /dev/null
+++ b/lib/mutt/generate-contacts.sh
@@ -0,0 +1,15 @@
+#!/usr/bin/env sh
+#
+# Source: http://wcm1.web.rice.edu/mutt-tips.html
+
+MESSAGE=$(cat)
+
+NEWALIAS=$(echo "${MESSAGE}" | grep ^"From: " | sed s/[\,\"\']//g | awk '{$1=""; if (NF == 3) {print "alias" $0;} else if (NF == 2) {print "alias" $0 $0;} else if (NF > 3) {print "alias", tolower($(NF-1))"-"tolower($2) $0;}}')
+
+if grep -Fxq "$NEWALIAS" $HOME/contacts.txt; then
+ :
+else
+ echo "$NEWALIAS" >> $HOME/contacts.txt
+fi
+
+echo "${MESSAGE}"
diff --git a/lib/mutt/solarized.muttrc b/lib/mutt/solarized.muttrc
new file mode 100644
index 0000000..3588389
--- /dev/null
+++ b/lib/mutt/solarized.muttrc
@@ -0,0 +1,146 @@
+# vim: filetype=muttrc
+
+# Based on https://github.com/altercation/mutt-colors-solarized/
+#
+# The original by @altercation only works if mutt is linked against slang, but
+# on NixOS both mutt and neomutt are linked against ncurses. This color scheme
+# has been modified to work with ncurses.
+
+# Highlight my name and other personally relevant strings
+color body color136 default "(ben|sima|bsima)"
+
+# Highlight messages which mention my name in the body
+color index color136 default "~b \"ben(_g|\!| sima)|bsima\" !~N !~T !~F !~p !~P"
+color index color136 color37 "~b \"ben(_g|\!| sima)|bsima\" ~T !~F !~p !~P"
+
+# for background in 16 color terminal, valid background colors include:
+# base03, bg, black, any of the non brights
+
+# Basic colors
+color normal color244 default
+color error color160 default
+color tilde color254 default
+color message color37 default
+color markers color160 default
+color attachment default default
+color search color61 default
+color status color244 color254
+color indicator color230 color136
+color tree color136 default # arrow in threads
+
+# Basic monocolor screen
+mono bold bold
+mono underline underline
+mono indicator reverse
+mono error bold
+
+# Index
+color index color160 default "~D(!~p|~p)" # deleted
+color index color254 default ~F # flagged
+color index color166 default ~= # duplicate messages
+color index color245 default "~A!~N!~T!~p!~Q!~F!~D!~P" # the rest
+color index color160 default "~A" # all messages
+color index color166 default "~E" # expired messages
+color index color33 default "~N" # new messages
+color index color33 default "~O" # old messages
+color index color61 default "~Q" # messages that have been replied to
+color index color245 default "~R" # read messages
+color index color33 default "~U" # unread messages
+color index color33 default "~U~$" # unread, unreferenced messages
+color index color244 default "~v" # messages part of a collapsed thread
+color index color244 default "~P" # messages from me
+color index color37 default "~p!~F" # messages to me
+color index color37 default "~N~p!~F" # new messages to me
+color index color37 default "~U~p!~F" # unread messages to me
+color index color245 default "~R~p!~F" # messages to me
+color index color160 default "~F" # flagged messages
+color index color160 default "~F~p" # flagged messages to me
+color index color160 default "~N~F" # new flagged messages
+color index color160 default "~N~F~p" # new flagged messages to me
+color index color160 default "~U~F~p" # new flagged messages to me
+color index color254 color160 "~D" # deleted messages
+color index color239 default "~v~(!~N)" # collapsed thread with no unread
+color index color136 default "~v~(~N)" # collapsed thread with some unread
+color index color64 default "~N~v~(~N)" # collapsed thread with unread parent
+
+# statusbg used to indicated flagged when foreground color shows other status
+# for collapsed thread
+color index color160 color254 "~v~(~F)!~N" # collapsed thread with flagged, no unread
+color index color136 color254 "~v~(~F~N)" # collapsed thread with some unread & flagged
+color index color64 color254 "~N~v~(~F~N)" # collapsed thread with unread parent & flagged
+color index color64 color254 "~N~v~(~F)" # collapsed thread with unread parent, no unread inside, but some flagged
+color index color37 color254 "~v~(~p)" # collapsed thread with unread parent, no unread inside, some to me directly
+color index color136 color160 "~v~(~D)" # thread with deleted (doesn't differentiate between all or partial)
+color index color136 default "~(~N)" # messages in threads with some unread
+color index color64 default "~S" # superseded messages
+color index color160 default "~T" # tagged messages
+color index color166 color160 "~=" # duplicated messages
+
+
+# Message headers
+
+color header color245 default "^"
+color hdrdefault color245 default
+color header color244 default "^(From)"
+color header color33 default "^(Subject)"
+
+
+# Message body
+
+color quoted color33 default
+color quoted1 color37 default
+color quoted2 color136 default
+color quoted3 color160 default
+color quoted4 color166 default
+
+color signature color245 default
+color bold color254 default
+color underline color254 default
+color normal color240 default
+
+color body color239 default "[;:][-o][)/(|]" # emoticons
+color body color239 default "[;:][)(|]" # emoticons
+color body color239 default "[*]?((N)?ACK|CU|LOL|SCNR|BRB|BTW|CWYL|\
+ |FWIW|vbg|GD&R|HTH|HTHBE|IMHO|IMNSHO|\
+ |IRL|RTFM|ROTFL|ROFL|YMMV)[*]?"
+color body color239 default "[ ][*][^*]*[*][ ]?" # more emoticon?
+color body color239 default "[ ]?[*][^*]*[*][ ]" # more emoticon?
+
+
+## pgp
+color body color160 default "(BAD signature)"
+color body color37 default "(Good signature)"
+color body color230 default "^gpg: Good signature .*"
+color body color244 default "^gpg: "
+color body color244 color160 "^gpg: BAD signature from.*"
+mono body bold "^gpg: Good signature"
+mono body bold "^gpg: BAD signature from.*"
+
+
+# yes, an insane URL regex
+color body color160 default "([a-z][a-z0-9+-]*://(((([a-z0-9_.!~*'();:&=+$,-]|%[0-9a-f][0-9a-f])*@)?((([a-z0-9]([a-z0-9-]*[a-z0-9])?)\\.)*([a-z]([a-z0-9-]*[a-z0-9])?)\\.?|[0-9]+\\.[0-9]+\\.[0-9]+\\.[0-9]+)(:[0-9]+)?)|([a-z0-9_.!~*'()$,;:@&=+-]|%[0-9a-f][0-9a-f])+)(/([a-z0-9_.!~*'():@&=+$,-]|%[0-9a-f][0-9a-f])*(;([a-z0-9_.!~*'():@&=+$,-]|%[0-9a-f][0-9a-f])*)*(/([a-z0-9_.!~*'():@&=+$,-]|%[0-9a-f][0-9a-f])*(;([a-z0-9_.!~*'():@&=+$,-]|%[0-9a-f][0-9a-f])*)*)*)?(\\?([a-z0-9_.!~*'();/?:@&=+$,-]|%[0-9a-f][0-9a-f])*)?(#([a-z0-9_.!~*'();/?:@&=+$,-]|%[0-9a-f][0-9a-f])*)?|(www|ftp)\\.(([a-z0-9]([a-z0-9-]*[a-z0-9])?)\\.)*([a-z]([a-z0-9-]*[a-z0-9])?)\\.?(:[0-9]+)?(/([-a-z0-9_.!~*'():@&=+$,]|%[0-9a-f][0-9a-f])*(;([-a-z0-9_.!~*'():@&=+$,]|%[0-9a-f][0-9a-f])*)*(/([-a-z0-9_.!~*'():@&=+$,]|%[0-9a-f][0-9a-f])*(;([-a-z0-9_.!~*'():@&=+$,]|%[0-9a-f][0-9a-f])*)*)*)?(\\?([-a-z0-9_.!~*'();/?:@&=+$,]|%[0-9a-f][0-9a-f])*)?(#([-a-z0-9_.!~*'();/?:@&=+$,]|%[0-9a-f][0-9a-f])*)?)[^].,:;!)? \t\r\n<>\"]"
+
+
+# and a heavy handed email regex
+color body color160 default "((@(([0-9a-z-]+\\.)*[0-9a-z-]+\\.?|#[0-9]+|\\[[0-9]?[0-9]?[0-9]\\.[0-9]?[0-9]?[0-9]\\.[0-9]?[0-9]?[0-9]\\.[0-9]?[0-9]?[0-9]\\]),)*@(([0-9a-z-]+\\.)*[0-9a-z-]+\\.?|#[0-9]+|\\[[0-9]?[0-9]?[0-9]\\.[0-9]?[0-9]?[0-9]\\.[0-9]?[0-9]?[0-9]\\.[0-9]?[0-9]?[0-9]\\]):)?[0-9a-z_.+%$-]+@(([0-9a-z-]+\\.)*[0-9a-z-]+\\.?|#[0-9]+|\\[[0-2]?[0-9]?[0-9]\\.[0-2]?[0-9]?[0-9]\\.[0-2]?[0-9]?[0-9]\\.[0-2]?[0-9]?[0-9]\\])"
+
+
+# Various smilies and the like
+color body default default "<[Gg]>" # <g>
+color body default default "<[Bb][Gg]>" # <bg>
+color body color136 default " [;:]-*[})>{(<|]" # :-) etc...
+
+# *bold*
+color body color33 default "(^|[[:space:][:punct:]])\\*[^*]+\\*([[:space:][:punct:]]|$)"
+mono body bold "(^|[[:space:][:punct:]])\\*[^*]+\\*([[:space:][:punct:]]|$)"
+
+# _underline_
+color body color33 default "(^|[[:space:][:punct:]])_[^_]+_([[:space:][:punct:]]|$)"
+mono body underline "(^|[[:space:][:punct:]])_[^_]+_([[:space:][:punct:]]|$)"
+
+# /italic/ (Sometimes gets directory names)
+color body color33 default "(^|[[:space:][:punct:]])/[^/]+/([[:space:][:punct:]]|$)"
+mono body underline "(^|[[:space:][:punct:]])/[^/]+/([[:space:][:punct:]]|$)"
+
+# Border lines.
+color body color33 default "( *[-+=#*~_]){6,}"
diff --git a/lib/muttrc b/lib/muttrc
new file mode 100644
index 0000000..ebbcdb0
--- /dev/null
+++ b/lib/muttrc
@@ -0,0 +1,115 @@
+# vim: filetype=muttrc
+
+set realname = "Ben Sima"
+set mbox_type = Maildir
+
+my_hdr X-URL: https://www.bsima.me
+# my_hdr Bcc: ben@bsima.me
+
+set editor = "vim -f"
+set mail_check = 60
+set timeout = 60
+set header_cache = ~/.mutt/cache/headers
+set message_cachedir = ~/.mutt/cache/bodies
+set certificate_file =~/.mutt/certificates
+
+# Contacts
+set display_filter=~/config/mutt/generate-contacts.sh
+set alias_file=~/contacts.txt
+source $alias_file
+
+set move = no
+set include
+set auto_tag = yes
+bind editor ^T complete
+set pager_index_lines = 10
+set implicit_autoview = yes
+
+set sort_aux = 'last-date-received'
+set index_format = "[%Z] %D %-20.20F %s"
+set date_format = "%m.%d..%H.%M"
+set nostrict_threads
+set sort = 'threads'
+set markers = no # hide line-wrap markers
+
+# Ignore all headers
+ignore *
+
+# Then un-ignore the ones I want to see
+unignore From:
+unignore To:
+unignore Reply-To:
+unignore Subject:
+unignore Date:
+unignore Organization:
+unignore Newsgroups:
+unignore CC:
+unignore BCC:
+unignore User-Agent:
+
+# Now order the visable header lines
+hdr_order Date: From: To: CC: BCC: Reply-To: Subject: Organization: User-Agent:
+
+set forward_format = "Fwd: %s"
+set fast_reply=yes
+set forward_decode # decode when forwarding
+set reply_to # reply to Reply to: field
+set use_envelope_from = yes
+set envelope_from = yes
+set text_flowed = yes
+
+# View multimedia emails
+
+alternative_order text/plain text/html *
+auto_view text/x-vcard text/html text/enriched
+macro index,pager \cb "<pipe-message> urlscan<Enter>" "Extract URLs"
+macro attach,compose \cb "<pipe-entry> urlscan<Enter>" "Extract URLs"
+
+# Code review stuff
+macro index ,A "| git am -s" "apply patch"
+
+# Searching/tagging with notmuch
+#
+# - https://neomutt.org/feature/notmuch
+# - https://wiki.archlinux.org/index.php/Notmuch#Integrating_with_NeoMutt
+
+set virtual_spoolfile=yes
+
+set nm_default_uri = "notmuch:///home/ben/Mail"
+virtual-mailboxes "inbox" "notmuch://?query=tag:inbox"
+virtual-mailboxes "archive" "notmuch://?query=tag:archive"
+virtual-mailboxes "jobs" "notmuch://?query=tag:jobs"
+virtual-mailboxes "todo" "notmuch://?query=tag:todo"
+virtual-mailboxes "newsletters" "notmuch://?query=tag:newsletters"
+virtual-mailboxes "github" "notmuch://?query=tag:github"
+
+macro index,pager S "<vfolder-from-query>" "search mailbox"
+macro index,pager A "<modify-labels>+archive -unread -inbox\n" "archive message"
+macro index,pager c "<change-vfolder>?" "change to vfolder overview"
+
+bind index,pager y modify-labels
+bind index,pager + entire-thread
+bind index,pager X change-vfolder
+
+## Accounts
+
+set my_pw = "`pass bnet/helium/mail/ben`"
+
+set imap_user = "ben@bsima.me"
+set imap_pass = $my_pw
+
+set sendmail = msmtpq
+
+set from = "ben@bsima.me"
+set use_from = yes
+
+#set smtp_url = "smtp://ben@bsima.me@mail.bsima.me:587"
+#set smtp_pass = $my_pw
+
+set ssl_starttls = "yes"
+
+set folder = "~/Mail/ben@bsima.me"
+set spoolfile = "+INBOX"
+set postponed = "+Drafts"
+set record = "+Sent"
+set imap_pipeline_depth = 0
diff --git a/lib/packages.nix b/lib/packages.nix
new file mode 100644
index 0000000..849cbe6
--- /dev/null
+++ b/lib/packages.nix
@@ -0,0 +1,42 @@
+{ pkgs }:
+
+# All common packages go here. Linux-specific should go in `linux.nix'
+
+with pkgs;
+
+[
+ag
+aspellDicts.en
+apvlv
+cloc
+cloc
+dhall
+entr
+expect
+file
+font-awesome_5
+git-lfs
+gopher
+htop
+ispell
+jq
+lshw
+lsof
+material-icons
+mononoki
+ncdu
+nix-prefetch-scripts
+pass
+pianobar
+python37Packages.black
+ranger
+ripgrep
+shellcheck
+tmux
+tree
+unrar
+unzip
+urlscan
+w3m
+zip
+]
diff --git a/lib/tmux b/lib/tmux
new file mode 100644
index 0000000..c292416
--- /dev/null
+++ b/lib/tmux
@@ -0,0 +1,66 @@
+# vim: filetype=tmux
+#
+# More settings are in common.nix
+#
+# Automatically set window title
+set-window-option -g automatic-rename on
+set-option -g set-titles on
+
+set -g xterm-keys on
+
+setw -g mouse on
+setw -g monitor-activity on
+
+## Panes
+
+# Split panes
+bind-key v split-window -h
+bind-key s split-window -v
+
+# Use Alt-vim keys without prefix key to switch panes
+bind -n M-h select-pane -L
+bind -n M-j select-pane -D
+bind -n M-k select-pane -U
+bind -n M-l select-pane -R
+
+# Use Alt-arrow keys without prefix key to switch panes
+bind -n M-Left select-pane -L
+bind -n M-Right select-pane -R
+bind -n M-Up select-pane -U
+bind -n M-Down select-pane -D
+
+# Shift arrow to switch windows
+bind -n S-Left previous-window
+bind -n S-Right next-window
+
+# Set current window pane to 80 columns
+bind-key 8 resize-pane -x 80
+
+## Text manipulation
+
+# vim-like copy/paste
+setw -g mode-keys vi
+
+bind [ copy-mode
+bind ] paste-buffer
+
+# copy/paste with xclip
+bind-key -Tcopy-mode-vi y send-keys -X copy-pipe-and-cancel 'xclip -sel clip -i'
+
+# buffer
+bind Space choose-buffer
+
+## Meta
+
+# Reload tmux config
+bind r source-file ~/.tmux.conf
+
+# status line text
+set -g status-left-length 30
+set -g status-left ' #(whoami)@#(hostname) | '
+set -g status-right '~%Y.%m.%d..%H.%M '
+
+# white-ish background with dark-grey text
+set -g status-style bg=colour0
+set -ag status-style fg=colour13
+
diff --git a/lib/vimrc b/lib/vimrc
new file mode 100644
index 0000000..f585f90
--- /dev/null
+++ b/lib/vimrc
@@ -0,0 +1,106 @@
+""" General settings
+set autoindent
+set backspace=indent,eol,start
+set complete-=i " Set the matches for insert mode completion
+set encoding=utf-8 " Set encoding
+set expandtab " Use spaces instead of tabs
+set formatoptions+=j " Delete comment character when joining commented lines
+set hlsearch " Highlight all search results
+set laststatus=1 " No status line
+set ignorecase " Ignore cases when searching
+set incsearch " Incremental search
+set linebreak " Break lines at word (requires Wrap lines)
+set nowrap " Don't add an actual linebreak when wrapping
+set ruler " Show line & col number of cursor position
+set shiftwidth=4 " Number of auto-indent spaces
+set showmatch " Highlight matching brace
+set smartcase " Better searching btw cases
+set smartindent " Autoindent when starting a new line
+set smarttab " Tab insertion & deletion
+set tabstop=4 " One tab = 4 spaces
+set textwidth=80 " Line wrap (number of cols)
+set visualbell " Use visual bell (no beeping)
+set wildmenu " Helpful completion menu
+
+" Strings to use in 'list' mode and for the :list command
+set listchars=tab:>\ ,trail:-,extends:>,precedes:<,nbsp:+
+
+""" Enable syntax
+if has('syntax') && !exists('g:syntax_on')
+ syntax enable
+endif
+
+""" Make , the leader key
+let mapleader = ","
+
+" easy escape
+imap fd <Esc>
+
+" send to ix.io
+noremap <silent> <leader>i :w !ix<CR>
+
+" edit files and buffers, relative to local
+nmap ,e :edit
+nmap ;e :edit <C-R>=expand("%:h") . "/" <CR>
+nmap ,o :buffer
+nmap ;o :buffer <C-R>=expand("%:h") . "/" <CR>
+
+" list buffers
+nmap ,l :ls<cr>
+
+" kill buffer
+nmap ,k :bdelete<cr>
+
+" insert current date
+nmap <silent> ,d :r !date +\%Y.\%m.\%d<cr>
+nmap <silent> ,D :r !date +\%Y.\%m.\%d..\%H.\%M.\%S<cr>
+
+" grep (ripgrep)
+nmap ,g :Rg
+
+" clear out trailing whitespace and lines ending in whitespace
+nmap <silent> ,w :%s/[\t ]\+$//e<cr>
+
+" Use <C-L> to clear the highlighting of :set hlsearch.
+if maparg('<C-L>', 'n') ==# ''
+ nnoremap <silent> <C-L> :nohlsearch<C-R>=has('diff')?'<Bar>diffupdate':''<CR><CR><C-L>
+endif
+
+" trailing spaces are always bad
+syntax match Warning display "\s\+$"
+" mixed tabs and spaces
+syntax match Warning display " \+\t"
+syntax match Warning display "\t\+ "
+
+" mark columns 80 and 81 in red for long lines...
+match ErrorMsg /\%80v.\%81v./
+
+""" Easily find cursor with crosshair (,c)
+:hi CursorLine cterm=NONE term=reverse ctermbg=7 guibg=Grey90
+:hi CursorColumn cterm=NONE term=reverse ctermbg=7 guibg=Grey90
+:nnoremap <Leader>c :set cursorline! cursorcolumn!<CR>
+
+""" File browser
+let g:netrw_banner=0 " Disable file browser banner
+let g:netrw_liststyle=3 " Tree view
+
+""" CTAGS shortcuts
+" open definition in a new tab:
+map <C-\> :tab split<CR>:exec("tag ".expand("<cword>"))<CR>
+" open definition in a vertical split:
+map <A-]> :vsp <CR>:exec("tag ".expand("<cword>"))<CR>
+
+""" Colors!
+set termguicolors
+let &t_8f = "\<Esc>[38;2;%lu;%lu;%lum"
+let &t_8b = "\<Esc>[48;2;%lu;%lu;%lum"
+
+""" Plugins with vim-plug
+" 2019.06.11: disabling b/c I'd rather just use nix/home-manager for vim
+" plugins, but this is nice code to have for reference too
+"if empty(glob('~/.vim/autoload/plug.vim'))
+" silent !curl -fLo ~/.vim/autoload/plug.vim --create-dirs
+" \ https://raw.githubusercontent.com/junegunn/vim-plug/master/plug.vim
+" autocmd VimEnter * PlugInstall --sync | source $MYVIMRC
+"endif
+"so ~/.vim/plugins.vim
diff --git a/lib/xmonad.hs b/lib/xmonad.hs
new file mode 100644
index 0000000..8b93acc
--- /dev/null
+++ b/lib/xmonad.hs
@@ -0,0 +1,157 @@
+{-
+
+Docs:
+
+- EZConfig: https://hackage.haskell.org/package/xmonad-contrib-0.13/docs/XMonad-Util-EZConfig.html#g:3
+- Media keys: https://hackage.haskell.org/package/X11-1.9/docs/Graphics-X11-ExtraTypes-XF86.html
+- Audio control: https://xmonadhaskell.wordpress.com/2018/10/24/xmonad-audio-control/
+
+- XMonad API: https://hackage.haskell.org/package/xmonad
+- Contrib API: https://hackage.haskell.org/package/xmonad-contrib
+
+-}
+
+import Graphics.X11.ExtraTypes.XF86
+import XMonad
+import XMonad.Actions.CopyWindow
+import XMonad.Config
+import XMonad.Hooks.EwmhDesktops (ewmh)
+import XMonad.Hooks.ManageDocks
+import XMonad.Layout.BinarySpacePartition
+import XMonad.Layout.Dwindle as Dwindle
+import XMonad.Layout.LayoutModifier
+import XMonad.Layout.NoBorders
+import XMonad.Layout.ResizableTile
+import XMonad.Layout.Spacing
+import XMonad.Layout.Spiral
+import XMonad.Layout.Tabbed
+import XMonad.Layout.TwoPane
+import XMonad.Util.CustomKeys (customKeys)
+import XMonad.Util.EZConfig (additionalKeys)
+
+-- Colors
+data Colors = Colors
+ { foreground :: String
+ , background :: String
+ , highlight :: String
+ }
+
+lightTheme = Colors
+ { highlight = "#67b11d"
+ , background = "#f6f1e1"
+ , foreground = "#655370"
+ }
+
+darkTheme = Colors
+ { highlight = "#5d4d7a"
+ , background = "#292b2e"
+ , foreground = "#b2b2b2"
+ }
+
+getColorsFromXtheme :: IO Colors
+getColorsFromXtheme = do
+ x <- readFile "/home/ben/.local/share/xtheme"
+ return $ case filter (/= '\n') x of
+ "light" -> lightTheme
+ "dark" -> darkTheme
+ _ -> darkTheme
+
+nixBin :: String
+nixBin = "/home/ben/.nix-profile/bin/"
+
+altMask :: KeyMask
+altMask = mod1Mask
+
+insKeys :: XConfig l -> [((KeyMask, KeySym), X ())]
+insKeys conf@(XConfig {modMask = modMask}) =
+ [ ((modMask, xK_y), spawn $ nixBin <> "passmenu")
+ , ((modMask, xK_m), spawn "cmdtree")
+ , ((modMask, xK_o), spawn "cmdtree")
+
+ -- restart xmonad nia home-manager
+ , ((modMMask, xK_r)
+ , spawn "$HOME/.nix-profile/bin/xmonad --recompile && $HOME/.nix-profile/bin/xmonad --restart")
+
+ -- sticky windows
+ , ((modMask, xK_a ), windows copyToAll) -- @@ Make focused window always visible
+ , ((modMask .|. shiftMask, xK_a ), killAllOtherCopies) -- @@ Toggle window state back
+
+ -- media/ function keys
+ -- backlight
+ , ((0, xK_F5), spawn "xbacklight -dec 5")
+ , ((0, xK_F6), spawn "xbacklight -inc 5")
+ , ((0, xF86XK_KbdBrightnessDown), spawn "xbacklight -dec 5")
+ , ((0, xF86XK_KbdBrightnessUp), spawn "xbacklight -inc 5")
+ -- volume controls
+ , ((0, xK_F1), amixer "toggle")
+ , ((0, xK_F2), amixer "2%+")
+ , ((0, xK_F3), amixer "2%-")
+
+ , ((0, xF86XK_AudioMute), amixer "toggle")
+ , ((0, xF86XK_AudioLowerVolume), amixer "2%-")
+ , ((0, xF86XK_AudioRaiseVolume), amixer "2%+")
+ ]
+
+amixer :: String -> X ()
+amixer cmd = spawn $ "amixer -q sset Master " <> cmd
+
+-- | Golden-ratio spiral
+goldenSpiral :: SpiralWithDir a
+goldenSpiral = spiral (6 / 7)
+
+myWorkspaces :: [String]
+myWorkspaces = ["1[chat]", "2[emacs]", "3[work]", "4[dandel]", "5[sabten]", "6[study]"] ++ map show [7 .. 9]
+
+addSpace :: l a -> ModifiedLayout Spacing l a
+addSpace = spacingRaw
+ True (Border 5 5 5 5)
+ True (Border 5 5 5 5)
+ True
+
+myTabCfg theme = def
+ { fontName = "xft:Fira Sans:size=10:ant"
+ , activeBorderColor = highlight theme
+ , inactiveBorderColor = background theme
+ , activeColor = highlight theme
+ , inactiveColor = background theme
+ }
+
+myLayout theme = avoidStruts $
+ noBorders (tabbed shrinkText $ myTabCfg theme)
+ ||| tiled
+ ||| Mirror tiled
+ ||| noBorders Full
+ ||| twopane
+ ||| Mirror twopane
+ ||| emptyBSP
+ ||| goldenSpiral
+ ||| Spiral L Dwindle.CW (3/2) (11/10) -- L means the non-main windows are put to the left.
+ where
+ -- The last parameter is fraction to multiply the slave window heights
+ -- with. Useless here.
+ tiled = addSpace $ ResizableTall nmaster delta ratio []
+ -- In this layout the second pane will only show the focused window.
+ twopane = addSpace $ TwoPane delta ratio
+ -- The default number of windows in the master pane
+ nmaster = 1
+ -- Default proportion of screen occupied by master pane
+ ratio = 1/2
+ -- Percent of screen to increment by when resizing panes
+ delta = 3/100
+
+myConf theme = additionalKeys c (insKeys c)
+ where c = def
+ { modMask = mod4Mask -- ^ super instead of alt
+ , normalBorderColor = background theme
+ , focusedBorderColor = highlight theme
+ , borderWidth = 3
+ , manageHook = manageDocks <+> manageHook def
+ , layoutHook = myLayout theme
+ , terminal = "/home/ben/.nix-profile/bin/xterm"
+ , workspaces = myWorkspaces
+ }
+
+main :: IO ()
+main = do
+ theme <- getColorsFromXtheme
+ xmonad $ ewmh $ docks $ myConf theme