summaryrefslogtreecommitdiff
path: root/.local
diff options
context:
space:
mode:
authorMike Vink <ivi@vinkies.net>2025-03-03 08:57:45 +0000
committerMike Vink <ivi@vinkies.net>2025-03-03 08:57:45 +0000
commit0f64245b60dc5180d01dd8da18796c2b6ff25bd3 (patch)
tree173481c63df442cf0cc84b8b2fa741a3551a14e8 /.local
parent8358636c1912f1ccc48c8e506b39cc5704fbd9ca (diff)
open images from jrnl
Diffstat (limited to '.local')
-rwxr-xr-x.local/bin/desktop-open-pipe2
-rwxr-xr-x.local/bin/open-image2
-rwxr-xr-x.local/bin/xdg-open4
3 files changed, 5 insertions, 3 deletions
diff --git a/.local/bin/desktop-open-pipe b/.local/bin/desktop-open-pipe
index 338929d..4989780 100755
--- a/.local/bin/desktop-open-pipe
+++ b/.local/bin/desktop-open-pipe
@@ -3,5 +3,5 @@ echo listening for open commands
loop {
let line = nc -l 127.0.0.1 1994
echo $line | save --append /tmp/debuglogs
- try { ^open $line }
+ try { bash -c $"open ($line)" }
}
diff --git a/.local/bin/open-image b/.local/bin/open-image
new file mode 100755
index 0000000..9f57f41
--- /dev/null
+++ b/.local/bin/open-image
@@ -0,0 +1,2 @@
+#!/bin/sh
+grep -o 'image://.*$' | sed s,image://,, | xargs xdg-open
diff --git a/.local/bin/xdg-open b/.local/bin/xdg-open
index f401d16..4cd0a92 100755
--- a/.local/bin/xdg-open
+++ b/.local/bin/xdg-open
@@ -1,5 +1,5 @@
#!/bin/bash
case "$(file --mime-type $1 | awk '{print $2}')" in
- text/*|application/json) exec "$EDITOR" $1 ;;
- *) nu --commands "^echo $1 | nc 127.0.0.1 1994 | echo" ;;
+ text/*|application/json) exec "$EDITOR" "$@" ;;
+ *) printf '%q ' "$@" | nc 127.0.0.1 1994 ;;
esac