Browse Source

Added systemd service file for an emacs daemon

master
Drew Short 9 years ago
parent
commit
677ca8327b
  1. 11
      home/.config/systemd/user/emacs.service
  2. 0
      home/.config/systemd/user/emacs.service~
  3. 28
      scripts/bootstrap.sh

11
home/.config/systemd/user/emacs.service

@ -0,0 +1,11 @@
[Unit]
Description=Emacs: the extensible, self-documenting text editor
[Service]
Type=forking
ExecStart=/usr/bin/emacs --daemon
ExecStop=/usr/bin/emacsclient --eval "(kill-emacs)"
Restart=always
[Install]
WantedBy=default.target

0
home/.config/systemd/user/emacs.service~

28
scripts/bootstrap.sh

@ -24,16 +24,16 @@ link() {
copy() {
# Only make a backup if an existing directory is there and is not a link
# Allow passing true as third param to do backups
backup=true
if [ ! -z "$4" ]; then
backup=$4
fi
overwrite=false
if [ ! -z "$5" ]; then
overwrite=$5
fi
if [ -f "$1/$2" ] || [ -L "$1/$2" ]; then
# Allow passing true as third param to do backups
backup=true
if [ ! -z "$4" ]; then
backup=$4
fi
overwrite=false
if [ ! -z "$5" ]; then
overwrite=$5
fi
if $backup; then
mv "$1/$2" "$1/$2.old"
echo "Backed up original $2 to $1/$2.old"
@ -202,6 +202,16 @@ link "$HOME" ".tmux.conf" "$DOTFILES_HOME/.tmux.conf"
# Copy example ssh config
copy "$HOME" ".ssh/config" "$DOTFILES_HOME/.ssh/config" false false
# Copy the systemd user files from .config
SYSTEMD_CONFIG_HOME=$HOME/.config/systemd/user
mkdir -p $SYSTEMD_CONFIG_HOME
systemd_configs=($(ls -d $DOTFILES_HOME/.config/systemd/user/*.service))
for systemd_config in ${systemd_configs[@]}; do
parts=($(echo "$systemd_config" | tr '/' ' '))
systemd_config_name=${parts[-1]}
copy $SYSTEMD_CONFIG_HOME $systemd_config_name $systemd_config true true
done
cd $GIT_DIR
# Create an auto updater for the dotfiles

Loading…
Cancel
Save