mirror of
https://github.com/sebaschi/dotfiles.git
synced 2025-12-29 10:18:26 +01:00
Compare commits
13 Commits
c074cfa3e0
...
main
| Author | SHA1 | Date | |
|---|---|---|---|
| a2ac456f72 | |||
| 04a07210a4 | |||
| 8ef6a87ba1 | |||
| 7c30e64c4b | |||
| 6475b15d70 | |||
| 36a3766aef | |||
| 0a392b6252 | |||
| 3540c154e6 | |||
| 45b952f37a | |||
| 4a425ec8f1 | |||
| 4b3a47a17f | |||
| 84b20638f3 | |||
| a4f2cff5f3 |
@@ -1,4 +0,0 @@
|
||||
# Changes
|
||||
|
||||
## Monday June 16, 2025
|
||||
Started to reorganize the repo for use with GNU stow. I'm thinking why develop and maintain a system myself, when such a good tool for symlink farming, and thus also my use case of dotfiles management, already exists.
|
||||
49
README.md
49
README.md
@@ -1,51 +1,38 @@
|
||||
# Dotfiles
|
||||
|
||||
A collection of configuration files for various tools and applications I use, with an installation script to easily set them up on new systems.
|
||||
Personal dotfiles and more
|
||||
|
||||
## Installation
|
||||
|
||||
### Clone the repository
|
||||
Install [GNU stow](https://gnu.org/software/stow/).
|
||||
You **will** want a version >= 8. September 2024! See [here](https://cgit.git.savannah.gnu.org/cgit/stow.git/tree/NEWS).
|
||||
This is so `dot-*` named files (or dirs) are handled correctly!
|
||||
|
||||
See `run.sh`. Use it as taskfile to install stow.
|
||||
|
||||
Then, to make sure that stow is correctly handling `dot-*` named dirs, run
|
||||
|
||||
```bash
|
||||
git clone git@github.com:sebaschi/dotfiles.git ~/.dotfiles
|
||||
stow --dotfiles --verbose stow
|
||||
```
|
||||
{
|
||||
This installs the `dot-stowrc` and global ignore list.
|
||||
|
||||
### Install configurations
|
||||
|
||||
The `dot-install` script can be used to install specific configurations or all of them at once:
|
||||
|
||||
```bash
|
||||
# Install everything
|
||||
~/.dotfiles/dot-install all
|
||||
|
||||
# Install specific configurations
|
||||
~/.dotfiles/dot-install git nvim tmux
|
||||
|
||||
# Install only bash aliases
|
||||
~/.dotfiles/dot-install bash:aliases
|
||||
## Installing configs
|
||||
```sh
|
||||
stow <config-pkg-name>
|
||||
```
|
||||
|
||||
Run `~/.dotfiles/dot-install` without arguments to see all available options.
|
||||
|
||||
## Testing
|
||||
|
||||
A test script is included to verify the installation script works correctly:
|
||||
|
||||
```bash
|
||||
~/.dotfiles/test-dot-install
|
||||
`<config-pkg-name>` is just one of the directories of this repo.
|
||||
To see what the effect would be without applying anything (dry-run):
|
||||
```sh
|
||||
stow -n <config-pkg-name>
|
||||
```
|
||||
|
||||
This runs the installation in an isolated environment to ensure all symlinks are correctly created.
|
||||
Nothing fancy, just creates mock home in `/tmp` and changes some envars used by the install script.
|
||||
The "Testing" amounts to check symlinks exist. This is mostly usefull once extended to detect config packages (just the directories containing an a config), to remind me to add a function for it in `dot-install`.
|
||||
|
||||
## Included Configurations
|
||||
|
||||
* **Shells**: Bash, Fish, Zsh
|
||||
* **Terminal**: Tmux, Zellij, Ghostty
|
||||
* **Editors**: Vim, Neovim (with lazy.nvim)
|
||||
* **Tools**: Git, Starship prompt, Borg backup
|
||||
* **Tools**: Git, Starship prompt, Borg backup, Fossil (**TODO**)
|
||||
* **Utilities**: Rsync filters
|
||||
|
||||
## Tools Tools
|
||||
|
||||
7
bash/dot-bash_logout
Normal file
7
bash/dot-bash_logout
Normal file
@@ -0,0 +1,7 @@
|
||||
# ~/.bash_logout: executed by bash(1) when login shell exits.
|
||||
|
||||
# when leaving the console clear the screen to increase privacy
|
||||
|
||||
if [ "$SHLVL" = 1 ]; then
|
||||
[ -x /usr/bin/clear_console ] && /usr/bin/clear_console -q
|
||||
fi
|
||||
161
bash/dot-bashrc
Normal file
161
bash/dot-bashrc
Normal file
@@ -0,0 +1,161 @@
|
||||
# ~/.bashrc: executed by bash(1) for non-login shells.
|
||||
# see /usr/share/doc/bash/examples/startup-files (in the package bash-doc)
|
||||
# for examples
|
||||
|
||||
# If not running interactively, don't do anything
|
||||
case $- in
|
||||
*i*) ;;
|
||||
*) return;;
|
||||
esac
|
||||
|
||||
# don't put duplicate lines or lines starting with space in the history.
|
||||
# See bash(1) for more options
|
||||
HISTCONTROL=ignoreboth
|
||||
|
||||
# append to the history file, don't overwrite it
|
||||
shopt -s histappend
|
||||
|
||||
# for setting history length see HISTSIZE and HISTFILESIZE in bash(1)
|
||||
HISTSIZE=1000
|
||||
HISTFILESIZE=2000
|
||||
|
||||
# check the window size after each command and, if necessary,
|
||||
# update the values of LINES and COLUMNS.
|
||||
shopt -s checkwinsize
|
||||
|
||||
# If set, the pattern "**" used in a pathname expansion context will
|
||||
# match all files and zero or more directories and subdirectories.
|
||||
#shopt -s globstar
|
||||
|
||||
# make less more friendly for non-text input files, see lesspipe(1)
|
||||
[ -x /usr/bin/lesspipe ] && eval "$(SHELL=/bin/sh lesspipe)"
|
||||
|
||||
# set variable identifying the chroot you work in (used in the prompt below)
|
||||
if [ -z "${debian_chroot:-}" ] && [ -r /etc/debian_chroot ]; then
|
||||
debian_chroot=$(cat /etc/debian_chroot)
|
||||
fi
|
||||
|
||||
# set a fancy prompt (non-color, unless we know we "want" color)
|
||||
case "$TERM" in
|
||||
xterm-color|*-256color) color_prompt=yes;;
|
||||
esac
|
||||
# uncomment for a colored prompt, if the terminal has the capability; turned
|
||||
# off by default to not distract the user: the focus in a terminal window
|
||||
# should be on the output of commands, not on the prompt
|
||||
#force_color_prompt=yes
|
||||
|
||||
if [ -n "$force_color_prompt" ]; then
|
||||
if [ -x /usr/bin/tput ] && tput setaf 1 >&/dev/null; then
|
||||
# We have color support; assume it's compliant with Ecma-48
|
||||
# (ISO/IEC-6429). (Lack of such support is extremely rare, and such
|
||||
# a case would tend to support setf rather than setaf.)
|
||||
color_prompt=yes
|
||||
else
|
||||
color_prompt=
|
||||
fi
|
||||
fi
|
||||
|
||||
if [ "$color_prompt" = yes ]; then
|
||||
PS1='${debian_chroot:+($debian_chroot)}\[\033[01;32m\]\u@\h\[\033[00m\]:\[\033[01;34m\]\w\[\033[00m\]\$ '
|
||||
else
|
||||
PS1='${debian_chroot:+($debian_chroot)}\u@\h:\w\$ '
|
||||
fi
|
||||
unset color_prompt force_color_prompt
|
||||
|
||||
# If this is an xterm set the title to user@host:dir
|
||||
case "$TERM" in
|
||||
xterm*|rxvt*)
|
||||
PS1="\[\e]0;${debian_chroot:+($debian_chroot)}\u@\h: \w\a\]$PS1"
|
||||
;;
|
||||
*)
|
||||
;;
|
||||
esac
|
||||
|
||||
# enable color support of ls and also add handy aliases
|
||||
if [ -x /usr/bin/dircolors ]; then
|
||||
test -r ~/.dircolors && eval "$(dircolors -b ~/.dircolors)" || eval "$(dircolors -b)"
|
||||
alias ls='eza --color'
|
||||
alias dir='dir --color'
|
||||
alias vdir='vdir --color'
|
||||
|
||||
# using ugrep instead of grep
|
||||
alias grep='ug -G --color'
|
||||
alias fgrep='ug -F --color'
|
||||
alias egrep='ug -E --color'
|
||||
fi
|
||||
|
||||
# colored GCC warnings and errors
|
||||
export GCC_COLORS='error=01;31:warning=01;35:note=01;36:caret=01;32:locus=01:quote=01'
|
||||
|
||||
# some more ls aliases
|
||||
alias ll='ls -alF'
|
||||
alias la='ls -A'
|
||||
alias l='ls -hF'
|
||||
|
||||
# Add an "alert" alias for long running commands. Use like so:
|
||||
# sleep 10; alert
|
||||
alias alert='notify-send --urgency=low -i "$([ $? = 0 ] && echo terminal || echo error)" "$(history|tail -n1|sed -e '\''s/^\s*[0-9]\+\s*//;s/[;&|]\s*alert$//'\'')"'
|
||||
|
||||
# Alias definitions.
|
||||
# You may want to put all your additions into a separate file like
|
||||
# ~/.bash_aliases, instead of adding them here directly.
|
||||
# See /usr/share/doc/bash-doc/examples in the bash-doc package.
|
||||
|
||||
if [ -f ~/.bash_aliases ]; then
|
||||
. ~/.bash_aliases
|
||||
fi
|
||||
|
||||
# Source bash env list
|
||||
source $HOME/.local/share/bash/bash_env
|
||||
|
||||
# Pet snippet manager
|
||||
# register previous command
|
||||
function prev() {
|
||||
PREV=$(echo $(history | tail -n2 | head -n1) | sed 's/[0-9]* //')
|
||||
sh -c "pet new $(printf %q "$PREV")"
|
||||
}
|
||||
|
||||
# TODO if [ -d ~/.bashrc.d ]; then
|
||||
|
||||
# enable programmable completion features (you don't need to enable
|
||||
# this, if it's already enabled in /etc/bash.bashrc and /etc/profile
|
||||
# sources /etc/bash.bashrc).
|
||||
if ! shopt -oq posix; then
|
||||
if [ -f /usr/share/bash-completion/bash_completion ]; then
|
||||
. /usr/share/bash-completion/bash_completion
|
||||
elif [ -f /etc/bash_completion ]; then
|
||||
. /etc/bash_completion
|
||||
fi
|
||||
fi
|
||||
. "$HOME/.cargo/env"
|
||||
|
||||
|
||||
# Starship init
|
||||
eval "$(starship init bash)"
|
||||
|
||||
# Homebrew
|
||||
eval "$(/home/linuxbrew/.linuxbrew/bin/brew shellenv)"
|
||||
|
||||
# Pagers
|
||||
#export PAGER="$(which moar)"
|
||||
# export MANPAGER="$PAGER"
|
||||
|
||||
# Github CLI aliases
|
||||
alias ghce="gh copilot explain"
|
||||
alias ghcs="gh copilot suggest"
|
||||
|
||||
# Util Aliases
|
||||
# broot does this now
|
||||
# alias fcd='cd "$(dirname "$(fzf)")"'
|
||||
alias st='systemctl-tui'
|
||||
alias task='./task.py'
|
||||
|
||||
# BEGIN hcloud
|
||||
source <(hcloud completion bash)
|
||||
# END hcloud
|
||||
|
||||
source /home/seb/.config/broot/launcher/bash/br
|
||||
|
||||
[ -f "/home/seb/.ghcup/env" ] && . "/home/seb/.ghcup/env" # ghcup-env
|
||||
|
||||
alias nodeman='ssh hwsec nodeman'
|
||||
@@ -7,7 +7,7 @@ window-width = 140
|
||||
window-height = 35
|
||||
window-save-state = always
|
||||
auto-update = download
|
||||
command = /home/linuxbrew/.linuxbrew/bin/nu
|
||||
# command = /home/linuxbrew/.linuxbrew/bin/nu
|
||||
keybind = ctrl+shift+l=goto_split:right
|
||||
keybind = ctrl+shift+h=goto_split:left
|
||||
keybind = ctrl+shift+j=goto_split:bottom
|
||||
|
||||
@@ -1,10 +1,9 @@
|
||||
[user]
|
||||
email = 74497638+sebaschi@users.noreply.github.com
|
||||
name = Sebastian Lenzlinger
|
||||
[http]
|
||||
sslVerify = false
|
||||
[filter "lfs"]
|
||||
clean = git-lfs clean -- %f
|
||||
smudge = git-lfs smudge -- %f
|
||||
process = git-lfs filter-process
|
||||
required = true
|
||||
email = s.m.lenzlinger@student.vu.nl
|
||||
[init]
|
||||
defaultBranch = devel
|
||||
[core]
|
||||
editor = nvim
|
||||
[gpg "ssh"]
|
||||
allowedSignersFile = /home/seb/.ssh/allowed_signers
|
||||
|
||||
17
git/dot-config/git/ignore
Normal file
17
git/dot-config/git/ignore
Normal file
@@ -0,0 +1,17 @@
|
||||
.claude/
|
||||
.claude
|
||||
.claude/**
|
||||
Claude.md
|
||||
*.o
|
||||
*.log
|
||||
cache/
|
||||
logs/
|
||||
build/
|
||||
|
||||
# Python stuff
|
||||
__pycache__/
|
||||
*.pyc
|
||||
|
||||
|
||||
# Environement/ 12 Factor
|
||||
.env
|
||||
5
helix/dot-config/helix/config.toml
Normal file
5
helix/dot-config/helix/config.toml
Normal file
@@ -0,0 +1,5 @@
|
||||
theme = "yellowed"
|
||||
|
||||
[editor.cursor-shape]
|
||||
insert = "bar"
|
||||
|
||||
37
pet/dot-config/pet/config.toml
Normal file
37
pet/dot-config/pet/config.toml
Normal file
@@ -0,0 +1,37 @@
|
||||
|
||||
[GHEGist]
|
||||
Public = false
|
||||
access_token = ""
|
||||
auto_sync = false
|
||||
base_url = ""
|
||||
file_name = ""
|
||||
gist_id = ""
|
||||
upload_url = ""
|
||||
|
||||
[General]
|
||||
Backend = "gist"
|
||||
Cmd = []
|
||||
Color = false
|
||||
Column = 40
|
||||
Editor = "sensible-editor"
|
||||
Format = "[$description]: $command $tags"
|
||||
SelectCmd = "fzf --ansi --layout=reverse --border --height=90% --pointer=* --cycle --prompt=Snippets:"
|
||||
SnippetDirs = []
|
||||
SnippetFile = "/home/seb/.config/pet/snippet.toml"
|
||||
SortBy = ""
|
||||
|
||||
[Gist]
|
||||
Public = false
|
||||
access_token = ""
|
||||
auto_sync = false
|
||||
file_name = "pet-snippet.toml"
|
||||
gist_id = ""
|
||||
|
||||
[GitLab]
|
||||
ID = ""
|
||||
Url = ""
|
||||
Visibility = "private"
|
||||
access_token = ""
|
||||
auto_sync = false
|
||||
file_name = "pet-snippet.toml"
|
||||
skip_ssl = false
|
||||
5
pet/dot-config/pet/notes.md
Normal file
5
pet/dot-config/pet/notes.md
Normal file
@@ -0,0 +1,5 @@
|
||||
# IMPORTANT
|
||||
The two `prev.{bash, zsh}` functions need to go into `.bashrc` or `.zshrc` respectively.
|
||||
The `pet-slect.*` need to be put in the rc EXACTLY AS IS!!!. Else the keys aren't rebound.
|
||||
Those files are taken from [this](https://github.com/knqyf263/pet) Readme. As such,
|
||||
that repos license might apply!
|
||||
2073
pet/dot-config/pet/pet-repo-README.md
Normal file
2073
pet/dot-config/pet/pet-repo-README.md
Normal file
File diff suppressed because one or more lines are too long
6
pet/dot-config/pet/pre-select.bash
Normal file
6
pet/dot-config/pet/pre-select.bash
Normal file
@@ -0,0 +1,6 @@
|
||||
function pet-select() {
|
||||
BUFFER=$(pet search --query "$READLINE_LINE")
|
||||
READLINE_LINE=$BUFFER
|
||||
READLINE_POINT=${#BUFFER}
|
||||
}
|
||||
bind -x '"\C-x\C-r": pet-select'
|
||||
8
pet/dot-config/pet/pre-select.zsh
Normal file
8
pet/dot-config/pet/pre-select.zsh
Normal file
@@ -0,0 +1,8 @@
|
||||
function pet-select() {
|
||||
BUFFER=$(pet search --query "$LBUFFER")
|
||||
CURSOR=$#BUFFER
|
||||
zle redisplay
|
||||
}
|
||||
zle -N pet-select
|
||||
stty -ixon
|
||||
bindkey '^s' pet-select
|
||||
4
pet/dot-config/pet/prev.bash
Normal file
4
pet/dot-config/pet/prev.bash
Normal file
@@ -0,0 +1,4 @@
|
||||
function prev() {
|
||||
PREV=$(echo `history | tail -n2 | head -n1` | sed 's/[0-9]* //')
|
||||
sh -c "pet new `printf %q "$PREV"`"
|
||||
}
|
||||
4
pet/dot-config/pet/prev.zsh
Normal file
4
pet/dot-config/pet/prev.zsh
Normal file
@@ -0,0 +1,4 @@
|
||||
function prev() {
|
||||
PREV=$(fc -lrn | head -n 1)
|
||||
sh -c "pet new `printf %q "$PREV"`"
|
||||
}
|
||||
12
pet/dot-config/pet/snippet.toml
Normal file
12
pet/dot-config/pet/snippet.toml
Normal file
@@ -0,0 +1,12 @@
|
||||
|
||||
[[Snippets]]
|
||||
Description = "Get root shell while preserving environment variables."
|
||||
Output = ""
|
||||
Tag = ["superuser", "bash", "sh", "envvar"]
|
||||
command = "sudo -E --shell"
|
||||
|
||||
[[Snippets]]
|
||||
Description = "Preprocess slabinfo header so that columns align correctly"
|
||||
Output = ""
|
||||
Tag = []
|
||||
command = "sed 's/# //' /proc/slabinfo | column -t"
|
||||
@@ -40,3 +40,6 @@ install_gnu_stow() {
|
||||
install_stow_latest_from_source
|
||||
fi
|
||||
}
|
||||
|
||||
|
||||
"@"
|
||||
12
shellib/dot-local/lib/shellib/libseb.sh
Normal file
12
shellib/dot-local/lib/shellib/libseb.sh
Normal file
@@ -0,0 +1,12 @@
|
||||
log() {
|
||||
# Write msg to stderr.
|
||||
# Taken from https://github.com/oils-for-unix/oils/blob/master/stdlib/osh/two.sh
|
||||
echo "$@" >&2
|
||||
}
|
||||
|
||||
die() {
|
||||
# Write error msg with script name and exit with status 1.
|
||||
# Taken from https://github.com/oils-for-unix/oils/blob/master/stdlib/osh/two.sh
|
||||
log "$@: fatal $@"
|
||||
exit 1
|
||||
}
|
||||
Reference in New Issue
Block a user