0

Let's use sudo apt-get install linux as an example.

Here is the notify send command: notify-send -i terminal Bash "execution complete"

How could I substitute 'bash' with the entire sudo command? Where the command appears in bold as the title as "execution complete" displays below it as a message. This would be used as a means of notification. Once a command finishes a notification appears displaying the message.

Others have used ";alert" to utilize notify-send. notify-send -i terminal Bash "execution complete" is saved as an alias as 'alert,' I'd like to add to this alias for the sake of convenience.

  • UPDATE: I've used the following two alias to do what was posted however it requires that I add ";alert" after every command. However I am in search of a method to avoid this. These two lines were written by another person. They've been manipulated to suit by needs. alias alert_helper='history|tail -n1|sed -e "s/^\s*[0-9]\+\s*//" -e "s/;\s*aler$ alias alert='notify-send -i terminal "$(alert_helper)" "execution complete"' – atlaspaine Nov 14 '14 at 4:02
1

You format text with html code

notify-send -i terminal "<font size=16 color=blue><b><i>'bash -c ls'</b></i></font>"  "execution complete"

change what is in the single quotes with the command you wish, feel free to change the size and color to what you wish.

If you need assistance, post your code and more detailed information on what you wish to change

  • 3
    The HTML code does not get parsed in my version notify-osd 0.9.35+15.04.2015 – mxmlnkn Feb 20 '17 at 22:08
  • @mxmlnkn - Rather then commenting here please either ask a new question or file a bug report. You would have to post your code if you need help. – Panther Feb 22 '17 at 16:49

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.