summaryrefslogtreecommitdiff
path: root/bin/kak-desktop
diff options
context:
space:
mode:
authorAlex Leferry 2 <alexherbo2@gmail.com>2020-08-13 18:21:25 +0200
committerAlex Leferry 2 <alexherbo2@gmail.com>2020-08-13 21:33:41 +0200
commit7fe2efc9bed557373e9c9cfe860d8e684dfd56bc (patch)
tree90e2a1c628b6ccc05c04415011255200c312f746 /bin/kak-desktop
parentdefb50fc0ace0195d12e804993b1b74343024ada (diff)
Overhaul
Diffstat (limited to 'bin/kak-desktop')
-rwxr-xr-xbin/kak-desktop21
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}
}
"
}