19 lines
351 B
Text
19 lines
351 B
Text
|
#!/usr/bin/env zsh
|
||
|
|
||
|
output=$1
|
||
|
shift
|
||
|
|
||
|
source $HOME/.profile
|
||
|
|
||
|
# Make sure the output directory exists.
|
||
|
[[ -d "$(dirname $output)" ]] || mkdir -p "$(dirname $output)"
|
||
|
|
||
|
echo "[Service]" > "$output"
|
||
|
|
||
|
# Write down all the environment variables.
|
||
|
for env in $@; do
|
||
|
echo "Environment=\"${env}=${(P)env}\""
|
||
|
done >> "$output"
|
||
|
|
||
|
systemctl --user daemon-reload
|