Skip to content

Instantly share code, notes, and snippets.

@recolic
Created October 11, 2019 03:21
Show Gist options
  • Save recolic/08ba4c61222769cd38e70f4b9919e8cd to your computer and use it in GitHub Desktop.
Save recolic/08ba4c61222769cd38e70f4b9919e8cd to your computer and use it in GitHub Desktop.
#!/bin/bash
# Prevent the fucking 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