76 lines
2.0 KiB
Bash
76 lines
2.0 KiB
Bash
#!/bin/zsh
|
|
|
|
# --- Shortcuts for quick ARANDR switch -----------------------
|
|
alias undock="$DOTWRYN/config/xserver/screenlayout/undock.sh";
|
|
alias workdock="$DOTWRYN/config/xserver/screenlayout/workdock.sh";
|
|
alias homedock="$DOTWRYN/config/xserver/screenlayout/homedock_hdmionly.sh";
|
|
alias hdmidock="$DOTWRYN/config/xserver/screenlayout/hdmidock.sh";
|
|
|
|
# --- Note-taking facilitated ---------------------------------
|
|
NOTE_PATH='/Users/w0ryn/Documents/notes';
|
|
NOTE_EXTENSION='.txt';
|
|
alias mynotes='cd $NOTE_PATH';
|
|
function note() { vim $NOTE_PATH/$1$NOTE_EXTENSION; }
|
|
function notes() { NOTE="$NOTE_PATH/$1$NOTE_EXTENSION"; [ $1 ] && [ -f $NOTE ] && vim $NOTE || vim $NOTE_PATH; }
|
|
|
|
# --- GIT -----------------------------------------------------
|
|
alias gitbranchcleanup='git branch -d $(git branch | sed -E "/develop|master|\*/d")'
|
|
alias fix='vim $(git diff --name-only | uniq) -p';
|
|
|
|
|
|
alias monitor_connection='MONITOR_GLOBAL_INTERNET_CONNECTION';
|
|
|
|
MONITOR_GLOBAL_INTERNET_CONNECTION() {
|
|
local DELIMITER="\n==============================\n";
|
|
local CONNECTION_MONITOR_FILE="$HOME/.local/connection"
|
|
|
|
[ ! -f $CONNECTION_MONITOR_FILE ] && touch $CONNECTION_MONITOR_FILE;
|
|
|
|
echo "Attempting first connection....";
|
|
|
|
while true; do
|
|
ping 8.8.8.8 -c 5 > $CONNECTION_MONITOR_FILE;
|
|
clear;
|
|
|
|
printf "$DELIMITER\n" | lolcat;
|
|
|
|
grep "packet loss" $CONNECTION_MONITOR_FILE | sed 's/^.*, \(.*% packet loss\).*$/\1/' | lolcat;
|
|
echo;
|
|
|
|
grep 'bytes from' $CONNECTION_MONITOR_FILE | lolcat;
|
|
|
|
printf "\n$DELIMITER" | lolcat;
|
|
|
|
sleep 30;
|
|
done;
|
|
}
|
|
|
|
alias pd='pushd';
|
|
alias qd='popd';
|
|
alias ds='dirs';
|
|
alias cdo='cd $(xclip -o)';
|
|
alias pdo='pwd | xclip';
|
|
|
|
alias rgv='EDIT_RIP_GREP_FILE_MATCHES';
|
|
|
|
EDIT_RIP_GREP_FILE_MATCHES() {
|
|
[ $EDITOR = "vim" ] \
|
|
&& $EDITOR -p $(rg -l $1) \
|
|
|| $EDITOR $(rg -l $1) ;
|
|
}
|
|
|
|
|
|
alias color_demo='DISPLAY_ALL_TERMINAL_COLORS'
|
|
|
|
DISPLAY_ALL_TERMINAL_COLORS() {
|
|
for x in {0..8}; do
|
|
for i in {30..37}; do
|
|
for a in {40..47}; do
|
|
echo -ne "\e[$x;$i;$a""m\\\e[$x;$i;$a""m\e[0;37;40m "
|
|
done
|
|
echo
|
|
done
|
|
done
|
|
echo ""
|
|
}
|