Created
May 18, 2018 18:28
-
-
Save eliocamp/9f625fe133e5d714a9c00d5a7255d9ec to your computer and use it in GitHub Desktop.
Notifications from R (only for linux)
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
notify <- function(title = "title", text = NULL, time = 2) { | |
time <- time*1000 | |
system(paste0("notify-send ", title, " ", text, "-t ", time, " -a rstudio")) | |
} | |
notify_after <- function(expression, ...) { | |
expression <- eval(expression) | |
notify(title = "Run\\ ended", ...) | |
return(expression) | |
} | |
notify_after(Sys.sleep(4)) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment