#Get Notified if terminal needs attention or when a command finshes.

14 messages · Page 1 of 1 (latest)

hazy dove
#

Many time program takes long time to perform it action like ( yay or pacman ) and i switch to other work and forget about it . when i come back the password prompt has timed out. Any way to fix this , so that i can get notified if a running command needs attention or has finished it work.

teal kettle
#

I've never done this, but I think it should be possible if you already have a notification daemon installed

#

doing a little digging it should be possible to add the following to the pacman.conf

# Hook for transaction completion (after transaction)
# Post-transaction notifications
[Trigger]
Operation = Install
Operation = Upgrade
Operation = Remove
Type = Package
Target = *

[Action]
Description = Notify transaction completion
When = PostTransaction
Exec = /usr/bin/notify-send "Pacman" "Transaction completed."
Depends = libnotify

# Hook for when user input is required (before transaction)
[Trigger]
Operation = Install
Operation = Upgrade
Type = Package
Target = *

[Action]
Description = Notify user input required
When = PreTransaction
Exec = /usr/bin/notify-send "Pacman" "User input required for transaction."
Depends = libnotify```
obviously change the notify daemon for whatever you're using
mellow stirrup
#

or run a basic bash script, ie)

if command; then 'play mp3 file' ; fi
hazy dove
long mortarBOT
#

_paulm received a thank you cookie!

hazy dove
hazy dove
#

ok .. it needs to be seprated....

#

i am getting this error -->

#
(3/5) Notify transaction completion
Error spawning command line “dbus-launch --autolaunch=2de8e8dfa7204b5ebaabda8ce11702dd --binary-syntax --close-stderr”: Child process exited with code 1
error: command failed to execute correctly
#

also i am not getting notfied when the terminal ask for password to complete installation ..

#

is it not possible ?

#

i found this .. https://unix.stackexchange.com/questions/491121/send-a-notification-or-alert-when-bash-asks-for-input-from-user

almost 5 years old , a little hard to grasp , but do you think it will work ? i am on hyprland