Skip to content

Latest commit

 

History

History
906 lines (716 loc) · 23.4 KB

dotfiles.org

File metadata and controls

906 lines (716 loc) · 23.4 KB

Dotfiles

Thou shalt not pollute your neighbor’s ~/ – Exodus 20:17

Identity

Set name and e-mail.

NAME="<<name>>"
EMAIL="<<email>>"

Well known directories

Set base directories.

XDG_CACHE_HOME="$HOME/.cache"
XDG_CONFIG_HOME="$HOME/.config"
XDG_DATA_HOME="$HOME/.local/share"

Then, set user directories.

XDG_DESKTOP_DIR="$HOME/.Bureaublad"
XDG_DOCUMENTS_DIR="$HOME/Documenten"
XDG_DOWNLOAD_DIR="$HOME/Inbox/tmp"
XDG_MUSIC_DIR="$HOME/Muziek"
XDG_PICTURES_DIR="$HOME/Afbeeldingen"
XDG_PUBLICSHARE_DIR="$HOME/Delen"
XDG_TEMPLATES_DIR="$HOME/Sjablonen"
XDG_VIDEOS_DIR="$HOME/Video's"

Again, but as environment variables.

<<user-dirs>>

Finally, set other directories.

KOEK_CALENDARS_DIR="$XDG_DOCUMENTS_DIR/Kalenders"
KOEK_CONTACTS_DIR="$XDG_DOCUMENTS_DIR/Contacten"
KOEK_EMAIL_DIR="$XDG_DOCUMENTS_DIR/E-mail"
KOEK_NEWS_DIR="$XDG_DOCUMENTS_DIR/Nieuws"
KOEK_NOTES_DIR="$XDG_DOCUMENTS_DIR/Notities"
KOEK_PROJECTS_DIR="$HOME/Projecten"

Superfluous applications

Hide superfluous applications.

<<desktop-nodisplay>>
Name=Avahi Zeroconf Browser
<<desktop-nodisplay>>
Name=Avahi SSH Server Browser
<<desktop-nodisplay>>
Name=Avahi VNC Server Browser
<<desktop-nodisplay>>
Name=Bluetooth Adapters
<<desktop-nodisplay>>
Name=CMake
<<desktop-nodisplay>>
Name=Manage Printing
<<desktop-nodisplay>>
Name=Hardware Locality lstopo
<<desktop-nodisplay>>
Name=OpenJDK Java Console
<<desktop-nodisplay>>
Name=OpenJDK Java Shell
<<desktop-nodisplay>>
Name=ipython
<<desktop-nodisplay>>
Name=compton
<<desktop-nodisplay>>
Name=picom
<<desktop-nodisplay>>
Name=Qt Assistant
<<desktop-nodisplay>>
Name=Qt Designer
<<desktop-nodisplay>>
Name=Qt Linguist
<<desktop-nodisplay>>
Name=Qt QDbusViewer
<<desktop-nodisplay>>
Name=Qt V4L2 test utility
<<desktop-nodisplay>>
Name=Qt V4L2 video capture utility
<<desktop-nodisplay>>
Name=Steam (Runtime)
<<desktop-nodisplay>>
Name=XDvi

EXWM

EXWM GDM

Disable display power management signaling and screensaver, i.e., disable turning off monitors.

xset -dpms
xset s off

Launch picom.

picom &

Launch xsettingsd.

xsettingsd_preset_file="${XDG_DATA_HOME:-$HOME/.local/share}/xsettingsd/presets/dark"
xsettingsd_config_file="${XDG_CONFIG_HOME:-$HOME/.config}/xsettingsd/xsettingsd"

ln -sf "$xsettingsd_preset_file" "$xsettingsd_config_file" \
    && xsettingsd -c "$xsettingsd_config_file" &

Set SSH agent.

eval $(gnome-keyring-daemon -s)
export SSH_AUTH_SOCK

Set pointer cursor. For cursor names, contrary to what the xsetroot man page says, see cursorfont.h.

xsetroot -cursor_name left_ptr

Hide pointer cursor shortly after it stops moving. Unhide it after it moved some distance, it’s common to bump into the pointing stick while typing.

unclutter --jitter 3 --ignore-scrolling &

Launch Emacs.

. /etc/exwm/exwmrc

picom

Ignore system configuration.

# Intentionally empty

xsettingsd

For settings, see XSETTINGS registry (freedesktop). To dump the settings of the running XSETTINGS daemon (e.g. GNOME Settings Daemon), run:

dump_xsettings

To create the configuration directory, run:

mkdir -p "${XDG_CONFIG_HOME:-$HOME/.config}/xsettingsd"

Common

Disable blink cursor.

Net/CursorBlink 0

Themes

Configure a light and a dark theme. For theme names, see theme directory.

Net/ThemeName "Adwaita"
Net/ThemeName "Adwaita-dark"

Presets

Combine common and theme configuration into a light and a dark preset.

<<xsettingsd-common>>
<<xsettingsd-light-theme>>
<<xsettingsd-common>>
<<xsettingsd-dark-theme>>

GNOME catgen

To apply configuration, run:

gnome-catgen -s

Creative

ardour.desktop
blender.desktop
calf.desktop
freecad.desktop
gimp.desktop
openscad.desktop
org.fontforge.FontForge.desktop
org.inkscape.Inkscape.desktop
org.pitivi.Pitivi.desktop
scribus.desktop
tape.desktop
valentina.desktop

DisplayCAL

displaycal-3dlut-maker.desktop
displaycal-apply-profiles.desktop
displaycal-curve-viewer.desktop
displaycal-profile-info.desktop
displaycal-scripting-client.desktop
displaycal-synthprofile.desktop
displaycal-testchart-editor.desktop
displaycal-vrml-to-x3d-converter.desktop
displaycal.desktop

Internet

chromium.desktop
firefox.desktop
io.github.qtox.qTox.desktop
jami-gnome.desktop
teams.desktop

Leisure

makemkv.desktop
org.gnome.Lollypop.desktop
org.musicbrainz.Picard.desktop
puddletag.desktop
steam-native.desktop
vlc.desktop

LibreOffice

libreoffice-base.desktop
libreoffice-calc.desktop
libreoffice-draw.desktop
libreoffice-impress.desktop
libreoffice-math.desktop
libreoffice-startcenter.desktop
libreoffice-writer.desktop

System

blueman-manager.desktop
ca.desrt.dconf-editor.desktop
gnome-control-center.desktop
gnome-system-monitor.desktop
org.gnome.DiskUtility.desktop
org.gnome.Extensions.desktop
org.gnome.Logs.desktop
org.gnome.Terminal.desktop
org.gnome.font-viewer.desktop
org.gnome.seahorse.Application.desktop
pavucontrol.desktop
yelp.desktop

Utilities

com.obsproject.Studio.desktop
eid-viewer.desktop
electrum.desktop
gromit-mpx.desktop
org.gnome.Cheese.desktop
org.gnome.Evince.desktop
org.gnome.FileRoller.desktop
org.gnome.Nautilus.desktop
org.gnome.Screenshot.desktop
org.gnome.eog.desktop
org.keepassxc.KeePassXC.desktop
simple-scan.desktop
syncthing-gtk.desktop

Work

arduino.desktop
emacs.desktop
org.gnome.Boxes.desktop
org.gnome.Calculator.desktop
org.gnome.Maps.desktop
org.gnome.Weather.desktop
org.gnome.clocks.desktop
org.octave.Octave.desktop
wireshark.desktop
wolfram-mathematica11.desktop

Bash

mkdir -p "${XDG_DATA_HOME:-$HOME/.local/share}/bash"

Login

Interactive and non interactive

export PATH="$HOME/.local/bin${PATH:+:$PATH}"
[[ -f ~/.bashrc ]] && . ~/.bashrc

Interactive

Non login

[[ $- != *i* ]] && return
export HISTFILE="${XDG_DATA_HOME:-$HOME/.local/share}/bash/history"
alias ls='ls -lah --group-directories-first --color=auto'
PS1='[\u@\h \W]\$ '

SSH

For hosts, see Hosts.

To generate an SSH key, run:

# Ed25519
ssh-keygen -t ed25519 -C "nicolas@dejaeghe.re"

# RSA
ssh-keygen -t rsa -b 4096 -C "nicolas@dejaeghe.re"

Ed25519 is preferred when supported. Unlike passwords, SSH keys can be reused.

GnuPG

When setting GnuPG’s home, the directory must be created manually. To create it, run:

mkdir -p "${XDG_DATA_HOME:-$HOME/.local/share}/gnupg"
chmod 700 "${XDG_DATA_HOME:-$HOME/.local/share}/gnupg"

Move data directory out of the way.

GNUPGHOME="${XDG_DATA_HOME:-$HOME/.local/share}/gnupg"

To generate a PGP key, run:

gpg --full-gen-key
  • Type: RSA and RSA
  • Size: 4096
  • Expires in: key does not expire
  • Name: Nicolas De Jaeghere
  • E-mail: nicolas@dejaeghe.re
  • Comment:

For a guide on encrypted e-mail, see Email Self-Defense (FSF).

Syncthing

Stores:

  • archive: Archief
  • documents: Bureaublad, Documenten, Inbox and Projecten
  • documents-extra: Boeken, Sjablonen and Varia
  • music: Muziek and Podcasts
  • pictures: Afbeeldingen
  • share: Delen
  • video: Video’s

To stow all stores, run:

stow -d ~/.ststore/ -t ~/ archive documents documents-extra music pictures share video

Git

Set identity.

[user]
name = <<name>>
email = <<email>>
signingkey = 08153F0DF65B934C

Sign commits.

[commit]
gpgsign = true

Global ignore

Ignore common artifacts. For pattern format, see man 5 gitignore.

.shadow-cljs/
build/
node_modules/
*.elc
.nrepl-port

Firefox

Saka Key

Saka Key (Firefox Add-ons)

Create a new profile. Change:

NameValue
Saka Key enabledYes
Prevent pages from stealing focusYes
Automatically activate hintYes
Detect hints using cursor styleNo
Smooth scrollNo
Scroll step32
NameValue
Bind to physical keysNo
Ignore modifier keysNo
Hint charactersqsdfjklm
Open linkj j
Open link in background tabj b
Open link in foreground tabj f
Open link in new windowj o
Open link in incognito windowj p
Download linkj d
Focus inputj i
Go backl
Go forwardr
Go upu
Go to rootM-u
Scroll downn
Scroll upp
Scroll rightf
Scroll leftb
Scroll page downSPC
Scroll page upDEL
Scroll half page downC-SPC
Scroll half page upC-DEL
Refresh tabg
Hard refresh tabM-g
Pass one key to pages
Pass all keys to pageM-s
Stop passing keys to pageM-s
^http://localhost:8888/notebooks/

uBlock Origin

uBlock Origin (Firefox Add-ons)

Keep defaults.

Video Downloader Professional

Video Downloader Professional (Firefox Add-ons)

Keep defaults.

E-mail

isync

Store sync state with maildir subdirectories, simplifying backup.

SyncState *

Personal account

To configure the domain, follow Configuring your domain with NS/MX (FastMail).

To create the maildir directory, run:

mkdir -p "$KOEK_EMAIL_DIR/Personal"

Define local personal store. Only tilde is expanded, not environment variables.

MaildirStore personal_local
Path "~/Documenten/E-mail/Personal/"
Inbox "~/Documenten/E-mail/Personal/INBOX/"
SubFolders Verbatim

To generate the app password, follow App passwords (FastMail). Name it Emacs e-mail and give it access to IMAP and SMTP. Then, to store it securely, run:

secret-tool store --label="Emacs e-mail personal (IMAP)" host "imap.fastmail.com" port "993" user "nicolas@dejaeghe.re"
secret-tool store --label="Emacs e-mail personal (SMTP)" host "smtp.fastmail.com" port "465" user "nicolas@dejaeghe.re"

Define remote personal store. For server details, see Server names and ports (FastMail).

IMAPStore personal_remote
Host imap.fastmail.com
SSLType IMAPS
User nicolas@dejaeghe.re
PassCmd "secret-tool lookup host \"imap.fastmail.com\" port \"993\" user \"nicolas@dejaeghe.re\""

Define personal channel.

Channel personal
Master :personal_remote:
Slave :personal_local:
Patterns *
Sync All
Create Both
Remove Both
Expunge Both
CopyArrivalDate yes

mu

Move maildir directory out of the way.

MAILDIR="$KOEK_EMAIL_DIR"

To create the database, run:

mbsync -c "${XDG_CONFIG_HOME:-$HOME/.config}/isync/mbsyncrc" -a && mu init --my-address="nicolas@dejaeghe.re" --my-address="nicodeja@gmail.com" --my-address="nicodeja@mac.com" --my-address="Nicolas.DeJaeghere@belfius.be"

vdirsyncer

Store sync state with vdir directories, simplifying backup. Only tilde is expanded, not environment variables.

[general]
status_path = "~/Documenten/Contacten/.vdirsyncer/"

Personal account

To create the vdir directory, run:

mkdir -p "$KOEK_CONTACTS_DIR/Personal"

Define local personal storage.

[storage personal_local]
type = "filesystem"
path = "~/Documenten/Contacten/Personal/"
fileext = ".vcf"

To generate the app password, follow App passwords (FastMail). Name it Emacs contacts and give it access to CardDAV. Then, to store it securely, run:

secret-tool store --label="Emacs contacts personal" host "carddav.fastmail.com:443" port "https" user "nicolas@dejaeghe.re"

Define remote personal storage. For server details, see Server names and ports (FastMail).

[storage personal_remote]
type = "carddav"
url = "https://carddav.fastmail.com/"
username = "nicolas@dejaeghe.re"
password.fetch = ["command", "secret-tool", "lookup", "host", "carddav.fastmail.com:443", "port", "https", "user", "nicolas@dejaeghe.re"]

Define personal pair.

[pair personal]
a = "personal_remote"
b = "personal_local"
collections = ["from a", "from b"]

To create the collections, run:

vdirsyncer discover && vdirsyncer sync

FreeCAD

Ensure FreeCAD’s packages are found.

PYTHONPATH="/usr/lib/freecad/lib"${PYTHONPATH:+:$PYTHONPATH}

Steam

Show Steam with native runtime as Steam.

[Desktop Entry]
Name=Steam
Comment=Application for managing and playing games on Steam
Exec=/usr/bin/steam-native %U
Icon=steam
Terminal=false
Type=Application
Categories=Network;FileTransfer;Game;
MimeType=x-scheme-handler/steam;
Actions=Store;Community;Library;Servers;Screenshots;News;Settings;BigPicture;Friends;
StartupWMClass=Steam

[Desktop Action Store]
Name=Store
Exec=steam steam://store

[Desktop Action Community]
Name=Community
Exec=steam steam://url/SteamIDControlPage

[Desktop Action Library]
Name=Library
Exec=steam steam://open/games

[Desktop Action Servers]
Name=Servers
Exec=steam steam://open/servers

[Desktop Action Screenshots]
Name=Screenshots
Exec=steam steam://open/screenshots

[Desktop Action News]
Name=News
Exec=steam steam://open/news

[Desktop Action Settings]
Name=Settings
Exec=steam steam://open/settings

[Desktop Action BigPicture]
Name=Big Picture
Exec=steam steam://open/bigpicture

[Desktop Action Friends]
Name=Friends
Exec=steam steam://open/friends

DisplayCAL

Calibration settings:

  • Whitepoint: 6500 K
  • White level: 120 cd/m^2
  • Tone curve: Gamma 2.2

To set the brightness of AU Optronics Corp. AUO B140HAN01.3 to the value determined during calibration, run:

echo 362 > /sys/class/backlight/intel_backlight/brightness

Org protocol

Define org protocol scheme handler. Must invoke a shell to expand environment variables. For desktop entry or scheme handler format, see Desktop Entry Specification (freedesktop) respectively Shared MIME Info Specification (freedesktop).

[Desktop Entry]
Type=Application
Name=org-protocol
Icon=emacs
TryExec=emacsclient
Exec=sh -c "emacsclient -s \"\\$XDG_RUNTIME_DIR/emacs/server\" %u"
Terminal=false
MimeType=x-scheme-handler/org-protocol;
NoDisplay=true

To register the scheme handler, run:

update-desktop-database "${XDG_DATA_HOME:-$HOME/.local/share}/applications"

Jupyter Notebook

Move configuration directory out of the way.

JUPYTER_CONFIG_DIR="${XDG_CONFIG_HOME:-$HOME/.config}/jupyter"

Documentation on configuring the frontend is limited. For settings, see User manual and reference guide - Configuration (CodeMirror).

{
    "CodeCell": {
        "cm_config": {
            "cursorBlinkRate": 0
        }
    },
    "MarkdownCell": {
        "cm_config": {
            "cursorBlinkRate": 0
        }
    }
}

IPython

Move configuration directory out of the way.

IPYTHONDIR="${XDG_CONFIG_HOME:-$HOME/.config}/ipython"

Leiningen

Move data directory out of the way.

LEIN_HOME="${XDG_DATA_HOME:-$HOME/.local/share}/lein"

CUDA

Move cache directory out of the way.

CUDA_CACHE_PATH="${XDG_CACHE_HOME:-$HOME/.cache}/nv/ComputeCache"

Keras

Move configuration directory out of the way.

KERAS_HOME="${XDG_CONFIG_HOME:-$HOME/.config}/keras"

NLTK

Move data directory out of the way.

NLTK_DATA="${XDG_DATA_HOME:-$HOME/.local/share}/nltk"