diff --git a/.gitignore b/.gitignore index 97899ce..ee3b231 100644 --- a/.gitignore +++ b/.gitignore @@ -9,3 +9,4 @@ termscripts/test.sh .vim/plugged *.o .vim/.netrwhist +*/TAGS diff --git a/.profile b/.profile index aaa2cba..0bca601 100644 --- a/.profile +++ b/.profile @@ -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' diff --git a/scripts/stop-100-pulseaudio.sh b/scripts/stop-100-pulseaudio.sh index 52f05fd..bcf8799 100644 --- a/scripts/stop-100-pulseaudio.sh +++ b/scripts/stop-100-pulseaudio.sh @@ -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 diff --git a/scripts/tube.sh b/scripts/tube.sh index 8a7aab3..806c8a0 100644 --- a/scripts/tube.sh +++ b/scripts/tube.sh @@ -4,4 +4,4 @@ [ "$url" = "" ] && notify-send "Tube.sh" "Nothing will be downloaded" && exit 0 -mpv "$url" +mpv $MPV_FLAGS "$url" diff --git a/scripts/watch-current-video.sh b/scripts/watch-current-video.sh index c48e5f5..d373390 100644 --- a/scripts/watch-current-video.sh +++ b/scripts/watch-current-video.sh @@ -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" diff --git a/scripts/watch-twitch-stream.sh b/scripts/watch-twitch-stream.sh index 274cceb..60a2f31 100644 --- a/scripts/watch-twitch-stream.sh +++ b/scripts/watch-twitch-stream.sh @@ -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 diff --git a/scripts/watch-twitch.sh b/scripts/watch-twitch.sh index b04b4ac..7dbc6c7 100644 --- a/scripts/watch-twitch.sh +++ b/scripts/watch-twitch.sh @@ -25,4 +25,4 @@ else fi -[ -n "$watch" ] && mpv "https://www.twitch.tv/$watch" +[ -n "$watch" ] && mpv $MPV_FLAGS "https://www.twitch.tv/$watch" diff --git a/scripts/yt-search.sh b/scripts/yt-search.sh index 44eaac2..dc78d8b 100644 --- a/scripts/yt-search.sh +++ b/scripts/yt-search.sh @@ -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" diff --git a/termscripts/get-xprop-from-pid.sh b/termscripts/get-xprop-from-pid.sh new file mode 100755 index 0000000..a6b2946 --- /dev/null +++ b/termscripts/get-xprop-from-pid.sh @@ -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 diff --git a/termscripts/play-videos-from-file.sh b/termscripts/play-videos-from-file.sh index df47244..c69de19 100644 --- a/termscripts/play-videos-from-file.sh +++ b/termscripts/play-videos-from-file.sh @@ -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 diff --git a/termscripts/yes-or-no.sh b/termscripts/yes-or-no.sh new file mode 100644 index 0000000..8400b34 --- /dev/null +++ b/termscripts/yes-or-no.sh @@ -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