minor updates
This commit is contained in:
parent
e3790a4f3f
commit
628baf3eea
32 changed files with 655 additions and 123 deletions
|
|
@ -1,4 +1,5 @@
|
|||
# if [ -z "$SSH_AUTH_SOCK" ]; then
|
||||
# eval "$(ssh-agent -s)"
|
||||
# fi
|
||||
|
||||
systemctl --user import-environment XDG_CURRENT_DESKTOP
|
||||
|
|
|
|||
|
|
@ -1,7 +1,7 @@
|
|||
set -a
|
||||
|
||||
PATH="$HOME/.local/share/go/bin:$PATH"
|
||||
PATH="${$(find -L ~/.local/bin -type d -printf %p:)%%:}:$PATH"
|
||||
PATH="${$(find -L ~/.local/bin ! -name '.*' -type d -printf %p:)%%:}:$PATH"
|
||||
|
||||
# lc vars
|
||||
LANGUAGE="en_US.UTF-8"
|
||||
|
|
@ -26,11 +26,6 @@ GPG_TTY="$(tty)"
|
|||
MANPAGER="sh -c 'col -bx | batcat -l man -p'"
|
||||
MANROFFOPT="-c"
|
||||
MTR_OPTIONS="-t"
|
||||
MOZ_USE_XINPUT2=1
|
||||
|
||||
XDG_CURRENT_DESKTOP="gtk"
|
||||
XDG_SESSION_DESKTOP="$XDG_CURRENT_DESKTOP"
|
||||
WINDOW_MANAGER="dwm"
|
||||
|
||||
SUDO_ASKPASS="${HOME}/.local/bin/scripts/dmenu_askpass"
|
||||
SSH_ASKPASS="${HOME}/.local/bin/scripts/ssh-askpass"
|
||||
|
|
|
|||
|
|
@ -1,8 +1,7 @@
|
|||
[[ $- != *i* ]] && return
|
||||
|
||||
[ "$TERM" = "linux" ] && export TERM=fbterm
|
||||
# [[ $- != *i* ]] && return # idk why would it be tho...
|
||||
|
||||
. ~/.cargo/env
|
||||
. ~/.config/zsh/modes.sh
|
||||
|
||||
# ls colors
|
||||
eval "$(dircolors -b)"
|
||||
|
|
@ -40,7 +39,7 @@ bindkey "^[n" backward-word
|
|||
bindkey "^[m" forward-word
|
||||
|
||||
# completions
|
||||
autoload -Uz compinit
|
||||
autoload -Uz compinit
|
||||
compinit
|
||||
|
||||
zstyle ':completion:*' menu select
|
||||
|
|
@ -86,6 +85,7 @@ alias 7z="7zz" # for whatever reason 7z provides 7zz binary in debian
|
|||
alias wt="watch -d -cn 0.1 "
|
||||
alias cal="ncal -b"
|
||||
alias .e="source .env"
|
||||
alias tp="taskell ${HOME}/.projects.md"
|
||||
|
||||
# function aliases
|
||||
bl() { brightnessctl set "$1"% &> /dev/null; }
|
||||
|
|
@ -126,4 +126,4 @@ alias ta="tmux a -t"
|
|||
stty -ixon
|
||||
|
||||
# print tasks on startup
|
||||
cat ~/.taskell.md
|
||||
cat ~/.taskell.md | grep -v '>.*'
|
||||
|
|
|
|||
62
.config/zsh/modes.sh
Normal file
62
.config/zsh/modes.sh
Normal file
|
|
@ -0,0 +1,62 @@
|
|||
mode::enable() {
|
||||
local mode_path="${HOME}/.config/zsh/modes/$1.sh"
|
||||
[ ! -f "$mode_path" ] && echo "Mode not found!" && return 1
|
||||
export MODE__ACTIVE_MODE="$1"
|
||||
|
||||
export MODE__OLD_PS1="$PS1"
|
||||
export PS1="($1) $PS1"
|
||||
|
||||
# shellcheck disable=SC1090
|
||||
source "$mode_path"
|
||||
}
|
||||
|
||||
|
||||
mode::disable() {
|
||||
export PS1="${MODE__OLD_PS1}"
|
||||
local mode_path="${HOME}/.config/zsh/modes/$MODE__ACTIVE_MODE.sh"
|
||||
|
||||
unset -v "MODE__OLD_PS1"
|
||||
unset -v "MODE__ACTIVE_MODE"
|
||||
|
||||
for mode_variable in $(perl -ne '/^(?>declare\s+(?>--?\w+\s*)+\s*)?\s*([\x21-\x3c\x3e-\x7e]+)=.*$/ && print "$1\n"' < "$mode_path"); do
|
||||
unset "$mode_variable"
|
||||
done
|
||||
|
||||
for mode_function in $(perl -ne '/^(?>function\s+)?([\x21-\x7e]+)\s*\(\)/ && print "$1\n"' < "$mode_path"); do
|
||||
unset -f "$mode_function"
|
||||
done
|
||||
|
||||
for mode_alias in $(perl -ne '/^alias ([\x21-\x3c\x3e-\x7e]+)=/ && print "$1\n"'< "$mode_path"); do
|
||||
unalias "$mode_alias"
|
||||
done
|
||||
}
|
||||
|
||||
|
||||
mode::help() {
|
||||
echo "USAGE"
|
||||
echo " mode [-h]"
|
||||
echo " mode <MODENAME>"
|
||||
echo " mode"
|
||||
echo
|
||||
echo "OPTIONS"
|
||||
echo " -h for help lol"
|
||||
echo
|
||||
echo "AVAILABLE MODES"
|
||||
for mode in ~/.config/zsh/modes/*; do
|
||||
printf " %s\n" "$(basename "${mode%.sh}")"
|
||||
done
|
||||
}
|
||||
|
||||
m() {
|
||||
[ -n "$MODE__ACTIVE_MODE" ] && mode::disable && return
|
||||
local cmd="${1:?}"
|
||||
|
||||
case "$cmd" in
|
||||
"-h"|"--help")
|
||||
mode::help
|
||||
;;
|
||||
*)
|
||||
mode::enable "$cmd" || mode::help >&2
|
||||
;;
|
||||
esac
|
||||
}
|
||||
18
.config/zsh/modes/cpp.sh
Normal file
18
.config/zsh/modes/cpp.sh
Normal file
|
|
@ -0,0 +1,18 @@
|
|||
# shellcheck disable=SC2139
|
||||
|
||||
CPP_MODE__BUILD_DIR="./cmake-build"
|
||||
|
||||
alias cb="cmake --build ${CPP_MODE__BUILD_DIR}"
|
||||
alias cg="cmake -B ${CPP_MODE__BUILD_DIR} -DCMAKE_EXPORT_COMPILE_COMMANDS=1 && ln -sf ${CPP_MODE__BUILD_DIR}/compile_commands.json ."
|
||||
|
||||
cpp_mode::find_exec() {
|
||||
find "${CPP_MODE__BUILD_DIR}/$1" -maxdepth 1 -type f -executable
|
||||
}
|
||||
|
||||
ct() {
|
||||
eval "$(cpp_mode::find_exec "tests")"
|
||||
}
|
||||
|
||||
cr() {
|
||||
eval "$(cpp_mode::find_exec)"
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue