Add shell version of powerline-client
Note: this shell script is still faster then client/powerline.py. `time` reports 0.00, 0.01, 0.02÷0.03 for powerline, powerline.sh and powerline.py respectively (run with `./client/powerline* tmux right`). Note: does not work in busybox as env there does not support -0 argument. Requires sed, id (for dash as $UID is not available there), env, printf and socat. Is not currently handled by setup.py.
This commit is contained in:
parent
7db428667c
commit
e613beb8df
|
@ -0,0 +1,13 @@
|
||||||
|
#!/bin/sh
|
||||||
|
|
||||||
|
ADDRESS="powerline-ipc-${UID:-`id -u`}"
|
||||||
|
|
||||||
|
# Warning: env -0 does not work in busybox. Consider switching to parsing
|
||||||
|
# `set` output in this case
|
||||||
|
(
|
||||||
|
for argv in "$@" ; do
|
||||||
|
printf '%s\0' "$argv"
|
||||||
|
done
|
||||||
|
env -0 | sed 's/\(\x00\)\([^\x00]\)\|^/\1--env=\2/g'
|
||||||
|
printf -- '--cwd=%s\0' "$PWD"
|
||||||
|
) | socat -t 10 - abstract-client:"$ADDRESS"
|
Loading…
Reference in New Issue