4 trap 'echo "$0:$LINENO:error: \"$BASH_COMMAND\" returned $?" >&2' ERR
6 [[ $EUID == 0 ]] ||
exec sudo
-E "$BASH_SOURCE" "$@"
8 shopt -s extglob nullglob
10 echo '[Default Applications]' >/etc
/xdg
/defaults.list
11 sed -r '/^MimeType=/!d;s/^MimeType=//;s/;/=mpv.desktop\n/g' /usr
/share
/applications
/mpv.desktop
>>/etc
/xdg
/defaults.list
13 # this is the new one, according to
14 # https://specifications.freedesktop.org/mime-apps-spec/mime-apps-spec-1.0.html
15 # https://wiki.debian.org/MIME
16 # https://standards.freedesktop.org/basedir-spec/basedir-spec-latest.html
17 cp /etc
/xdg
/defaults.list
/etc
/xdg
/mimapps.list
19 for f
in /usr
/share
/applications
/!(defaults
).list
; do
20 cp /etc
/xdg
/defaults.list
/etc
/xdg
/${f##*/}
23 update-desktop-database