blob: 636c97ce6be310b6ddf0a749be69d01eed5dbebf (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
|
#!/bin/bash
echo "<openbox_pipe_menu>"
echo "<item label=\"New\">"
echo "<action name=\"Execute\"><execute>x-terminal-emulator -e todoman new $id</execute></action>"
echo "</item>"
echo "<separator />"
tasks=$(todoman --porcelain | jq ".[]" -c)
while read -r task; do
summary=$(echo $task | jq ".summary" -r)
description=$(echo $task | jq ".description" -r)
id=$(echo $task | jq ".id" -r)
echo "<menu id=\"$summary\" label=\"$summary\">"
echo "<item label=\"$description\" />"
echo "<separator />"
echo "<item label=\"Edit\">"
echo "<action name=\"Execute\"><execute>x-terminal-emulator -e todoman edit $id</execute></action>"
echo "</item>"
echo "<item label=\"Complete\">"
echo "<action name=\"Execute\"><execute>todoman done $id</execute></action>"
echo "</item>"
echo "</menu>"
done <<< $tasks
echo "</openbox_pipe_menu>"
|