summaryrefslogtreecommitdiffstats
path: root/.scripts/i3cmds/showclip
blob: 7b3aeeeff6fecdaf6b7ffbc3267bd8f8705570e6 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
#!/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"