From 455bf639169a1ae26afc6d6207de0c89e9c94afc Mon Sep 17 00:00:00 2001 From: Alison Watson Date: Sat, 17 Aug 2019 20:34:01 -0400 Subject: [PATCH] add systemd user service for notifying calendar events --- links | 2 ++ scripts/hourly | 20 ++++++++++++++++++++ system/services/marrub.service | 8 ++++++++ system/services/marrub.timer | 10 ++++++++++ 4 files changed, 40 insertions(+) create mode 100755 scripts/hourly create mode 100644 system/services/marrub.service create mode 100644 system/services/marrub.timer diff --git a/links b/links index d303d89..83a5b17 100644 --- a/links +++ b/links @@ -22,6 +22,8 @@ system/fcitx/conf ~/.config/fcitx/conf system/fcitx/config ~/.config/fcitx/config system/fcitx/data ~/.config/fcitx/data system/fcitx/profile ~/.config/fcitx/profile +system/services/marrub.service ~/.config/systemd/user/marrub.service +system/services/marrub.timer ~/.config/systemd/user/marrub.timer themes/ripcord.json ~/.local/share/Ripcord/custom_theme.json vim/vconf ~/.vim/vconf vim/vimrc ~/.vim/vimrc diff --git a/scripts/hourly b/scripts/hourly new file mode 100755 index 0000000..9b97256 --- /dev/null +++ b/scripts/hourly @@ -0,0 +1,20 @@ +#!/usr/bin/env fish +# vim: syntax=fish: + +if not test "$DISPLAY" + exit 0 +end + +vdirsyncer sync + +set content (khal at) + +if test "$content" != "No events" + notify-send \ + -a 'Calendar Reminder' \ + -u critical \ + -i dialog-information \ + "$content" +end + +## EOF diff --git a/system/services/marrub.service b/system/services/marrub.service new file mode 100644 index 0000000..c8a7836 --- /dev/null +++ b/system/services/marrub.service @@ -0,0 +1,8 @@ +[Unit] +Description=Run some crap + +[Service] +ExecStart=/usr/bin/env fish --command='$_agw_dir_scripts/hourly' + +[Install] +WantedBy=basic.target diff --git a/system/services/marrub.timer b/system/services/marrub.timer new file mode 100644 index 0000000..eee1605 --- /dev/null +++ b/system/services/marrub.timer @@ -0,0 +1,10 @@ +[Unit] +Description=Run some crap every hour + +[Timer] +OnBootSec=1h +OnUnitActiveSec=1h +Unit=marrub.service + +[Install] +WantedBy=timers.target