mirror of
https://github.com/theniceboy/.config.git
synced 2026-07-16 22:01:21 +08:00
tmux watch notif
This commit is contained in:
parent
c56de89d3d
commit
8298371b35
3 changed files with 25 additions and 1 deletions
|
|
@ -67,7 +67,7 @@ func runTrackerCommand(args []string) error {
|
|||
}
|
||||
command := strings.TrimSpace(rest[0])
|
||||
switch command {
|
||||
case "start_task", "finish_task", "update_task", "acknowledge", "delete_task":
|
||||
case "start_task", "finish_task", "update_task", "acknowledge", "delete_task", "notify":
|
||||
ctx, err := resolveTrackerContext(env.Session, env.SessionID, env.Window, env.WindowID, env.Pane)
|
||||
if err != nil {
|
||||
return err
|
||||
|
|
|
|||
|
|
@ -204,6 +204,21 @@ func (s *server) handleCommand(env ipc.Envelope) error {
|
|||
s.broadcastStateAsync()
|
||||
s.statusRefreshAsync()
|
||||
return nil
|
||||
case "notify":
|
||||
target, err := requireSessionWindow(env)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
message := firstNonEmpty(env.Summary, env.Message)
|
||||
if message == "" {
|
||||
return fmt.Errorf("notify requires summary")
|
||||
}
|
||||
if s.notificationsAreEnabled() {
|
||||
if err := sendSystemNotification(notificationTitleForTarget(target), message, notificationActionForTarget(target)); err != nil {
|
||||
return err
|
||||
}
|
||||
}
|
||||
return nil
|
||||
case "update_task":
|
||||
target, err := requireSessionWindow(env)
|
||||
if err != nil {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue