summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMitsuo Tokumori <[email protected]>2025-06-25 03:21:50 +0900
committerMitsuo Tokumori <[email protected]>2025-06-25 03:21:50 +0900
commita2f2b28f086c455f85e3ec31c1fdde54b363744c (patch)
treeb227975dc57d7ec44d4e58337a833641a73e83a3
parent0ef90b80e441afdc8dada2b7c2f28fef415bf37e (diff)
downloaddotfiles-a2f2b28f086c455f85e3ec31c1fdde54b363744c.tar.gz
dotfiles-a2f2b28f086c455f85e3ec31c1fdde54b363744c.tar.bz2
dotfiles-a2f2b28f086c455f85e3ec31c1fdde54b363744c.zip
Add dmenu-snippet.sh
-rw-r--r--linking_example.sh2
-rwxr-xr-xpublic/.local/bin/dmenu-snippet.sh17
-rw-r--r--public/.local/share/dmenu/snippet/references.wiki3
-rw-r--r--public/.local/share/dmenu/snippet/syntaxhighlight.wiki7
-rw-r--r--public/.xbindkeysrc8
5 files changed, 32 insertions, 5 deletions
diff --git a/linking_example.sh b/linking_example.sh
index 2a1bc84..2c607c5 100644
--- a/linking_example.sh
+++ b/linking_example.sh
@@ -37,7 +37,7 @@ ln -sf $dotfiles/public/.config/zathura
mkdir -p $dest/.local/share
cd $dest/.local/share
-ln -s $target/../public/.local/share/dmenu
+ln -s $dotfiles/public/.local/share/dmenu
mkdir -p $dest/code/dwm
cd $dest/code/dwm
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 ==
+
+<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 @@
+<syntaxhighlight lang="c">
+#include <stdio.h>
+int main(int argc, char *argv[]) {
+ printf("Hello world!\n");
+ return 0;
+}
+</syntaxhighlight>
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
# -------------