dotfiles/.zsh_alias

205 lines
4.8 KiB
Text
Raw Normal View History

# ===
# Directory listing
# ===
2021-03-29 09:38:12 +02:00
alias ea='exa -lah'
alias ee='exa -lh'
alias esa='exa -a'
alias es='exa'
# ===
# Software
# ===
# ======
# Keyboard layout
# ======
2020-08-17 17:00:34 +02:00
alias layout='xkblayout-state print "%s(%v)" && echo -n "\n"'
# ======
# ======
# Compositing
# ======
2020-08-17 17:00:34 +02:00
alias picom-default='picom -bGC --backend glx --unredir-if-possible-delay 1000 --vsync'
# ======
# ======
# Octave
# ======
alias octave-gui='octave --force-gui'
# ======
# ======
# Polkit
# ======
alias xfce-polkit='/usr/lib/xfce-polkit/xfce-polkit'
# ======
# ======
# Resolve
# ======
2020-09-14 19:40:19 +02:00
alias resolve='/opt/resolve/bin/resolve'
# ======
2020-11-10 14:31:56 +01:00
# ======
2022-05-31 21:35:30 +02:00
# Pianoteq 7
2020-11-10 14:31:56 +01:00
# ======
2020-11-16 11:36:08 +01:00
alias pianoteq='pianoteq\ 7'
2020-11-10 14:31:56 +01:00
# ======
2021-03-23 13:52:27 +01:00
# ======
# Sabaki
# ======
alias sabaki='/opt/Sabaki/sabaki'
# ======
# ======
# ethminer preset for Binance
# ======
alias binance_miner='ethminer --farm-recheck 200 -P stratum+tcp://DustVoiceETH.Linux@ethash.poolbinance.com:1800'
# ======
# ======
# Tmate
# ======
alias tmate-obs='tmate -k tmk-ET35fx5m9cA7cxOt4jjWkSmaOy -r DustVoice'
# ======
# ======
# Screenkey
# ======
function screenkey-obs-func() {
width=$(xrandr | awk '$0 ~ "*" {split($1,res,"x"); print res[1];}')
height=$(xrandr | awk '$0 ~ "*" {split($1,res,"x"); print res[2];}')
screenkey --no-systray -t 2 -p fixed -s small -g $(awk -v height=$height -v width=$width 'BEGIN {printf "%.0fx%.0f+%.0f+%.0f", (width * 0.5), (height * 0.06), (width * 0.25), (height * 0.02)}') --key-mode composed --bak-mode full --mods-mode normal -f "Fira Code" --font-color "#f8f8f2" --bg-color "#44475a" --opacity "1.0"
}
alias screenkey-obs='screenkey-obs-func'
# ======
2020-09-08 19:30:24 +02:00
# ======
# Firefox
# ======
alias firefox-private='firefox --private-window'
# ======
# ======
# Polybar
# ======
alias polybar-launch="$HOME/.config/polybar/launch"
# ======
# ===
# ===
# Font
# ===
2020-08-17 20:04:10 +02:00
function get-font-func() {
fallback_font="Fira Code:pixelsize=12:antialias=true:autohint=true"
2020-08-17 20:04:10 +02:00
font=""
if [ -x $(command -v xgetres) ]; then
font=$(xgetres font || echo $fallback_font);
else
font=$fallback_font;
fi
echo "$font"
}
alias get-font='get-font-func'
# ===
2020-08-17 20:04:10 +02:00
# ===
# Lockscreen
# ===
alias lock-screen='xset 600 60 && env XSECURELOCK_AUTH_BACKGROUND_COLOR=rgb:28/2a/36 XSECURELOCK_AUTH_FOREGROUND_COLOR=rgb:f8/f8/f2 XSECURELOCK_AUTH_TIMEOUT=10 XSECURELOCK_BLANK_TIMEOUT=-1 XSECURELOCK_BLANK_DPMS_STATE=on XSECURELOCK_DISCARD_FIRST_KEYPRESS=1 XSECURELOCK_PASSWORD_PROMPT=cursor XSECURELOCK_SHOW_DATETIME=1 XSECURELOCK_SHOW_HOSTNAME=1 XSECURELOCK_SHOW_USERNAME=1 xsecurelock &'
# ===
2020-09-24 14:50:41 +02:00
# ===
# System maintenance
# ===
function check-iommu-func() {
for g in /sys/kernel/iommu_groups/*; do
echo "IOMMU Group ${g##*/}:"
for d in $g/devices/*; do
echo -e "\t$(lspci -nns ${d##*/})"
done;
done;
}
alias check-iommu='check-iommu-func'
2020-10-30 13:35:51 +01:00
function battery-monitor-func() {
watch -t -n 60 '( if [ $(cat /sys/class/power_supply/ACAD/online) == "1" ]; then printf "Power connected\n"; else printf "Power disconnected\n"; fi; printf "\nBattery capacity: "; cat /sys/class/power_supply/BAT1/capacity; printf "\n(Updated every 60s)"; )';
2020-10-30 13:35:51 +01:00
}
alias battery-monitor='battery-monitor-func'
2020-09-24 14:50:41 +02:00
# ===
# ===
# bspwm
# ===
function bspwm-workspaces-init-func() {
if [[ ! -n $BSPWM_FILES ]]; then
export BSPWM_FILES="$HOME/.local/share/bspwm"
fi
mkdir -p $BSPWM_FILES
}
2020-08-17 17:00:34 +02:00
function bspwm-save-func() {
bspwm-workspaces-init-func
if [[ -f $BSPWM_FILES/$1 ]]; then
cp $BSPWM_FILES/$1 $BSPWM_FILES/$2
fi
bspc query -m focused -D --names | tr '\n' ' ' | sed 's/ $//g' > $BSPWM_FILES/$1
}
2020-08-17 17:00:34 +02:00
function bspwm-load-func() {
bspwm-workspaces-init-func
if [[ -f $BSPWM_FILES/$1 ]]; then
bspwm-save-func $2 $2
bspc monitor -d $(< $BSPWM_FILES/$1)
fi
}
2020-08-27 13:32:56 +02:00
alias bspwm-save="bspwm-save-func workspaces workspaces.prev_save"
alias bspwm-load="bspwm-load-func workspaces workspaces.prev_load"
# ===
2022-05-31 21:35:30 +02:00
# ===
# Hyper-V agents forwarding
# ===
function hyperv-gpg-agent() {
socket_path="$HOME/.gnupg/S.gpg-agent"
host_ip=$(ip route show 0.0.0.0/0 dev eth0 | cut -d\ -f3)
2022-06-01 00:07:42 +02:00
if [[ -x $socket_path ]]; then
2022-05-31 21:35:30 +02:00
rm $socket_path
fi
(setsid socat UNIX-LISTEN:$socket_path,fork tcp-connect:$host_ip:59545)
}
function hyperv-ssh-agent() {
2022-05-31 22:01:49 +02:00
socket_path="$HOME/.gnupg/S.gpg-agent.ssh"
2022-05-31 21:35:30 +02:00
host_ip=$(ip route show 0.0.0.0/0 dev eth0 | cut -d\ -f3)
2022-06-01 00:07:42 +02:00
if [[ -x $socket_path ]]; then
2022-05-31 21:35:30 +02:00
rm $socket_path
fi
(setsid socat UNIX-LISTEN:$socket_path,fork tcp-connect:$host_ip:59546)
}
function hyperv-agents() {
2022-05-31 22:01:49 +02:00
hyperv-gpg-agent &
2022-05-31 21:35:30 +02:00
hyperv-ssh-agent
}
alias hyperv-gpg-forward="hyperv-gpg-agent"
alias hyperv-ssh-forward="hyperv-ssh-agent"
alias hyperv-forward="hyperv-agents"
# ===
# ===
# devkitPro development
# ===
function devkitPro-devkitARM() {
path=("/opt/devkitpro/devkitARM/bin" $path)
}
alias devkitARM="devkitPro-devkitARM"
# ===