Skip to content

ccadek/dotfiles

Repository files navigation

My Dotfiles

This dotfiles repository is administered via the bare git repository pattern. See Atlassian - Dotfiles: Best way to store in a bare git repository

Prerequisites

First ensure you have installed all these packages before cloning the repository

Cloning as bare repository

We will clone the the dotfiles repo as a bare repository into ~/.cfg. This basically means that .cfg will act as the .git directory, but you will not your home directory will not look like a git repository.

# Create a .gitignore file in your home directory that ignores .cfg
echo ".cfg" >> .gitignore

# Now we clone the dotfiles repo. Notice the --bare and how we reference the .cfg folder
git clone --bare git@github.com:ccadek/dotfiles.git $HOME/.cfg

# create a temporary alias for config.
alias config='/usr/bin/git --git-dir=$HOME/.cfg/ --work-tree=$HOME'

# Make sure you only see changes from files that are tracked by the repo
config config --local status.showUntrackedFiles no

# No we can actually pull the repository
config checkout

# Ensure all dependencies are installed
sudo pacman -S avizo bat brightnessctl curl dive eza fish grim jq neovim nerd-fonts pyenv slurp starship sway

# Change shell to fish to current user
chsh -s $(which fish)

You will most likely have issues with pulling. That is ok, with config status you can see which files are conflicting and either back them up, or completely remove them. Afterwards run the command again, it should now succeed.

After first installation

Gnome Alt+Tab should not group apps

Per default Gnome always groups several instances of the application together. In order to fix this open the Settings application and go to Keyboard > View and customize Shortcuts, look for Switch windows and replace Alt+Tab.

bat

bat is configured with the Catppuccin Mocha theme in .config/bat. In order for bat to really use that theme run bat cache --build.

Enable host.docker.internal

When using Docker in Windows, you can use the DNS entry host.docker.internal as a DNS to access the hosts localhost from within the docker container. In order to enable this in Linux add the following entry in /etc/hosts

 172.17.0.1 host.docker.internal

SSH Keep Alive

Per default SSH connections will automatically disconnect after a certain time. In order to keep the SSH connection open indefinitely, add the following line to ~/.ssh/config

Host *
    ServerAliveInterval 240

Initializing pre-commit hooks

These dotfiles are using pre-commit hooks to make sure all dotfiles are consistently formatted. This is a WIP and I will see how far I will take this. As pre-commit usually expects a regular repo we have to trick around a little bit. The way I initialized my setup was with tjex.net's guide. In case the site goes offline here the quick rundown:

# First install pre-commit
sudo pacman -S pre-commit

cd ~/.cfg
git worktree add main
cd main
cp ~/.pre-commit-config.yml . # copy existing pre-commit file into cfg/main/.pre-commit-config.yml

# for the next two commands it is important you stay in ~/.cfg/main/
pre-commit autoupdate
pre-commit install
cd ~

# (optional) clean up worktree
cd ~/.cfg
git worktree remove main

About

No description or website provided.

Topics

Resources

Stars

Watchers

Forks