I am wondering if there's an easy way (that doesn't require a ton of code) to display notifications on Linux. A prime example would be Ubuntu has "toast-like" notifications that are usually found on Windows 8 applications. Is there an easy (simple) way of triggering notifications that will work across distributions? It doesn't need to work across all of them although Ubuntu and its derivatives and maybe distributions like Arch. I'm using the following code for throwing balloon notifications on Windows and am curious if the same can be done on Linux with a similar amount of code.
PureBasic 5.73 | SpiderBasic 2.30 | Windows 10 Pro (x64) | Linux Mint 20.1 (x64)
Old bugs good, new bugs bad! Updates are evil: might fix old bugs and introduce no new ones.
;Options:
;--urgency=low, --urgency=normal, --urgency=critical
;--expire-time=ms
;--icon=StockIcon-Name OR IconFilename
; with --urgency=critical you have to click for hiding (on most systems)
Global nSummary.s= "My Application"
Global nBody.s = "A Desktop-Notification with 'notify-send'" + "\n" + "and a 2. line"
Global nIcon.s = "--icon=dialog-information --urgency=normal --expire-time=5000"
If Not RunProgram("notify-send", #DQUOTE$ + nSummary + #DQUOTE$ + " " + #DQUOTE$ + nBody + #DQUOTE$ + nIcon, "")
Debug "'notify-send' not available!"
Debug "install: sudo apt-get install libnotify-bin"
EndIf
Cheers, Charly
PureBasic 5.4-5.7, Linux: (X/L/K)Ubuntus+Mint - Windows XP (32Bit) PureBasic Linux-API-Library & Viewer: http://www.chabba.de