diff options
| author | Mike Vink <59492084+ivi-vink@users.noreply.github.com> | 2025-01-29 12:41:42 +0000 |
|---|---|---|
| committer | Mike Vink <59492084+ivi-vink@users.noreply.github.com> | 2025-01-29 12:41:42 +0000 |
| commit | 6e96b514dec29b438ac0b17a6bf81f7c179d7073 (patch) | |
| tree | 16c0d3ca780534c218fcadc34d0f5522bd303e6f /mut/bin/xdg-open | |
| parent | 0ab80470397dd38a0fe9f4d89d3a39dc0efa48fb (diff) | |
add mut updates
Diffstat (limited to 'mut/bin/xdg-open')
| -rwxr-xr-x | mut/bin/xdg-open | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/mut/bin/xdg-open b/mut/bin/xdg-open index ca18836..f401d16 100755 --- a/mut/bin/xdg-open +++ b/mut/bin/xdg-open @@ -1,2 +1,5 @@ #!/bin/bash -nu --commands "^echo $1 | nc 127.0.0.1 1994 | echo" +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" ;; +esac |
