From a2f2b28f086c455f85e3ec31c1fdde54b363744c Mon Sep 17 00:00:00 2001 From: Mitsuo Tokumori Date: Wed, 25 Jun 2025 03:21:50 +0900 Subject: Add dmenu-snippet.sh --- public/.local/bin/dmenu-snippet.sh | 17 +++++++++++++++++ public/.local/share/dmenu/snippet/references.wiki | 3 +++ public/.local/share/dmenu/snippet/syntaxhighlight.wiki | 7 +++++++ public/.xbindkeysrc | 8 ++++---- 4 files changed, 31 insertions(+), 4 deletions(-) create mode 100755 public/.local/bin/dmenu-snippet.sh create mode 100644 public/.local/share/dmenu/snippet/references.wiki create mode 100644 public/.local/share/dmenu/snippet/syntaxhighlight.wiki (limited to 'public') 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" diff --git a/public/.local/share/dmenu/snippet/references.wiki b/public/.local/share/dmenu/snippet/references.wiki new file mode 100644 index 0000000..518f731 --- /dev/null +++ b/public/.local/share/dmenu/snippet/references.wiki @@ -0,0 +1,3 @@ +== References == + + diff --git a/public/.local/share/dmenu/snippet/syntaxhighlight.wiki b/public/.local/share/dmenu/snippet/syntaxhighlight.wiki new file mode 100644 index 0000000..eef2530 --- /dev/null +++ b/public/.local/share/dmenu/snippet/syntaxhighlight.wiki @@ -0,0 +1,7 @@ + +#include +int main(int argc, char *argv[]) { + printf("Hello world!\n"); + return 0; +} + diff --git a/public/.xbindkeysrc b/public/.xbindkeysrc index e42ed03..b13bb79 100644 --- a/public/.xbindkeysrc +++ b/public/.xbindkeysrc @@ -147,9 +147,12 @@ "dmenu-webshortcuts.sh" Alt + w -"dmenu-emojicopy.sh" +"dmenu-emoji.sh" Alt + e +"dmenu-snippet.sh" + Alt + s + "screenshot.sh" Print @@ -198,9 +201,6 @@ "zeal" Mod4 + h -"dmenu-emoji.sh" - Mod4 + i - # Media control # ------------- -- cgit v1.2.3