LinuxQuestions.org
Welcome to the most active Linux Forum on the web.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 02-11-2017, 08:59 AM   #1
hack3rcon
Senior Member
 
Registered: Jan 2015
Posts: 1,432

Rep: Reputation: 11
Post Notification in Linux.


Hello.
When a task finished I like Linux notify me, How can I do it? For example, I'm downloading a file via "wget" and when it is finished then Linux notify me.

Thank you.
 
Old 02-11-2017, 09:29 AM   #2
JeremyBoden
Senior Member
 
Registered: Nov 2011
Location: London, UK
Distribution: Debian
Posts: 1,947

Rep: Reputation: 511Reputation: 511Reputation: 511Reputation: 511Reputation: 511Reputation: 511
A command line does so by asking for the next command.

But you could always do something like
Code:
wget URL && echo "finished"
 
Old 02-11-2017, 09:47 AM   #3
Turbocapitalist
LQ Guru
 
Registered: Apr 2005
Distribution: Linux Mint, Devuan, OpenBSD
Posts: 7,328
Blog Entries: 3

Rep: Reputation: 3726Reputation: 3726Reputation: 3726Reputation: 3726Reputation: 3726Reputation: 3726Reputation: 3726Reputation: 3726Reputation: 3726Reputation: 3726Reputation: 3726
You can also have a graphical notice pop up. There is usually some such utility like xmessage, zenity, or another pre-installed.

Code:
wget $url && zenity --info --text="Download Complete" || zenity --info --text="Failed to Download"

wget $url && xmessage -buttons 'OK' 'Download Complete' || xmessage -buttons 'OK' 'Failed to Download'
 
Old 02-11-2017, 10:04 AM   #4
hydrurga
LQ Guru
 
Registered: Nov 2008
Location: Pictland
Distribution: Linux Mint 21 MATE
Posts: 8,048
Blog Entries: 5

Rep: Reputation: 2925Reputation: 2925Reputation: 2925Reputation: 2925Reputation: 2925Reputation: 2925Reputation: 2925Reputation: 2925Reputation: 2925Reputation: 2925Reputation: 2925
Alternatively:

wget URL && beep

Refer to this page for some caveats and alternatives to beep: http://askubuntu.com/questions/19906...pt-not-working
 
Old 02-11-2017, 11:40 AM   #5
DavidMcCann
LQ Veteran
 
Registered: Jul 2006
Location: London
Distribution: PCLinuxOS, Debian
Posts: 6,142

Rep: Reputation: 2314Reputation: 2314Reputation: 2314Reputation: 2314Reputation: 2314Reputation: 2314Reputation: 2314Reputation: 2314Reputation: 2314Reputation: 2314Reputation: 2314
Surely beep isn't a bash command?

You can play something from /usr/share/sounds using paplay, like
paplay /usr/share/sounds/freedesktop/stereo/bell.oga
paplay /usr/share/sounds/purple/alert.wav
paplay /usr/share/sounds/gnome/default/alerts/bark.ogg
or whatever you have there
 
Old 02-11-2017, 11:49 AM   #6
hydrurga
LQ Guru
 
Registered: Nov 2008
Location: Pictland
Distribution: Linux Mint 21 MATE
Posts: 8,048
Blog Entries: 5

Rep: Reputation: 2925Reputation: 2925Reputation: 2925Reputation: 2925Reputation: 2925Reputation: 2925Reputation: 2925Reputation: 2925Reputation: 2925Reputation: 2925Reputation: 2925
Quote:
Originally Posted by DavidMcCann View Post
Surely beep isn't a bash command?

You can play something from /usr/share/sounds using paplay, like
paplay /usr/share/sounds/freedesktop/stereo/bell.oga
paplay /usr/share/sounds/purple/alert.wav
paplay /usr/share/sounds/gnome/default/alerts/bark.ogg
or whatever you have there
Those would certainly sound nice than beep. :-)

Beep is in the Ubuntu archives. I assume it is also available for other systems.
 
Old 02-11-2017, 02:12 PM   #7
JeremyBoden
Senior Member
 
Registered: Nov 2011
Location: London, UK
Distribution: Debian
Posts: 1,947

Rep: Reputation: 511Reputation: 511Reputation: 511Reputation: 511Reputation: 511Reputation: 511
Code:
~ $ beep
The program 'beep' is currently not installed.  To run 'beep' please ask your administrator to install the package 'beep'
beep: command not found
~ $ sudo apt-get install beep
man beep
beep - beep the [builtin] pc speaker any number of ways
...
Since beep wasn't pre-installed on a Debian system, it is likely that most distros won't include it.
 
Old 02-11-2017, 03:50 PM   #8
ondoho
LQ Addict
 
Registered: Dec 2013
Posts: 19,872
Blog Entries: 12

Rep: Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053
Quote:
Originally Posted by hack3rcon View Post
Linux notify me.
you have to define this better.

if you want a desktop notification, like so many apps use, it has a command line ... erm, command:
Code:
wget URL && notify-send WGET "is finished!"
 
Old 02-11-2017, 06:14 PM   #9
Doug G
Member
 
Registered: Jul 2013
Posts: 749

Rep: Reputation: Disabled
beep is in the fedora repositories but doesn't seem to be in centos7 repositories.
 
Old 02-11-2017, 07:07 PM   #10
r3sistance
Senior Member
 
Registered: Mar 2004
Location: UK
Distribution: CentOS 6/7
Posts: 1,375

Rep: Reputation: 217Reputation: 217Reputation: 217
&& echo -e '\07' or && echo -e '\a'

However this won't work over SSH, but I think you could use a >> to the relevant tty
 
Old 02-12-2017, 08:09 PM   #11
JJJCR
Senior Member
 
Registered: Apr 2010
Posts: 2,159

Rep: Reputation: 449Reputation: 449Reputation: 449Reputation: 449Reputation: 449
Quote:
wget URL && run a script to send email for notification
you need to have a script though to notify via email

or if you have sms module in your system, send an SMS to your phone once it's done.
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
SE Linux notification Pedroski Linux - Security 2 02-08-2010 06:17 PM
Few questions about Nagios - reboot notification, value=x notification. marccmile Linux - Software 5 06-04-2009 06:44 PM
Email notification for linux? reesee Linux - General 2 03-02-2004 06:30 PM
E-Mail notification to users via SMS (gateway script ok, but notification script?!?) Riku2015 Linux - Networking 10 03-08-2002 10:16 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 11:28 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration