2019-12-02 17:16:05 +00:00
|
|
|
#!/bin/zsh
|
|
|
|
|
2019-12-31 00:48:29 +00:00
|
|
|
# --- 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";
|
|
|
|
|
2019-12-02 17:16:05 +00:00
|
|
|
# --- 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")'
|
|
|
|
|
2020-09-10 15:31:34 +00:00
|
|
|
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;
|
|
|
|
}
|
2019-12-02 17:16:05 +00:00
|
|
|
|
|
|
|
alias pd='pushd';
|
|
|
|
alias qd='popd';
|
|
|
|
alias ds='dirs';
|
2020-04-23 01:14:04 +00:00
|
|
|
alias cdo='cd $(xclip -o)';
|
2020-04-28 21:44:33 +00:00
|
|
|
alias pdo='pwd | xclip';
|