diff --git a/.config/sway/config b/.config/sway/config index 2042598..aac7550 100644 --- a/.config/sway/config +++ b/.config/sway/config @@ -165,13 +165,16 @@ bindsym $mod+Mod1+g exec grimshot save output bindsym $mod+Ctrl+g exec grimshot save window # Turn the system off -bindsym $mod+Shift+e exec wlogout -p layer-shell +#bindsym $mod+Shift+e exec wlogout -p layer-shell # Bookmarks bindsym $mod+Insert exec wtype $(grep -v '^#' ~/.local/share/bookmarks/bookmarks | bemenu -p Bookmark: -l 50 -c -M 500 --fn 'Terminus 16' --tf '#ff4e00' --ff '#dbc077' --hf '#ff4e00' | cut -d ' ' -f1) bindsym $mod+Shift+Insert exec ~/.local/bin/bookmark_insert +# Emojis +bindsym $mod+Shift+e exec wtype $(awk '{print $1, $0}' ~/.local/share/chars/emojis* | bemenu -p Emoji: -l 25 -c -M 500 --fn 'Noto Color Emoji,Terminus 16' --tf '#ff4e00' --ff '#dbc077' --hf '#ff4e00' | awk '{print $1}') + ####################### # EXECS diff --git a/.local/bin/emoji_insert b/.local/bin/emoji_insert new file mode 100644 index 0000000..a68dbd4 --- /dev/null +++ b/.local/bin/emoji_insert @@ -0,0 +1,18 @@ +#!/bin/sh + +# Check dependencies +for cmd in bemenu wl-copy notify-send; do + command -v $cmd >/dev/null 2>&1 || { echo "$cmd is required but not installed. Aborting."; exit 1; } +done + +# Get user selection via bemenu from emoji file. +chosen=$(awk '{print $1, $0}' ~/.local/share/chars/emojis* | bemenu -i -l 30 | awk '{print $1}') + +# Exit if none chosen. +[ -z "$chosen" ] && exit + +# Copy selected emoji to clipboard. +echo -n "$chosen" | wl-copy + +# Send notification that the emoji has been copied. +notify-send "'$chosen' copied to clipboard."