diff options
| author | TheSiahxyz <164138827+TheSiahxyz@users.noreply.github.com> | 2025-06-29 15:52:38 +0900 |
|---|---|---|
| committer | TheSiahxyz <164138827+TheSiahxyz@users.noreply.github.com> | 2025-06-29 15:52:38 +0900 |
| commit | 6d4a3866ff2f5ecb0375d70a0a0d694b066a64df (patch) | |
| tree | 119b64aa9d24317ed8014e999add916d2ee33f60 /ar/.local/bin/mpvplay | |
| parent | 7bf3f2f31c74385b95f4068c5d7dacff720d7292 (diff) | |
updates
Diffstat (limited to 'ar/.local/bin/mpvplay')
| -rwxr-xr-x | ar/.local/bin/mpvplay | 16 |
1 files changed, 8 insertions, 8 deletions
diff --git a/ar/.local/bin/mpvplay b/ar/.local/bin/mpvplay index 08d43ed..f5a899e 100755 --- a/ar/.local/bin/mpvplay +++ b/ar/.local/bin/mpvplay @@ -12,7 +12,7 @@ loginurl() { username="$(echo | dmenu -i -p "Enter a username:")" [ -n "$username" ] && password="$(echo | dmenu -i -P -p "Enter a password:")" || exit if [ -n "$username" ] && [ -n "$password" ]; then - if ! mpv --ytdl-format='bestvideo[height<=1080]+bestaudio/best[height<=1080]' --ytdl-raw-options=username="$username",password="$password" "$url"; then + if ! mpv --x11-name=video --ytdl-format='bestvideo[height<=1080]+bestaudio/best[height<=1080]' --ytdl-raw-options=username="$username",password="$password" "$url"; then notify-send "❌ Failed to play $url" "❗ Check your username or password" exit 1 fi @@ -24,7 +24,7 @@ play_url() { [ -n "$url" ] && echo "$url" | grep -E '^https?://' >/dev/null || return 1 if yt-dlp --simulate --dump-json "$url" >/dev/null 2>&1; then notify-send "📽️ Playing video from URL:" "$url" - mpv --ytdl-format='bestvideo[height<=1080]+bestaudio/best[height<=1080]' "$url" + mpv --x11-name=video --ytdl-format='bestvideo[height<=1080]+bestaudio/best[height<=1080]' "$url" else loginurl fi @@ -34,14 +34,14 @@ play_media() { if echo "$1" | grep -q ".*\.m3u$"; then playlist_file="${1#--playlist=}" if grep -q "/home/$USER/Private" "$playlist_file"; then - mpv "$@" && check_unmount || exit + mpv --x11-name=video "$@" && check_unmount || exit else - $mount_script && mpv "$@" || exit + $mount_script && mpv --x11-name=video "$@" || exit fi elif echo "$1" | grep -q "/home/$USER/Private"; then - mpv "$@" && check_unmount || exit + mpv --x11-name=video "$@" && check_unmount || exit else - $mount_script && mpv "$@" || exit + $mount_script && mpv --x11-name=video "$@" || exit fi } @@ -172,9 +172,9 @@ EOF # Play the file with mpv, resuming from the saved time position if [ "$time_pos" -gt 0 ]; then - mpv --start="$time_pos" "$file_path" + mpv --x11-name=video --start="$time_pos" "$file_path" else - mpv "$file_path" + mpv --x11-name=video "$file_path" fi } |
