How is this not a built-in function of pacman?

  • moonpiedumplings@programming.dev
    link
    fedilink
    English
    arrow-up
    3
    ·
    13 hours ago

    When I desire to inhibit sleep, whether for an update via pacman, or for nix home manager, or any other reason, I usually use KDE’s power management widget. The advantage of this, as opposed to something pacman specific, is that it is explicit, activating and stopping when I want it to, which also makes it more general, and it can be used for anything.

    You can also manually do this (on systemd distros at least) via the systemd-inhibit command, which can wait for a command to finish.

    sudo systemd-inhibit --what=shutdown:sleep --mode=block pacman -Syu
    

    EDIT Oop someone already mentioned systemd-inhibit in another commend. And their answer is even shorter than mine and apparently still works.