dotfiles/README.org
2019-10-14 13:51:05 +02:00

25 KiB
Raw Blame History

Phundraks dotfiles

Presentation

https://cdn.rawgit.com/syl20bnr/spacemacs/442d025779da2f62fc86c2082703697714db6514/assets/spacemacs-badge.svg

This is my collection of dotfiles for my daily GNU/Linux environment, tweaked to my liking. If you wish to get the same setup as mine, follow the instructions below.

As you can see, I personally use fish as my shell of choice, and Emacs using Spacemacs (still with Emacs keybinding) as my main text editor.

I also use Resloveds fork of i3-gaps with two polybar bars and Tryone144s fork of Compton. The colors scheme for rofi, Emacs and polybar are chosen from the wallpapers using pywal.

Features

  • Emacs configuration perfectly tailored for my own use
  • Beautiful and comfy i3 and polybar configuration
  • And enough information below to get basically the same distro install as I have on my main computer and my travel laptop.

Screenshots

/phundrak/dotfiles/media/commit/eec74ab1b27149ab09593a152f62d442ff13740c/img/neofetch.png
Desktop with Neofetch in the terminal
/phundrak/dotfiles/media/commit/eec74ab1b27149ab09593a152f62d442ff13740c/img/emacs.png
Desktop with Emacs opened
/phundrak/dotfiles/media/commit/eec74ab1b27149ab09593a152f62d442ff13740c/img/rofi.png
Desktop with Rofi

Dependencies

Of course, some dependencies are needed for my dotfiles to work well. Here is a non-exhaustive list of software needed by these configuration files:

And some other stuff scattered around in my dotfiles.

BTW, I use Arch.

Installation

Here will be presented what I do to get my system up and running on a fresh Arch Linux install. These installation instructions were written in order to get an Arch Linux distribution up and running with the same configuration as my main computers and my travelling laptops configuration.

Install Arch Linux

I usually install Arch from the vanilla ISO, however I began using archfi to install easily the distro (Ive done it so many times, I know how it works now). Usually, my distros will be installed on at least two partitions, one dedicated to /home, the other to the root partition /.

If the computer supports EFI bootloaders, the EFI partition will be mounted on /boot. I generally use rEFInd as my boot manager, but if you are more comfortable with another one, just install what you want. Be aware that if you format your /boot partition, you will delete all boot managers that already exist; so, if you are dual-booting, DO NOT FORMAT IT. Yes, I made the mistake of wiping the Windows boot manager.

The swap partition is always at least 4GB large, and I should have a total of 12GB of combined RAM and swap. This means on my main computer I have 16GB of RAM and 4GB of swap, but on my thinkpad I have 4GB of RAM and 8GB of swap.

Get the latest live system with fast mirrors

When you boot into the live ISO, execute the following command:

  pacman -Syu reflector
  reflector --country France --country Germany --latest 200 \
            --protocol http --protocol https --sort rate \
            --save /etc/pacman.d/mirrorlist

This will update the packages from your live ISO, and you will get the best mirrors for your installation. Of course, change the countries accordingly to your location.

Install the system

Then you can use a custom script to ease your installation of Arch if you do not wish to do it manually. Personally, Ive done it several times already, I know how the distro works, I just want to be able to install my distro quickly now.

  wget archfi.sf.net/archfi
  # Or from matmoul.github.io/archfi if SourceForge is down
  sh archfi

Then, follow the instructions and install Arch Linux. Take the opportunity to install as many packages as you need, mainly yay which I use as my package manager (it is just a wrapper for pacman) and AUR helper.

Once your system is installed, reboot and remove your installation media from your computer.

Install yay if it hasnt been done during the system installation

Next step is to install the AUR helper yay. DO NOT use yaourt, it is discontinued, seriously updated and represents a serious security flaw.

Lets clone yay in a folder fromGIT that will be in our home folder. This is also where well download every other packages well install from git.

  mkdir -p fromGIT
  cd fromGIT
  git clone https://aur.archlinux.org/yay.git
  cd yay
  makepkg -si --noconfirm

We now have our AUR helper!

Update the system

Congrats, Arch is now installed on your system! But we are not done yet. Lets update the system, just in case some packages were updated during the installation. And lets install yadm (our dotfiles manager) and emacs while were at it.

  yay -Syua yadm emacs python-envtpl-git

Set up yadm

yadm is my dotfiles manager. It has some very interesting, including host and machine-specific files and file content, as can be seen in .config/i3/config##yadm.j2. It also manages some files system-wide (well, actually home-wide), so you usually dont have to symlink anything.

For some reason, when Im in i3, polybar crashes when I run any yadm command, so I made the C-S-p shortcut to relaunch it at will.

Get the dotfiles

You should clone the dotfiles with the help of yadm. For that purpose, you can execute either of the two following commands.

  • From labs.phundrak.fr:

      yadm clone https://labs.phundrak.fr/phundrak/dotfiles.git
  • From Github:

      yadm clone https://github.com/phundrak/dotfiles.git

To decrypt the encrypted files, run the following command:

  yadm decrypt

It will ask the passphrase.

Update the remotes

Now, lets make sure we have the correct remotes set up for the dotfiles.

  yadm remote set-url origin https://labs.phundrak.fr/phundrak/dotfiles.git
  yadm remote add github https://github.com/phundrak/dotfiles.git

You can swap the two links if you feel more comfortable with Github as the origin remote, just rename the github remote to something like phundraklabs or something like that.

If you have already generated (or copied, but dont do that) your SSH keys and uploaded them to Github and/or to Phundrak Labs, you can use the following urls instead as the remotes urls.

  git@labs.phundrak.fr:phundrak/dotfiles.git
  git@github.com:phundrak/dotfiles.git

Get our git submodules

Our dotfiles rely on a couple of submodules we should get. Lets download them.

  yadm submodule update --init --recursive

Generate the alt dotfiles

We will need to generate the host-specific dotfiles. We can run the following command:

  yadm alt

And with that, we should have all of our dotfiles placed where they need to be!

Set up Emacs

Now that we have our dotfiles installed, lets set up Emacs. First, lets download Spacemacs.

  git clone https://github.com/syl20bnr/spacemacs ~/.emacs.d

In our .emacs.d directory, lets switch Spacemacs branch to develop.

  git checkout develop

The rest of this READMEs code blocks should now be executable from Emacs itself, and we should be able to have a perfectly running Emacs installation. Thats the power of Org-mode!

Install our needed packages

Now, we can install all the packages I usually have installed on my computer.

  yay -S --needed asar ascii aspell-en aspell-fr assimp autoconf automake \
      awesome-terminal-fonts bash bat biber binutils bison bleachbit \
      bluez-firmware bluez-utils bookworm boost bzip2 chromium clisp compton \
      coreutils cppcheck cppreference cppreference-devhelp cpupower cronie \
      cryptsetup cups device-mapper dhcpcd diffutils discord-canary discount \
      ditaa dmenu dmenu-lpass docker docker-compose doxygen dunst dwarffortress \
      e2fsprogs emacs exfat-utils fakeroot feh ffmpegthumbnailer file \
      filesystem findutils fingerprint-gui firefox fish flake8 flex \
      font-mathematica fontforge freeglut fzf gawk gcc gcc-libs gdb gettext \
      gimp git glibc gnome-disk-utility gnome-epub-thumbnailer gnu-free-fonts \
      gnuplot go-tools grep gzip htop i3-gaps i3lock-blur i3status icecat-bin \
      igdm-bin inetutils intel-ucode iproute2 iputils j4-dmenu-desktop \
      jfsutils jmtpfs lastpass-cli less libnewt libtool licenses light \
      linux-headers lldb logrotate lsof lvm2 m4 make man-db man-pages \
      mate-polkit mdadm meson minted mpc mpd mpd-rich-presence-discord-git mpv \
      mupdf-tools nano nasm ncdu ncmpcpp nemo-fileroller nemo-preview neofetch \
      netctl networkmanager networkmanager-openvpn nm-connection-editor nnn \
      nomacs noto-fonts-emoji npm ntfs-3g numlockx openmp openssh p7zip pacman \
      pacman-contrib pandoc-bin patch pavucontrol pciutils pcurses pdfpc perl \
      pkgconf polybar procps-ng psmisc pulseaudio-bluetooth python-envtpl-git \
      python-pip python-pywal qemu r raw-thumbnailer redshift refind-efi \
      reflector reiserfsprogs rofi rofi-wifi-menu-git rsync rtv rustup s-nail \
      samba scrot sdl2_gfx sdl2_image sdl2_mixer sdl2_ttf sed sent shadow \
      siji-git simplescreenrecorder speedcrunch sshfs st-luke-git sudo \
      sysfsutils systemd-sysvcompat tar texinfo texlive-bibtexextra texlive-bin \
      texlive-core texlive-fontsextra texlive-formatsextra texlive-games \
      texlive-humanities texlive-langchinese texlive-langcyrillic \
      texlive-langextra texlive-langgreek texlive-langjapanese \
      texlive-langkorean texlive-latexextra texlive-localmanager-git \
      texlive-music texlive-pictures texlive-pstricks texlive-publishers \
      texlive-science tmux tree  ttf-arphic-uming ttf-baekmuk \
      ttf-bitstream-vera ttf-dejavu  ttf-google-fonts-opinionated-git \
      ttf-joypixels ttf-liberation  ttf-material-design-icons-git ttf-ms-fonts \
      ttf-symbola  ttf-tibetan-machine ttf-twemoji-color ttf-unifont unicode \
      unicode-emoji  unrar usbutils util-linux valgrind vi vim vulkan-headers \
      w3m wget which  whois x11-ssh-askpass xclip xdg-user-dirs-gtk \
      xf86-input-wacom  xf86-video-intel xfce4-power-manager xfsprogs \
      xorg-server xorg-xinit xss-lock yadm graphviz xorg-xprop

Given how many packages will be install from the AUR, Ill probably have to type my password a few times.

For some reasons, if you directly install compton-tryone-git without installing compton first, the package wont work, which is why I made you install compton in the command above. Now you can install compton-tryone-git. It will replace compton, so say “yes” when it warns you about the package conflict and whether compton should be removed.

  yay -S compton-tryone-git

Enable and start some services

As you can see above, docker has been installed. Lets enable and start its service.

  systemctl enable docker
  systemctl start docker

I also usually add myself as a member of the docker group because I dont like prefixing every single docker command with sudo. So lets execute this command:

  sudo usermod -aG docker $USER

Depending on my machine, I might enable the SSH server shipped with openssh. Edit your /etc/ssh/sshd_config file as needed, then lets do that here:

  systemctl enable sshd
  systemctl start sshd

Install Fisher and our fish shell extensions

As mentionned above, I use the fish shell as my main shell. And I use some extensions too that I installed from fisher, and custom functions.First, lets install fisher:

  curl https://git.io/fisher --create-dirs -sLo \
  ~/.config/fish/functions/fisher.fish

Awesome! Now, onto the fisher packages:

  fisher add edc/bass franciscolourenco/done jethrokuan/fzf jethrokuan/z \
  jorgebucaran/fish-getopts laughedelic/pisces matchai/spacefish \
  tuvistavie/fish-ssh-agent

Now our fish shell is ready to rock! Plus, we already have our custom functions installed from our dotfiles!

Install packages from git

Now, we move on to the installation of git-based packages.

Install i3-gaps-rounded

I know we already installed i3-gaps from the AUR, why reinstall it? Well, that is certainly bad practices, but this allowed me to already have the needed dependencies for building i3 installed. Now, lets clone it, build it, and install it. It will required the password during the actual installation.

  git clone https://github.com/resloved/i3.git i3-gaps-rounded
  cd i3-gaps-rounded
  rm -rf build
  autoreconf --force --install
  mkdir build && cd build
  ../configure --prefix=/usr --sysconfdir=/etc --disable-sanitizers
  make
  sudo make install

Install Polybar Battery

I use a custom tool for my battery indicator which also launches a warning when the battery is low. However, I need to build it, since it is not available in the repos nor the AUR.

  git clone https://github.com/drdeimos/polybar_another_battery.git
  cd polybar_another_battery
  go get -u github.com/distatus/battery/cmd/battery
  make build

Lets also create the ~/.local/bin/ directory in which I will put some custom executables, including the executable we just built.

Download Reveal.JS

Now, lets download Reveal.JS. I use it for some of my Org presentations, and I set it so it is found in ~/fromGIT.

  git clone https://github.com/hakimel/reveal.js.git

Set your locale

Archs default locale configuration is crap. Like… really. It took me a while to figure out why some elements in polybar didnt work along with some other pieces of software. So, go and uncomment the locales youll use in /etc/locale.gen. I personally have en_US.UTF-8, fr_FR.UTF-8 and ja_JP.UTF-8 uncommented, but what you choose is really up to you. Then run the following command as sudo.

  locale-gen

Now you can edit your /etc/locale.conf file. Mine looks like this, edit it to fit your needs.

  LANG=en_US.UTF-8
  LC_COLLATE=C
  LC_NAME=fr_FR.UTF-8
  LC_NUMERIC=fr_FR.UTF-8
  LC_IDENTIFICATION=fr_FR.UTF-8
  LC_TELEPHONE=fr_FR.UTF-8
  LC_MONETARY=fr_FR.UTF-8
  LC_PAPER=fr_FR.UTF-8
  LC_ADDRESS=fr_FR.UTF-8
  LC_TIME=fr_FR.UTF-8
  LC_MEASUREMENT=fr_FR.UTF-8

Launch X

Aaaand we should finally be good to launch X for the first time! My installation logs me in the tty by default, and I do this by choice, I dont really like display managers or desktop environments. So, to launch i3, lets run startx.

Create some directories

Thanks to the dmount and dumount utilities, mounting and unmounting devices can be done very easily. And to add to some easiness, lets create a couple of directories dedicated to what we might mount on our computer:

  mkdir -p /mnt/{USB,CD,Android}

And in case we need to mount some ext4 partitions on these, lets change the ownership of these directories.

  sudo chown $USER:(id -g $USER) /mnt/{USB,CD,Android}

Install Rust

Install the toolchains

When using rust, I bounce between two toolchains, the stable toolchain and the nightly toolchain. To install them, I will use rustup which has already been installed.

  rustup default nightly

This will both download the nightly toolchain and set it as the default one. Yup, I like to live dangerously. Now to install the stable toolchain, lets run this:

  rustup toolchain install stable

The nightly toolchain is ironically updated about daily (hence the name… sort of?), so well often have to run the following command:

  rustup update

Install some utilities

Well need some utilities when developing Rust from Emacs, namely rustfmt and racer. Lets install them with cargo.

  cargo install rustfmt racer

Clean the pacman and yay cache

Finally, we are almost done! Lets clean the cache of pacman and yay

  yay -Sc --noconfirm

You should now run a system pretty close to the one I have on my main computer and my thinkpad.

Licence

All of my dotfiles (and my dotfiles only) are available under the GNU GPLv3 Licence. Please consult /phundrak/dotfiles/src/commit/eec74ab1b27149ab09593a152f62d442ff13740c/LICENCE.md for more information. In short: you are free to access, edit and redistribute all of my dotfiles under the same licence and as allowed by the licence, and if you fuck up something, its your own responsibility.