aboutsummaryrefslogtreecommitdiff
path: root/archive/rofi-notmuch
diff options
context:
space:
mode:
authorLukasz Kasprzak <lukas@labunix.xyz>2026-05-10 22:57:02 +0200
committerLukasz Kasprzak <lukas@labunix.xyz>2026-05-10 22:57:02 +0200
commit3cd9138c9d8fb9be248c75330cca9da47f4d2e8a (patch)
treeb3b677a9c1a474589f45d20953028a987fa73b80 /archive/rofi-notmuch
parent83f7fe4b8402bab171d110703a1b1115efbc9b28 (diff)
downloadbin-3cd9138c9d8fb9be248c75330cca9da47f4d2e8a.tar.gz
bin-3cd9138c9d8fb9be248c75330cca9da47f4d2e8a.zip
added a whole bunch of scripts
Diffstat (limited to 'archive/rofi-notmuch')
-rw-r--r--archive/rofi-notmuch26
1 files changed, 26 insertions, 0 deletions
diff --git a/archive/rofi-notmuch b/archive/rofi-notmuch
new file mode 100644
index 0000000..8fa5097
--- /dev/null
+++ b/archive/rofi-notmuch
@@ -0,0 +1,26 @@
+#!/bin/sh
+set -eu
+
+DB="$HOME/.local/share/cheat-sheets/notmuch.tsv"
+
+[ -f "$DB" ] || exit 1
+
+choice="$(
+ cat "$DB" |
+ rofi -dmenu -i -p 'Notmuch ›'
+)"
+
+[ -n "${choice:-}" ] || exit 0
+
+# First column = keystrokes
+keys="$(printf '%s' "$choice" | cut -f1)"
+
+# Clipboard (Wayland/X11)
+if command -v wl-copy >/dev/null 2>&1; then
+ printf '%s' "$keys" | wl-copy
+elif command -v xclip >/dev/null 2>&1; then
+ printf '%s' "$keys" | xclip -selection clipboard
+else
+ printf '%s\n' "$keys"
+fi
+