2008-05-04 17:10:42 +04:00
|
|
|
#!/bin/sh
|
|
|
|
|
2010-07-23 00:18:35 +04:00
|
|
|
_progress () {
|
2011-11-03 13:40:51 +04:00
|
|
|
notify --type progress --group "MIME type updater" \
|
2010-07-23 00:41:58 +04:00
|
|
|
--timeout ${3:-30} \
|
2010-07-23 00:18:35 +04:00
|
|
|
--icon /boot/system/apps/DiskProbe \
|
|
|
|
--messageID $0_$$ \
|
|
|
|
--title "Updating file MIME types..." \
|
|
|
|
--progress $1 "$2" >/dev/null
|
|
|
|
}
|
|
|
|
|
2010-07-23 00:41:58 +04:00
|
|
|
_progress 0.0 "desktop files"
|
2010-07-23 00:18:35 +04:00
|
|
|
|
2009-08-16 21:09:03 +04:00
|
|
|
# Make sure files on the desktop are mimeset first
|
|
|
|
|
|
|
|
for f in $(/bin/finddir B_DESKTOP_DIRECTORY 2>/dev/null\
|
|
|
|
|| echo "/boot/home/Desktop")/*; do
|
2011-10-31 19:42:56 +04:00
|
|
|
if [ -f "$f" ]; then
|
|
|
|
mimeset -f "$f"
|
2009-08-16 21:09:03 +04:00
|
|
|
fi
|
|
|
|
done
|
|
|
|
|
2008-05-04 17:10:42 +04:00
|
|
|
# Make sure all apps have a MIME DB entry.
|
|
|
|
|
2009-06-14 02:07:31 +04:00
|
|
|
SYSTEM=$(/bin/finddir B_SYSTEM_DIRECTORY 2>/dev/null || echo "/boot/system")
|
2009-04-04 20:15:22 +04:00
|
|
|
|
2012-08-11 17:56:20 +04:00
|
|
|
mimeset -f "$SYSTEM/bin/userguide"
|
|
|
|
mimeset -f "$SYSTEM/bin/welcome"
|
|
|
|
|
2010-07-23 00:18:35 +04:00
|
|
|
_progress 0.1 "system applications"
|
2009-04-04 20:15:22 +04:00
|
|
|
mimeset -apps -f "$SYSTEM/apps"
|
2010-07-23 00:18:35 +04:00
|
|
|
_progress 0.2 "documentation"
|
2009-04-04 20:15:22 +04:00
|
|
|
mimeset -f "$SYSTEM/documentation"
|
2010-07-23 00:18:35 +04:00
|
|
|
_progress 0.3 "preferences"
|
2009-04-04 20:15:22 +04:00
|
|
|
mimeset -apps -f "$SYSTEM/preferences"
|
2010-07-23 00:18:35 +04:00
|
|
|
_progress 0.4 "servers"
|
2009-04-04 20:15:22 +04:00
|
|
|
mimeset -apps -f "$SYSTEM/servers"
|
2010-07-23 00:18:35 +04:00
|
|
|
_progress 0.5 "applications"
|
2009-04-04 20:15:22 +04:00
|
|
|
mimeset -apps -f "/boot/apps"
|
2010-07-23 00:18:35 +04:00
|
|
|
_progress 0.7 "application (by signature)"
|
2009-08-16 21:09:03 +04:00
|
|
|
|
2010-05-04 21:43:38 +04:00
|
|
|
query -f 'BEOS:APP_SIG=*' | xargs --no-run-if-empty mimeset -apps -f
|
2010-07-23 00:18:35 +04:00
|
|
|
|
2010-07-23 00:41:58 +04:00
|
|
|
_progress 1.0 "done" 10
|