LinuxQuestions.org
Welcome to the most active Linux Forum on the web.
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, 09:59 AM   #1
hack3rcon
Senior Member
 
Registered: Jan 2015
Posts: 1,432

Rep: Reputation: 10
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, 10:29 AM   #2
JeremyBoden
Senior Member
 
Registered: Nov 2011
Location: London, UK
Distribution: Debian
Posts: 1,645

Rep: Reputation: 359Reputation: 359Reputation: 359Reputation: 359
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, 10:47 AM   #3
Turbocapitalist
Senior Member
 
Registered: Apr 2005
Distribution: Linux Mint, Devuan, OpenBSD
Posts: 4,428
Blog Entries: 3

Rep: Reputation: 2205Reputation: 2205Reputation: 2205Reputation: 2205Reputation: 2205Reputation: 2205Reputation: 2205Reputation: 2205Reputation: 2205Reputation: 2205Reputation: 2205
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, 11:04 AM   #4
hydrurga
LQ Guru
 
Registered: Nov 2008
Location: Pictland
Distribution: Linux Mint 19.1 MATE
Posts: 8,018
Blog Entries: 5

Rep: Reputation: 2872Reputation: 2872Reputation: 2872Reputation: 2872Reputation: 2872Reputation: 2872Reputation: 2872Reputation: 2872Reputation: 2872Reputation: 2872Reputation: 2872
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, 12:40 PM   #5
DavidMcCann
LQ Veteran
 
Registered: Jul 2006
Location: London
Distribution: PCLinuxOS, Xubuntu
Posts: 5,431

Rep: Reputation: 1891Reputation: 1891Reputation: 1891Reputation: 1891Reputation: 1891Reputation: 1891Reputation: 1891Reputation: 1891Reputation: 1891Reputation: 1891Reputation: 1891
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, 12:49 PM   #6
hydrurga
LQ Guru
 
Registered: Nov 2008
Location: Pictland
Distribution: Linux Mint 19.1 MATE
Posts: 8,018
Blog Entries: 5

Rep: Reputation: 2872Reputation: 2872Reputation: 2872Reputation: 2872Reputation: 2872Reputation: 2872Reputation: 2872Reputation: 2872Reputation: 2872Reputation: 2872Reputation: 2872
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, 03:12 PM   #7
JeremyBoden
Senior Member
 
Registered: Nov 2011
Location: London, UK
Distribution: Debian
Posts: 1,645

Rep: Reputation: 359Reputation: 359Reputation: 359Reputation: 359
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, 04:50 PM   #8
ondoho
LQ Addict
 
Registered: Dec 2013
Posts: 13,390
Blog Entries: 9

Rep: Reputation: 3654Reputation: 3654Reputation: 3654Reputation: 3654Reputation: 3654Reputation: 3654Reputation: 3654Reputation: 3654Reputation: 3654Reputation: 3654Reputation: 3654
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, 07: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, 08: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, 09:09 PM   #11
JJJCR
Senior Member
 
Registered: Apr 2010
Posts: 1,645

Rep: Reputation: 278Reputation: 278Reputation: 278
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


Thread Tools Search this Thread
Search this Thread:

Advanced Search

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 07:17 PM
Few questions about Nagios - reboot notification, value=x notification. marccmile Linux - Software 5 06-04-2009 07:44 PM
Email notification for linux? reesee Linux - General 2 03-02-2004 07:30 PM
E-Mail notification to users via SMS (gateway script ok, but notification script?!?) Riku2015 Linux - Networking 10 03-08-2002 11:16 AM

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

All times are GMT -5. The time now is 06:54 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
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration