diff options
| author | TheSiahxyz <164138827+TheSiahxyz@users.noreply.github.com> | 2026-03-14 00:31:10 +0900 |
|---|---|---|
| committer | TheSiahxyz <164138827+TheSiahxyz@users.noreply.github.com> | 2026-03-14 00:31:10 +0900 |
| commit | 007b17d7c865012d9d026ffd58c11864a18f57d5 (patch) | |
| tree | 4ae2fdca08c811d07fd5e7a7080fdaacceb846cd /ar/.local | |
| parent | 5e954f3dfb4304341c1a50a1f9310f58dcf39682 (diff) | |
modified bin/ecrypt, modified bin/mpvplay
Diffstat (limited to 'ar/.local')
| -rwxr-xr-x | ar/.local/bin/ecrypt | 3 | ||||
| -rwxr-xr-x | ar/.local/bin/mpvplay | 22 |
2 files changed, 16 insertions, 9 deletions
diff --git a/ar/.local/bin/ecrypt b/ar/.local/bin/ecrypt index d16d746..0e189af 100755 --- a/ar/.local/bin/ecrypt +++ b/ar/.local/bin/ecrypt @@ -9,6 +9,7 @@ attempt_mount() { if mount | grep -q " $2 "; then if sudo umount "$2"; then notify-send "🔒 Locked: $3" + pkill -RTMIN+1 dwmblocks else notify-send "❗ Unable to lock" "Mounted: $3" fi @@ -20,7 +21,7 @@ attempt_mount() { notify-send "❌ Failed to retrieve passphrase." exit 1 } - mount_encrypted "$1" "$2" && notify-send "🔑 Unlocked: $3" + mount_encrypted "$1" "$2" && notify-send "🔑 Unlocked: $3" && pkill -RTMIN+1 dwmblocks fi } diff --git a/ar/.local/bin/mpvplay b/ar/.local/bin/mpvplay index bc7a0f6..8a32a4a 100755 --- a/ar/.local/bin/mpvplay +++ b/ar/.local/bin/mpvplay @@ -3,9 +3,9 @@ mount_script="${XDG_SCRIPTS_HOME:-${HOME}/.local/bin}/ecrypt" db_path="$HOME/.local/share/history/mpv.sqlite" -check_mount() { findmnt "$HOME/Private" >/dev/null || $mount_script; } +check_mount() { findmnt "$HOME/Secret" >/dev/null || $mount_script; } -check_unmount() { findmnt "$HOME/Private" >/dev/null && $mount_script; } +check_unmount() { findmnt "$HOME/Secret" >/dev/null && $mount_script; } loginurl() { notify-send "🔑 Authentication required" @@ -33,12 +33,12 @@ play_url() { play_media() { if echo "$1" | grep -q ".*\.m3u$"; then playlist_file="${1#--playlist=}" - if grep -q "/home/$USER/Private" "$playlist_file"; then + if grep -q "/home/$USER/Secret" "$playlist_file"; then mpv --x11-name=video "$@" && check_unmount || exit else $mount_script && mpv --x11-name=video "$@" || exit fi - elif echo "$1" | grep -q "/home/$USER/Private"; then + elif echo "$1" | grep -q "/home/$USER/Secret"; then mpv --x11-name=video "$@" && check_unmount || exit else $mount_script && mpv --x11-name=video "$@" || exit @@ -189,17 +189,21 @@ case "$content_choice" in "Local Files") check_mount # Build directory list - dir_list="$HOME/Downloads\n$HOME/Private\n$HOME/Torrents/complete\n$HOME/Videos" + dir_list="$HOME/Downloads\n$HOME/Secret\n$HOME/Torrents/complete\n$HOME/Videos" # Add subdirectories from /media/$USER if they exist if [ -d "/media/$USER" ]; then - media_subdirs=$(find "/media/$USER" -mindepth 1 -maxdepth 1 -type d ! -name ".*" 2>/dev/null) + media_subdirs=$(find "/media/$USER" -mindepth 1 -maxdepth 1 -type d ! -name ".*" 2>/dev/null | while read -r d; do + [ -n "$(ls -A "$d" 2>/dev/null)" ] && echo "$d" + done) [ -n "$media_subdirs" ] && dir_list="$dir_list\n$media_subdirs" fi # Add subdirectories from /mnt if they exist if [ -d "/mnt" ]; then - mnt_subdirs=$(find "/mnt" -mindepth 1 -maxdepth 1 -type d ! -name ".*" 2>/dev/null) + mnt_subdirs=$(find "/mnt" -mindepth 1 -maxdepth 1 -type d ! -name ".*" 2>/dev/null | while read -r d; do + [ -n "$(ls -A "$d" 2>/dev/null)" ] && echo "$d" + done) [ -n "$mnt_subdirs" ] && dir_list="$dir_list\n$mnt_subdirs" fi @@ -208,7 +212,9 @@ case "$content_choice" in [ -z "$init_dir" ] && $mount_script && exit selected_dir="$init_dir" while true; do - subdir_options="$(find "$selected_dir" -mindepth 1 -maxdepth 1 -type d ! -name ".*" -printf "%P\n" | sort)" + subdir_options="$(find "$selected_dir" -mindepth 1 -maxdepth 1 -type d ! -name ".*" | while read -r d; do + [ -n "$(ls -A "$d" 2>/dev/null)" ] && basename "$d" + done | sort)" [ -z "$subdir_options" ] && list_and_play "$selected_dir" && break options="All files\n$subdir_options" selected_relative_dir="$(printf "%b" "$options" | dmenu -i -p "Select a directory or 'All files':")" |
