summaryrefslogtreecommitdiffstats
path: root/public/.local/bin
diff options
context:
space:
mode:
Diffstat (limited to 'public/.local/bin')
-rwxr-xr-xpublic/.local/bin/dmenu-snippet.sh17
1 files changed, 17 insertions, 0 deletions
diff --git a/public/.local/bin/dmenu-snippet.sh b/public/.local/bin/dmenu-snippet.sh
new file mode 100755
index 0000000..46f21de
--- /dev/null
+++ b/public/.local/bin/dmenu-snippet.sh
@@ -0,0 +1,17 @@
+#!/bin/bash
+# Simple dmenu-based snippet tool that copies selected snippet to clipboard
+
+SNIPPETS_DIR="$HOME/.local/share/dmenu/snippet"
+[ ! -d "$SNIPPETS_DIR" ] && mkdir -p "$SNIPPETS_DIR"
+
+# Select snippet file using dmenu
+SNIPPET=$(ls "$SNIPPETS_DIR" | dmenu -i -l 10 -p "Select snippet:")
+
+# Exit if no snippet selected
+[ -z "$SNIPPET" ] && exit 1
+
+# Copy snippet content to clipboard
+cat "$SNIPPETS_DIR/$SNIPPET" | xclip -selection clipboard
+
+# Notify user
+notify-send "Snippet copied" "$SNIPPET copied to clipboard"