diff options
Diffstat (limited to 'qmenu/qmenu_vm/f_notes')
-rw-r--r-- | qmenu/qmenu_vm/f_notes | 23 |
1 files changed, 23 insertions, 0 deletions
diff --git a/qmenu/qmenu_vm/f_notes b/qmenu/qmenu_vm/f_notes new file mode 100644 index 0000000..ef93abd --- /dev/null +++ b/qmenu/qmenu_vm/f_notes @@ -0,0 +1,23 @@ +if [ "$(qvm-prefs "$qube" klass)" = DispVM ]; then + + notes=/tmp/."$qube".dispnotes +else + mkdir -p "$HOME"/.local/share/qubes-notes + notes="$HOME/.local/share/qubes-notes/$qube" +fi + +touch "$notes" + +note=$(dmenu-unlinked -l 25 -p "$qube:" < "$notes") + +while [ -n "$note" ]; do + + if grep -q "^$note\$" "$notes"; then + + sed -i "/^$note$/d" "$notes" + else + echo "$(date +%Y-%m-%d\ %H:%M) $note" >> "$notes" + fi + + note=$(dmenu-unlinked -l 25 -p "$qube:" < "$notes") +done |