From 197a1a74f468d9d69d624b19f90280a3946455e5 Mon Sep 17 00:00:00 2001 From: Raymaekers Luca Date: Tue, 16 Apr 2024 10:04:31 +0200 Subject: update --- config/essentials/zsh/.zshrc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'config/essentials/zsh/.zshrc') diff --git a/config/essentials/zsh/.zshrc b/config/essentials/zsh/.zshrc index cb5e120..b7128b9 100644 --- a/config/essentials/zsh/.zshrc +++ b/config/essentials/zsh/.zshrc @@ -22,9 +22,9 @@ zle -N add-surround surround zle -N change-surround surround ### Source files +. $XDG_CONFIG_HOME/zsh/comp.zsh . $XDG_CONFIG_HOME/shell/functions.sh . $XDG_CONFIG_HOME/shell/aliases.sh -. $XDG_CONFIG_HOME/zsh/comp.zsh . $XDG_CONFIG_HOME/zsh/widgets.zsh # . $XDG_CONFIG_HOME/zsh/prompt.zsh # . $XDG_CONFIG_HOME/zsh/plugins.zsh -- cgit v1.2.3 From 80462e764abf047544be6026c5d67c1f54599ae5 Mon Sep 17 00:00:00 2001 From: Raymaekers Luca Date: Fri, 3 May 2024 18:22:38 +0200 Subject: Update --- bin/extra/aivpn | 18 ++++++++++-------- config/essentials/shell/aliases.sh | 1 + config/essentials/shell/functions.sh | 11 +++++++++++ config/essentials/starship.toml | 4 +--- config/essentials/zsh/.zshrc | 7 +++++++ 5 files changed, 30 insertions(+), 11 deletions(-) (limited to 'config/essentials/zsh/.zshrc') diff --git a/bin/extra/aivpn b/bin/extra/aivpn index 6fa0783..21436ed 100755 --- a/bin/extra/aivpn +++ b/bin/extra/aivpn @@ -1,6 +1,6 @@ #!/bin/sh -logn() { printf "%s\n" "$@"; } +err() { printf "%s\n" "$@"; } if [ "$1" = "-k" ] then @@ -8,23 +8,25 @@ then exit fi -keyadd ehb/ai +err "I: Waiting for connectivity..." +while ! ssh -o ConnectTimeout=1 -o BatchMode=yes vm 2>&1 | grep "Permission denied" > /dev/null +do sleep 1 +done + export SSH_ASKPASS="sshpass" export SSH_ASKPASS_REQUIRE="prefer" export PASSWORD="zot/qemu" -logn "I: Waiting for connectivity..." -while ! ssh -o ConnectTimeout=1 -o BatchMode=yes vm 2>&1 | grep "Permission denied" > /dev/null -do sleep 1 -done - -logn "I: Activating vpn" +err "I: Activating vpn" ssh vm "rasdial \"vpn.student.ehb.be\"" + +keyadd ehb/ai ssh -f -N \ -L 2222:10.2.160.41:22 \ vm +keyadd ehb/vm_int ssh -f -N \ -L 2223:10.2.160.9:22 \ vm diff --git a/config/essentials/shell/aliases.sh b/config/essentials/shell/aliases.sh index d5f3e7f..6305a90 100644 --- a/config/essentials/shell/aliases.sh +++ b/config/essentials/shell/aliases.sh @@ -333,3 +333,4 @@ alias update-mirrors='reflector -p https | rankmirrors -n 10 -p -w - | doas tee alias tmpd='cd $(mktemp -d)' alias brs='$BROWSER' + diff --git a/config/essentials/shell/functions.sh b/config/essentials/shell/functions.sh index 8172c73..1fd6e92 100644 --- a/config/essentials/shell/functions.sh +++ b/config/essentials/shell/functions.sh @@ -332,3 +332,14 @@ serve() { } ssh_keyadd() { ssh-keygen -f "$HOME"/.ssh/"$1" -P "$(pass generate -f keys/"$HOST"/ssh/"$1" | tail -n 1)" -t ed25519; } + + +fchange() +{ + [ "$1" ] || return 1 + inotifywait -m -e create,modify,delete --format "%f" "${2:-.}" | + while read -r EVENT + do + eval "$1" + done +} diff --git a/config/essentials/starship.toml b/config/essentials/starship.toml index cd5832f..15139f5 100644 --- a/config/essentials/starship.toml +++ b/config/essentials/starship.toml @@ -34,8 +34,6 @@ disabled = false [custom.upds] command = 'cat ~/.cache/updates' # shows output of command -# detect_files = ['foo'] # can specify filters but wildcards are not supported -when = ''' test "$(cat ~/.cache/updates)" -gt 0''' +when = '[ "$(cat ~/.cache/updates)" -gt 0 ]' symbol = '📦' format = '$output$symbol ' - diff --git a/config/essentials/zsh/.zshrc b/config/essentials/zsh/.zshrc index c9bf8b1..ab66fcb 100644 --- a/config/essentials/zsh/.zshrc +++ b/config/essentials/zsh/.zshrc @@ -110,6 +110,13 @@ bindkey -M menuselect '^xh' accept-and-hold # Hold bindkey -M menuselect '^xn' accept-and-infer-next-history # Next bindkey -M menuselect '^xu' undo # Undo +space-expand-alias() { + zle _expand_alias + zle self-insert +} +zle -N space-expand-alias +bindkey -M main ' ' space-expand-alias + ## window title hooks add-zsh-hook -Uz preexec () { print -n "\e]0;$1\a\033[0m"; } add-zsh-hook -Uz precmd set_wt (){ print -Pn "\e]0;%n@%m on %~\a"; } -- cgit v1.2.3 From c4d529e5f67c4766ab5dad9f68aacaa1ccbc6382 Mon Sep 17 00:00:00 2001 From: Raymaekers Luca Date: Tue, 7 May 2024 03:16:34 +0200 Subject: reorganized. --- bin/extra/aivpn | 38 -------------------------------------- config/essentials/shell/aliases.sh | 9 ++++++++- config/essentials/zsh/.zshrc | 9 +-------- 3 files changed, 9 insertions(+), 47 deletions(-) delete mode 100755 bin/extra/aivpn (limited to 'config/essentials/zsh/.zshrc') diff --git a/bin/extra/aivpn b/bin/extra/aivpn deleted file mode 100755 index 21436ed..0000000 --- a/bin/extra/aivpn +++ /dev/null @@ -1,38 +0,0 @@ -#!/bin/sh - -err() { printf "%s\n" "$@"; } - -if [ "$1" = "-k" ] -then - pgrep -f -- "ssh.*-L.*vm" | xargs kill - exit -fi - -err "I: Waiting for connectivity..." -while ! ssh -o ConnectTimeout=1 -o BatchMode=yes vm 2>&1 | grep "Permission denied" > /dev/null -do sleep 1 -done - - -export SSH_ASKPASS="sshpass" -export SSH_ASKPASS_REQUIRE="prefer" -export PASSWORD="zot/qemu" - -err "I: Activating vpn" -ssh vm "rasdial \"vpn.student.ehb.be\"" - -keyadd ehb/ai -ssh -f -N \ - -L 2222:10.2.160.41:22 \ - vm - -keyadd ehb/vm_int -ssh -f -N \ - -L 2223:10.2.160.9:22 \ - vm -ssh -f -N \ - -L 2224:10.2.160.10:22 \ - vm -ssh -f -N \ - -L 2225:10.2.160.11:22 \ - vm diff --git a/config/essentials/shell/aliases.sh b/config/essentials/shell/aliases.sh index eb48416..de441a5 100644 --- a/config/essentials/shell/aliases.sh +++ b/config/essentials/shell/aliases.sh @@ -169,7 +169,14 @@ alias wgdown='doas wg-quick down wg0' alias npi="npm init --yes" # Python -alias penv='python3 -m venv env' + +if which uv > /dev/null 2>&1 +then + alias penv='uv venv env' + alias pip='uv pip' +else + alias penv='python3 -m venv env' +fi alias phttp='python3 -m http.server' alias pipreq='pip install -r requirements.txt' diff --git a/config/essentials/zsh/.zshrc b/config/essentials/zsh/.zshrc index ab66fcb..91a1618 100644 --- a/config/essentials/zsh/.zshrc +++ b/config/essentials/zsh/.zshrc @@ -110,19 +110,12 @@ bindkey -M menuselect '^xh' accept-and-hold # Hold bindkey -M menuselect '^xn' accept-and-infer-next-history # Next bindkey -M menuselect '^xu' undo # Undo -space-expand-alias() { - zle _expand_alias - zle self-insert -} -zle -N space-expand-alias -bindkey -M main ' ' space-expand-alias - ## window title hooks add-zsh-hook -Uz preexec () { print -n "\e]0;$1\a\033[0m"; } add-zsh-hook -Uz precmd set_wt (){ print -Pn "\e]0;%n@%m on %~\a"; } ## automatic ls after cd -add-zsh-hook -Uz chpwd (){ [ "$PWD" = "$HOME" ] || ls -a; } +add-zsh-hook -Uz chpwd (){ [ "$PWD" = "$HOME" ] || ls -A; } ### Variables ## Run menuscripts with fzf -- cgit v1.2.3