You are not logged in.

#1 2021-07-24 11:21:31

Mikko_H
Member
Registered: 2020-06-23
Posts: 5

[SOLVED] Pacman hook for wine not working

Every time wine updates, some custom registry edits are removed and I need to execute a .reg file to add them again. I would like to automate this using a pacman hook.

/usr/share/libalpm/scripts/wine-upgrade

#! /bin/bash

Prefix="/home/mikko/.local/wine/foobar2000"

if [ ! -d "$Prefix" ]; then
    echo "foobar2000 prefix not found"
    exit 0
fi

WINEPREFIX="$Prefix" regedit "$Prefix"/fix-launchers.reg
echo "foobar2000 prefix updated"
exit 0

Executing this script manually works as intended so the problem is in the .hook file?

/usr/share/libalpm/hooks/wine-upgrade.hook

[Trigger]
Type = Package
Operation = Upgrade
Target = wine

[Action]
Description = Updating wine prefix for foobar2000...
Exec = /usr/share/libalpm/scripts/wine-upgrade
When = PostTransaction

Edit: I just realized the regedit command should run as user instead of root.

Last edited by Mikko_H (2021-07-24 11:41:20)

Offline

Board footer

Powered by FluxBB