Skip to content

Instantly share code, notes, and snippets.

@m-bartlett
Forked from recolic/fuck-wine-mime.sh
Last active November 20, 2021 05:05
Show Gist options
  • Save m-bartlett/c2db302fe272276022bd0047c2408fc8 to your computer and use it in GitHub Desktop.
Save m-bartlett/c2db302fe272276022bd0047c2408fc8 to your computer and use it in GitHub Desktop.
#!/bin/bash
# Prevent the wine to add mime file association.
# Implements https://askubuntu.com/questions/323437/how-to-prevent-wine-from-adding-file-associations
set -o xtrace
rm -f ~/.local/share/mime/packages/x-wine*
rm -f ~/.local/share/applications/wine-extension*
rm -f ~/.local/share/icons/hicolor/*/*/application-x-wine-extension*
rm -f ~/.local/share/mime/application/x-wine-extension*
sudo sed -i 's/winemenubuilder.exe -a -r/winemenubuilder.exe -r/g' /usr/share/wine/wine.inf
if [[ "$WINEPREFIX" = "" ]]; then
WINEPREFIX="$HOME/.wine"
fi
if [[ -f "$WINEPREFIX/system.reg" ]]; then
sed -i 's/winemenubuilder.exe -a -r/winemenubuilder.exe -r/g' "$WINEPREFIX/system.reg"
fi
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment