summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLuke Shumaker <lukeshu@sbcglobal.net>2016-02-27 20:12:38 -0500
committerLuke Shumaker <lukeshu@sbcglobal.net>2016-02-27 20:12:38 -0500
commit4e802e740bb2f7c6891271d3eaab39768360e261 (patch)
tree52cd247d9ffabab2f5cfb9f7821fbafbb27678f7
parentbd42aa1b31e2e41cac7ac2ffa6edc05e04354815 (diff)
parentd09fa8687ee01dcb4ef540deb106b8531f56b403 (diff)
Merge branch 'master' into build64-par/master
-rw-r--r--.config/X11/clientrc23
-rw-r--r--.config/X11/resources (renamed from .config/X11/defaults)0
-rw-r--r--.config/bash/rc.d/10_aliases.sh35
-rw-r--r--.config/cron/make-config2
-rw-r--r--.config/emacs/custom.el3
-rw-r--r--.config/emacs/init.el7
-rw-r--r--.config/git/ignore1
-rw-r--r--.config/login.d/00_path.sh6
-rw-r--r--.config/login.d/02_xdg_runtime_dir.sh28
-rw-r--r--.config/login.d/10_gpg.sh2
-rw-r--r--.config/login.d/10_libreoffice.sh4
-rw-r--r--.config/login.d/90_dot-runtime.sh7
-rw-r--r--.config/ssh/config6
-rw-r--r--.config/symlinks1
-rw-r--r--.config/systemd/user/X11@.target2
l---------.config/systemd/user/X11@.target.requires/wmii@.service (renamed from .config/systemd/user/wm@.target.requires/wmii@.service)0
l---------.config/systemd/user/X11@.target.wants/xmodmap@.service1
l---------.config/systemd/user/X11@.target.wants/xresources-dpi@.service1
l---------.config/systemd/user/X11@.target.wants/xresources@.service1
l---------.config/systemd/user/basic.target.wants/import-profile.service1
-rw-r--r--.config/systemd/user/dunst@.service9
-rw-r--r--.config/systemd/user/emacs-daemon.service5
-rw-r--r--.config/systemd/user/import-profile.service11
-rw-r--r--.config/systemd/user/lxpanel@.service10
-rw-r--r--.config/systemd/user/maildirproc@.service2
-rw-r--r--.config/systemd/user/panel@.target4
-rw-r--r--.config/systemd/user/rbar@.service2
-rw-r--r--.config/systemd/user/redshift@.service11
-rw-r--r--.config/systemd/user/synergy@.service10
-rw-r--r--.config/systemd/user/vncserver@.service2
-rw-r--r--.config/systemd/user/wm-running@.target2
l---------.config/systemd/user/wm-running@.target.requires/wmii@.service1
-rw-r--r--.config/systemd/user/wm@.target2
-rw-r--r--.config/systemd/user/wmii@.service14
-rw-r--r--.config/systemd/user/x0vncserver@.service7
-rw-r--r--.config/systemd/user/xcompmgr@.service8
-rw-r--r--.config/systemd/user/xmodmap@.service14
-rw-r--r--.config/systemd/user/xresources-dpi@.service15
-rw-r--r--.config/systemd/user/xresources@.service14
-rw-r--r--.config/wmii-hg/config.sh13
-rw-r--r--.config/wmii-hg/include.sh3
-rwxr-xr-x.config/wmii-hg/quit2
-rw-r--r--.config/wmii-hg/rbar.sh4
-rw-r--r--.config/wmii-hg/rules1
-rwxr-xr-x.config/wmii-hg/term3
-rwxr-xr-x.config/wmii-hg/wmiirc4
-rw-r--r--.config/wmii-hg/workarounds.sh42
-rwxr-xr-x.local/bin/systemd-import-profile9
-rwxr-xr-x.local/bin/xrdb-set-dpi4
49 files changed, 250 insertions, 109 deletions
diff --git a/.config/X11/clientrc b/.config/X11/clientrc
index bc68ed6..5ffdd97 100644
--- a/.config/X11/clientrc
+++ b/.config/X11/clientrc
@@ -1,30 +1,15 @@
#!/hint/sh
-# Load system xinit modules (disabled)
-# Remove "false &&" to enable
-if false && [ -d /etc/X11/xinit/xinitrc.d ]; then
- echo ' ==> Running scripts in Entering xinitrc.d/*'
- for f in /etc/X11/xinit/xinitrc.d/*; do
- echo " -> $f"
- [ -x "$f" ] && . "$f"
- done
- unset f
- echo ' -> done'
-fi
-
-usermodmap="$XDG_CONFIG_HOME/X11/modmap"
-if [ -f "$usermodmap" ]; then
- xmodmap "$usermodmap"
-fi
-
if [ -z "$XDG_RUNTIME_DIR" ]; then
printf "XDG_RUNTIME_DIR isn't set\n" >&2
exit 6
fi
+
_DISPLAY="$(systemd-escape -- "$DISPLAY")"
trap "rm -f $(printf '%q' "${XDG_RUNTIME_DIR}/x11-wm@${_DISPLAY}")" EXIT
mkfifo "${XDG_RUNTIME_DIR}/x11-wm@${_DISPLAY}"
-cat "${XDG_RUNTIME_DIR}/x11-wm@${_DISPLAY}" &
-systemctl --user start "wm@${_DISPLAY}.target" &
+cat < "${XDG_RUNTIME_DIR}/x11-wm@${_DISPLAY}" &
+systemctl --user start "X11@${_DISPLAY}.target" &
wait
+systemctl --user stop "X11@${_DISPLAY}.target"
diff --git a/.config/X11/defaults b/.config/X11/resources
index fca1914..fca1914 100644
--- a/.config/X11/defaults
+++ b/.config/X11/resources
diff --git a/.config/bash/rc.d/10_aliases.sh b/.config/bash/rc.d/10_aliases.sh
index 758c069..03ece7e 100644
--- a/.config/bash/rc.d/10_aliases.sh
+++ b/.config/bash/rc.d/10_aliases.sh
@@ -68,6 +68,7 @@ alias tree='tree --charset utf8'
alias cd=pushd
alias gitk='gitk --all --date-order'
alias userctl='systemctl --user'
+alias mv='mv -i'
######################################################################
# These are actually functions :P #
@@ -81,15 +82,41 @@ term-title() {
printf "$fmt" "$*"
}
mvln() {
+ local target link
if [[ ! -L "$1" ]]; then
libremessages error 'Not a soft link: %s' "$1"
+ return 1
fi
- target=$(readlink -f -- "$1")
- ln -srT -- "$target" "$2"
- if cmp -- "$1" "$2"; then
+ if [[ -d "$2" ]]; then
+ link="$2/${1##*/}"
+ else
+ link="$2"
+ fi
+ target=$(readlink -f -- "$1") || return 1
+ ln -srT -- "$target" "$link"
+ if cmp -- "$1" "$link"; then
rm -f -- "$1"
else
- libremessages error 'Failed moving link: %s -> %s' "$1" "$2"
+ libremessages error 'Failed moving link: %s -> %s' "$1" "$link"
+ return 1
+ fi
+}
+cpln() {
+ local target link
+ if [[ ! -L "$1" ]]; then
+ libremessages error 'Not a soft link: %s' "$1"
+ return 1
+ fi
+ if [[ -d "$2" ]]; then
+ link="$2/${1##*/}"
+ else
+ link="$2"
+ fi
+ target=$(readlink -f -- "$1") || return 1
+ ln -srT -- "$target" "$link"
+ if ! cmp -- "$1" "$link"; then
+ libremessages error 'Failed copying link: %s -> %s' "$1" "$link"
+ return 1
fi
}
jarls() {
diff --git a/.config/cron/make-config b/.config/cron/make-config
index a4a3480..172233c 100644
--- a/.config/cron/make-config
+++ b/.config/cron/make-config
@@ -1,2 +1,2 @@
#m h dom mon dow command
-*/5 * * * * chronic make -C ~/.config
+*/5 * * * * systemd-run --user -- chronic make -C ~/.config
diff --git a/.config/emacs/custom.el b/.config/emacs/custom.el
index ef6e985..a099221 100644
--- a/.config/emacs/custom.el
+++ b/.config/emacs/custom.el
@@ -39,7 +39,8 @@
(quote
((Nginx-indent-tabs-mode)
(Nginx-indent-level . 4)
- (Nginx-indent-level . 8))))
+ (Nginx-indent-level . 8)
+ (c-set-style . "K&R"))))
'(scroll-bar-mode nil)
'(send-mail-function (quote smtpmail-send-it))
'(smtpmail-smtp-server "plus.smtp.mail.yahoo.com")
diff --git a/.config/emacs/init.el b/.config/emacs/init.el
index e0e39d4..f1650a4 100644
--- a/.config/emacs/init.el
+++ b/.config/emacs/init.el
@@ -75,7 +75,7 @@
;; 1) Disable package.el from getting loading all downloaded packages
;; 2) Use el-get to load a specified list of packages from elpa.
;;
-;; This is also nice because I can do event-base programming for what
+;; This is also nice because I can do event-based programming for what
;; to do once a package is loaded, using :after.
;; For some reason, el-get adds a bunch of 3rd-party repos to
@@ -111,12 +111,13 @@
(:name haml-mode :type elpa)
(:name markdown-mode :type elpa
:after (add-to-list 'auto-mode-alist '("\\.ronn\\'" . markdown-mode)))
+ (:name mediawiki :type elpa)
(:name nginx-mode :type elpa
:after (put 'nginx-indent-level 'safe-local-variable 'integerp))
(:name scss-mode :type elpa)
(:name yaml-mode :type elpa)
))
-;; What packages el-get should install, both from above, and it's
+;; What packages el-get should install, both from above, and its
;; internal list of sources.
(el-get 'sync (append
'(el-get)
@@ -138,6 +139,8 @@
graphviz-dot-mode
haml-mode
markdown-mode
+ yaml-mode
+ mediawiki
nginx-mode
php-mode-improved
scss-mode
diff --git a/.config/git/ignore b/.config/git/ignore
index d0f607c..a227edd 100644
--- a/.config/git/ignore
+++ b/.config/git/ignore
@@ -1,3 +1,4 @@
#*#
.#*
*~
+.nfs*
diff --git a/.config/login.d/00_path.sh b/.config/login.d/00_path.sh
index 2d5f4a5..ae2e8db 100644
--- a/.config/login.d/00_path.sh
+++ b/.config/login.d/00_path.sh
@@ -1,8 +1,12 @@
#!/hint/sh
+eval "$(
if type config-path &>/dev/null; then
config_path=config-path
else
# Bootstrap finding config-path
config_path="$HOME/.local/bin/config-path"
fi
-eval "$(IFS=$'\n'; lines=($("$config_path")); printf -- 'export %s\n' "${lines[@]}")"
+IFS=$'\n'
+lines=($("$config_path"))
+printf -- 'export %s\n' "${lines[@]}"
+)"
diff --git a/.config/login.d/02_xdg_runtime_dir.sh b/.config/login.d/02_xdg_runtime_dir.sh
deleted file mode 100644
index 6e3e4ad..0000000
--- a/.config/login.d/02_xdg_runtime_dir.sh
+++ /dev/null
@@ -1,28 +0,0 @@
-#!/hint/sh
-
-# Set XDG_RUNTIME_DIR if we can
-if [ -z "$XDG_RUNTIME_DIR" ] && type flock &>/dev/null; then
- _diy_xdg_runtime_login() {
- export XDG_RUNTIME_DIR="$XDG_CACHE_HOME/xdg-runtime-dir/$HOSTNAME"
- if ! [ /dev/fd/7 -ef "$XDG_CACHE_HOME/xdg-runtime-dir/.lock" ]; then
- mkdir -p -- "$XDG_CACHE_HOME/xdg-runtime-dir"
- exec 7>"$XDG_CACHE_HOME/xdg-runtime-dir/.lock"
- if flock -xn 7; then
- if [ ! -d "$XDG_RUNTIME_DIR" ]; then
- local tmp="$(mktemp -d --tmpdir -- "${USER}@${HOSTNAME}-runtime.XXXXXXXXXX")"
- ln -sfT -- "$tmp" "$XDG_RUNTIME_DIR"
- fi
- # Unfortunately this doesn't survive across exec(1).
- trap _diy_xdg_runtime_logout EXIT
- flock -sn 7
- fi
- fi
- }
- _diy_xdg_runtime_logout() {
- exec 7>"$XDG_CACHE_HOME/xdg-runtime-dir/.lock"
- if flock -xn 7; then
- rm -rf -- "$(readlink "$XDG_RUNTIME_DIR")"
- fi
- }
- _diy_xdg_runtime_login
-fi
diff --git a/.config/login.d/10_gpg.sh b/.config/login.d/10_gpg.sh
index c1c5f82..83e4203 100644
--- a/.config/login.d/10_gpg.sh
+++ b/.config/login.d/10_gpg.sh
@@ -1,4 +1,4 @@
#!/hint/sh
-if [[ -z $GPGKEY ]] && [[ -f "${HOME}/.gnupg/gpg.conf" ]]; then
+if [ -z "$GPGKEY" -a -f "${HOME}/.gnupg/gpg.conf" ]; then
export GPGKEY=`sed -nr 's/^\s*default-key\s+//p' "${GNUPG_HOME:-${HOME}/.gnupg}/gpg.conf"`
fi
diff --git a/.config/login.d/10_libreoffice.sh b/.config/login.d/10_libreoffice.sh
new file mode 100644
index 0000000..1831f5a
--- /dev/null
+++ b/.config/login.d/10_libreoffice.sh
@@ -0,0 +1,4 @@
+#!/hint/sh
+# Force LibreOffice to use GTK2.
+# (gtk = GTK2, gtk3 = GTK3, kde4 = Qt, gen = ?)
+export SAL_USE_VCLPLUGIN=gtk
diff --git a/.config/login.d/90_dot-runtime.sh b/.config/login.d/90_dot-runtime.sh
index cb0b7f2..bf0ddcc 100644
--- a/.config/login.d/90_dot-runtime.sh
+++ b/.config/login.d/90_dot-runtime.sh
@@ -1,8 +1,7 @@
+#!/hint/sh
# This is really only needed for ssh ControlPath; as I don't have a
# way to communicate XDG_RUNTIME_DIR to it otherwise.
-mkdir -p -- ~/.runtime
+mkdir -p -- ~/.r
if [ -n "$XDG_RUNTIME_DIR" ]; then
- ln -sfT -- "$XDG_RUNTIME_DIR" ~/.runtime/"$HOSTNAME"
-else
- ln -sfT -- /tmp ~/.runtime/"$HOSTNAME"
+ ln -sfT -- "$XDG_RUNTIME_DIR" ~/.r/"$HOSTNAME"
fi
diff --git a/.config/ssh/config b/.config/ssh/config
index f651513..19ed217 100644
--- a/.config/ssh/config
+++ b/.config/ssh/config
@@ -1,7 +1,7 @@
Host *
Protocol 2
ControlMaster auto
- ControlPath ~/.runtime/%l/ssh-%r@%h:%p
+ ControlPath ~/.r/%l/ssh-%r@%h:%p
Compression yes
# Purdue ###################################################
@@ -35,3 +35,7 @@ Host build64-par
Port 1864
ForwardX11 no
ForwardX11Trusted no
+
+Host 192.168.*.1 10.*
+ StrictHostKeyChecking no
+ UserKnownHostsFile /dev/null
diff --git a/.config/symlinks b/.config/symlinks
index 209f291..8d92ec8 100644
--- a/.config/symlinks
+++ b/.config/symlinks
@@ -4,7 +4,6 @@
.config/login.sh .profile
# X11
-.config/X11/defaults .Xdefaults
.config/X11/clientrc .xinitrc
.config/X11/serverrc .xserverrc
.config/X11/login .xsession
diff --git a/.config/systemd/user/X11@.target b/.config/systemd/user/X11@.target
new file mode 100644
index 0000000..d84f814
--- /dev/null
+++ b/.config/systemd/user/X11@.target
@@ -0,0 +1,2 @@
+[Unit]
+Description=Connection to X11 display %I
diff --git a/.config/systemd/user/wm@.target.requires/wmii@.service b/.config/systemd/user/X11@.target.requires/wmii@.service
index 1b202d2..1b202d2 120000
--- a/.config/systemd/user/wm@.target.requires/wmii@.service
+++ b/.config/systemd/user/X11@.target.requires/wmii@.service
diff --git a/.config/systemd/user/X11@.target.wants/xmodmap@.service b/.config/systemd/user/X11@.target.wants/xmodmap@.service
new file mode 120000
index 0000000..3eb09e4
--- /dev/null
+++ b/.config/systemd/user/X11@.target.wants/xmodmap@.service
@@ -0,0 +1 @@
+../xmodmap@.service \ No newline at end of file
diff --git a/.config/systemd/user/X11@.target.wants/xresources-dpi@.service b/.config/systemd/user/X11@.target.wants/xresources-dpi@.service
new file mode 120000
index 0000000..f3b5a4c
--- /dev/null
+++ b/.config/systemd/user/X11@.target.wants/xresources-dpi@.service
@@ -0,0 +1 @@
+../xresources-dpi@.service \ No newline at end of file
diff --git a/.config/systemd/user/X11@.target.wants/xresources@.service b/.config/systemd/user/X11@.target.wants/xresources@.service
new file mode 120000
index 0000000..807639b
--- /dev/null
+++ b/.config/systemd/user/X11@.target.wants/xresources@.service
@@ -0,0 +1 @@
+../xresources@.service \ No newline at end of file
diff --git a/.config/systemd/user/basic.target.wants/import-profile.service b/.config/systemd/user/basic.target.wants/import-profile.service
new file mode 120000
index 0000000..04009d1
--- /dev/null
+++ b/.config/systemd/user/basic.target.wants/import-profile.service
@@ -0,0 +1 @@
+../import-profile.service \ No newline at end of file
diff --git a/.config/systemd/user/dunst@.service b/.config/systemd/user/dunst@.service
index 568af3f..74d2447 100644
--- a/.config/systemd/user/dunst@.service
+++ b/.config/systemd/user/dunst@.service
@@ -1,10 +1,11 @@
[Unit]
Description=Dunst notification-daemon on X display %I
Documentation=man:dunst(1)
-StopWhenUnneeded=true
+After=X11@%i.target
+Requisite=X11@%i.target
[Service]
-Type=simple
Environment=DISPLAY=%I
-ExecStart=/usr/bin/dunst
-Restart=always
+
+Type=simple
+ExecStart=/usr/bin/env dunst
diff --git a/.config/systemd/user/emacs-daemon.service b/.config/systemd/user/emacs-daemon.service
index 4077e97..3869d75 100644
--- a/.config/systemd/user/emacs-daemon.service
+++ b/.config/systemd/user/emacs-daemon.service
@@ -3,8 +3,9 @@ Description=Emacs deamon
[Service]
Type=forking
-ExecStart=/bin/bash -l -c 'emacs --daemon'
-ExecStop=/bin/bash -l -c 'emacsclient -a false -e "(kill-emacs)"'
+ExecStart=/usr/bin/env emacs --daemon
+ExecStop=/usr/bin/env emacsclient -a false -e '(kill-emacs)'
+Restart=always
[Install]
WantedBy=default.target
diff --git a/.config/systemd/user/import-profile.service b/.config/systemd/user/import-profile.service
new file mode 100644
index 0000000..acde590
--- /dev/null
+++ b/.config/systemd/user/import-profile.service
@@ -0,0 +1,11 @@
+[Unit]
+Description=Load user profile into systemd
+Before=basic.target
+DefaultDependencies=no
+
+[Service]
+Type=oneshot
+ExecStart=/usr/bin/env bash -l -c systemd-import-profile
+
+[Install]
+WantedBy=basic.target
diff --git a/.config/systemd/user/lxpanel@.service b/.config/systemd/user/lxpanel@.service
index ecded87..76df925 100644
--- a/.config/systemd/user/lxpanel@.service
+++ b/.config/systemd/user/lxpanel@.service
@@ -2,14 +2,16 @@
Description=LXDE Desktop Panel on X display %I
Documentation=man:lxpanel(1)
StopWhenUnneeded=true
-After=wm@%i.target
+After=X11@%i.target wm-running@%i.target
+Requisite=X11@%i.target
+Requires=wm-running@%i.target
Before=panel@%i.target
[Service]
-Type=simple
Environment=DISPLAY=%I
-ExecStart=/usr/bin/lxpanel
-Restart=always
+
+Type=simple
+ExecStart=/usr/bin/env lxpanel
[Install]
RequiredBy=panel@%i.target
diff --git a/.config/systemd/user/maildirproc@.service b/.config/systemd/user/maildirproc@.service
index 9c4181c..450157f 100644
--- a/.config/systemd/user/maildirproc@.service
+++ b/.config/systemd/user/maildirproc@.service
@@ -3,7 +3,7 @@ Description=maildirproc mail filter
[Service]
Type=simple
-ExecStart=/usr/bin/maildirproc --rcfile=${HOME}/.config/maildirproc/%I.rc --logfile=-
+ExecStart=/usr/bin/env maildirproc --rcfile=${HOME}/.config/maildirproc/%I.rc --logfile=-
Restart=on-failure
[Install]
diff --git a/.config/systemd/user/panel@.target b/.config/systemd/user/panel@.target
index ed3dffd..53d45b0 100644
--- a/.config/systemd/user/panel@.target
+++ b/.config/systemd/user/panel@.target
@@ -1,3 +1,5 @@
[Unit]
-Description=Desktop Panel (System Tray) on display %I
+Description=Desktop Panel (System Tray) on X display %I
StopWhenUnneeded=true
+After=X11@%i.target
+Requisite=X11@%i.target
diff --git a/.config/systemd/user/rbar@.service b/.config/systemd/user/rbar@.service
index 18d6201..55b802c 100644
--- a/.config/systemd/user/rbar@.service
+++ b/.config/systemd/user/rbar@.service
@@ -4,4 +4,4 @@ StopWhenUnneeded=true
[Service]
Type=simple
-ExecStart=/usr/bin/bash -c '%h/.wmii-hg/rbar %I'
+ExecStart=/bin/sh -c '%h/.wmii-hg/rbar %I'
diff --git a/.config/systemd/user/redshift@.service b/.config/systemd/user/redshift@.service
index b4ef3bb..fda41d6 100644
--- a/.config/systemd/user/redshift@.service
+++ b/.config/systemd/user/redshift@.service
@@ -1,11 +1,12 @@
[Unit]
Description=Redshift display colour temperature adjustment on X display %I
Documentation=http://jonls.dk/redshift/
-StopWhenUnneeded=true
+After=X11@%i.target
+Requisite=X11@%i.target
[Service]
-Type=simple
Environment=DISPLAY=%I
-ExecStart=/usr/bin/redshift
-ExecStopPost=/usr/bin/redshift -x
-Restart=always
+
+Type=simple
+ExecStart=/usr/bin/env redshift
+ExecStopPost=/usr/bin/env redshift -x
diff --git a/.config/systemd/user/synergy@.service b/.config/systemd/user/synergy@.service
index df0640a..c045749 100644
--- a/.config/systemd/user/synergy@.service
+++ b/.config/systemd/user/synergy@.service
@@ -1,10 +1,12 @@
[Unit]
Description=Keyboard and mouse sharing on X display %I
-StopWhenUnneeded=true
+#StopWhenUnneeded=true
+After=X11@%i.target panel@%i.target
+Requisite=X11@%i.target
Requires=panel@%i.target
[Service]
-Type=simple
Environment=DISPLAY=%I
-ExecStart=/usr/bin/synergy
-Restart=always
+
+Type=simple
+ExecStart=/usr/bin/env synergy
diff --git a/.config/systemd/user/vncserver@.service b/.config/systemd/user/vncserver@.service
index 2433977..2b5b453 100644
--- a/.config/systemd/user/vncserver@.service
+++ b/.config/systemd/user/vncserver@.service
@@ -6,7 +6,7 @@ Conflicts=x0vncserver@%i.service
Type=simple
Restart=always
-ExecStart=/bin/bash -l -c 'vncserver -fg %I'
+ExecStart=/usr/bin/env vncserver -fg %I
ExecStopPost=/bin/rm /tmp/.X%I-lock /tmp/.X11-unix/X%I
[Install]
diff --git a/.config/systemd/user/wm-running@.target b/.config/systemd/user/wm-running@.target
new file mode 100644
index 0000000..8d3a38b
--- /dev/null
+++ b/.config/systemd/user/wm-running@.target
@@ -0,0 +1,2 @@
+[Unit]
+Description=Window Manager is running on X display %I
diff --git a/.config/systemd/user/wm-running@.target.requires/wmii@.service b/.config/systemd/user/wm-running@.target.requires/wmii@.service
new file mode 120000
index 0000000..1b202d2
--- /dev/null
+++ b/.config/systemd/user/wm-running@.target.requires/wmii@.service
@@ -0,0 +1 @@
+../wmii@.service \ No newline at end of file
diff --git a/.config/systemd/user/wm@.target b/.config/systemd/user/wm@.target
deleted file mode 100644
index c114bf5..0000000
--- a/.config/systemd/user/wm@.target
+++ /dev/null
@@ -1,2 +0,0 @@
-[Unit]
-Description=Window Manager on display %I
diff --git a/.config/systemd/user/wmii@.service b/.config/systemd/user/wmii@.service
index 4a81e3f..c939221 100644
--- a/.config/systemd/user/wmii@.service
+++ b/.config/systemd/user/wmii@.service
@@ -1,17 +1,19 @@
[Unit]
Description=Window Manager Improved Improved on X display %I
Documentation=file:/usr/share/doc/wmii/wmii.pdf
-Before=wm@%i.target
-StopWhenUnneeded=true
+After=X11@%i.target
+Requisite=X11@%i.target
+Before=wm-running@%i.target
[Service]
+Environment=DISPLAY=%I
+
# This assumes that you write READY=1 to $NOTIFY_SOCKET in wmiirc
Type=notify
NotifyAccess=all
-Environment=DISPLAY=%I
-ExecStart=/usr/bin/bash -l -c 'exec 8>${XDG_RUNTIME_DIR}/x11-wm@%I; exec /usr/bin/wmii'
-ExecStop=/usr/bin/wmiir xwrite /ctl Quit
+ExecStart=/usr/bin/env bash -c 'exec 8>${XDG_RUNTIME_DIR}/x11-wm@%I; exec /usr/bin/wmii'
+ExecStop=/usr/bin/env wmiir xwrite /ctl Quit
[Install]
-RequiredBy=wm@%i.service
+RequiredBy=X11@%i.target
diff --git a/.config/systemd/user/x0vncserver@.service b/.config/systemd/user/x0vncserver@.service
index 3ee349f..1582f42 100644
--- a/.config/systemd/user/x0vncserver@.service
+++ b/.config/systemd/user/x0vncserver@.service
@@ -1,9 +1,10 @@
[Unit]
Description=VNC server for real X display %I
Conflicts=vncserver@%i.service
-StopWhenUnneeded=true
+After=X11@%i.target
+Requisite=X11@%i.target
[Service]
+
Type=simple
-ExecStart=/usr/bin/x0vncserver display=%I PasswordFile=%h/.vnc/passwd
-Restart=always
+ExecStart=/usr/bin/env x0vncserver display=%I PasswordFile=%h/.vnc/passwd
diff --git a/.config/systemd/user/xcompmgr@.service b/.config/systemd/user/xcompmgr@.service
index 85decd2..c3d98d4 100644
--- a/.config/systemd/user/xcompmgr@.service
+++ b/.config/systemd/user/xcompmgr@.service
@@ -2,9 +2,11 @@
Description=Composite Window-Effects Manger on X display %I
Documentation=man:xcompmgr(1)
StopWhenUnneeded=true
+After=X11@%i.target
+Requisite=X11@%i.target
[Service]
-Type=simple
Environment=DISPLAY=%I
-ExecStart=/usr/bin/xcompmgr
-Restart=always
+
+Type=simple
+ExecStart=/usr/bin/env xcompmgr
diff --git a/.config/systemd/user/xmodmap@.service b/.config/systemd/user/xmodmap@.service
new file mode 100644
index 0000000..57bab8f
--- /dev/null
+++ b/.config/systemd/user/xmodmap@.service
@@ -0,0 +1,14 @@
+[Unit]
+Description=Load XModMap keyboard map on X display %I
+Documentation=man:xmodmap(1)
+After=X11@%i.target
+Requisite=X11@%i.target
+
+[Service]
+Environment=DISPLAY=%I
+
+Type=oneshot
+ExecStart=-/usr/bin/env xmodmap ${XDG_CONFIG_HOME}/X11/modmap
+
+[Install]
+WantedBy=X11@%i.target
diff --git a/.config/systemd/user/xresources-dpi@.service b/.config/systemd/user/xresources-dpi@.service
new file mode 100644
index 0000000..82f2096
--- /dev/null
+++ b/.config/systemd/user/xresources-dpi@.service
@@ -0,0 +1,15 @@
+[Unit]
+Description=Set the X Resources DataBase DPI to match the display DPI on X display %I
+Documentation=man:xrdb(1)
+Before=X11@%i.target
+Requisite=X11@%i.target
+Conflicts=xresources@:i.service
+
+[Service]
+Environment=DISPLAY=%I
+
+Type=oneshot
+ExecStart=/usr/bin/env xrdb-set-dpi
+
+[Install]
+WantedBy=X11@%i.target
diff --git a/.config/systemd/user/xresources@.service b/.config/systemd/user/xresources@.service
new file mode 100644
index 0000000..760fd0f
--- /dev/null
+++ b/.config/systemd/user/xresources@.service
@@ -0,0 +1,14 @@
+[Unit]
+Description=Load X Resources DataBase on X display %I
+Documentation=man:xrdb(1)
+Before=X11@%i.target
+Requisite=X11@%i.target
+
+[Service]
+Environment=DISPLAY=%I
+
+Type=oneshot
+ExecStart=/usr/bin/env xrdb -merge ${XDG_CONFIG_HOME}/X11/resources
+
+[Install]
+WantedBy=X11@%i.target
diff --git a/.config/wmii-hg/config.sh b/.config/wmii-hg/config.sh
index 4b968b0..77d813f 100644
--- a/.config/wmii-hg/config.sh
+++ b/.config/wmii-hg/config.sh
@@ -229,9 +229,9 @@ Key() {
$MODKEY-x) ## Open program menu
local command
command="$(path_ls "$_PATH" | wimenu -h "${HIST}.progs" -n 5000)" || return
- ( PATH=$_PATH; unset _PATH NOTIFY_SOCKET; exec $command ) & ;;
+ runcmd "$command" & ;;
$MODKEY-Return) ## Launch a terminal
- ( PATH=$_PATH; unset _PATH NOTIFY_SOCKET; exec x-terminal-emulator ) & ;;
+ runcmd x-terminal-emulator & ;;
## Tag actions
$MODKEY-t) ## Change to another tag
@@ -246,6 +246,15 @@ Key() {
esac
}
+runcmd() (
+ PATH=$_PATH
+ unset NOTIFY_SOCKET # systemd
+ unset WMII_CONFPATH # wmii
+ unset _PATH WMII_NAMESPACE WMII_DIR # wmiirc
+ exec 8>&- # xinit/systemd handshake
+ exec systemd-run --user --scope -- sh -c "$*"
+)
+
Action() {
local prog=$(path_which "$WMII_CONFPATH" "$1"); shift
if [ -n "$prog" ]; then
diff --git a/.config/wmii-hg/include.sh b/.config/wmii-hg/include.sh
index f8c4e0d..788e2af 100644
--- a/.config/wmii-hg/include.sh
+++ b/.config/wmii-hg/include.sh
@@ -8,8 +8,9 @@ if [[ -z "$WMII_NAMESPACE" ]]; then
export WMII_NAMESPACE="$(wmiir namespace)"
fi
if [[ -z "$WMII_DIR" ]]; then
- export WMII_DIR="${XDG_RUNTIME_DIR}/n/wmii${DISPLAY}"
+ export WMII_DIR="${XDG_RUNTIME_DIR}/wmii${DISPLAY}"
fi
+. workarounds.sh
. util.sh
. config.sh
diff --git a/.config/wmii-hg/quit b/.config/wmii-hg/quit
index b34a913..58d4db0 100755
--- a/.config/wmii-hg/quit
+++ b/.config/wmii-hg/quit
@@ -1,6 +1,6 @@
#!/usr/bin/env bash
if type systemctl &>/dev/null; then
- systemctl --user stop "wmii@$DISPLAY.service"
+ systemctl --user stop "wmii@$(systemd-escape -- "$DISPLAY").service"
else
. include.sh
echo quit >> $WMII_DIR/ctl
diff --git a/.config/wmii-hg/rbar.sh b/.config/wmii-hg/rbar.sh
index 287f427..cf256dd 100644
--- a/.config/wmii-hg/rbar.sh
+++ b/.config/wmii-hg/rbar.sh
@@ -5,11 +5,11 @@ if [[ -z "$XDG_RUNTIME_DIR" ]]; then
fi
setup_trap() {
- trap "rm -f -- \"\${XDG_RUNTIME_DIR}\"/n/wmii*/rbar/${1}" EXIT
+ trap "rm -f -- \"\${XDG_RUNTIME_DIR}\"/wmii*/rbar/${1}" EXIT
}
write() {
- local dirs=("${XDG_RUNTIME_DIR}"/n/wmii*/rbar/)
+ local dirs=("${XDG_RUNTIME_DIR}"/wmii*/rbar/)
sponge|tee -a "${dirs[@]/%/${1}}" > /dev/null
}
diff --git a/.config/wmii-hg/rules b/.config/wmii-hg/rules
index 6334a7c..65f8339 100644
--- a/.config/wmii-hg/rules
+++ b/.config/wmii-hg/rules
@@ -4,4 +4,5 @@
/^FLTK:FLTK:/ floating=always
/Emacs|Navigator/ force-tags=+sel floating=never
+/^Eclipse:Eclipse:/ floating=never
/.*/ floating=off
diff --git a/.config/wmii-hg/term b/.config/wmii-hg/term
new file mode 100755
index 0000000..4ba9d29
--- /dev/null
+++ b/.config/wmii-hg/term
@@ -0,0 +1,3 @@
+#!/usr/bin/env bash
+. include.sh
+exec urxvt \ No newline at end of file
diff --git a/.config/wmii-hg/wmiirc b/.config/wmii-hg/wmiirc
index 379de79..a66d3d9 100755
--- a/.config/wmii-hg/wmiirc
+++ b/.config/wmii-hg/wmiirc
@@ -12,9 +12,7 @@ fi
wmiir xwrite /event WmiircQuit # close any existing wmiirc's
Event WmiircStart
-# Notify systemd that we're ready
-systemd-notify READY=1 || true
-
+systemd-notify --ready || true
trap "Event Quit" EXIT
while read -r event; do
diff --git a/.config/wmii-hg/workarounds.sh b/.config/wmii-hg/workarounds.sh
new file mode 100644
index 0000000..b3d50fe
--- /dev/null
+++ b/.config/wmii-hg/workarounds.sh
@@ -0,0 +1,42 @@
+#!/hint/bash
+
+##
+# Just like systemd-notify(1), but slower, which is a shitty
+# workaround for a race condition in systemd.
+##
+systemd-notify() {
+ local args
+ args="$(getopt -n systemd-notify -o h -l help,version,ready,pid::,status:,booted -- "$@")"
+ ret=$?; [[ $ret == 0 ]] || return $ret
+ eval set -- "$args"
+
+ local arg_ready=false
+ local arg_pid=0
+ local arg_status=
+ while [[ $# -gt 0 ]]; do
+ case "$1" in
+ -h|--help) command systemd-notify --help; return $?;;
+ --version) command systemd-notify --version; return $?;;
+ --ready) arg_ready=true; shift 1;;
+ --pid) arg_pid=${2:-$$}; shift 2;;
+ --status) arg_status=$2; shift 2;;
+ --booted) command systemd-notify --booted; return $?;;
+ --) shift 1; break;;
+ esac
+ done
+
+ local our_env=()
+ if $arg_ready; then
+ our_env+=("READY=1")
+ fi
+ if [[ -n "$arg_status" ]]; then
+ our_env+=("STATUS=$arg_status")
+ fi
+ if [[ "$arg_pid" -gt 0 ]]; then
+ our_env+=("MAINPID=$arg_pid")
+ fi
+ our_env+=("$@")
+ local n
+ printf -v n '%s\n' "${our_env[@]}"
+ socat STDIO UNIX-SENDTO:"$NOTIFY_SOCKET" <<<"$n"
+}
diff --git a/.local/bin/systemd-import-profile b/.local/bin/systemd-import-profile
new file mode 100755
index 0000000..c896e31
--- /dev/null
+++ b/.local/bin/systemd-import-profile
@@ -0,0 +1,9 @@
+#!/bin/sh
+. ~/.profile
+vars=$(declare -x -p | sed -rn 's/^declare -x ([^=]+)(=.*)?$/\1/p' | grep -xFv -e PWD -e OLDPWD -e SHLVL)
+if test "$1" = '-p'; then
+ declare -p $vars
+ echo systemctl --user import-environment $vars
+else
+ systemctl --user import-environment $vars
+fi
diff --git a/.local/bin/xrdb-set-dpi b/.local/bin/xrdb-set-dpi
new file mode 100755
index 0000000..2a6b055
--- /dev/null
+++ b/.local/bin/xrdb-set-dpi
@@ -0,0 +1,4 @@
+#!/usr/bin/env bash
+
+dpi=$(LC_ALL=C DISPLAY=:0 xdpyinfo|sed -rn 's/^\s*resolution:\s*(.*) dots per inch$/\1/p')
+xrdb -merge <<<"Xft.dpi: ${dpi}"