From 2a35af964d27a67d08c233dc1f63a68347d208a4 Mon Sep 17 00:00:00 2001 From: Deven Blake Date: Mon, 28 Jun 2021 09:52:00 -0400 Subject: [PATCH] move mnt to oneliners --- dotfiles-old/.aliases | 7 ------- dotfiles-old/misc/oneliners.sh | 17 +++++++++++------ 2 files changed, 11 insertions(+), 13 deletions(-) diff --git a/dotfiles-old/.aliases b/dotfiles-old/.aliases index f20362a..3d65bf2 100755 --- a/dotfiles-old/.aliases +++ b/dotfiles-old/.aliases @@ -11,13 +11,6 @@ alias e="$EDITOR" alias ipconfig="ifconfig" #alias ls="9 ls" alias ls="ls -1A" - -# other volumes -mnt() { - test -d /mnt/$1 || sudo mkdir /mnt/$1 - sudo mount /dev/$1 /mnt/$1 && cd /mnt/$1 -} - alias mv="mv -iv" alias p="ping 1.1.1.1" diff --git a/dotfiles-old/misc/oneliners.sh b/dotfiles-old/misc/oneliners.sh index 6dc0787..e965b98 100755 --- a/dotfiles-old/misc/oneliners.sh +++ b/dotfiles-old/misc/oneliners.sh @@ -29,17 +29,22 @@ printf $SHEBANG'xrandr --output VGA-1 --auto --right-of LVDS-1\n printf $SHEBANG"xrandr --output HDMI-1 --off\n" >hdmioff printf $SHEBANG"xrandr --output VGA-1 --off\n" >vgaoff +# mounting volumes +printf $SHEBANG"[ -z \"\$1\" ] && printf 'Usage: %%b [device]\\\\n' \"\$0\" && exit 1 || true +[ -d \"/mnt/\$1\" ] || $SUDO mkdir \"/mnt/\$1\" +$SUDO mount \"/dev/\$1\" \"/mnt/\$1\" && cd \"/mnt/\$1\"\n" >mnt + # wireguard vpn stuff -printf $BASH_SHEBANG$SUDO' wg-quick up "$@"\n' >vpn-connect -printf $BASH_SHEBANG$SUDO' wg-quick down "$@"\n' >vpn-disconnect +printf $SHEBANG$SUDO' wg-quick up "$@"\n' >vpn-connect +printf $SHEBANG$SUDO' wg-quick down "$@"\n' >vpn-disconnect printf $SHEBANG$SUDO' ls /etc/wireguard/ | grep "conf$" | awk -F ".conf" "{print $1}"\n' >vpn-list printf $SHEBANG'xterm -e "vpn-connect $(vpn-list | dmenu); read -s -n 1"\n' >vpn-quick # not to be confused with wg-quick # youtube-dl stuff -printf $BASH_SHEBANG"youtube-dl --add-metadata -i -o \"$HOME/%%(upload_date)s %%(title)s.%%(ext)s\" \"\$@\"\n" >youtube-dlo -printf $BASH_SHEBANG"youtube-dlo -f \"bestvideo[vcodec=vp9]+bestaudio[acodec=opus]\" \"\$@\"\n" >youtube-dlp -printf $BASH_SHEBANG"youtube-dlp -f \$(youtube-dl -F \$1 | tail +4 | dmenu -p \"Choose a format.\" -l $DMENU_LINES | awk '{ print \$1 }') \"\$@\"\n" >youtube-dl-interactive -printf $BASH_SHEBANG"youtube-dl-interactive \"\$@\" -o - | mpv -\n" >youtube-dl-mpv +printf $SHEBANG"youtube-dl --add-metadata -i -o \"$HOME/%%(upload_date)s %%(title)s.%%(ext)s\" \"\$@\"\n" >youtube-dlo +printf $SHEBANG"youtube-dlo -f \"bestvideo[vcodec=vp9]+bestaudio[acodec=opus]\" \"\$@\"\n" >youtube-dlp +printf $SHEBANG"youtube-dlp -f \$(youtube-dl -F \$1 | tail +4 | dmenu -p \"Choose a format.\" -l $DMENU_LINES | awk '{ print \$1 }') \"\$@\"\n" >youtube-dl-interactive +printf $SHEBANG"youtube-dl-interactive \"\$@\" -o - | mpv -\n" >youtube-dl-mpv # sxhkd printf $SHEBANG"cd '$HOME/.config/sxhkd/'