From b780c946dc5d61cd00988a62aa281155ffb89363 Mon Sep 17 00:00:00 2001 From: Luke Shumaker Date: Thu, 11 Jun 2015 09:05:31 -0600 Subject: fix XDG_RUNTIME_DIR management --- .config/login.d/02_xdg_runtime_dir.sh | 17 +++++++++-------- .config/login.d/90_dot-runtime.sh | 4 ++++ .config/login.d/90_symlink_xdg_runtime_dir.sh | 7 ------- .config/symlinks | 2 -- 4 files changed, 13 insertions(+), 17 deletions(-) create mode 100644 .config/login.d/90_dot-runtime.sh delete mode 100644 .config/login.d/90_symlink_xdg_runtime_dir.sh (limited to '.config') diff --git a/.config/login.d/02_xdg_runtime_dir.sh b/.config/login.d/02_xdg_runtime_dir.sh index 6700669..864eadd 100644 --- a/.config/login.d/02_xdg_runtime_dir.sh +++ b/.config/login.d/02_xdg_runtime_dir.sh @@ -4,22 +4,23 @@ if [ -z "$XDG_RUNTIME_DIR" ] && shopt -q login_shell && type flock &>/dev/null; then _diy_xdg_runtime_login() { export XDG_RUNTIME_DIR="$XDG_CACHE_HOME/xdg-runtime-dir/$HOSTNAME" - # There's a race condition here, between the `ln -s` and `flock`. - # But it's not like I'll be hammering a box with logins. - if [ ! -d "$XDG_RUNTIME_DIR" ]; then - local tmp="$(mktemp -d --tmpdir -- "${USER}@${HOSTNAME}-runtime.XXXXXXXXXX")" - mkdir -p -- "$XDG_CACHE_HOME/xdg-runtime-dir" - ln -sfT -- "$tmp" "$XDG_RUNTIME_DIR" - fi if ! [ /dev/fd/7 -ef "$XDG_CACHE_HOME/xdg-runtime-dir/.lock" ]; then exec 7>"$XDG_CACHE_HOME/xdg-runtime-dir/.lock" - if flock -sn 7; then + if flock -xn 7; then + if [ ! -d "$XDG_RUNTIME_DIR" ]; then + local tmp="$(mktemp -d --tmpdir -- "${USER}@${HOSTNAME}-runtime.XXXXXXXXXX")" + mkdir -p -- "$XDG_CACHE_HOME/xdg-runtime-dir" + 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>&- + exec 7>"$XDG_CACHE_HOME/xdg-runtime-dir/.lock" if flock -xn 7; then rm -rf -- "$(readlink "$XDG_RUNTIME_DIR")" fi diff --git a/.config/login.d/90_dot-runtime.sh b/.config/login.d/90_dot-runtime.sh new file mode 100644 index 0000000..d06568f --- /dev/null +++ b/.config/login.d/90_dot-runtime.sh @@ -0,0 +1,4 @@ +# 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 +ln -sfT -- "$XDG_RUNTIME_DIR" ~/.runtime/"$HOSTNAME" diff --git a/.config/login.d/90_symlink_xdg_runtime_dir.sh b/.config/login.d/90_symlink_xdg_runtime_dir.sh deleted file mode 100644 index 7ee4bba..0000000 --- a/.config/login.d/90_symlink_xdg_runtime_dir.sh +++ /dev/null @@ -1,7 +0,0 @@ -#!/hint/sh -# This is really only needed for ssh ControlPath; as I don't have a -# way to communicate XDG_RUNTIME_DIR -if [ -n "$XDG_RUNTIME_DIR" ]; then - mkdir -p -- "$XDG_CACHE_HOME/xdg-runtime-dir" - ln -sfT -- "$XDG_RUNTIME_DIR" "$XDG_CACHE_HOME/xdg-runtime-dir/$HOSTNAME" -fi diff --git a/.config/symlinks b/.config/symlinks index 80cffc1..9896e0c 100644 --- a/.config/symlinks +++ b/.config/symlinks @@ -44,8 +44,6 @@ # .maildirproc is not used, but must exist /tmp/ .maildirproc -# There's a silly maximum length on Domain Sockets, so alias -.cache/xdg-runtime-dir/ .runtime # KDE .config/ .kde/share/apps # -- cgit v1.2.3-54-g00ecf From ad70cc9c05bda02de3bd06c910cec54863e8c024 Mon Sep 17 00:00:00 2001 From: Luke Shumaker Date: Thu, 11 Jun 2015 09:05:48 -0600 Subject: Don't put CPAN in .config --- .config/symlinks | 1 - 1 file changed, 1 deletion(-) (limited to '.config') diff --git a/.config/symlinks b/.config/symlinks index 9896e0c..c99afba 100644 --- a/.config/symlinks +++ b/.config/symlinks @@ -31,7 +31,6 @@ # Directories .config/arduino/ .arduino .config/bazaar/ .bazaar -.config/cpan/ .cpan .config/emacs/ .emacs.d .config/icons/ .icons .config/mozilla/ .mozilla # -- cgit v1.2.3-54-g00ecf From dd24df5f3765e0771d91892824298349c367fddb Mon Sep 17 00:00:00 2001 From: Luke Shumaker Date: Thu, 11 Jun 2015 09:08:29 -0600 Subject: set MAKEFLAGS to -j$(nproc) on login --- .config/login.d/10_makeflags.sh | 2 ++ 1 file changed, 2 insertions(+) create mode 100644 .config/login.d/10_makeflags.sh (limited to '.config') diff --git a/.config/login.d/10_makeflags.sh b/.config/login.d/10_makeflags.sh new file mode 100644 index 0000000..671c6d3 --- /dev/null +++ b/.config/login.d/10_makeflags.sh @@ -0,0 +1,2 @@ +#!/hint/sh +export MAKEFLAGS="-j$(nproc)" -- cgit v1.2.3-54-g00ecf From f97389c74b4642da8a8c313a48e907e014a6ed50 Mon Sep 17 00:00:00 2001 From: Luke Shumaker Date: Sun, 19 Jul 2015 19:10:14 -0600 Subject: cron/make-config: use moreutils chronic --- .config/cron/make-config | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to '.config') diff --git a/.config/cron/make-config b/.config/cron/make-config index 6a7e9d6..a4a3480 100644 --- a/.config/cron/make-config +++ b/.config/cron/make-config @@ -1,2 +1,2 @@ #m h dom mon dow command -*/5 * * * * cronic make -C ~/.config +*/5 * * * * chronic make -C ~/.config -- cgit v1.2.3-54-g00ecf From 369f1aeccf80323edddde34b4a5f3cd7d5234432 Mon Sep 17 00:00:00 2001 From: Luke Shumaker Date: Sun, 19 Jul 2015 19:10:43 -0600 Subject: ssh: recognize moore$N as Purdue boxes --- .config/ssh/config | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to '.config') diff --git a/.config/ssh/config b/.config/ssh/config index 8649e61..dc32703 100644 --- a/.config/ssh/config +++ b/.config/ssh/config @@ -6,7 +6,7 @@ Host * # Purdue ################################################### -Host data lore borg?? xinu?? sac?? sslab?? +Host data lore borg?? xinu?? sac?? sslab?? moore?? HostName %h.cs.purdue.edu User shumakl Host *.cs.purdue.edu -- cgit v1.2.3-54-g00ecf From bcdc8591d20f23e3f4a1645a7ccfc473b2916c3e Mon Sep 17 00:00:00 2001 From: Luke Shumaker Date: Wed, 22 Apr 2015 16:19:24 -0400 Subject: X11/clientrc: properly escape $DISPLAY for systemd --- .config/X11/clientrc | 9 +++++---- .config/X11/modmap.new | 4 ++++ 2 files changed, 9 insertions(+), 4 deletions(-) create mode 100644 .config/X11/modmap.new (limited to '.config') diff --git a/.config/X11/clientrc b/.config/X11/clientrc index 88ae527..ac0d5a8 100644 --- a/.config/X11/clientrc +++ b/.config/X11/clientrc @@ -18,9 +18,10 @@ if [ -f "$usermodmap" ]; then fi [ -n "$XDG_RUNTIME_DIR" ] || exit 1 -trap "rm -f $(printf '%q' "${XDG_RUNTIME_DIR}/x11-wm@${DISPLAY}")" EXIT -mkfifo "${XDG_RUNTIME_DIR}/x11-wm@${DISPLAY}" +_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 "wm@${_DISPLAY}.target" & wait diff --git a/.config/X11/modmap.new b/.config/X11/modmap.new new file mode 100644 index 0000000..c902b52 --- /dev/null +++ b/.config/X11/modmap.new @@ -0,0 +1,4 @@ +keycode 135 = Super_R + +clear mod4 +add mod4 = Super_L Super_R Hyper_L Hyper_R Menu -- cgit v1.2.3-54-g00ecf From 93420febe072e47be485fda291e00a41a504e3af Mon Sep 17 00:00:00 2001 From: Luke Shumaker Date: Wed, 22 Apr 2015 16:20:11 -0400 Subject: Update mail filters --- .config/maildirproc/att.rc | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) (limited to '.config') diff --git a/.config/maildirproc/att.rc b/.config/maildirproc/att.rc index 98ef8ae..43cec78 100644 --- a/.config/maildirproc/att.rc +++ b/.config/maildirproc/att.rc @@ -15,10 +15,9 @@ def mailman_domain(mail, domain): """ m = mail["List-Id"].matches("(.*<)?([^<]*)\."+re.escape(domain)) if m: - if mail["Subject"].contains("["+m.group(2)+"]"): - return m.group(2) + return m.group(2) for hdr in [ 'To', 'Cc', 'From' ]: - m = mail[hdr].matches("(\w*)@"+re.escape(domain)) + m = mail[hdr].matches("((\w|-)*)@"+re.escape(domain)) if m: if mail["Subject"].contains("["+m.group(1)+"]"): return m.group(2) @@ -295,6 +294,7 @@ def my_filters(mail): "@core3.amsl.com", "@defectivebydesign.org", "@eff.org", + "@fedorahosted.org", "@foocorp.net", "@fsf.org", "@github.com", @@ -303,6 +303,7 @@ def my_filters(mail): "@gnu.org", "@ietf.org", "@kde.org", + "@lists.fedorahosted.org", "@nongnu.org", "@sourceforge.com", "@thyrsus.com", -- cgit v1.2.3-54-g00ecf From 4fbcd8769a06ddb9e53b7b647c3e1416b8d9962f Mon Sep 17 00:00:00 2001 From: Luke Shumaker Date: Wed, 22 Apr 2015 16:21:08 -0400 Subject: wmii: Use systemd-notify instead of hitting the socket manually --- .config/wmii-hg/config.sh | 4 +--- .config/wmii-hg/wmiirc | 4 +--- 2 files changed, 2 insertions(+), 6 deletions(-) (limited to '.config') diff --git a/.config/wmii-hg/config.sh b/.config/wmii-hg/config.sh index 6846920..4b968b0 100644 --- a/.config/wmii-hg/config.sh +++ b/.config/wmii-hg/config.sh @@ -68,9 +68,7 @@ Event() { ## WMII-meta events Quit) ## No args trap - EXIT - if [ -S "$NOTIFY_SOCKET" ]; then - echo STOPPING=1 | socat STDIO UNIX-SENDTO:"$NOTIFY_SOCKET" - fi + systemd-notify STOPPING=1 || true Event WmiircUnmount Event WmiircQuit;; Warning) ## $@=string diff --git a/.config/wmii-hg/wmiirc b/.config/wmii-hg/wmiirc index 260aaa1..379de79 100755 --- a/.config/wmii-hg/wmiirc +++ b/.config/wmii-hg/wmiirc @@ -13,9 +13,7 @@ wmiir xwrite /event WmiircQuit # close any existing wmiirc's Event WmiircStart # Notify systemd that we're ready -if [ -S "$NOTIFY_SOCKET" ]; then - echo READY=1 | socat STDIO UNIX-SENDTO:"$NOTIFY_SOCKET" -fi +systemd-notify READY=1 || true trap "Event Quit" EXIT -- cgit v1.2.3-54-g00ecf From 3d872ce1c678e5d829d5e324f92b50eef02877fb Mon Sep 17 00:00:00 2001 From: Luke Shumaker Date: Wed, 22 Apr 2015 16:24:55 -0400 Subject: libretools configuration --- .config/libretools/.gitignore | 1 - .config/libretools/libretools.conf | 4 ++++ 2 files changed, 4 insertions(+), 1 deletion(-) delete mode 100644 .config/libretools/.gitignore create mode 100644 .config/libretools/libretools.conf (limited to '.config') diff --git a/.config/libretools/.gitignore b/.config/libretools/.gitignore deleted file mode 100644 index 1881962..0000000 --- a/.config/libretools/.gitignore +++ /dev/null @@ -1 +0,0 @@ -blacklist.txt diff --git a/.config/libretools/libretools.conf b/.config/libretools/libretools.conf new file mode 100644 index 0000000..a2f2c24 --- /dev/null +++ b/.config/libretools/libretools.conf @@ -0,0 +1,4 @@ +HOOKPOSTRELEASE=":" +if [[ -n "${ONLY_ARCH:-}" ]]; then + ARCHES=("$ONLY_ARCH") +fi -- cgit v1.2.3-54-g00ecf From b575e899e72f78a0f810be8fc614b018f6926f6d Mon Sep 17 00:00:00 2001 From: Luke Shumaker Date: Sun, 19 Jul 2015 19:23:39 -0600 Subject: .config/Makefile: better error handling --- .config/Makefile | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) (limited to '.config') diff --git a/.config/Makefile b/.config/Makefile index 94d0cca..ffac989 100644 --- a/.config/Makefile +++ b/.config/Makefile @@ -4,8 +4,8 @@ default: all; @: %: . ~/.profile && $(MAKE) '$@' else -SHELL = /bin/bash +SHELL = /bin/bash -o pipefail GIT_DIR = ${HOME}/.git targets = \ @@ -16,7 +16,8 @@ targets = \ all: $(targets) clean: - rm -f $(targets) + rm -f -- $(targets) +.PHONY: all clean ${HOME}/.folders: ${HOME}/Maildir $(MAKEFILE_LIST) find $< -mindepth 2 -maxdepth 2 \( -type f -name "maildirfolder" -o -type d -name new -o -type d -name tmp -o -type d -name cur \) -printf '%P\0' | xargs -r0 dirname -z -- | sort -zu | xargs -0 printf -- '.%s\n' | grep -vP '^\.FOLDERS.Ham.20(?!15)' > '$@' @@ -40,7 +41,5 @@ ${HOME}/Maildir/%: | ${HOME}/Maildir touch '$@'/maildirfolder .DELETE_ON_ERROR: -.PHONY: FORCE PHONY -FORCE: ; -PHONY: ; +.SECONDARY: endif -- cgit v1.2.3-54-g00ecf From 9211c8a57ec13be6c9ebe0333aa8d3ad65c8cdbe Mon Sep 17 00:00:00 2001 From: Luke Shumaker Date: Sun, 19 Jul 2015 19:24:11 -0600 Subject: Makefile: .folders: recognize symlinks --- .config/Makefile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to '.config') diff --git a/.config/Makefile b/.config/Makefile index ffac989..9ee3115 100644 --- a/.config/Makefile +++ b/.config/Makefile @@ -20,7 +20,7 @@ clean: .PHONY: all clean ${HOME}/.folders: ${HOME}/Maildir $(MAKEFILE_LIST) - find $< -mindepth 2 -maxdepth 2 \( -type f -name "maildirfolder" -o -type d -name new -o -type d -name tmp -o -type d -name cur \) -printf '%P\0' | xargs -r0 dirname -z -- | sort -zu | xargs -0 printf -- '.%s\n' | grep -vP '^\.FOLDERS.Ham.20(?!15)' > '$@' + find -L $< -mindepth 2 -maxdepth 2 \( -type f -name "maildirfolder" -o -type d -name new -o -type d -name tmp -o -type d -name cur \) -printf '%P\0' | xargs -r0 dirname -z -- | sort -zu | xargs -0 printf -- '.%s\n' | grep -vP '^\.FOLDERS.Ham.20(?!15)' > '$@' ${GIT_DIR}/info/exclude: ${HOME}/.git.info.exclude.in $(shell echo .??*/) ( cat $<; find $^ -type f -name 'CACHEDIR.TAG' -printf '%h\n'|sed 's@^\./@/@' ) > $@ -- cgit v1.2.3-54-g00ecf From f58b1d0d6467ee0e0fe460cbc51b507b6ca404f5 Mon Sep 17 00:00:00 2001 From: Luke Shumaker Date: Sun, 19 Jul 2015 19:26:11 -0600 Subject: tidy --- .config/X11/modmap.new | 4 ---- .config/pacman/makepkg.conf | 2 +- 2 files changed, 1 insertion(+), 5 deletions(-) delete mode 100644 .config/X11/modmap.new (limited to '.config') diff --git a/.config/X11/modmap.new b/.config/X11/modmap.new deleted file mode 100644 index c902b52..0000000 --- a/.config/X11/modmap.new +++ /dev/null @@ -1,4 +0,0 @@ -keycode 135 = Super_R - -clear mod4 -add mod4 = Super_L Super_R Hyper_L Hyper_R Menu diff --git a/.config/pacman/makepkg.conf b/.config/pacman/makepkg.conf index 8389fb5..dc3c5ba 100644 --- a/.config/pacman/makepkg.conf +++ b/.config/pacman/makepkg.conf @@ -1,4 +1,4 @@ -#!/phony/bash +#!/hint/bash PKGDEST="${LIBREHOME:-$HOME}/packages/pkgdest" SRCDEST="${LIBREHOME:-$HOME}/packages/srcdest" -- cgit v1.2.3-54-g00ecf From 83431d32040061990874bebd6150eeab80aa0322 Mon Sep 17 00:00:00 2001 From: Luke Shumaker Date: Sun, 19 Jul 2015 19:26:23 -0600 Subject: mail filters --- .config/maildirproc/att.rc | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to '.config') diff --git a/.config/maildirproc/att.rc b/.config/maildirproc/att.rc index 43cec78..792b42c 100644 --- a/.config/maildirproc/att.rc +++ b/.config/maildirproc/att.rc @@ -13,14 +13,14 @@ def mailman_domain(mail, domain): """ Return a string that is the list-name for a mailman domain """ - m = mail["List-Id"].matches("(.*<)?([^<]*)\."+re.escape(domain)) + m = mail["List-Id"].matches("^(.*<|)([^<]*)\."+re.escape(domain)) if m: return m.group(2) for hdr in [ 'To', 'Cc', 'From' ]: m = mail[hdr].matches("((\w|-)*)@"+re.escape(domain)) if m: if mail["Subject"].contains("["+m.group(1)+"]"): - return m.group(2) + return m.group(1) return None def is_to_or_from(mail,address): @@ -96,6 +96,7 @@ def handle_incoming_unknown(mail): or mail["From"].contains("@gandi.net") or mail["From"].contains("@github.com>") or mail["From"].contains("@goodwillindy.org>") + or mail["From"].contains("@kickstarter.com>") or mail["From"].contains("@lpi.org>") or mail["From"].contains("@msdlt.k12.in.us>") or mail["From"].contains("@parabola.nu") -- cgit v1.2.3-54-g00ecf From 4c94dd5c044d3e3456937919e48481d8b3bb00cb Mon Sep 17 00:00:00 2001 From: Luke Shumaker Date: Sun, 19 Jul 2015 19:27:08 -0600 Subject: bash aliases: change mvln --- .config/bash/rc.d/aliases.sh | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) (limited to '.config') diff --git a/.config/bash/rc.d/aliases.sh b/.config/bash/rc.d/aliases.sh index 6b2460e..cd2cfd8 100644 --- a/.config/bash/rc.d/aliases.sh +++ b/.config/bash/rc.d/aliases.sh @@ -46,7 +46,18 @@ alias userctl='systemctl --user' ###################################################################### alias lock="clear; away -C 'This terminal is locked'" alias plock="term-title Terminal Locked;lock" -mvln() { mv $1 $2; ln -s $2 $1; } +mvln() { + if [[ ! -L "$1" ]]; then + libremessages error 'Not a soft link: %s' "$1" + fi + target=$(readlink -f -- "$1") + ln -srT -- "$target" "$2" + if cmp -- "$1" "$2"; then + rm -f -- "$1" + else + libremessages error 'Failed moving link: %s -> %s' "$1" "$2" + fi +} jarls() { jar tf "$1" | sed -n 's/\.class$//p' | LC_ALL=C sort | xargs -r -d $'\n' javap -classpath "$1"; } tarls() { local file; for file in "$@"; do bsdtar tf "$file" | sed "s|^|$file:|"; done; } jarmain() { jarls "$1" 2>/dev/null | grep -E '(^[a-z]|public static void main\(java\.lang\.String\[\]\))' | grep -B1 '^ '; } -- cgit v1.2.3-54-g00ecf