[HowTo] Create a pacman hook to detect .pacnew files

If you don’t like using pacman hooks, don’t :slight_smile: :slight_smile: . If you feel like sharing your how-to’s please open a thread.

Please guys no more suggestion about how to use other various method to have ‘similar’ results, because if you do that on all how-to threads, it is infinite, this is by essence how it works, you can achieve the same thing in various different ways, for almost everything. This is completely off topic.

Point of the thread: creating a pacman hook to check for .pacnew files. That’s all.

Opinions not really welcomed.

3 Likes

your first script has an syntax error

else
    # echo "no .pacnew files found"
fi

uncomment it!!

Personally, I simply installed pacnew-chaser and it works very well.

3 Likes

I just noticed my initial post has been edited by @Fabby and it now has errors in it, and I can’t edit it now. Fabby, fix the pacman hook or put the previous script path back, because now it doesn’t match…

You changed the executable path.

On a side note, why can’t I edit my own post now? Aren’t we supposed to be able to edit WIKI posts (and aren’t post in tutorial category considered WIKI posts or something like that?)

1 Like

Yes. It wasn’t a wiki post, but it is now. You should be able to edit it now.

Apparently not by default.

OK thanks :slight_smile:

@Fabby I’ll edit the post myself then.

:+1:

1 Like

Modified tutorial based on papajoke’s input

@Yochanan I saw the mistake but you edited too quickly.

1 Like

A post was split to a new topic: Wy integrate .pacnew files

What about adding some Desktop notify ?

notify-send 'Found some pacnew files:' "'$L'" --icon=dialog-information --expire-time=600000

It could be a good idea, would that work with Pamac too then? That could improve the script itself if it adds notification in that case (but if it only works with Pacman, then I don’t think it is relevant to add it, as it already adds a warning in Pacman output, which was the purpose of the script initially, and adding more warnings would seem redundant at least, and now I imagine adding sound alarms, flashing popups, and so on :rofl:).

1 Like

Does the file check-pacnew.hook need to be made executable as well?

No, just 0644 (.rw-r--r--).

1 Like

So that would be these:

:question:

Indeed.