Skip to content

lepisma/cfg

Repository files navigation

cfg

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.

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

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

Window Management

All of these are for the main machine running StumpWM.

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

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;
}

Stumpwm

Need two sbcl setups. The one from main repo is going to run stumpwm with swank. The following snip setups that. Needs quicklisp:

sbcl --eval "(ql:quickload '(clx-truetype swank stumpwm cl-strings inferior-shell))" --quit
mkdir -p ~/stumpwm

Clone the repo and use make from there on

git clone https://github.com/stumpwm/stumpwm
# Should checkout to some version
git clone https://github.com/stumpwm/stumpwm-contrib ./contrib

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).

Fonts

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

Custom Iosevka

git clone [email protected]: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

Et book

git clone [email protected]: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

All the Icons

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

Terminal

I use Konsole as the terminal emulator across machines.

[Appearance]
AntiAliasFonts=true
BoldIntense=true
ColorScheme=Nordic
Font=Iosevka,12,-1,5,50,0,0,0,0,0
LineSpacing=4
UseFontLineChararacters=false

[Cursor Options]
CursorShape=1

[General]
Command=/usr/bin/fish
DimWhenInactive=false
Directory=/home/lepisma/Desktop
LocalTabTitleFormat=%d | %n
Name=lepisma
Parent=FALLBACK/
RemoteTabTitleFormat=%d | %n
TerminalCenter=false
TerminalMargin=10

[Interaction Options]
AutoCopySelectedText=true

[Scrolling]
HistoryMode=2
ScrollBarPosition=2

[Terminal Features]
BlinkingCursorEnabled=true
UrlHintsModifiers=67108864
cp ./konsole/Nordic.colorscheme ~/.local/share/konsole/Nordic.colorscheme

Languages

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

Python setup

First set up pyenv.

pip install -r ./packages/pip

IPython init

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

Node

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

Email

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

Setup hardware

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)

euclid-blue

I have been using geary here and that works well.

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

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

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

Hardware

Hardware specific configurations or installation steps.

euclid-red

Graphics Tablet

For Wacom One, run configure-tablet.

Touchpad

Two finger for right click.

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

Keyboards

Swap keys on laptop’s main board.

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

Macropad

Installed KMonad and set up the service for macropad.

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

Streamdeck

Import config from ~~./streamdeck~.

euclid-blue

Battery

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

systemctl enable tlp.service
systemctl start tlp.service

Keyboard

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

Touch Scrolling

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