The howto is in reply #1 and #2. aka post #2 and #3 of this thread.
______________
Some weeks ago I found in a thread the code how the popup message is coded in Port, like the NetworkManager Applet "Connection established" one, and I did copy the code and played a bit with it.
But now that I want to incorporate the popup message into a script, silly me neither finds the thread (searched for "popup message remove" - since it was about how to remove the popup message that came on every boot) nor the locally saved code.
I know some of you know how to code such popup.
[howto] code a popup
- Rava
- Contributor
- Posts: 5401
- Joined: 11 Jan 2011, 02:46
- Distribution: XFCE 5.01 x86_64 + 4.0 i586
- Location: Forests of Germany
[howto] code a popup
Cheers!
Yours Rava
Yours Rava
- ncmprhnsbl
- DEV Team
- Posts: 3925
- Joined: 20 Mar 2012, 03:42
- Distribution: v5.0-64bit
- Location: australia
- Contact:
howto code a popup?
if you're talking about using a notification (daemon), that most of the 003-DE modules have (eg. xfce4-notifyd) :
at it's simplist:
for some more options:
at it's simplist:
Code: Select all
notify-send "a message"
Code: Select all
notify-send --help
Forum Rules : https://forum.porteus.org/viewtopic.php?f=35&t=44
- Rava
- Contributor
- Posts: 5401
- Joined: 11 Jan 2011, 02:46
- Distribution: XFCE 5.01 x86_64 + 4.0 i586
- Location: Forests of Germany
howto code a popup?
Indeed, that was it. Thanks.
Without the -t parameter set to 0 or at least 1000 nothing is to be seen, at least on an 8 core machine.
Sadly, not even man notify-send explains what the valid TYPE of
Code: Select all
--category=TYPE
I search online for tutorials on notify-send.
Added in 4 minutes 34 seconds:
http://vaskovsky.net/notify-send/linux.html gives some tips.
e.g.
Code: Select all
notify-send -i info -t 0 "Encoding" "finished"
Code: Select all
notify-send -i info -t 0 "Downloading" "finished"
Though in both cases "finished" might not be "successfully finished" - e.g. server downtime while downloading.
But that can be handled via examining $? of e.g. ffmpeg or wget.
Cheers!
Yours Rava
Yours Rava
[howto] code a popup
Hi Rava,
notify-send -i info ....
The option "-i info" creates a icon (letter i on blue circle)
Are other icons possible? Which?
Thanks
notify-send -i info ....
The option "-i info" creates a icon (letter i on blue circle)
Are other icons possible? Which?
Thanks
- Rava
- Contributor
- Posts: 5401
- Joined: 11 Jan 2011, 02:46
- Distribution: XFCE 5.01 x86_64 + 4.0 i586
- Location: Forests of Germany
[howto] code a popup
Its in the link I put in above…
:
-i ICON, --icon=ICON: specifies an icon filename or stock icon to display, for example, info, important or error. Default: no icon.
[…]
-a, --app-name=APP_NAME: specifies the application name for the icon.
Cheers!
Yours Rava
Yours Rava
- Rava
- Contributor
- Posts: 5401
- Joined: 11 Jan 2011, 02:46
- Distribution: XFCE 5.01 x86_64 + 4.0 i586
- Location: Forests of Germany
[howto] code a popup
like with a one-liner:
Code: Select all
ffmpeg [whatever];if [ $? -eq 0 ];then notify-send -i info -t 0 "Encoding" "successfully finished";else notify-send -i info -t 0 "Encoding" "ended with error";fi
Code: Select all
true;if [ $? -eq 0 ];then notify-send -i info -t 0 "Encoding" "successfully finished";else notify-send -i info -t 0 "Encoding" "ended with error";fi
false;if [ $? -eq 0 ];then notify-send -i info -t 0 "Encoding" "successfully finished";else notify-send -i info -t 0 "Encoding" "ended with error";fi
Cheers!
Yours Rava
Yours Rava