1
1
Fork 0
nixos/options/custom/scripts/clipboard.sh

15 lines
395 B
Bash
Raw Normal View History

#! /usr/bin/env bash
# Toggle clipboard menu
# Kill menu if running
if ! pkill wofi; then
# Prompt clipboard for selection
selection="$(cliphist list | wofi --dmenu)"
# Decode and copy to clipboard
cliphist decode <<< "$selection" | tee >(xclip -rmlastnl -selection clipboard &> /dev/null) >(wl-copy --trim-newline &> /dev/null)
notify-send '> clipboard' 'Copied' --urgency low
fi