Search Criteria
Package Details: pacman-beep-hook 0.1-1
Package Actions
Git Clone URL: | https://aur.archlinux.org/pacman-beep-hook.git (read-only, click to copy) |
---|---|
Package Base: | pacman-beep-hook |
Description: | hook to play Pac-Man theme using pcspkr before and after any transaction |
Upstream URL: | None |
Submitter: | 7Ji |
Maintainer: | 7Ji |
Last Packager: | 7Ji |
Votes: | 3 |
Popularity: | 0.000000 |
First Submitted: | 2022-04-06 08:35 (UTC) |
Last Updated: | 2022-04-13 12:39 (UTC) |
Dependencies (2)
- beep (beep-sudoableAUR, abeep-beep-providesAUR)
- beep-sudoableAUR (optional) – skip sudo check
Latest Comments
7Ji commented on 2022-04-13 12:06 (UTC)
@terminator0821
You can also install beep-sudoable instead of beep, the sudoable one is patched so there will be not such issue anymore:
https://aur.archlinux.org/packages/beep-sudoable
7Ji commented on 2022-04-13 06:14 (UTC) (edited on 2022-04-13 06:19 (UTC) by 7Ji)
@terminator0821
That error is throwed by beep which is running during the hook. A hook erroring out does not stop any installation/upgrading/removal transaction. Which means pacman-beep-hook the package itself is successfully installed even you saw that error. You can confirm it by pacman -Q pacman-beep-hook, and pacman -Ql pacman-beep-hook to confirm the hooks and the beeping script is installed.
How to avoid that error afterwards though, is another question. You got that error because you are running beep as sudo (or sudo pacman, which forks beep), and beep was hard-coded to refuse to actually beep if it detects this:
https://github.com/spkr-beep/beep/blob/41a9eb83fa6b7d173949a965e6b29929025a64da/beep-main.c#L478
Check the other two comments I wrote a week ago to understand how to avoid this error:
https://aur.archlinux.org/packages/pacman-beep-hook#comment-860031
https://aur.archlinux.org/packages/pacman-beep-hook#comment-860131
marcandru commented on 2022-04-13 03:47 (UTC)
Couldn't install it:
:: Running post-transaction hooks... (1/2) Arming ConditionNeedsUpdate... (2/2) Pac-Man beep beep: Error: Running as root under sudo, which is not supported for security reasons. beep: Error: Set up permissions for the pcspkr evdev device file and run as non-root user instead. error: command failed to execute correctly
7Ji commented on 2022-04-07 03:23 (UTC)
@himan You can also patch beep so it will not exit when running with sudo, since beep is in the official repository, I will not create another package just for the sake of being able to beep with sudo. And that is insecure anyway. You can apply the following patch and compile beep yourself:
0001-Yolo-it-when-running-with-sudo.patch
Basically you can
(then copy the above content and :wq to save it)
(the beep in the current folder is the patched executable, you can then overwrite /usr/bin/beep with it, or pacman -R beep and move it to /usr/bin/beep to have some out-of-tree binaries, or save it seperately and edit the hooks so the modified beep will be invoked)
7Ji commented on 2022-04-06 16:09 (UTC)
@himan According to @EmbarrassedActive4, beep will refuse to actually beep if the environment variables SUDO_* suggests you are running as root under sudo, you can either sudo -s/su root to actually got a root shell then run pacman, or su -c 'pacman' to su to root and run pacman in one go.
himan commented on 2022-04-06 14:14 (UTC) (edited on 2022-04-06 14:15 (UTC) by himan)
(3/5) Pac-Man beep
??
7Ji commented on 2022-04-06 13:31 (UTC)
Just figured I wrote wrong pacman-beep.sh path in the hooks, it's fixed now