Skip to content

gjtiquia/dotfiles

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

23 Commits
 
 

Repository files navigation

dotfiles

documentation of all my dotfiles, config files, etc

$HOME dotfiles

Linux

Ubuntu (bash): https://github.com/gjtiquia/.ubuntu_dotfiles

Termux (bash): https://github.com/gjtiquia/.termux_dotfiles

Steam Deck (bash): https://github.com/gjtiquia/.steamdeck_dotfiles

MacOS

MacOS (zsh): https://github.com/gjtiquia/.macos_dotfiles

Windows

Powershell (and wezterm): https://github.com/gjtiquia/.powershell_dotfiles

WSL (Ubuntu): https://github.com/gjtiquia/.wsl_dotfiles

technically can have the same as Ubuntu but... just in case lol bound to be some differences running Ubuntu in wsl vs an entire OS

Cygwin: https://github.com/gjtiquia/.cygwin_dotfiles

shared dotfiles

Neovim (btw): https://github.com/gjtiquia/kickstart.nvim

vim (btw): https://github.com/gjtiquia/.vim

lazygit: https://github.com/gjtiquia/lazygit_config

tmux: https://github.com/gjtiquia/.tmux

yazi: https://github.com/gjtiquia/yazi_config

ghostty: https://github.com/gjtiquia/ghostty_config

flameshot: https://github.com/gjtiquia/flameshot_config

Open Bar (GNOME extension config): https://github.com/gjtiquia/openbar_config

goals and non-goals

some people like to put all their dotfiles into a single repo

that doesnt work for me, cuz i find that some dotfiles are machine/OS/runtime specific, and some are shared

i prefer a more "modular" approach, where config files are as "self-contained" as possible

this way i can choose individually which dotfiles are "shared", which are not

some people like to use GNU Stow for managing their dotfiles

i prefer not to, as i want less dependencies as possible, just plain ol' git, and a consistent setup that works across Windows, MacOS, and Linux

setup $HOME dotfiles

preface

these dotfiles live in the $HOME directory

but not all files in the $HOME directory are version controlled

hence there is some git magic to perform in order to make this work, as its not a typical git repo

tldr: bare git repo

the following steps are referenced from this amazing article

i "could" write a script to run all this but... running this manually "once" isnt too difficult i guess

and... its nice to know under-the-hood whats going on, just in-case

the steps

setting up git repo

DOTFILES_HOME=$HOME
DOTFILES_GIT_DIR=.ubuntu_dotfiles # using Ubuntu as an example 

# git init
git init --bare $DOTFILES_HOME/$DOTFILES_GIT_DIR

# set alias
alias dotfiles="git --git-dir=$DOTFILES_HOME/$DOTFILES_GIT_DIR/ --work-tree=$DOTFILES_HOME"

# check setup (should show a lot of untracked files)
dotfiles status

# only keep track of files we explicitly add
dotfiles config --local status.showUntrackedFiles no

# check setup (should not show untracked files)
dotfiles status

remember add to .bashrc so it works for new shells

DOTFILES_HOME=$HOME
DOTFILES_GIT_DIR=.ubuntu_dotfiles 

# set alias
alias dotfiles="git --git-dir=$DOTFILES_HOME/$DOTFILES_GIT_DIR/ --work-tree=$DOTFILES_HOME"

adding files to git repo

dotfiles add .bashrc
dotfiles commit -m "add .bashrc"

push to remote

dotfiles remote add origin <remote-url>
dotfiles push -u origin main

installing on new system

DOTFILES_HOME=$HOME
DOTFILES_GIT_DIR=.ubuntu_dotfiles

# set alias
alias dotfiles="git --git-dir=$DOTFILES_HOME/$DOTFILES_GIT_DIR/ --work-tree=$DOTFILES_HOME"

# .gitignore to prevent weird recursions
echo $DOTFILES_GIT_DIR >> .gitignore

# git clone
git clone --bare <remote-url> $DOTFILES_HOME/$DOTFILES_GIT_DIR

# checkout (handle overwrite files one-by-one manually if needed, eg. by renaming them as a backup, like .bashrc_bak)
dotfiles checkout

# only keep track of files we explicitly add
dotfiles config --local status.showUntrackedFiles no

# check setup (should not show untracked files)
dotfiles status

steps for Cygwin

Cygwin has a lot of weird behavior, so there are some things that you do differently for Cygwin

such as

# for some reason this is the only way to actually point to $HOME
DOTFILES_HOME=/cygwin64$HOME

# you may need to run this line to prevent issues with line endings
dotfiles config --local core.autocrlf false

steps for Powershell

the above steps are meant to be run on a bash shell

you would need to "translate" them into Powershell commands

see my Powershell dotfiles for an example of how it is "translated"

side note on terminals and shells on Windows

Windows Terminal has weird behaviors with FiraMono font
Wezterm feels ok so far, we'll see with more usage over time

if everything is in WSL, i recommend using WSL

if the project files are in Windows, i recommend using Powershell.
surprisingly a lot of common Linux CLI tools are compiled for Windows too, with package managers like scoop or choco. so its actually quite usable. can be configured to "feel at home" like in Linux
Powershell makes it "feel more at home" compared to Command Prompt (cmd), so i recommend Powershell over Command Prompt too. (eg. you can use commands like ls)
although, it is worth exploring, whether the project files can fully be in Linux as well. if so, it might be worth just migrating everything to Linux and either use WSL, use a VM, or go full Linux with dual booting.

i dont recommend using Cygwin.
for "basic" use cases its ok. for more "advanced" things, you start to run into limitations and hacks. you can pretty much achieve whatever you need with either WSL or Powershell

setup shared dotfiles

see each repo for setup steps, i probably documented them there

but most likely, they are either a self contained directory in $HOME or $HOME/.config

so just do regular git cloning would suffice. just be aware of correct directory naming.

About

documentation of all my dotfiles, config files, etc

Resources

Stars

Watchers

Forks