2021-09-16 20:55:50 +00:00
|
|
|
#!/bin/zsh
|
|
|
|
# ---------------------------------------------------------------------
|
|
|
|
alias restart='clear; source ~/.zshrc; echo'
|
|
|
|
|
|
|
|
alias pd='pushd';
|
|
|
|
alias qd='popd';
|
|
|
|
alias lspd='dirs';
|
|
|
|
|
|
|
|
alias bp='bpython';
|
|
|
|
|
|
|
|
alias pdo='pwd | xclip'; # [p]aste current [d]irectory [o]n clipboard
|
|
|
|
alias cdo='cd $(xclip -o)'; # [cd] to directory [o]n clipboard
|
|
|
|
|
2021-09-17 01:42:11 +00:00
|
|
|
alias readable-date='date +"%A %B %d, %Y"'
|
|
|
|
|
|
|
|
alias fix='vim $(git diff --name-only | uniq) -p'
|
2021-09-23 17:16:41 +00:00
|
|
|
|
|
|
|
alias i3-config-update="$DOTWRYN/bin/i3/update-local-config"
|
2021-09-16 20:55:50 +00:00
|
|
|
# ---------------------------------------------------------------------
|
|
|
|
|
|
|
|
alias erg='EDIT_RIP_GREP_FILE_MATCHES';
|
|
|
|
EDIT_RIP_GREP_FILE_MATCHES() {
|
|
|
|
[ $EDITOR = "vim" ] \
|
|
|
|
&& $EDITOR -p $(rg --color=never -l $1 ) \
|
|
|
|
|| $EDITOR $(rg --color=never -l $1) ;
|
|
|
|
}
|
2021-09-17 01:40:59 +00:00
|
|
|
|
|
|
|
# ---------------------------------------------------------------------
|
|
|
|
|
2021-11-06 05:09:37 +00:00
|
|
|
alias -s mp4=google-chrome-stable
|
|
|
|
alias -s pdf=google-chrome-stable
|
|
|
|
|
|
|
|
# ---------------------------------------------------------------------
|
|
|
|
|
2021-09-17 01:40:59 +00:00
|
|
|
alias gdrive="RCLONE_GOOGLE_DRIVE_MOUNT"
|
|
|
|
alias gphotos="RCLONE_GOOGLE_PHOTOS_MOUNT"
|
|
|
|
|
|
|
|
RCLONE_GOOGLE_DRIVE_MOUNT() {
|
|
|
|
local REMOTE_NAME='google-drive';
|
|
|
|
local MOUNT_POINT="$HOME/GoogleDrive";
|
|
|
|
local TITLE="GOOGLE DRIVE CONNECTION";
|
|
|
|
local MOUNT_FOLDER_EXTENSION="$1";
|
|
|
|
|
|
|
|
RCLONE_GOOGLE_MOUNT "$REMOTE_NAME" "$MOUNT_POINT" "$TITLE" "$MOUNT_FOLDER_EXTENSION";
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
RCLONE_GOOGLE_PHOTOS_MOUNT() {
|
|
|
|
local REMOTE_NAME='google-photos';
|
|
|
|
local MOUNT_POINT="$HOME/GooglePhotos";
|
|
|
|
local TITLE="GOOGLE PHOTOS CONNECTION";
|
|
|
|
|
|
|
|
RCLONE_GOOGLE_MOUNT "$REMOTE_NAME" "$MOUNT_POINT" "$TITLE";
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
RCLONE_GOOGLE_MOUNT() {
|
|
|
|
local REMOTE_NAME="$1";
|
|
|
|
local MOUNT_POINT="$2";
|
|
|
|
local TITLE="$3";
|
|
|
|
local MOUNT_FOLDER_EXTENSION="$4";
|
|
|
|
|
|
|
|
[ -d $MOUNT_POINT ] && [[ $(ls $MOUNT_POINT | wc -l) -gt 0 ]] \
|
|
|
|
&& { echo "connection already active at '$MOUNT_POINT'"; return 1; }
|
|
|
|
|
|
|
|
clear;
|
|
|
|
figlet -w $(tput cols) "$TITLE"| lolcat;
|
|
|
|
echo -e "\e[3m(C-c to close)\e[0m";
|
|
|
|
|
|
|
|
mkdir $MOUNT_POINT >/dev/null 2>&1;
|
|
|
|
rclone mount "$REMOTE_NAME:$MOUNT_FOLDER_EXTENSION" "$MOUNT_POINT"
|
|
|
|
rmdir $MOUNT_POINT >/dev/null 2>&1;
|
|
|
|
}
|