diff options
Diffstat (limited to 'config/shell/funcs')
| -rw-r--r-- | config/shell/funcs | 21 | 
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  }  |