dotfiles

configuration files
git clone https://pi.duncano.de/git/dotfiles.git
Log | Files | Refs | README

commit 43c5de4bd2ee4e0231107ebcbe0e625447dd9893
parent a3e4228b88b09e3884d95da0f35ad4a0782a7d7e
Author: Duncaen <mail@duncano.de>
Date:   Mon,  6 Jul 2015 01:29:28 +0200

add x, statusbar, dwm and unclutter as user service

Diffstat:
bin/runx | 22++++++++++------------
bin/s | 32+-------------------------------
install.sh | 3+++
profile | 4+++-
service/ck-session | 2--
service/dwm | 2--
service/syncthing | 4++--
service/x | 2--
sv/ck-session/check | 4----
sv/ck-session/down | 0
sv/ck-session/finish | 3---
sv/ck-session/run | 17-----------------
sv/dwm/after/x | 2--
sv/dwm/down | 0
sv/dwm/env/PWD | 1-
sv/dwm/run | 6++++--
sv/statusbar/after/x | 2--
sv/statusbar/run | 3+++
sv/unclutter/after/dwm | 0
sv/x/after/ck-session | 0
sv/x/deps | 0
sv/x/down | 0
sv/x/env/DISPLAY | 1-
sv/x/env/XAUTHORITY | 1-
sv/x/finish | 5+++++
sv/x/run | 16++++++++++++----
sv/x/xinit | 14++++++++++++++
xinitrc | 11+++++------
28 files changed, 62 insertions(+), 95 deletions(-)

diff --git 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 @@ -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 @@ -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 @@ -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 @@ -1 +0,0 @@ -/home/duncan/sv/ck-session- \ No newline at end of file diff --git a/service/dwm b/service/dwm @@ -1 +0,0 @@ -/home/duncan/sv/dwm- \ No newline at end of file diff --git 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 @@ -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 @@ -1,4 +0,0 @@ -#!/bin/mksh - -[ ! -d "./env/" ] && exit 1 -exit 0 diff --git a/sv/ck-session/down b/sv/ck-session/down diff --git a/sv/ck-session/finish b/sv/ck-session/finish @@ -1,3 +0,0 @@ -#!/bin/mksh - -rm -rf ./env/ diff --git a/sv/ck-session/run b/sv/ck-session/run @@ -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 @@ -1 +0,0 @@ -/home/duncan/sv/x/- \ No newline at end of file diff --git a/sv/dwm/down b/sv/dwm/down diff --git a/sv/dwm/env/PWD b/sv/dwm/env/PWD @@ -1 +0,0 @@ -/home/duncan diff --git 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 @@ -1 +0,0 @@ -../../x- \ No newline at end of file diff --git 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 diff --git a/sv/x/after/ck-session b/sv/x/after/ck-session diff --git a/sv/x/deps b/sv/x/deps diff --git a/sv/x/down b/sv/x/down diff --git a/sv/x/env/DISPLAY b/sv/x/env/DISPLAY @@ -1 +0,0 @@ -:0 diff --git a/sv/x/env/XAUTHORITY b/sv/x/env/XAUTHORITY @@ -1 +0,0 @@ -/home/duncan/.Xauthority diff --git a/sv/x/finish 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 @@ -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 @@ -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 @@ -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