summaryrefslogtreecommitdiff
path: root/bin/guiscripts
diff options
context:
space:
mode:
Diffstat (limited to 'bin/guiscripts')
-rwxr-xr-xbin/guiscripts/clipo6
-rwxr-xr-xbin/guiscripts/clipp6
-rwxr-xr-xbin/guiscripts/clipswap4
-rwxr-xr-xbin/guiscripts/cliptype2
-rwxr-xr-xbin/guiscripts/dmfm3
5 files changed, 20 insertions, 1 deletions
diff --git a/bin/guiscripts/clipo b/bin/guiscripts/clipo
new file mode 100755
index 0000000..39994f9
--- /dev/null
+++ b/bin/guiscripts/clipo
@@ -0,0 +1,6 @@
+#!/bin/sh
+[ "$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
new file mode 100755
index 0000000..c9e4f51
--- /dev/null
+++ b/bin/guiscripts/clipp
@@ -0,0 +1,6 @@
+#!/bin/sh
+[ "$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 -
diff --git a/bin/guiscripts/dmfm b/bin/guiscripts/dmfm
index d1dd8b8..9485469 100755
--- a/bin/guiscripts/dmfm
+++ b/bin/guiscripts/dmfm
@@ -2,9 +2,10 @@
while true
do
+ dir="$(printf '%s' "$PWD" | sed "s#^$HOME#\~#;s#\([^/]\)[^/]*/#\1/#g")"
file=$(find . -maxdepth 1 -mindepth 1 -not -name '.*' -printf '%y\t%f\n' |
sort -k 1 -k 2 | cut -f 2- |
- commander -xcd -p "$PWD>")
+ commander -xc -p "$dir")
[ "$file" ] || break
[ ! -e "$file" ] && continue