scripts - scripts - some useful shell scripts

git clone git://git.bcharge.de/scripts.git

About | Log | Files | Refs

commit 64a5259593a4f4f084dd73149e051f20c8889f2c
parent f96cc5f2500b102b3f9bb09f23a52daa45479a0e
Author: Bakar Chargeishvili <bakar@bcharge.de>
Date:   Tue, 24 Jun 2025 16:15:30 +0200

Select unicode chars using dmenu

Diffstat:
Admenuunicode | 18++++++++++++++++++
1 file changed, 18 insertions(+), 0 deletions(-)

diff --git a/dmenuunicode b/dmenuunicode @@ -0,0 +1,18 @@ +#!/bin/sh + +# The famous "get a menu of emojis to copy" script. + +# Get user selection via dmenu from emoji file. +chosen=$(cut -d ';' -f1 ~/.local/share/chars/* | dmenu -i -l 30 | sed "s/ .*//") + +# Exit if none chosen. +[ -z "$chosen" ] && exit + +# If you run this command with an argument, it will automatically insert the +# character. Otherwise, show a message that the emoji has been copied. +if [ -n "$1" ]; then + xdotool type "$chosen" +else + printf "%s" "$chosen" | xclip -selection clipboard + notify-send "'$chosen' copied to clipboard." & +fi