Continued work on Windows CLI
This commit is contained in:
parent
7d473488de
commit
613348d37e
9 changed files with 135 additions and 71 deletions
|
@ -38,7 +38,7 @@ Here's an example showing how to publish a simple message using a POST request:
|
|||
|
||||
=== "PowerShell"
|
||||
``` powershell
|
||||
Invoke-RestMethod -Method 'Post' -Uri https://ntfy.sh/topic -Body "Backup successful 😀" -UseBasicParsing
|
||||
Invoke-RestMethod -Method 'Post' -Uri https://ntfy.sh/mytopic -Body "Backup successful" -UseBasicParsing
|
||||
```
|
||||
|
||||
=== "Python"
|
||||
|
|
|
@ -145,12 +145,27 @@ Here's an example config file that subscribes to three different topics, executi
|
|||
fi
|
||||
```
|
||||
|
||||
=== "%AppData%\ntfy\client.yml"
|
||||
```
|
||||
subscribe:
|
||||
- topic: echo-this
|
||||
command: 'echo Message received: %message%'
|
||||
- topic: calc
|
||||
command: calc
|
||||
if:
|
||||
priority: high,urgent
|
||||
- topic: toastthis
|
||||
command: |
|
||||
notifu /p "a title: %NTFY_TITLE%" /m "%NTFY_MESSAGE%"
|
||||
exit 0
|
||||
```
|
||||
|
||||
In this example, when `ntfy subscribe --from-config` is executed:
|
||||
|
||||
* Messages to `echo-this` simply echos to standard out
|
||||
* Messages to `alerts` display as desktop notification for high priority messages using [notify-send](https://manpages.ubuntu.com/manpages/focal/man1/notify-send.1.html)
|
||||
* Messages to `calc` open the gnome calculator 😀 (*because, why not*)
|
||||
* Messages to `print-temp` execute an inline script and print the CPU temperature
|
||||
* Messages to `print-temp` execute an inline script and print the CPU temperature (Linux version only)
|
||||
|
||||
I hope this shows how powerful this command is. Here's a short video that demonstrates the above example:
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue