sxmo_files now respect user desktop configurations

We use our own implementation of xdg-open that replace the hardcoded
script used in sxmo_files.

We add and will maintain some desktop entries to offer a suckless
experience by default.

Signed-off-by: Reed Wade <reedwade@misterbanal.net>
Signed-off-by: Anjandev Momi <anjan@momi.ca>
This commit is contained in:
Reed Wade 2020-11-24 08:43:34 +01:00 committed by Anjandev Momi
parent a90f565c12
commit 08b95c6182
5 changed files with 344 additions and 14 deletions

View file

@ -3,18 +3,6 @@ DIR="$1"
[ -z "$DIR" ] && DIR="/home/$USER/"
cd "$DIR" || exit 1
handlefiles() {
if echo "$1" | grep -iE ".(webm|ogg|mp4|mov|avi|mkv)$"; then
st -e mpv -ao=alsa "$@"
elif echo "$1" | grep -iE ".(wav|opus|m4a|flac|mp3)$"; then
st -e mpv -ao=alsa --vid=no -v "$@"
elif echo "$1" | grep -iE ".(jpg|png|gif)$"; then
st -e sxiv "$@"
else
st -e sh -ic "$EDITOR $*"
fi
}
while true; do
CHOICES="$(printf %b 'Close Menu\n../\n*\n'"$(ls -1p)")"
DIR="$(basename "$(pwd)")"
@ -31,6 +19,6 @@ while true; do
echo "$PICKED" | grep "Close Menu" && exit 0
[ -d "$PICKED" ] && cd "$PICKED" && continue
echo "$PICKED" | grep -E '^[*]$' && handlefiles ./*
[ -f "$PICKED" ] && handlefiles "$PICKED"
echo "$PICKED" | grep -E '^[*]$' && sxmo_open.sh -a ./*
[ -f "$PICKED" ] && sxmo_open.sh -a "$PICKED"
done