summaryrefslogtreecommitdiff
path: root/qmenu/qmenu_vm/f_notes
blob: ef93abdfe2e52120320991abf75ed0d586d6c3a8 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
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