cfg

Table of Contents



This page is generated via scout. For now it just shows the project README. You can check the full source code here

Configuration scripts and notes in literate style configuration using Org-Babel. The configurations kept here are for the following machines:

  1. euclid-red that runs Manjaro with StumpWM (X). This is primarily a keyboard driven system (Legion Y720) and stays at my home workspace.
  2. euclid-blue that runs Manjaro with GNOME (Wayland). This is a convertible laptop (HP Spectre x360) that I use to move around, read, and take notes.
  3. euclid-black is my Android based cell phone.
  4. euclid-white is an M1 Macbook Air (2020) from my current workplace.
  5. euclid-silver is a Raspberry PI 4 with Home Assistant OS used for home automation and other home network applications.

Name prefix has a historical reason. There are a few other cloud machines other than these. The repository itself has a few other items and assets that might not be connected with the process in this org file.

1. Basic packages & shell setup

My current OS is Manjaro across almost all Linux systems so this stage is common across my two main machines.

uname -a
Linux euclid-red 5.15.89-1-MANJARO #1 SMP PREEMPT Wed Jan 18 20:37:11 UTC 2023 x86_64 GNU/Linux

Install yay before going ahead:

pacman -S yay

For blue:

yay -S $(grep -vE "^\s*#" ./packages/manjaro.euclid-blue | tr "\n" " ")

For red:

yay -S $(grep -vE "^\s*#" ./packages/manjaro.euclid-red | tr "\n" " ")

Now that fish is installed, we will set it as the default shell.

chsh -s $(which fish)

Install fish packages

# Install fisher
curl -sL https://git.io/fisher | source && fisher install jorgebucaran/fisher

for p in (cat ./fish/.config/fish/fishfile)
    fisher install $p
end
stow -t ~/ fish
stow -t ~/ git
stow -t ~/ scripts

2. Window Management

All of these are for the main machine running StumpWM.

stow -t ~/ stumpwm
stow -t ~/ dunst
stow -t ~/ picom
stow -t ~/ redshift

2.1. Rofi

Use theme set up from here and the following colors.

/* colors */
* {
  al:      #00000000;
  bg:      #2E3440ff;
  se:      #374C6Bff;
  fg:      #D8DEE9cc;
  ac:      #81A1C1ff;
  red:     #434C5Eff;
  green:   #475C6Bff;
  yellow:  #8a9899ff;
  blue:    #42A5F5ff;
  purple:  #B48EADff;
  cyan:    #4DD0E1ff;
}

2.2. Stumpwm

Install sbcl from distro package (this might cause problems on system updates and I will have to make switch to the pre-built download). On Manjaro this gets the most recent version. Then fresh install quicklisp (do update-dist also).

  • Delete cache of system *fasls and quicklisp
  • Load following packages for building stumpwm
(ql:quickload '("clx" "cl-ppcre" "alexandria"))

Then

mkdir ~/stumpwm
cd ~/stumpwm
git clone https://github.com/stumpwm/stumpwm
git clone https://github.com/stumpwm/stumpwm-contrib ./contrib
# Checkout some reasonable version
./autogen.sh
env SBCL_HOME="/usr/lib/sbcl" ./configure
make
sudo make install

Now to make my config work, we need to set up clx-truetype which is not available in quicklisp now. Thankfully a fork is maintained that we need to clone in ~/.quicklisp/local-projects. This is also a fork that resolves an old memory leak.

git clone https://github.com/goose121/clx-truetype.git

Finally I have set Iosevka NF font in my config which needs to be installed too.

Here goes the xinitrc

#!/bin/sh

xrandr --setprovideroutputsource modesetting NVIDIA-0
xrandr --auto
exec stumpwm
chmod +x ~/.xinitrc

I might also need to disable the default display manager. See this.

There might be a font loading issue which is fixed by (xft:cache-fonts).

3. Fonts

Few fonts are already installed when I install the basic packages. Rest are listed here.

3.1. Custom Iosevka

git clone git@github.com:lepisma/iosevka-lepisma /tmp/iosevka-lepisma
mkdir /usr/share/fonts/iosevka/
mv /tmp/iosevka-lepisma/ttf/patched/*ttf /usr/share/fonts/iosevka/

Override medium fonts

yes | cp iosevka/iosevka-lepisma-regular.ttf iosevka/iosevka-lepisma-medium.ttf
yes | cp iosevka/iosevka-lepisma-italic.ttf iosevka/iosevka-lepisma-mediumitalic.ttf
yes | cp iosevka/iosevka-lepisma-oblique.ttf iosevka/iosevka-lepisma-mediumoblique.ttf

fc-cache -f

3.2. Et book

git clone git@github.com:edwardtufte/et-book /tmp/et-book
mkdir /usr/share/fonts/et-book/
mv /tmp/et-book/et-book/*/*.ttf /usr/share/fonts/et-book/

fc-cache -f

3.3. All the Icons

(require 'all-the-icons)
(all-the-icons-install-fonts)

4. Terminal

I use Kitty as the terminal emulator across machines.

stow -t ~/ kitty

5. Languages

Programming language setup as needed. I only keep primary languages here and rest as on-demand.

5.1. Python setup

First set up pyenv.

pip install -r ./packages/pip

IPython init

get_ipython().magic("%load_ext autoreload")
get_ipython().magic("%autoreload 2")

5.2. Node

I use node primarily for a few CLI tools listed here.

6. Email

6.1. euclid-red

On this machine, I use a combination of offlineimap and mu4e.

stow -t ~/ offlineimap

Create .authinfo.gpg file in ~/ with two items like the following for each account:

# -*- epa-file-encrypt-to: ("<gpg-key-email-id>") -*-
machine imap.gmail.com name gmail-imap port 993 login <> password <> email <>
machine smtp.gmail.com name gmail-smtp port 465 login <> password <> email <>
[Desktop Entry]
Type=Application
Name=Compose Mail
Exec=/home/lepisma/bin/compose-mail %u
StartupNotify=false
MimeType=x-scheme-handler/mailto

7. Setup hardware

7.1. Bluetooth sinks

Dumping commands. Need to enable bluetooth service and stuff.

  pacmd list-sinks | grep -e 'name:' -e 'index:'
  pacmd set-default-sink <n>
>>>>>>> ce96b50 (add example for authinfo entry)

7.2. euclid-blue

I have been using geary here and that works well.

8. Default Programs

As a common item, I have a script www that dispatches urls to the right browser. That's supposed to be set as the primary web handler.

[Desktop Entry]
Encoding=UTF-8
Version=1.0
Type=Application
NoDisplay=true
Exec=/home/lepisma/bin/www
Name=www
Comment=Browser dispatch

Org protocol for capturing literature nodes

[Desktop Entry]
Name=Org-Protocol
Exec=emacsclient %u
Icon=emacs-icon
Type=Application
Terminal=false
MimeType=x-scheme-handler/org-protocol

8.1. euclid-red

xdg-mime default feh.desktop image/jpeg
xdg-mime default feh.desktop image/png
xdg-mime default www.desktop x-scheme-handler/http
xdg-mime default www.desktop x-scheme-handler/https
xdg-mime default compose-mail.desktop x-scheme-handler/mailto
xdg-mime default org.kde.okular.desktop application/pdf
xdg-mime default org-protocol.desktop x-scheme-handler/org-protocol

handlr set inode/directory nautilus.desktop
handlr set .doc org.onlyoffice.desktopeditors.desktop
handlr set .docx org.onlyoffice.desktopeditors.desktop

8.2. euclid-blue

I don't have much customization here and I let GNOME handle most of items.

xdg-mime default www.desktop x-scheme-handler/http
xdg-mime default www.desktop x-scheme-handler/https
xdg-mime default org-protocol.desktop x-scheme-handler/org-protocol

9. Hardware

Hardware specific configurations or installation steps.

9.1. euclid-red

9.1.1. Graphics Tablet

For Wacom One, run configure-tablet.

9.1.2. Touchpad

Two finger for right click.

Section "InputClass"
	Identifier "touchpad overrides"
	Driver "libinput"
	MatchIsTouchpad "on"
	Option "Tapping" "on"
	Option "TappingButtonMap" "lrm"
EndSection

9.1.3. Keyboards

Swap keys on laptop's main board.

clear lock
clear control
keycode 66 = Control_L
add control = Control_L Control_R

9.1.4. Macropad

Installed KMonad and set up the service for macropad.

9.1.5. Graphics Card

My laptop has Intel and Nvidia card. I switch to just Nvidia drivers which works well for me. Relevant portion for xinitrc:

# Goes above exec stump..
xrandr --setprovideroutputsource modesetting NVIDIA-0
xrandr --auto

9.1.6. Streamdeck

Import config from ~./streamdeck.

9.2. euclid-blue

9.2.1. Battery

Install tlp (already done in package installation), and enable the service.

systemctl enable tlp.service
systemctl start tlp.service

9.2.2. Keyboard

Installed KMonad and set up this service for colemak-dh.

9.2.3. Touch Scrolling

Firefox needs some configuration to enable intuitive scrolling in touchscreen laptops. Here is a guide.