added (go)jq and updated!
This commit is contained in:
parent
c6943e7487
commit
99513bc0a0
17
README.md
17
README.md
|
@ -1,23 +1,26 @@
|
|||
# herbed-tiramisu
|
||||
tiramisu wrapper(?) for herbe (desktop notification tools)
|
||||
tiramisu working with herbe in a script <br/>
|
||||
needs tiramisu, herbe and jq or gojq
|
||||
|
||||
## for installing
|
||||
```
|
||||
make #default install
|
||||
```
|
||||
|
||||
## for uninstallimg
|
||||
## for uninstalling
|
||||
```
|
||||
make uninstall
|
||||
```
|
||||
|
||||
## make parameters
|
||||
PREFIX = string : prefix to install (default "/usr/local") <br/>
|
||||
asroot = string : program that runs as root (default sudo, doas works)
|
||||
PREFIX = string : prefix to install (default "/usr/local"). <br/>
|
||||
asroot = string : program that runs as root (default sudo, doas works).
|
||||
|
||||
## thanks for
|
||||
[Sweets](https://github.com/Sweets) for [tiramisu](https://github.com/Sweets/tiramisu) <br/>
|
||||
[dudik](https://github.com/dudik) for [herbe](https://github.com/dudik/herbe)
|
||||
[Sweets](https://github.com/Sweets) for [tiramisu](https://github.com/Sweets/tiramisu). <br/>
|
||||
[dudik](https://github.com/dudik) for [herbe](https://github.com/dudik/herbe).
|
||||
|
||||
## notes
|
||||
I first tried this in wayland with xwayland, I think It's work well in xwayland.
|
||||
I first tried this in wayland with xwayland, I think It's work well in xwayland. <br/>
|
||||
I recommend [that](http://git.vern.cc/mertoalex/herbe-title-patched) fork/patch/whatever. <br/>
|
||||
[herbed-tiramisu.old](./herbed-tiramisu.old) script was first try of that script.
|
||||
|
|
|
@ -0,0 +1,11 @@
|
|||
#!/usr/bin/env bash
|
||||
|
||||
#thanks to anufrievroman for style (https://github.com/anufrievroman/polytiramisu/blob/9c0a039d8cd8b7066bccbbd237cd8939da66e1fb/polytiramisu.sh#L18)
|
||||
tiramisu -o "export timeout='#timeout' app='#source' message='#summary'" |
|
||||
|
||||
while read -r tiramisu
|
||||
do $tiramisu
|
||||
#grep "-" &>/dev/null <<< $timeout && export timeout=1
|
||||
#herbe &> /dev/null || :
|
||||
#timeout -s9 ${timeout}s herbe "App: $app" "" "Message: $message"
|
||||
done
|
|
@ -1,9 +1,19 @@
|
|||
#!/usr/bin/env bash
|
||||
[ -z $JQ ] && \
|
||||
{ command -v gojq &> /dev/null && JQ=gojq;} || \
|
||||
{ command -v jq &> /dev/null && JQ=jq;} || \
|
||||
{ echo "No jq found."; exit 1;}
|
||||
|
||||
|
||||
#thanks to anufrievroman for style (https://github.com/anufrievroman/polytiramisu/blob/9c0a039d8cd8b7066bccbbd237cd8939da66e1fb/polytiramisu.sh#L18)
|
||||
tiramisu -o "export timeout=#timeout app=#source message=#summary" |
|
||||
tiramisu -j |
|
||||
|
||||
while read -r tiramisu
|
||||
do $tiramisu
|
||||
timeout -s9 ${timeout}s herbe "App: $app" "" "Message: $message"
|
||||
while read -r jsonData
|
||||
do timeout="$($JQ -r '.timeout' <<< $jsonData)"
|
||||
source="$($JQ -r '.source' <<< $jsonData)"
|
||||
summary="$($JQ -r '.summary' <<< $jsonData)"
|
||||
body="$($JQ -r '.body' <<< $jsonData)"
|
||||
grep "-" &>/dev/null <<< $timeout && export timeout=1
|
||||
herbe &> /dev/null || :
|
||||
timeout -s9 ${timeout}s herbe "$source" "$summary" $'\n' "$body"
|
||||
done
|
||||
|
|
Loading…
Reference in New Issue