Yad --icon --read-dir presents desktop files in a directory. If every file and every directory had a .desktop file representing it then that would make for a rudimentary file navigator, with executable functionality and higher levels of custom actionability per file or per dir. This makes for advanced customised security. So my experiment so far was to make a desktop file with the contents.
Code: Select all
[Desktop Entry]
Encoding=UTF-8
Name=root
GenericName=root
Icon=dir.png
Comment=directory
Exec=yad --icons --read-dir=/root
Terminal=false
Type=Application
Categories=File
and yes, it opens up a yad --icons --read-dir instance for /root. However i presently don't have .desktop files in /root representing files and dirs that are there. Of course creating them automatically would be trivial. Each would have an icon corresponding to a limited number of (mime) types. All dirs to any depth can be visible on the top plane, like a flattened tree. Files only get represented on opening a dir.desktop file. The Exec= string can be set automatically or manually. Just a simple backup file system navigator. I wonder how practical it would be?
Code: Select all
#!/bin/bash
for i in $(ls /)
do
echo "[Desktop Entry]
Encoding=UTF-8
Name=$i
GenericName=$i
Icon=dir.png
Comment=$i
Exec=yad --icons --read-dir=/$i
Terminal=false
Type=Application
Categories=File" > /tmp/$i.desktop
done
or better with find -max-depth -exec yfm.sh {} ... etc