summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLuke Shumaker <LukeShu@sbcglobal.net>2014-04-04 13:12:14 -0400
committerLuke Shumaker <LukeShu@sbcglobal.net>2014-04-04 13:12:14 -0400
commit495e029bfd0c53d04429940629e7200fd9e8b095 (patch)
tree1637085f5dab0335a834039db27b5d6d9d0c8274
parent4ab7be69dc77bf158fe89fffd816b9cc9212cb75 (diff)
move the daemon stuff to use a systemd user instance
-rw-r--r--.config/login.local.sh11
-rw-r--r--.config/login.sh6
-rw-r--r--.config/systemd/user/default.target.wants/batterymon.service9
-rw-r--r--.config/systemd/user/default.target.wants/emacs-daemon.service9
-rw-r--r--.config/systemd/user/default.target.wants/gpg-agent.service9
5 files changed, 28 insertions, 16 deletions
diff --git a/.config/login.local.sh b/.config/login.local.sh
deleted file mode 100644
index 19f1abb..0000000
--- a/.config/login.local.sh
+++ /dev/null
@@ -1,11 +0,0 @@
-#!/bin/sh
-
-# Start background programs ##########################################
-if [ -x "`which daemon`" ]; then
- daemon -i maildirproc.att maildirproc -r "$XDG_CONFIG_HOME"/maildirproc/att.rc
- daemon -i maildirproc.purdue maildirproc -r "$XDG_CONFIG_HOME"/maildirproc/purdue.rc
- daemon batterymon 20 "
- amixer sset Master unmute 100%;
- espeak 'PLUG ME IN';
- sleep .2;"
-fi
diff --git a/.config/login.sh b/.config/login.sh
index 1fd9505..3c29c99 100644
--- a/.config/login.sh
+++ b/.config/login.sh
@@ -29,7 +29,7 @@ export TMPDIR="$HOME/tmp"
. "$HOME/.local/lib/xdg.sh"
mkdir -p -- "$XDG_RUNTIME_DIR/sessions"
-ln -sf -- "$XDG_RUNTIME_DIR/sessions" ~/.sessions
+ln -sfT -- "$XDG_RUNTIME_DIR/sessions" ~/.sessions
# Settings ###########################################################
@@ -52,10 +52,6 @@ if [[ -z $GPGKEY ]] && [[ -f "${HOME}/.gnupg/gpg.conf" ]]; then
echo 'login: Setting GPGKEY'
export GPGKEY=`sed -nr 's/^\s*default-key\s+//p' "${HOME}/.gnupg/gpg.conf"`
fi
-if [[ -z "$(pgrep -u `whoami` gpg-agent)" ]] && type gpg-agent &>/dev/null; then
- echo 'login: Starting gpg-agent'
- gpg-agent --daemon --write-env-file ~/.sessions/gpg >/dev/null
-fi
if [[ -f ~/.sessions/gpg ]]; then
echo 'login: Setting gpg-agent info:'
cat ~/.sessions/gpg
diff --git a/.config/systemd/user/default.target.wants/batterymon.service b/.config/systemd/user/default.target.wants/batterymon.service
new file mode 100644
index 0000000..c8abc0d
--- /dev/null
+++ b/.config/systemd/user/default.target.wants/batterymon.service
@@ -0,0 +1,9 @@
+[Unit]
+Description=Battery monitor
+
+[Service]
+Type=simple
+ExecStart=/usr/bin/batterymon 20 "amixer sset Master unmute 100%; espeak 'PLUG ME IN'; sleep 7;"
+
+[Install]
+WantedBy=default.target
diff --git a/.config/systemd/user/default.target.wants/emacs-daemon.service b/.config/systemd/user/default.target.wants/emacs-daemon.service
new file mode 100644
index 0000000..ef8f65f
--- /dev/null
+++ b/.config/systemd/user/default.target.wants/emacs-daemon.service
@@ -0,0 +1,9 @@
+[Unit]
+Description=Emacs deamon
+
+[Service]
+Type=forking
+ExecStart=/bin/bash -l -c 'emacs --daemon'
+
+[Install]
+WantedBy=default.target
diff --git a/.config/systemd/user/default.target.wants/gpg-agent.service b/.config/systemd/user/default.target.wants/gpg-agent.service
new file mode 100644
index 0000000..a9de9b2
--- /dev/null
+++ b/.config/systemd/user/default.target.wants/gpg-agent.service
@@ -0,0 +1,9 @@
+[Unit]
+Description="GnuPG agent daemon"
+
+[Service]
+Type=forking
+ExecStart=/usr/bin/gpg-agent --daemon --write-env-file ${HOME}/.sessions/gpg
+
+[Install]
+WantedBy=default.target