Skip to content

maxminoS/.dotfiles

Repository files navigation

Dotfiles

The dotfiles that compile just about everything I need in a machine.

Table of Contents

Setting up

Base Directories

Make sure these directories exist in the home folder:

  • .bin/ (custom scripts)
  • Bookshelf/ (books, articles)
  • Development/ (programming)
  • Documents/
  • Downloads/
  • Dropbox/
  • Pictures/
  • Transmission/ (torrents)
  • Videos/

Private Files

  • GPG Public & Secret Keys (gpg)
  • mbsyncrc (mail)
  • ~/.emacs.d/lisp/.authinfo.gpg (magit, mu4e)
  • .secrets.el (spotifyd)
  • spotifyd.conf (spotifyd)

Package Manager

  • Arch: pacman
  • AUR: yay
sudo pacman -S base-devel
git clone https://aur.archlinux.org/yay-git.git
cd yay-git
makepkg -si
  • Debian: apt
  • macOS: brew
/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"
eval "$(/opt/homebrew/bin/brew shellenv)"

Base Setup

Linux

  1. Install emacs, git, gpg, pass, stow, zsh
  2. git clone https://github.com/maxminoS/.dotfiles
  3. Stow, at the least, the following packages: git, zsh, bash
  4. Restart for environment variables to take effect
  5. git clone https://github.com/maxminoS/.emacs.d
  6. Install Dropbox (org-mode)
  7. Import GPG Keys gpg --import <key_file>
  8. cd ~/.local/share/ then clone .password-store/

macOS

  1. Install git
  2. git clone https://github.com/maxminoS/.dotfiles
  3. sh brew.sh then sh .macos
  4. Stow required packages, at least git and zsh
  5. Restart for environment variables to take effect
  6. git clone https://github.com/maxminoS/.emacs.d
  7. Add Emacs to have full file access (dired)
  8. Import GPG Keys gpg --import <key_file>
  9. cd ~/.local/share/ then clone .password-store/

Emacs

Upgrade Emacs with: brew reinstall

Before Opening

Magit

  1. Set the appropriate usernames:
git config --global user.name "maxminoS"
git config --global user.email "email@address.com"
  1. Create Personal Access Tokens and store them as ~/.emacs.d/lisp/.authinfo.gpg
# -*- epa-file-encrypt-to: ("gpg@email.com") -*-
machine api.github.com login <username>^forge password <token>
machine gitlab.com/api/v4 login <username>^forge password <token>

VTerm

Install: cmake, libtool-bin, libvterm[-dev]

mu4e

  1. Install mu (including mu4e) and isync
  2. Add email authentication to ~/.emacs.d/lisp/.authinfo.gpg
# -*- epa-file-encrypt-to: ("gpg@email.com") -*-
...
machine smtp.gmail.com login <email@address.com> password <password> port 465
  1. Create appropriate ~/.config/isync/mbsyncrc
# Account: email1@address.com
# Full Name: Your F. Name
# SMTP smtp.gmail.com
IMAPAccount <username1>-gmail
Host imap.gmail.com
User email1@address.com
PassCmd "pass Mail/email1\@address.com"
SSLType IMAPS
# Linux
CertificateFile /etc/ssl/certs/ca-certificates.crt
# macOS
CertificateFile /usr/local/etc/openssl/cert.pem
AuthMechs PLAIN

# Remote
IMAPStore <username1>-gmail-remote
Account <username1>-gmail

# Local
MaildirStore <username1>-gmail-local
Subfolders Verbatim
Path ~/.config/mail/email1@address.com/
Inbox ~/.config/mail/email1@address.com/Inbox

# Channels
Channel <username1>-gmail-inbox
Far :<username1>-gmail-remote:
Near :<username1>-gmail-local:
Patterns "Inbox"
Create Both
SyncState *

Channel <username1>-gmail-sent
Far :<username1>-gmail-remote:"[Gmail]/Sent Mail"
Near :<username1>-gmail-local:"Sent"
Create Both
SyncState *

Channel <username1>-gmail-trash
Far :<username1>-gmail-remote:"[Gmail]/Trash"
Near :<username1>-gmail-local:"Trash"
Create Both
SyncState *

Channel <username1>-gmail-all
Far :<username1>-gmail-remote:"[Gmail]/All Mail"
Near :<username1>-gmail-local:"All"
Create Both
SyncState *

Channel <username1>-gmail-starred
Far :<username1>-gmail-remote:"[Gmail]/Starred"
Near :<username1>-gmail-local:"Starred"
Create Both
SyncState *

# Group
Group <username1>-gmail
Channel <username1>-gmail-inbox
Channel <username1>-gmail-sent
Channel <username1>-gmail-trash
Channel <username1>-gmail-all
Channel <username1>-gmail-starred


# Account: email2@address.com
...
  1. Make the appropriate email directories in ~/.config/mail
  2. mbsync -a
  3. Initialize mu
mu init --maildir=~/.config/mail \
    --my-address=EMAIL_ADDRESS_1 \
    --my-address=EMAIL_ADDRESS_2

mu index

spotifyd

  1. Install spotifyd
  2. Set spotifyd configuration in ~/.config/spotifyd/spotifyd.conf
[global]
username = ""
password = ""
backend = "" # Check =spotifyd -h= to search available backends
device_name = ""
device_type = "computer"
bitrate = 320
  1. Set spotify client ID and secret in ~/.emacs.d/lisp/.secret.el
(setq emax/spotify-client-id "<client-id>")
(setq emax/spotify-client-secret "<client-secret>")
  1. Make launch at startup

Within Emacs

  • M-x all-the-icons-install-fonts
  • Install unzip (nov.el)

LSP Mode

PDF Tools

  • Linux: gcc, g++, automake, autoconf, libpng-dev, zlib1g-dev, libpoppler-glib-dev, libpoppler-private-dev, imagemagick
  • macOS: brew install poppler automake and export PKG_CONFIG_PATH=/usr/local/Cellar/zlib/1.2.8/lib/pkgconfig:/usr/local/lib/pkgconfig:/opt/X11/lib/pkgconfig

Yabai

Yabai is a tiling window manager for macOS. Paired with skhd, window management can be handled using only the keyboard.

You may need to disable the System Integrity Protection for Yabai (in Recovery Mode)

csrutil disable --with kext --with dtrace --with nvram --with basesystem
brew install koekeishiya/formulae/yabai
sudo yabai --install-sa

brew services start yabai

skhd

brew install koekeishiya/formulae/skhd
brew services start skhd

Manual

Stow

  • stow <packages> dotfiles directory to stow listed packages
  • Each package must be in the appropriate directory structure
  • stow -D <packages> to unlink packages

GPG

  • List keys: gpg -k
  • Export keys: gpg -o public-key.gpg --export --armor --key email@address.com gpg -o secret-key.gpg --export-secret-key --armor email@address.com
  • Import keys: gpg --import <key_file>

Tmux

  • New session: tmux new -s <session>
  • Kill session: tmux kill-ses -t <session>
  • Attach session: tmux a -t <session>
  • List session: tmux ls
  • Rename session: C-x $
  • Detach: C-x d
  • Copy mode: C-x <SPC>
  • Previous/Next session: C-x (/)
  • Previous/Next window: C-x p/n
  • Split/Vsplit window: C-x s/v
  • New window: C-x t
  • Rename window: C-x r
  • Configs: tmux show-options [-g|s|w]

Images

stow images (links it to ~/Pictures/images)
# For EXWM
sudo mkdir /usr/share/backgrounds
sudo ln -sF ~/Pictures/images /usr/share/backgrounds

macOS Keybindings

Modifier Keys

Control, Meta, and super keys are only Emacs notations

  • C - Control (bound to fn)
  • M - Option
  • s - Command
  • CapsLock - Esc

Trackpad

  • Three Finger Swipe Up - Mission Control
  • Three Finger Swipe Down - Current Application Windows
  • Three Finger Swipe Left/Right - Switch workspaces
  • Two Finger Swipe Left from Right Fringe - Notification Center

Keybinds

  • Option-<1-9> - Switch to workspace <1-9>
  • Option-Shift-Return - Screenread selection
  • Control-Space - Switch input source
  • Command-Space - Search Spotlight

Keyboard Navigation

  • Control-F2 - Focus menu bar
  • Control-F3 - Focus dock
  • Control-F4 - Move to next window
  • Control-F8 - Focus status menu

Screenshots

(Command-Shift-x to clipboard)

  • 3 - Entire screen
  • 4 - Selected area
  • 5 - Change screenshot/recording options
  • 6 - Touch bar

Add Control to save screenshots as a file

Yabai

  • Option-Shift-<1-9> - Move window to Space
  • Option-<h/j/k/l> - Focus left/down/up/right window
  • Option-<Left/Down/Up/Right> - Swap window
  • Option/Control-Shift-<Left/Down/Up/Right> - Increase/Decrease window size
  • Option-= - Balance window size
  • Option-F - Toggle fullscreen
  • Option-P - Pop in/out
  • Control-F12 - Open URL in clipboard in mpv

Terminal

In macOS, its Terminal emulator may be enough without Alacritty.

Preferences > Profiles > Import > macos/*.terminal

Installations

Command Line Applications

AppArchmacOS
pacman -Sbrew install
gitgitgit
gpggnupggnupg
stowstowstow
zshzshInstalled
passpasspass
unzipunzipInstalled
vimvimInstalled
ffmpegffmpegffmpeg
htophtophtop
neofetchneofetchneofetch
wgetwgetwget
curlcurlInstalled
pythonpythonpython
nodenodejsnode
npmnpmnode
yarnyarnyarn
typescriptnpm i -gtypescript
gogogo
picompicomNot macOS
cmakecmakecmake
libtoollibtoollibtool
libvtermlibvtermlibvterm
muyay mumu
isyncisyncisync
spotifydspotifydspotifyd
youtube-dlyoutube-dlyoutube-dl
windscribeyay windscribe-cliwindscribe
gccgccgcc
automakeautomakeautomake
autoconfautoconfautoconf
libpnglibpnglibpng
zlibzlibzlib
imagemagickimagemagickimagemagick
popplerpopplerpoppler
coreutilsInstalledcoreutils
moreutilsInstalledmoreutils
findutilsInstalledfindutils
gnu-sedInstalledgnu-sed
grepInstalledgrep
opensshInstalledopenssh
ssh-copy-idInstalledssh-copy-id

Desktop Applications

brew tap d12frosted/emacs-plus
brew install emacs-plus --with-imagemagick --with-no-frame-refocus --with-native-comp --with-modern-doom3-icon --with-poll
AppArchmacOS
pacman -Sbrew install –cask
chromeyay google-chromegoogle-chrome
firefoxfirefoxfirefox
tortorbrowser-launchertor-browser
pcmanfmpcmanfm-gtk3Not macOS
alacrittyalacrittyalacritty
xtermxtermNot macOS
spotifyyay spotifyspotify
dropboxyay dropboxdropbox
discorddiscorddiscord
fehfehNot macOS
mpvmpvmpv
vlcvlcvlc
gimpgimpgimp
inkscapeinkscapeinkscape
qbittorrentqbittorrentqbittorrent
zoomNot Linuxzoom
warpNot Linuxcloudflare-warp