aboutsummaryrefslogtreecommitdiff
path: root/config/shell/funcs
diff options
context:
space:
mode:
authorryo <ryo@nopwd.lol>2025-03-02 14:18:20 +0000
committerryo <ryo@nopwd.lol>2025-03-02 14:18:20 +0000
commit9b8855688aff1ee354fbaa7430f03209692ee0d0 (patch)
tree4047a154499e5e65622623dcd140b41476bac6a6 /config/shell/funcs
parente602a23c7ecdc315da15dd6331e96bba50b9bf39 (diff)
Removed nvim and alacritty configsHEADmain
setup.sh: read package names from a file shell: clean up in aliases to keep it simple tmux: added two shortcuts
Diffstat (limited to 'config/shell/funcs')
-rw-r--r--config/shell/funcs21
1 files changed, 14 insertions, 7 deletions
diff --git a/config/shell/funcs b/config/shell/funcs
index 7788689..d1231bd 100644
--- a/config/shell/funcs
+++ b/config/shell/funcs
@@ -1,24 +1,31 @@
#!/usr/bin/env zsh
-proxy_connect=0
+reload() {
+ source ~/.zprofile
+ source $ZDOTDIR/.zshrc
+}
+
+proxy_enabled=0
+PS2=$PS1
toggle_proxy() {
if [[ "$proxy_connect" -eq 0 ]]; then
- export http_proxy="http://127.0.0.1:2081"
+ export http_proxy="http://127.0.0.1:2080"
export https_proxy=$http_proxy
proxy_connect=1
- echo "vpn activated"
+ echo "proxy enabled"
+ PS2=$PS1
+ PS1="%{$fg[red]%}[v] $PS1"
else
unset http_proxy
unset https_proxy
proxy_connect=0
- echo "vpn deactivated"
+ echo "proxy disabled"
+ PS1=$PS2
fi
}
generate_pass() {
local len=8
- if [ $# -eq 1 ]; then
- len=$1
- fi
+ [ $# -eq 1 ] && len=$1
tr -cd '[:graph:]' < /dev/urandom | head -c $len | xargs -0
}