/dotfiles

My personal dotfiles - GNU stow version

Primary LanguageEmacs LispOtherNOASSERTION

Dotfiles

.assets/neofetch.png

This repository contains my personal dotfiles managed with GNU stow. I made some additions heavily inspired by xero’s dotfiles.

The main reason I chose GNU stow is it’s minimal dependencies. I used homesick before but it requires ruby. Choosing GNU stow made moving to Gentoo much easier and faster. On the other hand, a lot of nice commands, especially the track command, are missing.

This repo is not meant to be used verbatim. These are my personal dotfiles and they only work for my setup. But if you are crafting your own dotfiles, you might find one or two interesting things in here.

Features:

  • alsa config to set my soundcard (hardware dependent)
  • dunst notification daemon config
  • Emacs configuration using Spacemacs
  • Fonts
  • fun shell scripts
  • Gentoo management scripts
  • git configuration
  • gtk configuration to set the theme
  • htop configuration
  • i3 tiling window manager configuration which makes heavy use of modes
  • ncmpcpp ncurses mpd client configuration
  • notmuch for mail
  • parcellite clipboard manager configuration
  • polybar status-bar configuration
  • pdb python debugger configuration
  • browser startpage
  • tmux terminal multiplexer configuration
  • steamlink-twitch-gui configuration
  • wallpapers
  • x11 startx and .Xresources script for urxvt and rofi
  • xdg configuration for mimetypes and user directories
  • xmodmap configuration to make Cap Lock a second Ctrl key
  • zsh configuration using zplug

This repo deprecates: storaxcastle emacs-castle zsh-castle i3-castle

Installation

GNU stow is very easy to use. For each directory in this repo, you simply call:

stow -t ~/ -D <directory>

I added a simple script to automate most of the required steps.

./install.zsh

Packages

Here is some little documentation about each package.

emacs

The main features:

  • spacemacs with vim bindings.
  • helm over ivy because helm has a couple of advanced features that are quite nice. Although I have to say ivy looks very good but so far there was no reason to change.
  • magit completely replaces the git commandline interface or any other GUI.
  • org-mode for taking notes, and organizing. Agendas etc have been configured but I rarely use it anymore.
  • zenburn: I like low contrast themes and this on of the best.
  • python has the most configuration because it is my main programming language.
  • some ‘advanced’ yasnippets
  • notmuch for mail
  • icons for dired/helm-find-file/modes/…
  • helm-dash for browsing documentation

I’ve written some emacs plugins that I sometimes use (or use at work):

  • org-tfl: Transport for London meets org-mode
  • emaci: A silly CI-server inside emacs
  • lame: Manual task streamlining

Python

I use the spacemacs python layer with a couple of customizations. Running tests has been customized to run tests at point/module/project with tox and pdb.

The GUD interface has been extended. There is support for setting breakpoints at point, printing variables/region and a couple helm sources for navigating breakpoints etc. Most of the pdb functions are accessible via keybindings. It’s not as good as pudb but I like it as I can stay in emacs and browse files with all my keybindings and settings.

i3

My i3 config is simple but I love it.

Startscreen: .assets/startscreen.jpg

Rofi run menu: .assets/rofi.png

Requirements

  • urxvt as a terminal emulator
  • feh for wallpapers
  • rofi for dmenu and window selection
  • roficlip for clipboard selection
  • i3lock for screensaver/lock screen
  • ncmpcpp for starting the music client
  • mpc for controlling the mpd media player daemon
  • alsa-utils for controlling the volume
  • xbacklight for controlling the display brightness
  • unclutter to hide the mouse after a period of inactivity
  • gnome-settings-daemon
  • compton as a composite manager to render transparency
  • polybar as a statusbar replacement
  • xautolock for activating i3lock
  • xset for setting display sleep mode

Keybindings

The keybindings rely heavily on modes. The default mode only has one keybinding AltR (as in the right ALT key) configured to enter the main mode. You can always go back to the default mode with ESC or SPC

I chose this setup because I mostly have to press one key at a time. SPC is always in reach, so quitting is really fast and becomes part of the muscle memory really fast.

Backspace will always go to the parent mode. Escape will always go to the default mode.

For moving i j k l is used in multiple contexts.

F-12 is bound in default mode and switches to my ‘quiet place’. It is the startscreen shown above, which is a transparent urxvt terminal. I was a big fan of dropdown consoles. When they are semitransparent you can type while reading something. But I now use this only for certain actions. In other cases I quickly open a new terminal side by side the browser/other application.

Main mode

To enter the main mode press AltR. This gives you quick access to switch focus and workspaces. Other modes can be entered from here.

KeyAction
i j k lfocus up/left/down/right
0-9switch workspace
Returnopen terminal
drofi run mode
Qquit application
;i3-message
croficlip
ffocus mode
mmove mode
rresize mode
tlayout mode
xsystem mode
wworkspace mode
Focus mode

Mode focus changing keybindings

KeyAction
i j k lfocus up/left/down/right
0-9switch workspace
pfocus parent
cfocus child
ftoggle between floating focus
drofi window mode
Tabnext workspace
S-Tabprevious workspace
mmove mode
Move mode

Move windows

KeyAction
i j k lmove up/left/down/right
0-9move to workspace
tfloating toggle
ffocus mode
Resize mode

Resize windows

KeyAction
i j k lresize window in direction
ffullscreen
hhide
sshow
Layout mode

Change layouts

KeyAction
i j k lfocus up/left/down/right
pfocus parent
cfocus child
ffullscreen
ddefault layout
hhorizontal split
vvertical split
sstacking
wtabbed
etoggle split
tfloating toggle
mmove mode
Workspace mode

Manage workspaces

KeyAction
rrename workspace
Tabnext workspace
S-Tabprevious workspace
drofi workspaces mode
0-9swith to workspace
System mode
KeyAction
eexit mode
ssound mode
ddisplay mode
llock
rrestart i3
creload i3 config
Exit mode
KeyAction
llock
elogout
hhibernate
Rreboot
Pshutdown
Sound mode
KeyAction
ivolume up
kvolume down
mmute
sncmpcpp
pplay/pause
jprevious song
lnext song
Display mode
KeyAction
ibrightness up
kbrightness down

Credits

This config is heavily inspired by syl20bnr’s config. It helped me a lot putting this together.

notmuch

notmuch is my email system of choice. It is very fast, has good Emacs integration and nice plugins. For sending emails I use msmtp and for receiving email isync. I won’t post the config files for those, as they contain sensitive information. Notmuch uses a tagging system instead, which is fast and powerful.

I lost my old notmuch config, so for now the tagging is quite basic.

Requirements

  • notmuch
  • isync
  • msmtp
  • recode

Notifications

I have a cronjob that runs every 10 minutes and checks for new mails. Checking for new mails will also notify in case of unread mails. To set it up edit your crontab:

crontab -e

Add the following line to it:

*/30 * * * * /bin/zsh -c "export DISPLAY=:0; notmuch new" > /dev/null 2>&1

This calls the notify script notmuch/bin/notmuch-notify. Edit this file for custom searches.

polybar

.assets/polybar2.jpg With active i3 mode: .assets/polybar.jpg

From left to right:

  • workspaces
  • i3 mode line
  • mpd status
  • download/upload speed
  • wifi connectivity
  • CPU usage
  • temperature
  • volume
  • battery
  • brightness
  • date/time
  • tray icons

tmux

.assets/tmux.jpg

I mostly use the Tmux Plugin Manager with a bunch of plugins:

  • tmux-sensible: Basic tmux settings everyone can agree on.
  • tmux-prefix-highlight: Plugin that highlights when you press tmux prefix key Plugin that highlights when you press tmux prefix key.
  • tmux-resurrect: Persists tmux environment across system restarts.
  • tmux-continuum: Continuous saving of tmux environment. Automatic restore when tmux is started. Automatic tmux start when computer is turned on.
  • tmux-sessionist: Lightweight tmux utils for manipulating sessions.
  • tmux-pain-control: Standard pane key-bindings for tmux.
  • tmux-yank: Tmux plugin for copying to system clipboard. Works on OSX, Linux and Cygwin.

zsh

.assets/zshprompt.jpg

For zsh I migrated from antigen to zplug. The installation is completely automated. At the moment I use these plugins:

zplug list
plugins/cp => from:"oh-my-zsh"
zsh-users/zaw => none
zsh-users/zsh-completions => none
plugins/python => from:"oh-my-zsh"
themes/kphoen => as:"theme", from:"oh-my-zsh"
plugins/pip => from:"oh-my-zsh"
plugins/dirhistory => from:"oh-my-zsh"
plugins/copydir => from:"oh-my-zsh"
b4b4r07/zsh-vimode-visual => defer:"3"
zsh-users/zsh-syntax-highlighting => defer:"2"
plugins/copyfile => from:"oh-my-zsh"
plugins/emacs => from:"oh-my-zsh"
plugins/colored-man-pages => from:"oh-my-zsh"
plugins/vagrant => from:"oh-my-zsh"
plugins/nyan => from:"oh-my-zsh"
plugins/colorize => from:"oh-my-zsh"
rupa/z => use:"z.sh"
plugins/gem => from:"oh-my-zsh"
plugins/command-not-found => from:"oh-my-zsh"
plugins/sudo => from:"oh-my-zsh"
plugins/git-flow => from:"oh-my-zsh"
plugins/git => from:"oh-my-zsh"

.zshrc only contains a list of files to source. The order matters for some files. I use vim bindings with a right prompt to signal the normal or insert mode.