Skip to content

Instantly share code, notes, and snippets.

@bogdanRada
Forked from flying-sheep/fix_jar_mime.sh
Created April 10, 2023 11:01
Show Gist options
  • Save bogdanRada/744a427ccd3c96a189f666fc225db798 to your computer and use it in GitHub Desktop.
Save bogdanRada/744a427ccd3c96a189f666fc225db798 to your computer and use it in GitHub Desktop.
A bug exists for ages in Kubuntu (and afaik only there) that can be fixed by removing a superfluous file and rebuilding the MIME DB.
#!/bin/bash
ROOT_UID=0
FIX_JAR_MIME="rm -vf /usr/share/mime/packages/sun-java*-jre.xml
update-mime-database /usr/share/mime"
if [ "$UID" -ne "$ROOT_UID" ]; then
kdesudo -c "$FIX_JAR_MIME"
kbuildsycoca4 #only possible if run as underprivileged
else
"$FIX_JAR_MIME"
fi
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment