From 54b4cbe4a1d83226fb1d69a208e02410765c626c Mon Sep 17 00:00:00 2001 From: Hendrik Boll Date: Sun, 16 Mar 2025 15:53:06 +0100 Subject: [PATCH] sh: initial commit, profile, alias --- dot_alias | 24 ++++++++++++++++++++ dot_profile | 52 ++++++++++++++++++++++++++++++++++++++++++++ dot_shrc | 9 ++++++++ dot_zshrc | 23 ++++++++++++++++++++ symlink_dot_zprofile | 1 + 5 files changed, 109 insertions(+) create mode 100644 dot_alias create mode 100644 dot_profile create mode 100644 dot_shrc create mode 100644 dot_zshrc create mode 100644 symlink_dot_zprofile diff --git a/dot_alias b/dot_alias new file mode 100644 index 0000000..a426e21 --- /dev/null +++ b/dot_alias @@ -0,0 +1,24 @@ +# xbps +alias xup='xi -Su' +alias xun='xi -Sun' + +# listing files +eza_params=( + --git --icons --group --group-directories-first --time-style=long-iso + --color-scale=all --modified --classify=auto +) +eza_params_long=( + --long --header +) +[ ! -z $_EZA_PARAMS ] && eza_params=($_EZA_PARAMS) + +alias ls="eza $eza_params" +alias l="eza --git-ignore $eza_params" +alias ll="eza $eza_params_long $eza_params" +alias la="eza --all $eza_params_long $eza_params" +alias lt="eza $eza_params_long $eza_params --level" + +alias cat="bat -p" + +# system helpers +command -v doas >/dev/null && alias sudo='doas' diff --git a/dot_profile b/dot_profile new file mode 100644 index 0000000..4bbd7b0 --- /dev/null +++ b/dot_profile @@ -0,0 +1,52 @@ +#!/bin/sh +# .profile + +: ${BROWSER:=$(command -v firefox 2>/dev/null)} +export BROWSER + +: ${EDITOR:=$(command -v hx 2>/dev/null)} +: ${VISUAL:="$EDITOR"} +export EDITOR VISUAL + +: ${PAGER:=$(command -v bat)} +export PAGER + +for x in \ + "$HOME/.local/share" \ + "/usr/share" \ + "/usr/local/share" \ + ; do + [ -d "$x" ] || continue + case ":${XDG_DATA_DIRS}:" in + *":${x}:"*) ;; + *) XDG_DATA_DIRS="${XDG_DATA_DIRS:+$XDG_DATA_DIRS:}${x}" ;; + esac +done +export XDG_DATA_DIRS + +for x in \ + "$HOME/bin" \ + "$HOME/.local/bin" \ + "/usr/local/sbin" \ + "/usr/local/bin" \ + "/usr/sbin" \ + "/usr/bin" \ + "/sbin" \ + "/bin" \ + ; do + [ -d "$x" ] || continue + case ":${PATH}:" in + *":${x}:"*) ;; + *) PATH="${x:+$x:}${PATH}" ;; + esac +done +export PATH + +# XDG_RUNTIME_DIR is managed by turnstile +: ${XDG_CONFIG_HOME:=$HOME/.config} +: ${XDG_CACHE_HOME:=$HOME/.cache} +: ${XDG_DATA_HOME:=$HOME/.data} +export XDG_CONFIG_HOME XDG_CACHE_HOME XDG_DATA_HOME + +export FZF_DEFAULT_COMMAND="fd --strip-cwd-prefix --hidden --follow" +export SVDIR="${XDG_CONFIG_HOME}"/service diff --git a/dot_shrc b/dot_shrc new file mode 100644 index 0000000..1dc7371 --- /dev/null +++ b/dot_shrc @@ -0,0 +1,9 @@ +#!/bin/sh +# .shrc + +for f in \ + "$HOME"/.profile \ + "$HOME"/.alias \ + ; do + [ -f "$f" ] && . "$f" +done diff --git a/dot_zshrc b/dot_zshrc new file mode 100644 index 0000000..2577c00 --- /dev/null +++ b/dot_zshrc @@ -0,0 +1,23 @@ +#!/bin/zsh +# .zshrc + +# if not running interactively, don't do anything +[[ $- != *i* ]] && return + +# load shell agnostic configs +source "$HOME"/.shrc + +# init zinit +ZINIT_HOME="${XDG_DATA_HOME:-${HOME}/.local/share}/zinit/zinit.git" + +[ ! -d "$ZINIT_HOME" ] && { + mkdir -p "$(dirname $ZINIT_HOME)" + git clone https://github.com/zdharma-continuum/zinit.git "$ZINIT_HOME" +} +source "${ZINIT_HOME}/zinit.zsh" + +# load custom configs +for f in "$HOME"/.zsh/*.zsh ; do + source "$f" +done + diff --git a/symlink_dot_zprofile b/symlink_dot_zprofile new file mode 100644 index 0000000..0830d45 --- /dev/null +++ b/symlink_dot_zprofile @@ -0,0 +1 @@ +/home/hendrik/.profile