During my last arch linux update using
pacman -Syu I shut down my laptop, as I had forgotten that the update was running in the background and installing the packages.
Afterwards I could not start arch linux anymore and had to go through the time consuming (for me) process of creating a bootable usb with another laptop and using chroot to run re-run
pacman -Syu in order to fix my arch linux install.
I've had similar problems before after accidentally shutting down my laptop while running a system update, so I was wondering if there is a way to display a warning that pacman is running if the shutdown process is about to be initiated.
I shut down my computer using the regular KDE Plasma "switch off" mechanism.
As an idea; I think I might be able to write a script which first checks if pacman is running, as explained here, and then, if pacman is not running, calls the kde shutdown command that is shown here.
I can't try it out since I cannot access my Linux machine at the moment, but I'll try it out this evening.