Initial commit: Python dotfiles system

This commit is contained in:
2025-07-03 17:14:52 +02:00
commit 6b4f19c2dc
20 changed files with 2185 additions and 0 deletions

23
templates/shell/bashrc Normal file
View File

@@ -0,0 +1,23 @@
OS=$(cat /etc/os-release | grep '^ID=' | cut -d "=" -f2)
. /etc/skel/.bashrc
alias ls='ls --color=auto'
alias grep='grep --color=auto'
alias codium="codium --ozone-platform-hint=wayland"
export PATH=~/.cargo/bin:~/.bin:/home/cseyfferth/.local/bin:$PATH
# PS1='[\u@\h \W]\$ '
export BW_SESSION="+GCKSMq51RO3R/+zNblGqegfqZnA+FnywqaNEuiakQafhtah/4jlenScb387utdOQoyhx+5AorSUOFV149zqnA=="
export SSH_AUTH_SOCK=$XDG_RUNTIME_DIR/gcr/ssh
export PATH=~/node_modules/.bin:$PATH
export PATH=~/.bin/:$PATH
[[ "$TERM_PROGRAM" == "vscode" ]] && . "$(code --locate-shell-integration-path bash)"
#THIS MUST BE AT THE END OF THE FILE FOR SDKMAN TO WORK!!!
export SDKMAN_DIR="$HOME/.sdkman"
[[ -s "$HOME/.sdkman/bin/sdkman-init.sh" ]] && source "$HOME/.sdkman/bin/sdkman-init.sh"

39
templates/shell/bashrc.j2 Normal file
View File

@@ -0,0 +1,39 @@
# Bash configuration for {{ machine }} ({{ hostname }})
# Generated by dotfiles system
# History settings
HISTSIZE=10000
HISTFILESIZE=20000
HISTCONTROL=ignoreboth
# Aliases
alias ll='ls -alF'
alias la='ls -A'
alias l='ls -CF'
alias grep='grep --color=auto'
{% if machine == 'server' %}
# Server-specific settings
alias logs='sudo journalctl -f'
alias status='systemctl status'
{% elif machine == 'desktop' %}
# Desktop-specific settings
alias open='xdg-open'
alias screenshot='gnome-screenshot'
{% endif %}
# User-specific settings
export EDITOR=vim
export PATH="$HOME/.local/bin:$PATH"
# Machine-specific additions
{% if machine == 'laptop' %}
# Laptop power settings
alias hibernate='systemctl hibernate'
alias suspend='systemctl suspend'
{% endif %}
# Load local bashrc if it exists
if [ -f ~/.bashrc.local ]; then
source ~/.bashrc.local
fi

85
templates/shell/zshrc Normal file
View File

@@ -0,0 +1,85 @@
bindkey '[3~' delete-char
function load_venv_on_cd() {
if [[ -d "./venv" ]]; then
source "./venv/bin/activate"
echo "Python venv aktiviert: ./venv"
elif [[ -d "./.venv" ]]; then
source "./.venv/bin/activate"
echo "Python venv aktiviert: ./.venv"
fi
}
if [[ ! "$TERM_PROGRAM" == "vscode" ]]; then
typeset -g POWERLEVEL9K_TERM_SHELL_INTEGRATION=true
# Enable Powerlevel10k instant prompt. Should stay close to the top of ~/.zshrc.
# Initialization code that may require console input (password prompts, [y/n]
# confirmations, etc.) must go above this block; everything else may go below.
if [[ -r "${XDG_CACHE_HOME:-$HOME/.cache}/p10k-instant-prompt-${(%):-%n}.zsh" ]]; then
source "${XDG_CACHE_HOME:-$HOME/.cache}/p10k-instant-prompt-${(%):-%n}.zsh"
fi
# The following lines were added by compinstall
zstyle ':completion:*' completer _expand _complete _ignored _correct _approximate
zstyle ':completion:*' group-name ''
zstyle :compinstall filename '/home/cseyfferth/.zshrc'
autoload -Uz compinit
compinit
# End of lines added by compinstall
# Lines configured by zsh-newuser-install
HISTFILE=~/.histfile
HISTSIZE=1000
SAVEHIST=1000
# End of lines configured by zsh-newuser-install
PROMPT="[%n@%m %~]$ "
RPROMPT='%(?.%F{green}√.%F{red}?%?)%f~'
source /usr/share/zsh/plugins/fast-syntax-highlighting/fast-syntax-highlighting.plugin.zsh
#source /usr/share/zsh/scripts/zplug/init.zsh
source /usr/share/zsh-theme-powerlevel10k/powerlevel10k.zsh-theme
# To customize prompt, run `p10k configure` or edit ~/.p10k.zsh.
[[ ! -f ~/.p10k.zsh ]] || source ~/.p10k.zsh
zstyle ':completion:*:(ssh|scp|sftp):*:hosts' ignored-patterns '*'
# zstyle ':completion:*:ssh:*' config-file ~/.ssh/config
zstyle ':completion:*' insert-tab false
autoload -Uz compinit
compinit
zstyle ':completion:*' menu select
export BW_SESSION="+GCKSMq51RO3R/+zNblGqegfqZnA+FnywqaNEuiakQafhtah/4jlenScb387utdOQoyhx+5AorSUOFV149zqnA=="
export SSH_AUTH_SOCK=$XDG_RUNTIME_DIR/gcr/ssh
export PATH=/home/cseyfferth/.bin/:$PATH
else
echo "🚀 Powerlevel10k instant prompt is disabled in Visual Studio Code terminal. To enable, set TERM_PROGRAM to a value other than 'vscode'."
[[ "$TERM_PROGRAM" == "vscode" ]] && . "$(code --locate-shell-integration-path zsh 2>/dev/null)" 2>/dev/null || . "$(code-insiders --locate-shell-integration-path zsh 2>/dev/null)"
# wenn $? = 0 dann ist der letzte Befehl erfolgreich ausgeführt worden
if [[ $? -eq 0 ]]; then
echo "🚀 Visual Studio Code shell integration enabled."
else
echo "🚀 Visual Studio Code shell integration not found. Please make sure that 'code' is in PATH."
fi
# set prompt
PROMPT="[%n@%m %~]$ "
fi
export PATH=/home/cseyfferth/.cargo/bin:$PATH
autoload -U add-zsh-hook
add-zsh-hook chpwd load_venv_on_cd
#THIS MUST BE AT THE END OF THE FILE FOR SDKMAN TO WORK!!!
export SDKMAN_DIR="$HOME/.sdkman"
[[ -s "$HOME/.sdkman/bin/sdkman-init.sh" ]] && source "$HOME/.sdkman/bin/sdkman-init.sh"
# Created by `pipx` on 2025-06-19 10:50:20
export PATH="$PATH:/home/cseyfferth/.local/bin"