diff options
| author | Alex Leferry 2 <alexherbo2@gmail.com> | 2020-08-13 18:21:25 +0200 |
|---|---|---|
| committer | Alex Leferry 2 <alexherbo2@gmail.com> | 2020-08-13 21:33:41 +0200 |
| commit | 7fe2efc9bed557373e9c9cfe860d8e684dfd56bc (patch) | |
| tree | 90e2a1c628b6ccc05c04415011255200c312f746 /bin/kak-desktop | |
| parent | defb50fc0ace0195d12e804993b1b74343024ada (diff) | |
Overhaul
Diffstat (limited to 'bin/kak-desktop')
| -rwxr-xr-x | bin/kak-desktop | 21 |
1 files changed, 13 insertions, 8 deletions
diff --git a/bin/kak-desktop b/bin/kak-desktop index 5e03ab7..f9c1aa3 100755 --- a/bin/kak-desktop +++ b/bin/kak-desktop @@ -1,24 +1,29 @@ #!/bin/sh main() { - # Send the edit command to the client. - if test -n "$IN_KAKOUNE_CONNECT"; then - edit "$@" - # Terminal. + # Send the edit command to the client + if [ "$IN_KAKOUNE_CONNECT" ]; then + :edit "$@" + + # Terminal elif test -t 0 -a -t 1; then kak "$@" - # GUI apps. + + # GUI apps else - launch "$@" + open "$@" fi } -launch() { +open() { + # Skip options + [ "$1" = '--' ] && shift + file=$1 line=$2 column=$3 kak -ui dummy -e " new %{ hook -always -once global ClientClose %val{client} kill! - edit %{$file} $line $column + edit %{$file} %{$line} %{$column} } " } |
