aboutsummaryrefslogtreecommitdiff
path: root/config/shell
diff options
context:
space:
mode:
authorryo <ryo@nopwd.lol>2024-10-30 20:10:03 +0000
committerryo <ryo@nopwd.lol>2024-10-30 20:10:03 +0000
commitcc6d6fcfc6e8403e87dae9f092e61f0edf8e3cc6 (patch)
treef7f751a92c30b5ef7cf8770004c30479c516fdca /config/shell
Initial commit
Diffstat (limited to 'config/shell')
-rw-r--r--config/shell/alias60
-rw-r--r--config/shell/func24
2 files changed, 84 insertions, 0 deletions
diff --git a/config/shell/alias b/config/shell/alias
new file mode 100644
index 0000000..0b6287a
--- /dev/null
+++ b/config/shell/alias
@@ -0,0 +1,60 @@
+#!/usr/bin/env zsh
+
+# Ryo aliases
+# https://ryo.nopwd.lol
+#
+# fork of Luke's config
+# https://github.com/lukesmithxyz/voidrice
+
+# only if variables exists
+[ -f "$XINITRC" ] && alias startx="startx $XINITRC"
+[ -f "$MBSYNCRC" ] && alias mbsync="mbsync -c $MBSYNCRC"
+
+# be careful
+alias \
+ cp="cp -i" \
+ mv="mv -i" \
+ rm="rm -I" \
+ bc="bc -ql" \
+ d='doas'
+
+# colorize commands when possible.
+alias \
+ ls="ls -hN --color=auto --group-directories-first" \
+ grep="grep --color=auto" \
+ diff="diff --color=auto" \
+ ccat="highlight --out-format=ansi" \
+ ip="ip -color=auto"
+
+# Arch pacman
+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" \
+ 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' \
+ ffmpeg="ffmpeg -hide_banner"
+
diff --git a/config/shell/func b/config/shell/func
new file mode 100644
index 0000000..7788689
--- /dev/null
+++ b/config/shell/func
@@ -0,0 +1,24 @@
+#!/usr/bin/env zsh
+
+proxy_connect=0
+toggle_proxy() {
+ if [[ "$proxy_connect" -eq 0 ]]; then
+ export http_proxy="http://127.0.0.1:2081"
+ export https_proxy=$http_proxy
+ proxy_connect=1
+ echo "vpn activated"
+ else
+ unset http_proxy
+ unset https_proxy
+ proxy_connect=0
+ echo "vpn deactivated"
+ fi
+}
+
+generate_pass() {
+ local len=8
+ if [ $# -eq 1 ]; then
+ len=$1
+ fi
+ tr -cd '[:graph:]' < /dev/urandom | head -c $len | xargs -0
+}