#!/bin/bash
# Desktop in pipe menu
where=$(xdg-user-dir DESKTOP)
#where="/home/ticho/tmp2sdfsdfsdf"
cd "$where" || exit # better error must be here, for pipe xml
# func
printer() {
cat << ITEM
-
thunar '$where/$stuff'
ITEM
}
# menu head
echo ""
# just open ~/Desktop
cat << ITEM
-
thunar '$where'
ITEM
# fodlers
for stuff in *
do
if [[ -d $stuff ]]; then
printer
fi
done
echo ""
# files & links
for stuff in *
do
if [[ -f $stuff ]]; then
printer
fi
done
# menu foot
echo ""