aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDuncaen <mail@duncano.de>2015-07-06 01:29:28 +0200
committerDuncaen <mail@duncano.de>2015-07-06 01:36:38 +0200
commit43c5de4bd2ee4e0231107ebcbe0e625447dd9893 (patch)
tree787e22205c3e44f8afceec175d5805ac2989e926
parenta3e4228b88b09e3884d95da0f35ad4a0782a7d7e (diff)
downloaddotfiles-43c5de4bd2ee4e0231107ebcbe0e625447dd9893.tar.gz
add x, statusbar, dwm and unclutter as user service
-rwxr-xr-xbin/runx22
-rwxr-xr-xbin/s32
-rwxr-xr-xinstall.sh3
-rw-r--r--profile4
l---------service/ck-session1
l---------service/dwm1
l---------service/syncthing2
l---------service/x1
-rwxr-xr-xsv/ck-session/check4
-rw-r--r--sv/ck-session/down0
-rwxr-xr-xsv/ck-session/finish3
-rwxr-xr-xsv/ck-session/run17
l---------sv/dwm/after/x1
-rw-r--r--sv/dwm/down0
-rw-r--r--sv/dwm/env/PWD1
-rwxr-xr-xsv/dwm/run6
l---------sv/statusbar/after/x1
-rwxr-xr-xsv/statusbar/run3
-rw-r--r--sv/unclutter/after/dwm0
-rw-r--r--sv/x/after/ck-session0
-rw-r--r--sv/x/deps0
-rw-r--r--sv/x/down0
-rw-r--r--sv/x/env/DISPLAY1
-rw-r--r--sv/x/env/XAUTHORITY1
-rwxr-xr-xsv/x/finish5
-rwxr-xr-xsv/x/run16
-rwxr-xr-xsv/x/xinit14
-rw-r--r--xinitrc11
28 files changed, 61 insertions, 89 deletions
diff --git a/bin/runx b/bin/runx
index a7e9f58..22eeea2 100755
--- a/bin/runx
+++ b/bin/runx
@@ -5,16 +5,14 @@
# [ "$RETRY" -gt 3 ] && exit
# done
-(
- sleep 3;
- xset +fp ~/.fonts/
- xset +fp /usr/share/fonts/misc/
- xset fp rehash
- xset -b
- xrandr --dpi 96
- setxkbmap de
- xset -q >> /tmp/xset
- echo "--" >> /tmp/xset
-)&
+# create ConsoleKit2 session and save variables
+# /usr/bin/ck-launch-session env | while IFS= read -r var; do
+ # for name in "XDG_SESSION_COOKIE XDG_RUNTIME_DIR"; do
+ # [ "${var#*=}" != "$name" ] || continue
+ # echo "${var#*=}" >> "./env/${var%%=*}"
+ # done
+# done
-exec Xorg "$DISPLAY" -nolisten tcp -noreset -verbose 2 -auth "$XAUTHORITY"
+
+# exec Xorg "$DISPLAY" -nolisten tcp -noreset -verbose 2 -auth "$XAUTHORITY"
+exec runsv ~/sv/x
diff --git a/bin/s b/bin/s
index 7f2d2bf..960cb35 100755
--- a/bin/s
+++ b/bin/s
@@ -22,7 +22,7 @@ sv_disable() {
}
sv_list() {
- sv s "${SERVICEDIR}"*
+ sv s "${SVDIR}"* 2>/dev/null
}
sv_deps() {
@@ -41,36 +41,6 @@ sv_deps() {
exit 0
}
-sv_tree() {
- services=$(ls -1 "$1" 2>/dev/null)
- [ "$?" -ne "0" ] && return 1
-
- set -A tree
-
- for f in ${services}; do
- for b in $(ls -1 "${SVDIR}${f}/before" 2> /dev/null); do
- echo "$b>$f"
- before="$before$b:$f\n"
- done
- for a in $(ls -1 "${SVDIR}${f}/after" 2> /dev/null); do
- echo "$f<$a"
- after="$after$a:$f\n"
- done
- done
-
- for f in ${services}; do
- echo "$f;"
- for a in $(echo "$after" | grep "$f"'$'); do
- echo "$f--$a"
- after=$(echo "$after" | sed 's/^://g')
- done
- done
-
- echo "before:\n$before"
- echo "after:\n$after"
-
-}
-
while getopts "u:w:v" opt; do
case "$opt" in
u) SVUSER="$OPTARG" ;;
diff --git a/install.sh b/install.sh
index 4b57b15..44ef866 100755
--- a/install.sh
+++ b/install.sh
@@ -39,5 +39,8 @@ ln -sfv $dotfiles/sv /home/$user/sv
rm -rfv /home/$user/service
ln -sfv $dotfiles/service /home/$user/service
+rm -rfv /home/$user/service.x
+ln -sfv $dotfiles/service.x /home/$user/service.x
+
# install plugins
# vim +PlugInstall +qall
diff --git a/profile b/profile
index 2e2f10b..3066736 100644
--- a/profile
+++ b/profile
@@ -5,4 +5,6 @@
# runsvdir ~/service
export DISPLAY=:0
-export XAUTHORITY=~/.Xauthority
+export XAUTHORITY=/home/duncan/.Xauthority
+# echo "$XDG_RUNTIME_DIR" > /home/duncan/sv/x/env/XDG_RUNTIME_DIR
+# echo "$XDG_SESSION_COOKIE" > /home/duncan/sv/x/env/XDG_SESSION_COOKIE
diff --git a/service/ck-session b/service/ck-session
deleted file mode 120000
index 1eb8309..0000000
--- a/service/ck-session
+++ /dev/null
@@ -1 +0,0 @@
-/home/duncan/sv/ck-session \ No newline at end of file
diff --git a/service/dwm b/service/dwm
deleted file mode 120000
index 73ae249..0000000
--- a/service/dwm
+++ /dev/null
@@ -1 +0,0 @@
-/home/duncan/sv/dwm \ No newline at end of file
diff --git a/service/syncthing b/service/syncthing
index a0354c4..f22c2a6 120000
--- a/service/syncthing
+++ b/service/syncthing
@@ -1 +1 @@
-../sv/syncthing \ No newline at end of file
+/home/duncan/sv/syncthing \ No newline at end of file
diff --git a/service/x b/service/x
deleted file mode 120000
index cfe1dea..0000000
--- a/service/x
+++ /dev/null
@@ -1 +0,0 @@
-/home/duncan/sv/x \ No newline at end of file
diff --git a/sv/ck-session/check b/sv/ck-session/check
deleted file mode 100755
index 4092ae3..0000000
--- a/sv/ck-session/check
+++ /dev/null
@@ -1,4 +0,0 @@
-#!/bin/mksh
-
-[ ! -d "./env/" ] && exit 1
-exit 0
diff --git a/sv/ck-session/down b/sv/ck-session/down
deleted file mode 100644
index e69de29..0000000
--- a/sv/ck-session/down
+++ /dev/null
diff --git a/sv/ck-session/finish b/sv/ck-session/finish
deleted file mode 100755
index 46bcf42..0000000
--- a/sv/ck-session/finish
+++ /dev/null
@@ -1,3 +0,0 @@
-#!/bin/mksh
-
-rm -rf ./env/
diff --git a/sv/ck-session/run b/sv/ck-session/run
deleted file mode 100755
index 9fea970..0000000
--- a/sv/ck-session/run
+++ /dev/null
@@ -1,17 +0,0 @@
-#!/bin/mksh
-
-[ -d "./env" ] && exit 1
-
-mkdir ./env
-
-save_env() {
- while IFS= read -r var; do
- echo "${var#*=}" >> "./env/${var%%=*}"
- done
-}
-
-/usr/bin/ck-launch-session env \
- | grep "XDG_SESSION_COOKIE\|XDG_RUNTIME_DIR" \
- | save_env
-
-exec pause
diff --git a/sv/dwm/after/x b/sv/dwm/after/x
deleted file mode 120000
index b63d97c..0000000
--- a/sv/dwm/after/x
+++ /dev/null
@@ -1 +0,0 @@
-/home/duncan/sv/x/ \ No newline at end of file
diff --git a/sv/dwm/down b/sv/dwm/down
deleted file mode 100644
index e69de29..0000000
--- a/sv/dwm/down
+++ /dev/null
diff --git a/sv/dwm/env/PWD b/sv/dwm/env/PWD
deleted file mode 100644
index 31318f3..0000000
--- a/sv/dwm/env/PWD
+++ /dev/null
@@ -1 +0,0 @@
-/home/duncan
diff --git a/sv/dwm/run b/sv/dwm/run
index 93b3af5..965f90d 100755
--- a/sv/dwm/run
+++ b/sv/dwm/run
@@ -1,6 +1,8 @@
#!/bin/mksh
-~/bin/s deps "ck-session" "x" || exit 1
+# ~/bin/s deps "ck-session" "x" || exit 1
exec 2>&1
-exec chpst -e ./env -e ../x/env -e ../ck-session/env dwm
+
+cd ~
+exec dwm
diff --git a/sv/statusbar/after/x b/sv/statusbar/after/x
deleted file mode 120000
index fb79940..0000000
--- a/sv/statusbar/after/x
+++ /dev/null
@@ -1 +0,0 @@
-../../x \ No newline at end of file
diff --git a/sv/statusbar/run b/sv/statusbar/run
index e69de29..8668019 100755
--- a/sv/statusbar/run
+++ b/sv/statusbar/run
@@ -0,0 +1,3 @@
+#!/bin/mksh
+
+exec ~/repos/go-dwmstatus/go-dwmstatus
diff --git a/sv/unclutter/after/dwm b/sv/unclutter/after/dwm
deleted file mode 100644
index e69de29..0000000
--- a/sv/unclutter/after/dwm
+++ /dev/null
diff --git a/sv/x/after/ck-session b/sv/x/after/ck-session
deleted file mode 100644
index e69de29..0000000
--- a/sv/x/after/ck-session
+++ /dev/null
diff --git a/sv/x/deps b/sv/x/deps
deleted file mode 100644
index e69de29..0000000
--- a/sv/x/deps
+++ /dev/null
diff --git a/sv/x/down b/sv/x/down
deleted file mode 100644
index e69de29..0000000
--- a/sv/x/down
+++ /dev/null
diff --git a/sv/x/env/DISPLAY b/sv/x/env/DISPLAY
deleted file mode 100644
index 16f4102..0000000
--- a/sv/x/env/DISPLAY
+++ /dev/null
@@ -1 +0,0 @@
-:0
diff --git a/sv/x/env/XAUTHORITY b/sv/x/env/XAUTHORITY
deleted file mode 100644
index 3661338..0000000
--- a/sv/x/env/XAUTHORITY
+++ /dev/null
@@ -1 +0,0 @@
-/home/duncan/.Xauthority
diff --git a/sv/x/finish b/sv/x/finish
new file mode 100755
index 0000000..88875d3
--- /dev/null
+++ b/sv/x/finish
@@ -0,0 +1,5 @@
+#!/bin/mksh
+
+sv -w600 force-stop ~/service.x
+sv exit ~/service.x
+rm -rf /tmp/serverauth.*
diff --git a/sv/x/run b/sv/x/run
index 7b236bf..cd1ee97 100755
--- a/sv/x/run
+++ b/sv/x/run
@@ -1,6 +1,14 @@
-#!/usr/bin/mksh
-
-~/bin/s deps "ck-session" || exit 1
+#!/bin/mksh
exec 2>&1
-exec chpst -e ./env -e ../ck-session/env ~/bin/runx
+
+export DISPLAY="${DISPLAY:-:0}"
+export XAUTHORITY="${XAUTHORITY:-~/.Xauthority}"
+
+mcookie=$(/usr/bin/mcookie)
+xserverauthfile=$(mktemp -p /tmp serverauth.XXXXXXXXXX)
+
+xauth -q -f "$xserverauthfile" add "$DISPLAY" . "$mcookie"
+xauth -q add "$DISPLAY" . "$mcookie"
+
+exec xinit "${PWD}/xinit" -- /etc/X11/xinit/xserverrc "$DISPLAY" -noreset -auth "${xserverauthfile}"
diff --git a/sv/x/xinit b/sv/x/xinit
new file mode 100755
index 0000000..2c767c7
--- /dev/null
+++ b/sv/x/xinit
@@ -0,0 +1,14 @@
+#!/bin/mksh
+
+exec 2>&1
+
+echo "setting up x environment"
+xset +fp ~/.fonts/
+xset +fp /usr/share/fonts/misc/
+xset fp rehash
+xset -b
+xrandr --dpi 96
+setxkbmap de
+
+echo "starting ~/service.x"
+exec /usr/bin/ck-launch-session dbus-launch runsvdir ~/service.x
diff --git a/xinitrc b/xinitrc
index 2c519de..5e9b45e 100644
--- a/xinitrc
+++ b/xinitrc
@@ -25,12 +25,11 @@ xrandr --dpi 96 &
setxkbmap de &
# hide cursor
-unclutter -noevents -root -visible -jitter 10 -idle 5 &
+# unclutter -noevents -root -visible -jitter 10 -idle 5 &
# statusbar
-repos/go-dwmstatus/go-dwmstatus &
+# repos/go-dwmstatus/go-dwmstatus &
-while true; do
- dwm >/dev/null 2>&1
-done
-# exec dwm
+# runsvdir ~/service/x/after/*
+
+exec runsvdir ~/service.x