日韩性视频-久久久蜜桃-www中文字幕-在线中文字幕av-亚洲欧美一区二区三区四区-撸久久-香蕉视频一区-久久无码精品丰满人妻-国产高潮av-激情福利社-日韩av网址大全-国产精品久久999-日本五十路在线-性欧美在线-久久99精品波多结衣一区-男女午夜免费视频-黑人极品ⅴideos精品欧美棵-人人妻人人澡人人爽精品欧美一区-日韩一区在线看-欧美a级在线免费观看

歡迎訪問 生活随笔!

生活随笔

當前位置: 首頁 > 运维知识 > Ubuntu >内容正文

Ubuntu

ubuntu自动提醒

發(fā)布時間:2024/9/15 Ubuntu 39 豆豆
生活随笔 收集整理的這篇文章主要介紹了 ubuntu自动提醒 小編覺得挺不錯的,現(xiàn)在分享給大家,幫大家做個參考.

文章目錄

notify-send是系統(tǒng)自帶的工具,用于在桌面彈出提醒彈窗,使用方法:
NAME
notify-send - a program to send desktop notifications

SYNOPSIS
notify-send [OPTIONS] [body]

DESCRIPTION
With notify-send you can sends desktop notifications to the user via a
notification daemon from the command line. These notifications can be
used to inform the user about an event or display some form of informa‐
tion without getting in the user’s way.

OPTIONS
-u, --urgency=LEVEL Specifies the urgency level (low, normal, criti‐
cal).

-t, --expire-time=TIMEThe duration, in milliseconds, for the notification to appear onscreen. (Ubuntu's Notify OSD and GNOME Shell both ignore thisparameter.)-i, --icon=ICON[,ICON...]Specifies an icon filename or stock icon to display.-c, --category=TYPE[,TYPE...]Specifies the notification category.Help options:-?, --helpShow this help message-h, --hint=TYPE:NAME:VALUESpecifies basic extra data to pass. Valid types are int, double,string and byte.SEE ALSOThe Desktop Notification Spec on http://www.galago-project.org/specs/notification/.

$ notify-send “test”

也可以使用-i參數(shù)指定icon:

$ notify-send -i ~/test.jpg “test again”

更多的使用說明查閱:man notify-send

crontab是創(chuàng)建定時計劃的工具,使用命令:crontab -e進入人物編輯狀態(tài),可以在里面添加自己的計劃任務(wù)。

共有6列,用空格分隔,分別是:

1.分鐘,0-59的數(shù)字,可用數(shù)字指定某時刻。例如:“1”表示任務(wù)在1分執(zhí)行;可用“-”加數(shù)字來表示時間段,例如“1-30”表示任務(wù)在時間段1到30分內(nèi)執(zhí)行,默認每分鐘執(zhí)行一次;可用“,”來指定多個時間點執(zhí)行任務(wù),例如“1,5,10"表示在第1分,第5分,第10分分別執(zhí)行任務(wù)

2.小時,0-23的數(shù)字,規(guī)則如上

3.日期,1-31的數(shù)字,規(guī)則如上

4.月份,1-12的數(shù)字,規(guī)則如上

5.星期,0-7的數(shù)字,規(guī)則如上,其中0與7意義相同

6.命令,可以用”;"添加一系列命令

如下所示:

表示每周的周一到周五,每天的20:00時刻執(zhí)行一次提醒任務(wù),提醒內(nèi)容為“test notify”。

其中,"export DISPLAY=:0.0"必須要執(zhí)行,因為notify-send屬于GUI程序,而crontab只能在后臺運行,如果不指定環(huán)境變量的話,是顯示不了提醒彈窗的。

定時提醒只是最簡單的應用,還可以使用其他命令進行各種計劃任務(wù),也可以定時執(zhí)行指定腳本,功能非常強大。

總結(jié)

以上是生活随笔為你收集整理的ubuntu自动提醒的全部內(nèi)容,希望文章能夠幫你解決所遇到的問題。

如果覺得生活随笔網(wǎng)站內(nèi)容還不錯,歡迎將生活随笔推薦給好友。