diff options
Diffstat (limited to 'config/shell')
| -rw-r--r-- | config/shell/aliases | 18 | ||||
| -rw-r--r-- | config/shell/funcs | 21 | 
2 files changed, 16 insertions, 23 deletions
diff --git a/config/shell/aliases b/config/shell/aliases index cdbedac..4cc32a3 100644 --- a/config/shell/aliases +++ b/config/shell/aliases @@ -25,33 +25,19 @@ alias \  	ccat="highlight --out-format=ansi" \  	ip="ip -color=auto" -# Arch pacman +# Arch specific  alias \ -	p="pacman" \  	pacins='doas pacman -S' \  	pacinf='pacman -Si' \  	pacsch='pacman -Ss' -# Void xbps -alias \ -	xi="doas xbps-install" \ -	xr="sudo xbps-remove -R" \ -	xq="xbps-query" -  alias \ -	ll='ls -lh' \ -	g="git" \ -	i='nsxiv' \  	v="$EDITOR" \ -	re='source $ZDOTDIR/.zshrc' \ -	a='mpv --no-video' \ -	mkd="mkdir -pv" \ +	ll='ls -lh' \  	hmpv='mpv --really-quiet' \  	hcurl='curl -L -O' \  	hgit='git clone --depth=1 --no-tags --single-branch' \ -	hfont='fc-list | grep -i' \ -	hfind='find . -name' \  	xclip='xclip -selection clipboard -r' \  	idate='TZ=Iran date' \  	hxkb='setxkbmap -option caps:swapescape -layout us,ir -option grp:shifts_toggle' \ 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  }  |