summaryrefslogtreecommitdiff
path: root/bin/guiscripts
diff options
context:
space:
mode:
authorRaymaekers Luca <raymaekers.luca@gmail.com>2023-11-06 09:29:30 +0100
committerRaymaekers Luca <raymaekers.luca@gmail.com>2023-11-06 09:29:30 +0100
commit61d5bb429488794ac178a47fa73c38322aa14c04 (patch)
tree6cd7d3510f999701b5e2f7fe10b0f790cd868243 /bin/guiscripts
parentaf9608a3a98f0ab4217da80b8d478810505801bc (diff)
parent694813e05187b5ccf144425c4bad6f5ab4f92234 (diff)
Merge branch 'main' of db:dotfiles
Diffstat (limited to 'bin/guiscripts')
-rwxr-xr-xbin/guiscripts/clipo8
-rwxr-xr-xbin/guiscripts/clipp8
-rwxr-xr-xbin/guiscripts/clipswap4
-rwxr-xr-xbin/guiscripts/cliptype2
4 files changed, 16 insertions, 6 deletions
diff --git a/bin/guiscripts/clipo b/bin/guiscripts/clipo
index e3ae714..39994f9 100755
--- a/bin/guiscripts/clipo
+++ b/bin/guiscripts/clipo
@@ -1,4 +1,6 @@
#!/bin/sh
-[ "$WAYLAND_DISPLAY" ] &&
- wl-paste -n ||
- xclip -o -selection clipboard -r
+[ "$1" = "-p" ] && arg='primary'
+if [ "$WAYLAND_DISPLAY" ]
+then wl-paste -n ${1}
+else xclip -o -selection "${arg:-clipboard}" -r
+fi
diff --git a/bin/guiscripts/clipp b/bin/guiscripts/clipp
index 538f69b..c9e4f51 100755
--- a/bin/guiscripts/clipp
+++ b/bin/guiscripts/clipp
@@ -1,4 +1,6 @@
#!/bin/sh
-[ "$WAYLAND_DISPLAY" ] &&
- wl-copy -n ||
- xclip -selection clipboard -r
+[ "$1" = "-p" ] && arg='primary'
+if [ "$WAYLAND_DISPLAY" ]
+then wl-copy -n $1
+else xclip -selection "${arg:-clipboard}" -r
+fi
diff --git a/bin/guiscripts/clipswap b/bin/guiscripts/clipswap
new file mode 100755
index 0000000..1cae135
--- /dev/null
+++ b/bin/guiscripts/clipswap
@@ -0,0 +1,4 @@
+#!/bin/sh
+paste="$(clipo)"
+clipo -p | clipp
+printf '%s' "$paste" | clipp -p
diff --git a/bin/guiscripts/cliptype b/bin/guiscripts/cliptype
new file mode 100755
index 0000000..e6ac093
--- /dev/null
+++ b/bin/guiscripts/cliptype
@@ -0,0 +1,2 @@
+#!/bin/sh
+clipo | ydotool type -f -