and after what I learned from these discussions that it is better to do it through a hook not a script.
So, after actually doing a hook, it is really interesting to have a hook to automate something under a certain condition. I am trying to explore other possible hooks that can be made to make our system even better.
I am posting this to exchange ideas about what hooks can be made?
I just thought of something to start with, a hook to watch memory and if used memory is above a certain limit the hook runs a command to free up memory so your machine will never hang because of memory shortage.
Any other ideas to make our EndeavourOS even better?
Thank you very much @LewdLoli
I will read the link and see.
I am trying to like brainstorm and find out some good ideas as I like the concept of hooks.
Pacman hooks are run during package management operations, hooks aren’t daemons.
To actually answer your question, I masked update-mandb.timer (or something like that) on my old PC and made a pacman hook which did the job of the service the timer triggered. That timer triggered on first boot of every day and significantly slowed down boot process (I had a HDD back then) so I moved the functionality to a pacman hook.
It was the existence of a hook that caused all this GRUB mess in the first place. If anything else, it’s a good reminder that updates on Arch shouldn’t be automated.
In general, I prefer to have as few hooks, soystemd services, timers, cronjobs, etc, as possible.