From b7203da49c12fb3864f3e0358ff92c95ee2d8584 Mon Sep 17 00:00:00 2001 From: coolnsx Date: Sat, 2 May 2026 23:27:59 +0530 Subject: [PATCH] forgot a contact page woops haha --- .functions | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/.functions b/.functions index 0b6affb..1547ffc 100644 --- a/.functions +++ b/.functions @@ -44,18 +44,18 @@ error_linux() { } player_droid() { - file="/storage/emulated/0/.mpv/mpv.config.mp4" - if [ ! -w "$file" ]; then + dir="/storage/emulated/0/.mpv" + file="$dir/mpv.config.mp4" + if [ -w "${dir%*/.mpv}" ]; then + [ -d "${dir}" ] || mkdir "${dir}" + printf "%s" "$3" | sed 's| --|\n|g; s|^--||g' > "$file" + else printf "\n\033[1;31mCannot write\033[0m → $file\n" printf "\033[1;36mRun:\033[0m termux-setup-storage\n\n" printf "\033[1;36mThen:\033[0m\n" printf "> allow storage permission\n" printf "> add → include='$file'\n" printf " to MPV → Settings > Advanced > mpv.conf\n" - - else - mkdir -p "$(printf '%s' "$file" | sed 's|[^/]*$||')" - printf "%s" "$3" | sed 's| --|\n|g; s|^--||g' > "$file" fi am start --user 0 -a android.intent.action.VIEW -d "$1" -n is.xyz.mpv/.MPVActivity -e "title" "$2" >/dev/null 2>&1 #am start --user 0 -a android.intent.action.VIEW -d "$1" -n org.videolan.vlc/org.videolan.vlc.gui.video.VideoPlayerActivity -e "title" "$2" >/dev/null 2>&1