Everyone loves setting up their system from scratch as easy as possible. Because of this, much smarter than me people has come up with the idea of dotfiles. A collection of scripts, configuration-files and system settings that can make your whole system installation and configuration as seamless as possible. My final goal with this “project” of sorts is to be able to install fresh Debian, run one master .sh file and then just wait couple of hours unitl everything is getting ready by itself…time in which I can, I don’t know, drink tea and watch movies or something.
Please! Do not run any of my scripts without understanding what they do. Look at the config files and choose the settings that you like and discard those you don’t. Creating (steeling form somebody else) your own dotfiles is pretty much an art.
For now I’ve chosen to use Debian as my primary distro. This may seem a little bit controversial but I feel comfortable with it and I have never used the AUR so I don’t know what am I missing. If I want to use something that is on the AUR and it is not present in the Debian repositories, I just compile it myself. I’ve actually written a separate tool (code-manager) that can pull repos from Github (or whatever) and compiles\installs them automatically.
Some of the relevant things that I currently use for my system setup:
- i3-gaps - A tiling windows manager. No Desktop Environment here!
- i3blocks - A status bar with easy to use configuration.
- i3lock - A screen locker.
- compton - A windows compositor for that sweet sweet transparency.
- urxvt - A suckless and minimal terminal emulator
- ranger - Terminal based file manager.
- rofi - An application launcher.
- qutebrowser - A mouse oriented browser.
- Emacs - Yes, I am in that tribe. I also write my own packages for Emacs so.. yeah, I am knee deep in it.
- pamixer and playerctl(a systemd thing) - for controlling audio and media playback over Dbus.
- dunst - a lightweight notification-daemon.
All of those (and a few more) things add up to create a comfy environment where everything is setup to my tastes, I can preform almost any action through the keyboard and I can be much more productive than when I am using Windows or some DE (Desktop Environment). A few screenshot for visual representation of my system:
Note: As said, I use Debian and my dotfiles and system setup will probably work only on it as I have a few Debian specific things. Use the dotfiles on other systems at your own risk!
There are a few ways to download the setup the whole thing. If your system is fully fresh and you don’t even have git on your system, you can run:
curl -LOs https://gist.githubusercontent.com/palikar/02e1d0e3c14e63bdf80a12d484ce9f46/raw/c5e0851bd814bc5ebbe89da8a60b8d59e9825cfb/install_setup.sh
sudo bash install_setup.sh
This is this gist of mines. Of course this relies on curl.
If you, however, already have git, you can just clone the repo and run the install.sh
script. My recommended way of doing that is.
cd ~
mkdir code && cd code
git clone https://github.com/palikar/dotfiles
cd dotfiles
sudo bash setup_all.sh
This “should” setup almost everything. I keep all of my configuration files in the directory of the repository and just create symbolic links at the right places. This way I have quite the separation between the used system and all of the configuration for it.
As you may see, I have quite a lot of files that I use for my system. I don’t have the time to go over each of them but I can present some short explanations on some of them.
A list of somewhat important configuration files:
.emacs
- init file for Emacs. Doesn’t do that much on its own. The file loads a separate configuration file for Emacs written in org-mode – myinit.org.vimrc
- very basic vim configuration. I took it form “the internet”..Xdefaults
- sets up the colors and XResources for the XSession and it’s used by urxvt as a config file..paths
- every line here must be directory. The directories in the file will be added to your PATH automatically.emacs_packages.txt
- A list of emacs packages that I want installed and present in my Emacs. The file is used by a script that updates the file and the an Emacs configuration file so that every time I launch Emacs, all of the packages will be checked. I something is not installed, it gets installed automatically.apt_packages.txt
- A list of apt packages that I want to have on my system. The packages will be installed upon system setup by theinstall.sh
script.system-config/.bash_aliases
- some useful abbriviations for certain commands in the terminalsystem-config/.bash_prompt
system-config/.env
- setting up some basic environment variablessystem-config/.bashr
- this file will be evaluated every time you launch bash.system-config/.profile
- the file will be evaluated upon starting the session.system-config/.inputrc
- some minor fixes for better typing in the terminal.gitconfig
- makinggit
more pleasant to work with. Mainly diffetent abbreviations for git-commands. Also sets up my email-address for git commits. This is important! Change the address if you are going to use the file.
The important “linux” files are in folder .
The folder contains couple of bash scripts that will be sourced by .bashrc
. Fzf is a command-line fuzzy finder and it provides some useful features for those of us that spend a lot of time looking at the terminal. The command that I regularly use are:
Keybinding | Command |
---|---|
Alt-c |
Fuzzy change directory. It will recursively find all directories from the current one onward and it will prompt you choose one. |
C-r |
Fuzzy search for previous command. List all commands in the bash history and choose one |
C-t |
Fuzzy select file. List all files in the subdirectories and prompts you to choose one. |
On Linux a lot of applications create their own folders with configuration files and those are usually created in the ~/.config
folder. I don’t care about all of the applications’ configurations on my system so I don’t version control the whole ~/.config
folder but rather only parts of it. Some of the more important things in there are:
code_manager/
- configuration files, cache and install scripts for a tool for package management that I’ve written in python. For more information, check out the repository.compton/
- configuration files of Compton.dunst/
- Dunst configuration that makes the notifications that pop up somewhat prettyfeh/
- feh is an image viewer that I use for… setting my background (no joke). And yeah, I also use if as image viewer sometimes so I need some basic keybindings.gitk/
gitk is a Git repository browser. Very convenienti3/
- This contains probably the most important configuration file for my system – the configuration for the windows manager.i3blocks/
- again a single configuration file that specifies how the status bar of the system should look like. The configuration uses a lot of the scripts in.scripts/
directory.khal/
- khal is a CLI calendar application.ranger/
- the configuration files of my file managerqutebrowser/
- the configuration files of my file browserrofir/
- configuration mainly to “prettify” rofi
2
The folder <.scripts> contains… a lot of stuff. There I put scripts needed by some part of the system. The folder is in the path so everything can be easily executed on command line. There are a lot of scripts in there and a lot of them are self-explanatory. For sake of completeness though…:
battle
- opens a bunch of stuff that I found myself opening manually when I sit on my computer.i3battery
- used by i3blocks to display battery information of a laptopi3calendar
- used by i3blocks for the current datei3cputemp
- used by i3blocks for some processor informationi3currentson
- used by i3blocks to display the currently played by Spotify songi3ipadress
- used by i3blocks to display your local IP addressi3playerctrl
- used by i3blocks to display the status of the media playeri3ramusage
- used by i3blocks to display info about the RAMi3resize
- used by i3-gaps to intuitively resize windowsi3spotifyupdate
- used as a daemon to gather information coming from Spotify and notify i3blocksi3systeminfo
- used by i3blocks to bring together RAM and CPU infoi3volume
- used by i3blocks to display the current volumei3weather
- used by i3blocks to display the current weather informationi3wifi
- used by i3blocks to display the current wifi statusi3xautolock
- used as daemon to lock the computer after certain amount of inactivitylmc
- used by i3blocks control median and soundlockscreen
- used by i3-gaps to lock the computernetworkmanager_dmenu
- used to easy manage network connections. Check out here.pathloader
- used by.profile
to load paths from.paths
prompt
- used by i3-gaps as a generic way to prompt something by dmenu.rofi-xrandr
- used for easily configuring two displays. Uses xrandr.samedir
- opens a new terminal in the same directory as the current onesetupxkbd
- sets up keyboard layout thingsshortcuts
- sets up shortcuts for bash (in form of aliases), qutebrowser and ranger. Full credit goes to Luke Smith.texclear
- deletes all files generated when compiling a .tex filetoggletouchpad
- disables the touchpad on a laptopunix
- Find out yourself. This is… not for normies.updateaptpack
- Updatesemacs_packages.txt
with the currently installed by Emacs packagesupdateemacspack
- Updatesapt_packages.txt
with the currently installed packages on the system.
I’ve been using EMACS for a while now. Before my config was just a random snippets of code that I’ve found online. Now, it’s beautifully sorted random snippets of code that I’ve found online, all put together nicely on a formatted .org
file. The .emacs
file is there just to load myinin.org. There, in literate programming style, is my actual init file. There are even some explanations around some of the the snippets and everything is categorized. If you use Emacs you can open the file and experience it in all it’s beauty. The whole Emacs configuration probably deserves its own repository but oh well. More information on the Emacs config – EMACS.md . This is actually the configuration itself but exported to markdown file
For my Debian system I use diffetent sources for the apt-packages from those the come with the system. My sources.list
files are in the package-sources directory of the repository. Upon installation of the dot files hey….the are still nice.
For my dotfiles I’ve extensively taken inspiration from:
- Mathias Bynens and his dotfile
- This very good post on starting up with dotfiles
- Recently I’ve changed my Bash Prompt and made it pretty much like this guy’s(KeizerDev) one.
- A LOT of the scripts were first taken form Luke Smith’s voidrice. Also, go check out this Youtube’s channel for some non-normie content.