Initial commit

This commit is contained in:
2025-08-20 15:41:13 +02:00
commit d9edd98175
15 changed files with 1077 additions and 0 deletions

50
dotfiles/.bashrc Normal file
View File

@@ -0,0 +1,50 @@
#
# ~/.bashrc
#
# If not running interactively, don't do anything
[[ $- != *i* ]] && return
# History file settings
# No duplicate lines / lines starting with space in history
HISTCONTROL=ignoreboth
# Append to history file (no overwrite)
shopt -s histappend
# File and history sizes
HISTSIZE=1000
HISTFILESIZE=2000
# Check window size after each command, and update accordingly
shopt -s checkwinsize
# Enable color in classic programs
alias ls='ls --color=auto'
alias grep='grep --color=auto'
alias egrep='egrep --color=auto'
alias fgrep='fgrep --color=auto'
alias dir='dir --color=auto'
export MICRO_TRUECOLORS=1
# Bash completion
if [[ -r /usr/share/bash-completion/bash_completion ]]; then
. /usr/share/bash-completion/bash_completion
fi
# Prompt
source /home/${USER}/.config/prompt.sh
# Bitwarden SSH agent
export SSH_AUTH_SOCK=/home/${USER}/.bitwarden-ssh-agent.sock
# PATH modifications
# Local binaries
export PATH="${PATH}:/home/${USER}/.local/bin"
# Editor
export EDITOR=micro
# Aliases
alias e=${EDITOR}
alias l="ls -lla"
alias c="clear"
alias k="kubectl"

View File

@@ -0,0 +1,30 @@
{
"workbench.colorTheme": "One Dark Pro",
"workbench.iconTheme": "material-icon-theme",
"workbench.productIconTheme": "adwaita",
"window.zoomLevel": 2,
"editor.fontFamily": "'Ligconsolata', 'monospace', monospace",
"editor.fontLigatures": true,
"editor.inlineSuggest.enabled": true,
"git.confirmSync": false,
"diffEditor.ignoreTrimWhitespace": false,
"editor.formatOnSave": false,
"github.copilot.enable": {
"*": false
},
"explorer.confirmDelete": false,
"workbench.editorAssociations": {
"*.pdf": "latex-workshop-pdf-hook"
},
"workbench.startupEditor": "none",
"[c]": {
"editor.defaultFormatter": "xaver.clang-format"
},
"window.titleBarStyle": "custom",
"window.commandCenter": true,
"window.autoDetectColorScheme": true,
"workbench.preferredDarkColorTheme": "Adwaita Dark",
"workbench.preferredLightColorTheme": "Adwaita Light",
"editor.renderLineHighlight": "none",
"workbench.tree.indent": 12
}

View File

@@ -0,0 +1,16 @@
# What protocol to use when performing git operations. Supported values: ssh, https
git_protocol: https
# What editor gh should run when creating issues, pull requests, etc. If blank, will refer to environment.
editor:
# When to interactively prompt. This is a global config that cannot be overridden by hostname. Supported values: enabled, disabled
prompt: enabled
# A pager program to send command output to, e.g. "less". Set the value to "cat" to disable the pager.
pager:
# Aliases allow you to create nicknames for gh commands
aliases:
co: pr checkout
# The path to a unix socket through which send HTTP connections. If blank, HTTP traffic will be handled by net/http.DefaultTransport.
http_unix_socket:
# What web browser gh should use when opening URLs. If blank, will refer to environment.
browser:
version: "1"

View File

@@ -0,0 +1,7 @@
font-family = Fira Code
font-size = 15
cursor-style = underline
shell-integration = bash
window-width = 94
window-height = 26
theme = Adwaita Dark

View File

@@ -0,0 +1,31 @@
[user]
name = ${GIT_USER}
email = ${EMAIL}
[core]
compression = 9
whitespace = error
preloadindex = true
autocrlf = input
[url "https://github.com/"]
insteadOf = "gh:"
[credential "https://github.com"]
helper = !/usr/bin/gh auth git-credential
[credential "https://gist.github.com"]
helper = !/usr/bin/gh auth git-credential
[credential]
helper = /usr/lib/git-core/git-credential-libsecret
[init]
defaultBranch = main
[push]
autoSetupRemote = true
default = current
followTags = true
[pull]
default = current
[rebase]
autoStash = true
missingCommitsCheck = warn

View File

@@ -0,0 +1,64 @@
#!/usr/bin/env bash
parse_git_branch()
{
branch=$(git branch 2> /dev/null | sed -e '/^[^*]/d' -e 's/* \(.*\)/ <\1>/')
if [ "$branch" = "" ]; then
echo ""
else
echo -e " \Ue702$branch"
fi
}
parse_docker_context()
{
psdock=$(docker context inspect | jq --raw-output .[0].Name)
if [ "$psdock" = "default" ]; then
echo ""
else
echo -e " \Uf21f $psdock"
fi
}
parse_kubernetes_context()
{
ctx=$(kubectx -c)
if [ "$ctx" = "default" ]; then
echo ""
else
echo -e " \Ue81d $ctx"
fi
}
kernel_live_version() {
echo $(uname -r)
}
kernel_installed_version() {
pacout=$(pacman -Q linux-zen)
pacarr=($pacout)
echo "${pacarr[1]}-zen" | sed 's/\(.*\)\./\1-/'
}
PROMPT_NEED_REBOOT() {
live=$(kernel_live_version)
installed=$(kernel_installed_version)
if [ "$live" = "$installed" ]; then
echo ""
else
echo -e '\[\e[38;2;252;23;3m\] \Uf0709 \[$(tput sgr0)\]'
fi
}
PROMPT_GIT() {
echo "\[$(tput setaf 142)\]\$(parse_git_branch)\[$(tput sgr0)\]"
}
PROMPT_DOCKER() {
echo "\[\e[38;2;29;99;237m\]\$(parse_docker_context)\[$(tput sgr0)\]"
}
PROMPT_KUBE() {
echo "\[\e[38;2;50;108;229m\]\$(parse_kubernetes_context)\[$(tput sgr0)\]"
}
PS1="[\[$(tput setaf 39)\]\u@\h\[$(tput sgr0)\]\[$(tput setaf 31)\] \W\[$(tput sgr0)\]$(PROMPT_GIT)$(PROMPT_DOCKER)$(PROMPT_KUBE)$(PROMPT_NEED_REBOOT)]\\$ \[$(tput sgr0)\]"