Views:
1,942β
Votes: 3β
β
Solution
Tags:
notification
bashrc
Link:
π See Original Answer on Ask Ubuntu β§ π
URL:
https://askubuntu.com/q/847624
Title:
notify-send (alert) not popping-up GUI bubble messages
ID:
/2016/11/10/notify-send-_alert_-not-popping-up-GUI-bubble-messages
Created:
November 10, 2016
Edited: June 12, 2020
Upload:
December 22, 2024
Layout: post
TOC:
false
Navigation: false
Copy to clipboard: false
Aliases are automatically created in ~/.bashrc
When you look in ~/.bashrc you see these lines:
# Add an "alert" alias for long running commands. Use like so:
# sleep 10; alert
alias alert='notify-send --urgency=low -i "$([ $? = 0 ] && echo terminal || echo error)" "$(history|tail -n1|sed -e '\''s/^\s*[0-9]\+\s*//;s/[;&|]\s*alert$//'\'')"'
The problem with the code is the --urgency=low
flag. Sometimes the message pops up, some times it doesnβt. After all it is low priority right?
To make the message always appear set the urgency to critical
. Rather than changing the system default I created a new line for my own purposes:
# Add a "redalert" alias to pop-up on GUI desktop screens. Use like so:
# redalert "Weather update: It's raining Red States"
alias redalert='notify-send --urgency=critical -i "$([ $? = 0 ] && echo terminal || echo error)" "$(history|tail -n1|sed -e '\''s/^\s*[0-9]\+\s*//;s/[;&|]\s*alert$//'\'')"'
Now you can use:
redalert "Weather Update: It's raining Red States"
and it works perfectly!