From 4b4a1f35dc73546de7dbb87a2bde338535ee22c3 Mon Sep 17 00:00:00 2001 From: Luke Shumaker Date: Sun, 4 Oct 2015 15:34:06 -0400 Subject: emacs: fix typos in comments --- .config/emacs/init.el | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.config/emacs/init.el b/.config/emacs/init.el index e0e39d4..fe2400d 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 @@ -116,7 +116,7 @@ (: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) -- cgit v1.2.3 From c9daeaee779e50ed84b03a34914ebf940aa7993c Mon Sep 17 00:00:00 2001 From: Luke Shumaker Date: Sat, 12 Dec 2015 16:47:45 -0500 Subject: bash: alias mv='mv -i' --- .config/bash/rc.d/10_aliases.sh | 1 + 1 file changed, 1 insertion(+) diff --git a/.config/bash/rc.d/10_aliases.sh b/.config/bash/rc.d/10_aliases.sh index 758c069..d6a1ab3 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 # -- cgit v1.2.3 From 771d5a041a48b4ebf2c5ee8ff2fc98834a613843 Mon Sep 17 00:00:00 2001 From: Luke Shumaker Date: Sat, 12 Dec 2015 16:48:02 -0500 Subject: bash: improve the mvln function --- .config/bash/rc.d/10_aliases.sh | 16 ++++++++++++---- 1 file changed, 12 insertions(+), 4 deletions(-) diff --git a/.config/bash/rc.d/10_aliases.sh b/.config/bash/rc.d/10_aliases.sh index d6a1ab3..f34230b 100644 --- a/.config/bash/rc.d/10_aliases.sh +++ b/.config/bash/rc.d/10_aliases.sh @@ -82,15 +82,23 @@ 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 } jarls() { -- cgit v1.2.3 From 2ae901c981b699f7a8607a5ea6f6790ccbb0adb8 Mon Sep 17 00:00:00 2001 From: Luke Shumaker Date: Sat, 12 Dec 2015 17:22:17 -0500 Subject: emacs: stuff --- .config/emacs/custom.el | 3 ++- .config/emacs/init.el | 3 +++ 2 files changed, 5 insertions(+), 1 deletion(-) 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 fe2400d..f1650a4 100644 --- a/.config/emacs/init.el +++ b/.config/emacs/init.el @@ -111,6 +111,7 @@ (: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) @@ -138,6 +139,8 @@ graphviz-dot-mode haml-mode markdown-mode + yaml-mode + mediawiki nginx-mode php-mode-improved scss-mode -- cgit v1.2.3 From d69957eb815987ab1f96b7b8ef43d3d5df69d1e4 Mon Sep 17 00:00:00 2001 From: Luke Shumaker Date: Sat, 12 Dec 2015 17:17:27 -0500 Subject: libreoffice: use GTK-2 theme --- .config/login.d/10_libreoffice.sh | 4 ++++ 1 file changed, 4 insertions(+) create mode 100644 .config/login.d/10_libreoffice.sh 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 -- cgit v1.2.3 From b29a4ce1e8256987e195c710a76bb529644ed46f Mon Sep 17 00:00:00 2001 From: Luke Shumaker Date: Mon, 7 Dec 2015 00:39:22 -0500 Subject: tidy (generic) --- .config/login.d/10_gpg.sh | 2 +- .config/login.d/90_dot-runtime.sh | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) 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/90_dot-runtime.sh b/.config/login.d/90_dot-runtime.sh index cb0b7f2..9aefa59 100644 --- a/.config/login.d/90_dot-runtime.sh +++ b/.config/login.d/90_dot-runtime.sh @@ -1,3 +1,4 @@ +#!/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 -- cgit v1.2.3 From bde70052c4b05b9ecc19b17f03bcff348bfc354a Mon Sep 17 00:00:00 2001 From: Luke Shumaker Date: Sat, 12 Dec 2015 17:27:17 -0500 Subject: shorten ~/.runtime to ~/.r --- .config/login.d/90_dot-runtime.sh | 6 +++--- .config/ssh/config | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/.config/login.d/90_dot-runtime.sh b/.config/login.d/90_dot-runtime.sh index 9aefa59..9536fb4 100644 --- a/.config/login.d/90_dot-runtime.sh +++ b/.config/login.d/90_dot-runtime.sh @@ -1,9 +1,9 @@ #!/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" + ln -sfT -- "$XDG_RUNTIME_DIR" ~/.r/"$HOSTNAME" else - ln -sfT -- /tmp ~/.runtime/"$HOSTNAME" + ln -sfT -- /tmp ~/.r/"$HOSTNAME" fi diff --git a/.config/ssh/config b/.config/ssh/config index f651513..a243c5d 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 ################################################### -- cgit v1.2.3 From 259b88d6f8df12ff737257a4ef0a3ab23ab2bdb9 Mon Sep 17 00:00:00 2001 From: Luke Shumaker Date: Thu, 10 Dec 2015 21:12:08 -0500 Subject: git: ignore NFS lock files --- .config/git/ignore | 1 + 1 file changed, 1 insertion(+) 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* -- cgit v1.2.3 From 21bb3f7fb1111d8b1043ff4c3a1d821042a8e4c6 Mon Sep 17 00:00:00 2001 From: Luke Shumaker Date: Thu, 10 Dec 2015 21:14:23 -0500 Subject: XDG_RUNTIME_DIR: "Recent" Linux kernels support flock over NFS. And Purdue seems to have enabled that. --- .config/login.d/02_xdg_runtime_dir.sh | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/.config/login.d/02_xdg_runtime_dir.sh b/.config/login.d/02_xdg_runtime_dir.sh index 6e3e4ad..86f1232 100644 --- a/.config/login.d/02_xdg_runtime_dir.sh +++ b/.config/login.d/02_xdg_runtime_dir.sh @@ -1,12 +1,11 @@ #!/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" + export XDG_RUNTIME_DIR="$XDG_CACHE_HOME/xdg-runtime-dir/$HOSTNAME.dir" + if ! [ /dev/fd/7 -ef "$XDG_CACHE_HOME/xdg-runtime-dir/$HOSTNAME.lock" ]; then + mkdir -p -- "$XDG_CACHE_HOME/xdg-runtime-dir" + exec 7>"$XDG_CACHE_HOME/xdg-runtime-dir/$HOSTNAME.lock" if flock -xn 7; then if [ ! -d "$XDG_RUNTIME_DIR" ]; then local tmp="$(mktemp -d --tmpdir -- "${USER}@${HOSTNAME}-runtime.XXXXXXXXXX")" @@ -19,9 +18,9 @@ if [ -z "$XDG_RUNTIME_DIR" ] && type flock &>/dev/null; then 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")" + rm -f -- "$XDG_RUNTIME_DIR" fi } _diy_xdg_runtime_login -- cgit v1.2.3 From c2ee55d77f093d7a5abf8118870900b866dbba52 Mon Sep 17 00:00:00 2001 From: Luke Shumaker Date: Sat, 27 Feb 2016 20:05:40 -0500 Subject: stuff --- .config/bash/rc.d/10_aliases.sh | 18 ++++++++++++++++++ .config/login.d/02_xdg_runtime_dir.sh | 27 --------------------------- .config/login.d/90_dot-runtime.sh | 2 -- .config/ssh/config | 4 ++++ .config/wmii-hg/rules | 1 + 5 files changed, 23 insertions(+), 29 deletions(-) delete mode 100644 .config/login.d/02_xdg_runtime_dir.sh diff --git a/.config/bash/rc.d/10_aliases.sh b/.config/bash/rc.d/10_aliases.sh index f34230b..03ece7e 100644 --- a/.config/bash/rc.d/10_aliases.sh +++ b/.config/bash/rc.d/10_aliases.sh @@ -101,6 +101,24 @@ mvln() { 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() { jar tf "$1" | sed -n 's/\.class$//p' | 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 86f1232..0000000 --- a/.config/login.d/02_xdg_runtime_dir.sh +++ /dev/null @@ -1,27 +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.dir" - if ! [ /dev/fd/7 -ef "$XDG_CACHE_HOME/xdg-runtime-dir/$HOSTNAME.lock" ]; then - mkdir -p -- "$XDG_CACHE_HOME/xdg-runtime-dir" - exec 7>"$XDG_CACHE_HOME/xdg-runtime-dir/$HOSTNAME.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() { - if flock -xn 7; then - rm -rf -- "$(readlink "$XDG_RUNTIME_DIR")" - rm -f -- "$XDG_RUNTIME_DIR" - fi - } - _diy_xdg_runtime_login -fi diff --git a/.config/login.d/90_dot-runtime.sh b/.config/login.d/90_dot-runtime.sh index 9536fb4..bf0ddcc 100644 --- a/.config/login.d/90_dot-runtime.sh +++ b/.config/login.d/90_dot-runtime.sh @@ -4,6 +4,4 @@ mkdir -p -- ~/.r if [ -n "$XDG_RUNTIME_DIR" ]; then ln -sfT -- "$XDG_RUNTIME_DIR" ~/.r/"$HOSTNAME" -else - ln -sfT -- /tmp ~/.r/"$HOSTNAME" fi diff --git a/.config/ssh/config b/.config/ssh/config index a243c5d..19ed217 100644 --- a/.config/ssh/config +++ b/.config/ssh/config @@ -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/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 -- cgit v1.2.3 From 5e5e5029e76d88b3887bb175e28709a9022323a8 Mon Sep 17 00:00:00 2001 From: Luke Shumaker Date: Sat, 27 Feb 2016 18:31:31 -0500 Subject: X11 systemd stuff --- .config/X11/clientrc | 14 ++++++-- .config/X11/defaults | 25 ------------- .config/X11/resources | 25 +++++++++++++ .config/symlinks | 1 - .config/systemd/user/X11@.target | 2 ++ .../user/X11@.target.requires/wmii@.service | 1 + .config/systemd/user/dunst@.service | 7 ++-- .config/systemd/user/emacs-daemon.service | 1 + .config/systemd/user/lxpanel@.service | 8 +++-- .config/systemd/user/panel@.target | 4 ++- .config/systemd/user/redshift@.service | 7 ++-- .config/systemd/user/synergy@.service | 8 +++-- .config/systemd/user/wm-running@.target | 2 ++ .../user/wm-running@.target.requires/wmii@.service | 1 + .config/systemd/user/wm@.target | 2 -- .../systemd/user/wm@.target.requires/wmii@.service | 1 - .config/systemd/user/wmii@.service | 10 +++--- .config/systemd/user/x0vncserver@.service | 5 +-- .config/systemd/user/xcompmgr@.service | 6 ++-- .config/wmii-hg/config.sh | 13 +++++-- .config/wmii-hg/include.sh | 3 +- .config/wmii-hg/rbar.sh | 4 +-- .config/wmii-hg/term | 3 ++ .config/wmii-hg/wmiirc | 4 +-- .config/wmii-hg/workarounds.sh | 42 ++++++++++++++++++++++ 25 files changed, 139 insertions(+), 60 deletions(-) delete mode 100644 .config/X11/defaults create mode 100644 .config/X11/resources create mode 100644 .config/systemd/user/X11@.target create mode 120000 .config/systemd/user/X11@.target.requires/wmii@.service create mode 100644 .config/systemd/user/wm-running@.target create mode 120000 .config/systemd/user/wm-running@.target.requires/wmii@.service delete mode 100644 .config/systemd/user/wm@.target delete mode 120000 .config/systemd/user/wm@.target.requires/wmii@.service create mode 100755 .config/wmii-hg/term create mode 100644 .config/wmii-hg/workarounds.sh diff --git a/.config/X11/clientrc b/.config/X11/clientrc index bc68ed6..e280f8d 100644 --- a/.config/X11/clientrc +++ b/.config/X11/clientrc @@ -17,14 +17,24 @@ if [ -f "$usermodmap" ]; then xmodmap "$usermodmap" fi +dpi=$(LC_ALL=C DISPLAY=:0 xdpyinfo|sed -rn 's/^\s*resolution:\s*(.*) dots per inch$/\1/p') +xrdb -merge <<<"Xft.dpi: ${dpi}" + +userresources="$XDG_CONFIG_HOME/X11/resources" +if [ -f "$userresources" ]; then + xrdb -merge "$userresources" +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/defaults deleted file mode 100644 index fca1914..0000000 --- a/.config/X11/defaults +++ /dev/null @@ -1,25 +0,0 @@ -! -*- Mode: Conf-xdefaults -*- - -! "native" colors -!URxvt.background: #000000 -!URxvt.foreground: #CCCCCC -! Tango-dark -URxvt.background: #2E3436 -URxvt.foreground: #EEEEEC -URxvt.color4: #729FCF -URxvt.color12: #729FCF - -URxvt.scrollstyle: plain -URxvt.scrollBar_floating: true - -URxvt.font: xft:Monospace-8 -URxvt.cursorBlink: true -URxvt.pastableTabs: true - -URxvt.scrollTtyOutput: false -URxvt.scrollTtyKeypress: false -URxvt.scrollWithBuffer: true - -URxvt.perl-ext-common: default,matcher -URxvt.url-launcher: v-www-browser -URxvt.matcher.button: 1 diff --git a/.config/X11/resources b/.config/X11/resources new file mode 100644 index 0000000..fca1914 --- /dev/null +++ b/.config/X11/resources @@ -0,0 +1,25 @@ +! -*- Mode: Conf-xdefaults -*- + +! "native" colors +!URxvt.background: #000000 +!URxvt.foreground: #CCCCCC +! Tango-dark +URxvt.background: #2E3436 +URxvt.foreground: #EEEEEC +URxvt.color4: #729FCF +URxvt.color12: #729FCF + +URxvt.scrollstyle: plain +URxvt.scrollBar_floating: true + +URxvt.font: xft:Monospace-8 +URxvt.cursorBlink: true +URxvt.pastableTabs: true + +URxvt.scrollTtyOutput: false +URxvt.scrollTtyKeypress: false +URxvt.scrollWithBuffer: true + +URxvt.perl-ext-common: default,matcher +URxvt.url-launcher: v-www-browser +URxvt.matcher.button: 1 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/X11@.target.requires/wmii@.service b/.config/systemd/user/X11@.target.requires/wmii@.service new file mode 120000 index 0000000..1b202d2 --- /dev/null +++ b/.config/systemd/user/X11@.target.requires/wmii@.service @@ -0,0 +1 @@ +../wmii@.service \ No newline at end of file diff --git a/.config/systemd/user/dunst@.service b/.config/systemd/user/dunst@.service index 568af3f..265845b 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 + +Type=simple ExecStart=/usr/bin/dunst -Restart=always diff --git a/.config/systemd/user/emacs-daemon.service b/.config/systemd/user/emacs-daemon.service index 4077e97..eaf6729 100644 --- a/.config/systemd/user/emacs-daemon.service +++ b/.config/systemd/user/emacs-daemon.service @@ -5,6 +5,7 @@ Description=Emacs deamon Type=forking ExecStart=/bin/bash -l -c 'emacs --daemon' ExecStop=/bin/bash -l -c 'emacsclient -a false -e "(kill-emacs)"' +Restart=always [Install] WantedBy=default.target diff --git a/.config/systemd/user/lxpanel@.service b/.config/systemd/user/lxpanel@.service index ecded87..3a0dc67 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 + +Type=simple ExecStart=/usr/bin/lxpanel -Restart=always [Install] RequiredBy=panel@%i.target 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/redshift@.service b/.config/systemd/user/redshift@.service index b4ef3bb..dff6e7b 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 + +Type=simple ExecStart=/usr/bin/redshift ExecStopPost=/usr/bin/redshift -x -Restart=always diff --git a/.config/systemd/user/synergy@.service b/.config/systemd/user/synergy@.service index df0640a..dc15e58 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 + +Type=simple ExecStart=/usr/bin/synergy -Restart=always 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/wm@.target.requires/wmii@.service b/.config/systemd/user/wm@.target.requires/wmii@.service deleted file mode 120000 index 1b202d2..0000000 --- a/.config/systemd/user/wm@.target.requires/wmii@.service +++ /dev/null @@ -1 +0,0 @@ -../wmii@.service \ No newline at end of file diff --git a/.config/systemd/user/wmii@.service b/.config/systemd/user/wmii@.service index 4a81e3f..f1e87df 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 [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..4a995f6 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 diff --git a/.config/systemd/user/xcompmgr@.service b/.config/systemd/user/xcompmgr@.service index 85decd2..6d80218 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 + +Type=simple ExecStart=/usr/bin/xcompmgr -Restart=always 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/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/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" +} -- cgit v1.2.3 From 65cb251ba9d9203056c3c71e49576d7bd7e36069 Mon Sep 17 00:00:00 2001 From: Luke Shumaker Date: Sat, 27 Feb 2016 20:02:10 -0500 Subject: more systemd/x11 stuff --- .config/X11/clientrc | 25 ---------------------- .config/cron/make-config | 2 +- .../user/X11@.target.wants/xmodmap@.service | 1 + .../user/X11@.target.wants/xresources-dpi@.service | 1 + .../user/X11@.target.wants/xresources@.service | 1 + .../user/basic.target.wants/import-profile.service | 1 + .config/systemd/user/dunst@.service | 2 +- .config/systemd/user/emacs-daemon.service | 4 ++-- .config/systemd/user/import-profile.service | 11 ++++++++++ .config/systemd/user/lxpanel@.service | 2 +- .config/systemd/user/maildirproc@.service | 2 +- .config/systemd/user/rbar@.service | 2 +- .config/systemd/user/redshift@.service | 4 ++-- .config/systemd/user/synergy@.service | 2 +- .config/systemd/user/vncserver@.service | 2 +- .config/systemd/user/wmii@.service | 4 ++-- .config/systemd/user/x0vncserver@.service | 2 +- .config/systemd/user/xcompmgr@.service | 2 +- .config/systemd/user/xmodmap@.service | 14 ++++++++++++ .config/systemd/user/xresources-dpi@.service | 15 +++++++++++++ .config/systemd/user/xresources@.service | 14 ++++++++++++ .config/wmii-hg/quit | 2 +- .local/bin/systemd-import-profile | 9 ++++++++ .local/bin/xrdb-set-dpi | 4 ++++ 24 files changed, 87 insertions(+), 41 deletions(-) create mode 120000 .config/systemd/user/X11@.target.wants/xmodmap@.service create mode 120000 .config/systemd/user/X11@.target.wants/xresources-dpi@.service create mode 120000 .config/systemd/user/X11@.target.wants/xresources@.service create mode 120000 .config/systemd/user/basic.target.wants/import-profile.service create mode 100644 .config/systemd/user/import-profile.service create mode 100644 .config/systemd/user/xmodmap@.service create mode 100644 .config/systemd/user/xresources-dpi@.service create mode 100644 .config/systemd/user/xresources@.service create mode 100755 .local/bin/systemd-import-profile create mode 100755 .local/bin/xrdb-set-dpi diff --git a/.config/X11/clientrc b/.config/X11/clientrc index e280f8d..5ffdd97 100644 --- a/.config/X11/clientrc +++ b/.config/X11/clientrc @@ -1,30 +1,5 @@ #!/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 - -dpi=$(LC_ALL=C DISPLAY=:0 xdpyinfo|sed -rn 's/^\s*resolution:\s*(.*) dots per inch$/\1/p') -xrdb -merge <<<"Xft.dpi: ${dpi}" - -userresources="$XDG_CONFIG_HOME/X11/resources" -if [ -f "$userresources" ]; then - xrdb -merge "$userresources" -fi - if [ -z "$XDG_RUNTIME_DIR" ]; then printf "XDG_RUNTIME_DIR isn't set\n" >&2 exit 6 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/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 265845b..74d2447 100644 --- a/.config/systemd/user/dunst@.service +++ b/.config/systemd/user/dunst@.service @@ -8,4 +8,4 @@ Requisite=X11@%i.target Environment=DISPLAY=%I Type=simple -ExecStart=/usr/bin/dunst +ExecStart=/usr/bin/env dunst diff --git a/.config/systemd/user/emacs-daemon.service b/.config/systemd/user/emacs-daemon.service index eaf6729..3869d75 100644 --- a/.config/systemd/user/emacs-daemon.service +++ b/.config/systemd/user/emacs-daemon.service @@ -3,8 +3,8 @@ 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] 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 3a0dc67..76df925 100644 --- a/.config/systemd/user/lxpanel@.service +++ b/.config/systemd/user/lxpanel@.service @@ -11,7 +11,7 @@ Before=panel@%i.target Environment=DISPLAY=%I Type=simple -ExecStart=/usr/bin/lxpanel +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/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 dff6e7b..fda41d6 100644 --- a/.config/systemd/user/redshift@.service +++ b/.config/systemd/user/redshift@.service @@ -8,5 +8,5 @@ Requisite=X11@%i.target Environment=DISPLAY=%I Type=simple -ExecStart=/usr/bin/redshift -ExecStopPost=/usr/bin/redshift -x +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 dc15e58..c045749 100644 --- a/.config/systemd/user/synergy@.service +++ b/.config/systemd/user/synergy@.service @@ -9,4 +9,4 @@ Requires=panel@%i.target Environment=DISPLAY=%I Type=simple -ExecStart=/usr/bin/synergy +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/wmii@.service b/.config/systemd/user/wmii@.service index f1e87df..c939221 100644 --- a/.config/systemd/user/wmii@.service +++ b/.config/systemd/user/wmii@.service @@ -12,8 +12,8 @@ Environment=DISPLAY=%I Type=notify NotifyAccess=all -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=X11@%i.target diff --git a/.config/systemd/user/x0vncserver@.service b/.config/systemd/user/x0vncserver@.service index 4a995f6..1582f42 100644 --- a/.config/systemd/user/x0vncserver@.service +++ b/.config/systemd/user/x0vncserver@.service @@ -7,4 +7,4 @@ Requisite=X11@%i.target [Service] Type=simple -ExecStart=/usr/bin/x0vncserver display=%I PasswordFile=%h/.vnc/passwd +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 6d80218..c3d98d4 100644 --- a/.config/systemd/user/xcompmgr@.service +++ b/.config/systemd/user/xcompmgr@.service @@ -9,4 +9,4 @@ Requisite=X11@%i.target Environment=DISPLAY=%I Type=simple -ExecStart=/usr/bin/xcompmgr +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/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/.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}" -- cgit v1.2.3 From d09fa8687ee01dcb4ef540deb106b8531f56b403 Mon Sep 17 00:00:00 2001 From: Luke Shumaker Date: Sat, 27 Feb 2016 20:02:30 -0500 Subject: login.d/00_path.sh: don't leak temporary variables --- .config/login.d/00_path.sh | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) 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[@]}" +)" -- cgit v1.2.3