Thatbytes

Mostly Interesting

Bash Notificaiton

I haven’t updated the blog in ages and I think it’s about time that I wrote a post. I’m forever running commands that take forever to complete, I forget about them and only release they have complete once I cycle through all the windows in my tmux session. To overcome this, I wrote a super simple function that sends a desktop notification once the command completes. It also returns the exit code of the command rather than the exit code of notify-send.

1
2
3
4
5
6
7
 wdone()
 {
   $@
   code=$?
   notify-send "Complete: ${@}"
   return $code
 }

Comments