diff --git a/home/.config/systemd/user/emacs.service b/home/.config/systemd/user/emacs.service new file mode 100644 index 0000000..6785396 --- /dev/null +++ b/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 \ No newline at end of file diff --git a/home/.config/systemd/user/emacs.service~ b/home/.config/systemd/user/emacs.service~ new file mode 100644 index 0000000..e69de29 diff --git a/scripts/bootstrap.sh b/scripts/bootstrap.sh index 710341d..f3939e7 100755 --- a/scripts/bootstrap.sh +++ b/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