Open JackieMium opened 6 years ago
在 ~/.Rprofile
里添加:
notify <- function(){
cmd <- "notify-send"
system2(cmd, args="-i emblem-default 'R Message' 'Mission Complete!'")
}
beep <- function(){beepr::beep()}
这样以后执行需要长时间跑的命令时,如果你打算去打开网页看其他东西,直接在末尾放上 notify()
任务完成时桌面会弹出通知,如果你打算玩手机,beep()
会在任务完成是发出声音(在自习室或图书馆请插上耳机谢谢)。
让 R 在完成任务时发送通知或者叮一声
Is there a way to make R beep/play a sound at the end of a script?
Throw a Beep
The package is developped at GitHub.
To get a message, you can use
notify-send
command: