@@ -2,6 +2,8 @@ local Date = require('orgmode.objects.date')
2
2
local config = require (' orgmode.config' )
3
3
local utils = require (' orgmode.utils' )
4
4
local NotificationPopup = require (' orgmode.notifications.notification_popup' )
5
+ local current_file_path = string.sub (debug.getinfo (1 , ' S' ).source , 2 )
6
+ local root_path = vim .fn .fnamemodify (current_file_path , ' :p:h:h:h:h' )
5
7
6
8
--- @class OrgNotifications
7
9
--- @field timer table
@@ -79,11 +81,17 @@ function Notifications:_cron_notifier(tasks)
79
81
local date = string.format (' %s: %s' , task .type , task .time :to_string ())
80
82
81
83
if vim .fn .executable (' notify-send' ) == 1 then
82
- vim .loop .spawn (' notify-send' , { args = { string.format (' %s\n %s\n %s' , title , subtitle , date ) } })
84
+ vim .system ({
85
+ ' notify-send' ,
86
+ (' --icon=%s/assets/nvim-orgmode-small.png' ):format (root_path ),
87
+ ' --app-name=orgmode' ,
88
+ title ,
89
+ string.format (' %s\n %s' , subtitle , date ),
90
+ })
83
91
end
84
92
85
93
if vim .fn .executable (' terminal-notifier' ) == 1 then
86
- vim .loop . spawn ( ' terminal-notifier' , { args = { ' -title' , title , ' -subtitle' , subtitle , ' -message' , date } })
94
+ vim .system ({ ' terminal-notifier' , ' -title' , title , ' -subtitle' , subtitle , ' -message' , date })
87
95
end
88
96
end
89
97
end
0 commit comments