Skip to content

Commit

Permalink
Merge pull request #98 from vesper8/patch-1
Browse files Browse the repository at this point in the history
add -contentImage option to TerminalNotifier
  • Loading branch information
pyrech authored Apr 24, 2024
2 parents 18aa721 + 49eed58 commit 3963656
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 3 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
## Not released yet

* Added wsl-notify-send notifier for Windows Subsystem for Linux
* Changed TerminalNotifier to use contentImage option for icon instead of appIcon

## 2.6.0 (2023-12-03)

Expand Down
2 changes: 1 addition & 1 deletion src/Notifier/TerminalNotifierNotifier.php
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ protected function getCommandLineArguments(Notification $notification): array
}

if ($notification->getIcon() && version_compare(OsHelper::getMacOSVersion(), '10.9.0', '>=')) {
$arguments[] = '-appIcon';
$arguments[] = '-contentImage';
$arguments[] = $notification->getIcon();
}

Expand Down
4 changes: 2 additions & 2 deletions tests/Notifier/TerminalNotifierNotifierTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ protected function getExpectedCommandLineForNotificationWithAnIcon(): string
$iconDir = $this->getIconDir();

return <<<CLI
'terminal-notifier' '-message' 'I'\\''m the notification body' '-appIcon' '{$iconDir}/image.gif'
'terminal-notifier' '-message' 'I'\\''m the notification body' '-contentImage' '{$iconDir}/image.gif'
CLI;
}

Expand All @@ -82,7 +82,7 @@ protected function getExpectedCommandLineForNotificationWithAllOptions(): string
$iconDir = $this->getIconDir();

return <<<CLI
'terminal-notifier' '-message' 'I'\\''m the notification body' '-title' 'I'\\''m the notification title' '-appIcon' '{$iconDir}/image.gif' '-open' 'https://google.com'
'terminal-notifier' '-message' 'I'\\''m the notification body' '-title' 'I'\\''m the notification title' '-contentImage' '{$iconDir}/image.gif' '-open' 'https://google.com'
CLI;
}

Expand Down

0 comments on commit 3963656

Please sign in to comment.