Now using $MPV_FLAGS = best[height<=1441]

This commit is contained in:
inigoortega 2020-01-23 16:16:28 +01:00
parent a56e7d1cf4
commit f002f281a7
11 changed files with 39 additions and 9 deletions

1
.gitignore vendored
View File

@ -9,3 +9,4 @@ termscripts/test.sh
.vim/plugged
*.o
.vim/.netrwhist
*/TAGS

View File

@ -24,7 +24,7 @@ export DEVICES_FOLDER="/media"
export FAV_STREAMERS="$HOME/fav_streamers"
export LC_ALL=en_US.utf8
export KERNEL_CONFIGS="$HOME/kernel-configs"
export MPV_FLAGS="--ytdl-format best[height<=1080]"
export MPV_FLAGS="--ytdl-format best[height<=1441]"
# ALIASES
alias ll='lsd --group-dirs first --date relative -alh'

View File

@ -7,6 +7,7 @@ cpupulse=$(top -b -n 1 -p "$pulseid" | tail -n 1 | awk '{print $9}')
stuck=$(printf "%b\n" "$cpupulse > 90" | bc -l)
if [ "$stuck" -eq 1 ]; then
stop_pulse=$(printf "%b\n" "Yes\nNo" | dmenu -i -p "Stop PulseAudio?")
[ "$stop_pulse" = "Yes" ] && killall pulseaudio
# stop_pulse=$(printf "%b\n" "Yes\nNo" | dmenu -i -p "Stop PulseAudio?")
# [ "$stop_pulse" = "Yes" ] && killall pulseaudio
date >> $HOME/pulseaudio.log
fi

View File

@ -4,4 +4,4 @@
[ "$url" = "" ] && notify-send "Tube.sh" "Nothing will be downloaded" && exit 0
mpv "$url"
mpv $MPV_FLAGS "$url"

View File

@ -8,4 +8,4 @@ xdotool key ctrl+c
# link="$(xclip -o -selection clipboard | sed -E 's|([^&]*)(&)(.*)|\1|')"
link="$(xclip -o | sed -E 's|([^&]*)(&)(.*)|\1|')"
mpv "$link"
mpv $MPV_FLAGS "$link"

View File

@ -5,7 +5,7 @@ streamer="$(rofi -dmenu)"
if [ -n "$streamer" ]; then
if [ "$(youtube-dl -e "https://www.twitch.tv/$streamer" 2>/dev/null)" ]; then
notify-send "$streamer found"
mpv "https://www.twitch.tv/$streamer"
mpv $MPV_FLAGS "https://www.twitch.tv/$streamer"
else
notify-send "$streamer NOT FOUND or NOT STREAMING"
fi

View File

@ -25,4 +25,4 @@ else
fi
[ -n "$watch" ] && mpv "https://www.twitch.tv/$watch"
[ -n "$watch" ] && mpv $MPV_FLAGS "https://www.twitch.tv/$watch"

View File

@ -8,7 +8,7 @@ if [ -n "$search" ]; then
link="https://invidio.us/watch?v=$id"
mpv "$link" 1>&2
mpv $MPV_FLAGS "$link" 1>&2
printf "%b\n" "$link"

View File

@ -0,0 +1,18 @@
#!/usr/bin/env sh
findpid=$1
known_windows=$(xwininfo -root -children|sed -e 's/^ *//'|grep -E "^0x"|awk '{ print $1 }')
for id in ${known_windows}
do
xp=$(xprop -id $id _NET_WM_PID)
if test $? -eq 0; then
pid=$(xprop -id $id _NET_WM_PID|cut -d'=' -f2|tr -d ' ')
if test "x${pid}" = x${findpid}
then
echo "Windows Id: $id"
fi
fi
done

View File

@ -11,7 +11,7 @@ do
video="$(sed "$current_video q;d" "$1")"
mpv "$video"
mpv $MPV_FLAGS "$video"
length="$(wc -l "$1" | awk '{print $1}')"
if [ "$length" -eq "$current_video" ]; then

10
termscripts/yes-or-no.sh Normal file
View File

@ -0,0 +1,10 @@
#!/usr/bin/env sh
while true; do
read -p "$* [Y/n]: " yn
case $yn in
"") return 0 ;;
[Yy]*) return 0 ;;
[Nn]*) printf "%b\n" "Aborted" ; return 1 ;;
esac
done