mirror of
https://github.com/theniceboy/.config.git
synced 2026-05-11 17:36:05 +08:00
tmux watch notif
This commit is contained in:
parent
c56de89d3d
commit
8298371b35
3 changed files with 25 additions and 1 deletions
|
|
@ -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