From 3c402bfd4e20d749ee8361f3701593d1c4a2c34e Mon Sep 17 00:00:00 2001 From: Mylloon Date: Mon, 1 May 2023 13:55:08 +0200 Subject: [PATCH] add a pacman hook --- Makefile | 3 +++ pacman.d/hooks/stop-wine-associations.hook | 10 ++++++++++ 2 files changed, 13 insertions(+) create mode 100644 pacman.d/hooks/stop-wine-associations.hook diff --git a/Makefile b/Makefile index ea64fb3..5bd624b 100644 --- a/Makefile +++ b/Makefile @@ -104,6 +104,9 @@ sync-arch: # VSCodium @$(WGET) $(REPO_SRC)/.config/VSCodium/product.json -O $(HOME)/.config/VSCodium/product.json +# Pacman hooks + @$(WGET) $(REPO_SRC)/pacman.d/hooks/stop-wine-associations.hook -P /etc/pacman.d/hooks + # Windows Subsystem for Linux specific sync-wsl: diff --git a/pacman.d/hooks/stop-wine-associations.hook b/pacman.d/hooks/stop-wine-associations.hook new file mode 100644 index 0000000..367393b --- /dev/null +++ b/pacman.d/hooks/stop-wine-associations.hook @@ -0,0 +1,10 @@ +[Trigger] +Operation = Install +Operation = Upgrade +Type = Path +Target = usr/share/wine/wine.inf + +[Action] +Description = Stopping Wine from hijacking file associations... +When = PostTransaction +Exec = /bin/sh -c '/usr/bin/grep -q "HKCU,\"Software\\\Wine\\\FileOpenAssociations\",\"Enable\",2,\"N\"" /usr/share/wine/wine.inf || /usr/bin/sed -i "s/\[Services\]/\[Services\]\nHKCU,\"Software\\\Wine\\\FileOpenAssociations\",\"Enable\",2,\"N\"/g" /usr/share/wine/wine.inf'