Yotube videos on mpv + looping enhanced

This commit is contained in:
inigoortega 2019-08-21 18:06:06 +02:00
parent 175f471133
commit f842cfd31f
7 changed files with 54 additions and 12 deletions

View file

@ -25,7 +25,7 @@ SETUVAR fish_color_selection:white\x1e\x2d\x2dbold\x1e\x2d\x2dbackground\x3dbrbl
SETUVAR fish_color_user:brgreen
SETUVAR fish_color_valid_path:\x2d\x2dunderline
SETUVAR fish_greeting:Welcome\x20to\x20fish\x2c\x20the\x20friendly\x20interactive\x20shell
SETUVAR fish_key_bindings:fish_default_key_bindings
SETUVAR fish_key_bindings:fish_vi_key_bindings
SETUVAR fish_pager_color_completion:\x1d
SETUVAR fish_pager_color_description:B3A06D\x1eyellow
SETUVAR fish_pager_color_prefix:white\x1e\x2d\x2dbold\x1e\x2d\x2dunderline

View file

@ -1,3 +1,4 @@
function fish_greeting
fish_vi_key_bindings
neofetch
end

View file

@ -3,7 +3,7 @@ dash $HOME/bin/dwmbar.sh &
# ALWAYS ON TOP
sxhkd -c "$HOME/.config/sxhkd/sxhkdrc" &
mksh $TSCRIPTS/loop.sh 0 "mksh $TSCRIPTS/refresh-cpu-usage.sh" &
mksh $TSCRIPTS/loop.sh -l 0 -p 5 "mksh $TSCRIPTS/refresh-cpu-usage.sh" &
mksh $SCRIPTS/set-random-wallpaper.sh &
redshift &
workrave &

9
scripts/ctrl-tab-loop.sh Normal file
View file

@ -0,0 +1,9 @@
#!/bin/sh
if [ "$1" -ge 1 ] 2>/dev/null; then
period="$1"
else
period="3"
fi
dash $TSCRIPTS/loop.sh -l 5 -p $period "xdotool key ctrl+Tab"

View file

@ -1,6 +1,6 @@
#!/bin/sh
[ "$1" = "" ] && url="$(xclip -o | dmenu -p "Clipboard: ")" || url="$1"
[ "$1" = "" ] || url="$1"
[ "$url" = "" ] && url="$(echo "" | dmenu -p "Type the ID: ")"
@ -20,10 +20,12 @@ cd /tmp
# Download the file
youtube-dl --merge-output-format mkv "$url"
mpv "$filename"
} && {
# PLAY
cd $origin
mpv "$filename"
} || cd $origin
# rm "$filename"

View file

@ -1,14 +1,44 @@
#!/bin/sh
if [ "$1" -ge 0 ] 2>/dev/null; then
time="$1"
shift
else
time="5"
fi
loops="0"
period="5"
while [ -z "" ]
while [ -n "$1" ]; do # while loop starts
case "$1" in
-l)
loops="$2"
shift
;;
-p)
period="$2"
shift
;;
--)
shift # The double dash which separates options from parameters
break
;; # Exit the loop using break command
*)
break
;;
esac
shift
done
[ "$loops" -eq "0" ] && infinite="true"
while [ $loops -gt 0 -o "$infinite" = "true" ]
do
mksh -c "$@"
sleep "$time"
[ "$loops" -gt 0 ] && loops=$(( $loops - 1 ))
sleep "$period"
done