Add import-env to repo

This commit is contained in:
crater2150 2023-08-20 17:21:42 +02:00
parent 283d26d831
commit 2de8087c3e
3 changed files with 8 additions and 2 deletions

6
import-env.zsh Normal file
View file

@ -0,0 +1,6 @@
import-env() {
SOURCE_PROCESS=$1
SOURCE_PID=$(pgrep $SOURCE_PROCESS | head -n 1)
SOURCE_ENV=("${(@ps:\000:)$(</proc/${SOURCE_PID}/environ)}")
export ${SOURCE_ENV[@]:#}
}

View file

@ -1,4 +1,4 @@
#!/bin/zsh #!/bin/zsh
source import-env.zsh source ${0:a:h:h}/import-env.zsh
import-env awesome import-env awesome
exec picom exec picom

View file

@ -1,4 +1,4 @@
#!/bin/zsh #!/bin/zsh
source import-env.zsh source ${0:a:h:h}/import-env.zsh
import-env awesome import-env awesome
exec xss-lock -l -- xsecurelock-wrapper 2>&1 exec xss-lock -l -- xsecurelock-wrapper 2>&1