kitty:daemon: Use TMPDIR and support multi-user
This commit is contained in:
@@ -5,9 +5,11 @@
|
||||
# Print the current working directory of the focused kitty window. Returns 4 if
|
||||
# none exist or is focused.
|
||||
|
||||
socket_path="${TMPDIR:-/tmp}/kitty.$USER/kitty.sock"
|
||||
|
||||
# NOTE: the backticks are used for hacky line-continuation, taken from
|
||||
# https://stackoverflow.com/a/7729087/2092762c9
|
||||
kitten @ --to unix:/tmp/mykitty ls \
|
||||
kitten @ --to unix:"$socket_path" ls \
|
||||
| jq -er ".[]`
|
||||
` | select(.is_focused).tabs.[]`
|
||||
` | select(.is_focused).windows.[]`
|
||||
|
||||
Reference in New Issue
Block a user