voidrice/.scripts/i3cmds/showclip

16 lines
350 B
Text
Raw Normal View History

2018-11-19 01:31:24 +00:00
#!/bin/sh
# Display contents of selection via dunst if running.
# Separate script for i3.
! pgrep -x dunst >/dev/null && echo "dunst not running." && exit
clip=$(xclip -o -selection clipboard)
prim=$(xclip -o -selection primary)
[ "$prim" != "" ] && notify-send "<b>Clipboard:</b>
$prim"
[ "$clip" != "" ] && notify-send "<b>Primary:</b>
$clip"