aboutsummaryrefslogtreecommitdiffstats
path: root/rofi-notes.sh
diff options
context:
space:
mode:
authorDanilo M. <danix@danix.xyz>2026-09-27 19:01:48 +0200
committerDanilo M. <danix@danix.xyz>2026-09-27 19:01:48 +0200
commitfb0ce82b670d211278f428b935a376c9bc5e57da (patch)
tree8bfd09c9e3c842af6e83c98b42e3fdbd904f1e42 /rofi-notes.sh
parentfb79a12769d26c7608393f4a3beb5e39de3cc704 (diff)
downloadbash-notes-master.tar.gz
bash-notes-master.zip
Add rofi-notes.sh, the rofi front end for notesHEADmaster
Moved into the repo from a standalone script in ~/bin. It now exits quietly when the rofi menu is dismissed instead of launching a terminal with no note ID (which flashed a window open and shut), calls notes from PATH, and fixes the swapped kitty arguments on the add-note path. Document the symlink install in AGENTS.md and README. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Diffstat (limited to 'rofi-notes.sh')
-rwxr-xr-xrofi-notes.sh43
1 files changed, 43 insertions, 0 deletions
diff --git a/rofi-notes.sh b/rofi-notes.sh
new file mode 100755
index 0000000..82f2e91
--- /dev/null
+++ b/rofi-notes.sh
@@ -0,0 +1,43 @@
+#! /bin/bash
+
+# bash-notes © 2023 by danix is licensed under CC BY-NC 4.0.
+# To view a copy of this license, visit http://creativecommons.org/licenses/by-nc/4.0/
+
+# rofi front end for notes.sh. Bind it to hotkeys in your window manager:
+# rofi-notes.sh show note
+# rofi-notes.sh -a add note
+# rofi-notes.sh -e edit note
+# rofi-notes.sh -d delete note
+
+rofi_command="rofi -theme ~/.config/rofi/udt/menu.rasi"
+notes_command=notes
+
+# list of existing notes passed to rofi
+options=$($notes_command -pl)
+
+# how to run the script
+PARAM="$1"
+case $PARAM in
+ -a )
+ # add note
+ kitty --session=none --class notes -T notes $notes_command -a
+ ;;
+ -e )
+ # edit note_ID
+ selected=$(echo -e "$options" | $rofi_command -p "edit note" -dmenu -selected-row 0 | cut -d " " -f1)
+ [ -n "$selected" ] || exit 0
+ kitty --session=none --class notes -T notes $notes_command -e ${selected}
+ ;;
+ -d )
+ # delete note_ID
+ selected=$(echo -e "$options" | $rofi_command -p "delete note" -dmenu -selected-row 0 | cut -d " " -f1)
+ [ -n "$selected" ] || exit 0
+ kitty --session=none --class notes -T notes $notes_command -d ${selected}
+ ;;
+ * )
+ # list notes
+ selected=$(echo -e "$options" | $rofi_command -p "notes" -dmenu -selected-row 0 | cut -d " " -f1)
+ [ -n "$selected" ] || exit 0
+ kitty --session=none --class notes -T notes $notes_command -s $selected
+ ;;
+esac