/dotfiles

My dotfiles for linux

Primary LanguageShell

Linux Dotfiles

I use these dotfiles for my daily driver Ubuntu and Android setup, as well as proxmox and LXCs.

Overview

If you plan on cloning / forking this repo, be aware that all config is tailored to me (e.g. paths, usernames, ...) and make sure to change .gitconfig to your name and email. But if you're starting from scratch anyway (which I recommend, in order to become fammiliar with the functionality bit by bit). Since these dotfiles are tailored specifically to me, your needs and preferences will be different and I would recommend you just copy the bits and pieces you need.

dotfiles
├── bin  # custom scripts
├── desktop # ubuntu specifc: desktop shortcuts, icons
├── [dotbot](https://github.com/anishathalye/dotbot)
├── git  # git config maps to ~/.gitconig, ...
├── ssh  # ssh config maps to ~/.ssh
├── vim  # vim config
├── secrets # priv. & encrypted repo (see git/hooks & setup secrets)
├── zsh
│   ├── plugin-files # place for plugin / theme scripts
│   ├── aliases # aliases for zsh, git, ...
│   ├── colors # colors for filetypes in shell
│   ├── exports # env vars and path configs
│   ├── functions # custom functions
│   ├── plugins # sourcing plugins
│   ├── zsh_config # zsh specific settings
│   └── zshrc  # putting it all together
├── .gitmodules # for dotbot
├── setup # installing packages, plugins, theme, platform specific setups, ...
├── install # idempotent main install script (basic & quick setup)
├── install.conf.yaml # setup dir structure, symlinks, ...

Setup (Desktop)

Post (distro-) installation steps
sudo apt update && sudo apt full-upgrade
sudo apt autoremove && sudo apt clean

Pre-requisites:

sudo apt-get update && sudo apt-get install -y git gh
gh auth login
cd ~ && git clone git@github.com:MaxWolf-01/dotfiles.git
# or
cd ~ && git clone --depth 1 git@github.com:MaxWolf-01/dotfiles.git
mv dotfiles .dotfiles && cd ~/.dotfiles && ./install

open new shell (or reboot when in doubt)

Optional next steps:

Run ./setup all to install packages, plugins, themes, ... Works on Ubuntu. Run ./setup minimal for an unbloated setup with essential cli tools and a minimal zsh setup on any system. For more/specific setups, check out setup.

./install is idempotent, so you can run it multiple times without breaking anything, i.e. after pulling new changes, which will update the symlinks etc. But make sure to export your gnome keyboard shortcuts via ./bin/keybindings.pl before you execute the script, otherwise they get overwritten by mine.

Setup (Android)

Download and install termux apk from f-droid. Don't worry about warnings from termux-setup-storage about deleting all your data. Should be fine.
~/storage/shared in your termux home directory is symlinked /storage/emulated/0 (where downloads folder etc. are on Android)

export DEBIAN_FRONTEND=noninteractive
termux-setup-storage
pkg update && pkg upgrade && pkg install git
cd /data/data/com.termux/files/home && git clone --depth 1 https://github.com/MaxWolf-01/dotfiles.git
mv dotfiles .dotfiles && cd ~/.dotfiles && ./install
./setup android

./setup android will install essential packages and setup up Obsidian. An "obsidian" folder will be created in the android home directory.
To automatically commit, pull and push, run sync. Aliases for android specifically are in zsh/android. Make sure to always sync before and after you work on one of them, or you'll need to deal with merge conflicts. Scripts for pushing conflicts to deal with them in an IDE and fixing occasional corrupt git objects are in bin.

What's in it?

Functions

  • o (open file explorer or the file given as argument)
  • mcd (make directory and cd into it)
  • targz (create a .tar.gz archive, using zopfli, pigz or gzip for compression)
  • extract (extracts archived files / mounts disk images)
  • fs (determine size of a file or total size of a directory)
  • lsfs (list n largest files and folder in a directory, recursively; smallest if n is negative; n defaults to 10)
  • gz (compare original and gzipped file size)
  • tre (tre is a shorthand for tree with hidden files and color enabled, ignoring the .git directory, listing directories first.)
  • newsshpwd (change the ssh passphrase of given key)
  • numel (number of elements in folder)
  • ``archive_md` (archive websites as markdown using dhravya/markdowner
  • and many more ... (see functions / aliases in zsh folder)

Various scripts, such as gnome keyboard shortcut backup/restore, laptop battery limiter, backup scripts, nightlight toggle shortcuts, ...

Plugins

  • fzf - fuzzy finder for commands (Ctrl + R) and files (Ctrl + T), (Alt + C) to cd into selected dir. Examples:
    • vim <Ctrl + T> OR vim **<tab> (trigger ** can be changed in exports)
    • git switch $(git branch -a | fzf)
  • Zap plugin manger
  • Zsh-syntax-highlighting
  • Zsh-autosuggestions
  • ...

Credits

Visuals