Guest
[Entry]
"Tested on Ubuntu 14.04, 16.04, 18.04, 20.04. Screenshots from Ubuntu 20.04.
[WORKS WELL] Popup notification that auto-closes after 4~10 seconds (somehow tied to your OS settings?): notify-send ""Hello world""
Source: superuser.com/a/31919/425838
Popup window with buttons to click:
Window does NOT get auto-focus: Source: myself; note: for older Unity-based versions of Ubuntu, such as 16.04, -t is ignored for all values except 0--how stupid. :(. For newer Gnome-based versions of Ubuntu, such as 18.04 or 20.04, -t is ignored entirely. Therefore, on older Unity-based versions of Ubuntu, such as 16.04, using -t 0 causes buttons to show up, but on newer Gnome-based versions, it does NOT. That means that for the Ubuntu 20.04 screenshot shown below, the behavior and look of notify-send -t 0 ""Hello world"" is exactly identical to notify-send ""Hello world"" above. notify-send -t 0 ""Hello world""
On Ubuntu 18.04 or 20.04 or later, just add -u critical to the command instead to get it to stay open indefinitely until you click anywhere on it!: notify-send -u critical ""Hello world""
Source: @lucidbrot's comment below this answer, plus my own testing.
OR Window DOES get auto-focus: zenity --info --title ""Hello"" --text ""World""
Note: the window will NOT close until you click the OK button.
Source: askubuntu.com/a/804475/327339
[MY FAVORITE] The window auto-closes after the specified --timeout in seconds, OR after you click the ""OK"" button! zenity --info --title ""Hello"" --text ""World"" --timeout=2
Note: the window WILL automatically close after the specified timeout above, in seconds!
Source: myself reading the man pages: man zenity
[super ugly-looking] xmessage 'hello world'
Note: the window will NOT close until you click the okay button.
Source: http://www.linux-commands-examples.com/xmessage
Play sounds too
If you want to play sounds too, along with the window popup, to signify the completion of a command or something, see my other answer here: AskUbuntu.com: How to make a sound once a process is complete?"
|