From 98dee73710944a92982a35b1b2e3e9f63d5562bc Mon Sep 17 00:00:00 2001 From: Deven Blake Date: Wed, 10 Feb 2021 22:33:44 -0500 Subject: [PATCH] more oneliners and stuff --- dotfiles-old/scripts/oneliners.sh | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/dotfiles-old/scripts/oneliners.sh b/dotfiles-old/scripts/oneliners.sh index e515928..265752e 100755 --- a/dotfiles-old/scripts/oneliners.sh +++ b/dotfiles-old/scripts/oneliners.sh @@ -9,11 +9,15 @@ source ./cdecho.sh mkdir -p $HOME/bin/oneliners || exit cde $HOME/bin/oneliners +DMENU_LINES="40" SHABANG="#!/bin/sh\n" # music stuff -printf "selection=\"\$(find /mnt/audio -type d -mindepth 2 2>/dev/null | sort | dmenu -l 50)\"\n[ \$selection = \$(printf \"\\n\") ] 2>/dev/null || audacious \"\$selection\"\n" >play_album -printf "selection=\"\$(find /mnt/audio -type f | sort | dmenu -l 50)\"\n[ \$selection = \$(printf \"\\n\") ] 2>/dev/null || audacious \"\$selection\"\n" >play_song +printf $SHABANG"selection=\"\$(find /mnt/audio -type d -mindepth 2 2>/dev/null | sort | dmenu -l $DMENU_LINES)\"\n[ \$selection = \$(printf \"\\n\") ] 2>/dev/null || audacious \"\$selection\"\n" >play_album +printf $SHABANG"selection=\"\$(find /mnt/audio -type f | sort | dmenu -l $DMENU_LINES)\"\n[ \$selection = \$(printf \"\\n\") ] 2>/dev/null || audacious \"\$selection\"\n" >play_song + +# reading +printf $SHABANG"SELECTION=\"\$(find /mnt/partone/texts/ -type f | sort | dmenu -l $DMENU_LINES)\"\nEXTENSION=\"\$(echo \$SELECTION | asplit - . 1)\"\n[ \"\$EXTENSION\" = \"pdf\" ] && xpdf \"\$SELECTION\"\n" >read_book # private bookmarks printf $SHABANG"firefox file://"$HOME"/bookmarks.html\n" >bmarks @@ -32,10 +36,13 @@ printf $SHABANG"xrandr --output VGA-1 --auto --right-of LVDS-1\n" >mv720 printf $SHABANG"xrandr --output HDMI-1 --off\n" >hdmioff printf $SHABANG"xrandr --output VGA-1 --off\n" >vgaoff +# project i'm working on +printf $SHABANG"xterm -e \"source $HOME/src/ytfeed.py/bin/activate && python $HOME/src/ytfeed.py/cli.py\"\n" >ytfeed + # youtube-dl stuff printf $SHABANG"youtube-dl --add-metadata -i -o \"$HOME/%%(upload_date)s %%(title)s.%%(ext)s\" \"\$@\"\n" >youtube-dlo printf $SHABANG"youtube-dlo -f \"bestvideo[vcodec=vp9]+bestaudio[acodec=opus]\" \"\$@\"\n" >youtube-dlp -printf $SHABANG"youtube-dlp -f \$(youtube-dl -F \$1 | 9 tail +4 | dmenu -p \"Choose a format.\" -l 20 | asplit - SP 0) \"\$@\"\n" >youtube-dl-interactive +printf $SHABANG"youtube-dlp -f \$(youtube-dl -F \$1 | 9 tail +4 | dmenu -p \"Choose a format.\" -l $DMENU_LINES | asplit - SP 0) \"\$@\"\n" >youtube-dl-interactive printf $SHABANG"youtube-dl-interactive \"\$@\" -o - | mpv -\n" >youtube-dl-mpv ls && [ $(printf "Yes.\nNo." | dmenu -p "Any risky files?") = "No." ] && printf "Making executable.\n" && chmod +x *