From 0d93d9e5720fdf8674670fe0b76a52adb8af6950 Mon Sep 17 00:00:00 2001 From: "Mahlon E. Smith" Date: Tue, 2 Apr 2024 16:50:13 -0700 Subject: [PATCH] Add the timer name to system notifications. (#22) --- lua/pomo/notifiers/system.lua | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/lua/pomo/notifiers/system.lua b/lua/pomo/notifiers/system.lua index d94e47b..72ef0ff 100644 --- a/lua/pomo/notifiers/system.lua +++ b/lua/pomo/notifiers/system.lua @@ -41,8 +41,9 @@ SystemNotifier.done = function(self) ---@diagnostic disable-line: unused-local if util.get_os() == util.OS.Darwin then os.execute( string.format( - [[osascript -e 'display notification "Timer done!" with title "Timer #%d, %s%s" sound name "Ping"']], + [[osascript -e 'display notification "Timer done!" with title "Timer #%d%s%s%s" sound name "Ping"']], self.timer.id, + ( self.timer.name and ' ('..self.timer.name..'), ' or ', ' ), util.format_time(self.timer.time_limit), repetitions_str ) @@ -50,8 +51,9 @@ SystemNotifier.done = function(self) ---@diagnostic disable-line: unused-local elseif util.get_os() == util.OS.Linux then os.execute( string.format( - [[notify-send -u critical -i "appointment-soon" "Timer %d, %s%s" "Timer done!"]], + [[notify-send -u critical -i "appointment-soon" "Timer %d%s%s%s" "Timer done!"]], self.timer.id, + ( self.timer.name and ' ('..self.timer.name..'), ' or ', ' ), util.format_time(self.timer.time_limit), repetitions_str )