summaryrefslogtreecommitdiff
path: root/bin/guiscripts
diff options
context:
space:
mode:
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 -