diff options
author | Tom Willemse | 2016-07-26 15:19:32 +0200 |
---|---|---|
committer | Tom Willemse | 2016-07-26 15:19:32 +0200 |
commit | 769211e95616fecd6d81d5eabd14978f71b7c1c8 (patch) | |
tree | 59892406c0131296234493f390f46147b92f0c85 /systemd/usr/bin | |
parent | f1a55c3030a2c193b344db57893aaeef978b64e5 (diff) | |
download | new-dotfiles-769211e95616fecd6d81d5eabd14978f71b7c1c8.tar.gz new-dotfiles-769211e95616fecd6d81d5eabd14978f71b7c1c8.zip |
Start Emacs daemon as a systemd service
Diffstat (limited to 'systemd/usr/bin')
-rwxr-xr-x | systemd/usr/bin/save-environment-variables | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/systemd/usr/bin/save-environment-variables b/systemd/usr/bin/save-environment-variables new file mode 100755 index 0000000..9735151 --- /dev/null +++ b/systemd/usr/bin/save-environment-variables @@ -0,0 +1,18 @@ +#!/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 |