lib: add import-env
This commit is contained in:
parent
6345cbdb09
commit
3eb81b9445
|
@ -64,3 +64,10 @@ pip-venv-deps() {
|
||||||
exit 1
|
exit 1
|
||||||
fi
|
fi
|
||||||
}
|
}
|
||||||
|
|
||||||
|
import-env() {
|
||||||
|
SOURCE_PROCESS=$1
|
||||||
|
SOURCE_PID=$(pgrep $SOURCE_PROCESS | head -n 1)
|
||||||
|
SOURCE_ENV=("${(@ps:\000:)$(</proc/${SOURCE_PID}/environ)}")
|
||||||
|
export ${SOURCE_ENV[@]:#}
|
||||||
|
}
|
||||||
|
|
|
@ -1,10 +1,8 @@
|
||||||
#!/bin/zsh
|
#!/bin/zsh
|
||||||
#dep:xprintidle pgrep chronic
|
#dep:xprintidle pgrep chronic
|
||||||
|
|
||||||
ALLARGS=("$@")
|
source ${$(realpath "$0"):h:h}/lib/common.zsh
|
||||||
WINDOW_MANAGER=awesome
|
import-env awesome
|
||||||
WM_PID=$(pgrep WINDOW_MANAGER | head -n 1)
|
|
||||||
export "${(@ps:\000:)$(</proc/${WM_PID}/environ)}"
|
|
||||||
|
|
||||||
zparseopts -D -maxidle:=maxidle -in-chronic=chronic l:=logfile -logfile:=logfile
|
zparseopts -D -maxidle:=maxidle -in-chronic=chronic l:=logfile -logfile:=logfile
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue