aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTom Ryder <tom@sanctum.geek.nz>2022-05-01 01:02:21 +1200
committerTom Ryder <tom@sanctum.geek.nz>2022-05-01 01:02:21 +1200
commit888e989e0d6aa79e6d7fd8a4da19bf4891655db0 (patch)
treebaec7f937db9298028806278b78f3d3d1262685a
parentMerge branch 'release/v11.20.0' (diff)
parentBump VERSION (diff)
downloaddotfiles-888e989e0d6aa79e6d7fd8a4da19bf4891655db0.tar.gz
dotfiles-888e989e0d6aa79e6d7fd8a4da19bf4891655db0.zip
Merge branch 'release/v11.21.0'v11.21.0
* release/v11.21.0: (23 commits) Sort tags by tag date descending Further increase aggression of gscr(1df) Only export BROWSER if it's not empty Handle monitor and wallpaper setup with config Remove long-unneeded `make clean` deletion Use .xsession as executable script Correct prompt status writing broken by preload Add a comment Refactor xsession entirely, remove subfiles Remove no-op ssh-askpass config Couple dunst config together Couple urxvt config together Move sxhkd files to dedicated target Move redshift files to dedicated target Check and execute ~/.fehbg rather than sourcing it Move X mouse settings to subscript Set Vim filetype for X startup scripts Increase coverage of gscr(1df) Remove unneeded stdin redirection ...
-rw-r--r--.gitignore1
-rw-r--r--Makefile31
-rw-r--r--VERSION4
-rw-r--r--X/xsession15
-rw-r--r--X/xsession.d/background.sh7
-rw-r--r--X/xsession.d/browser.sh26
-rw-r--r--X/xsession.d/redshift.sh3
-rw-r--r--X/xsession.d/ssh.sh4
-rw-r--r--X/xsession.d/sxhkd.sh3
-rw-r--r--X/xsession.d/urxvt.sh3
-rw-r--r--X/xsession.d/xkb.sh5
-rw-r--r--X/xsession.sh52
-rw-r--r--bash/bashrc.d/prompt.bash8
-rwxr-xr-x[-rw-r--r--]bin/gscr.sh9
-rw-r--r--check/xsession.sh7
-rw-r--r--cpanm/profile.d/cpanm.sh1
-rw-r--r--dunst/xsession.d/dunst.sh (renamed from X/xsession.d/dunst.sh)1
-rw-r--r--git/config.mi53
-rw-r--r--ksh/kshrc.d/prompt.ksh17
-rw-r--r--lint/xsession.sh5
-rw-r--r--redshift/redshift.conf (renamed from X/redshift.conf)0
-rw-r--r--redshift/xsession.d/redshift.sh2
-rw-r--r--sxhkd/sxhkdrc (renamed from X/sxhkdrc)0
-rw-r--r--sxhkd/xsession.d/sxhkd.sh2
-rw-r--r--urxvt/Xresources.d/URxvt (renamed from X/Xresources.d/URxvt)0
-rw-r--r--urxvt/xsession.d/urxvt.sh2
-rw-r--r--vim/filetype.vim3
-rw-r--r--zsh/zshrc.d/prompt.zsh17
28 files changed, 102 insertions, 129 deletions
diff --git a/.gitignore b/.gitignore
index 126c3f52..7d5916cd 100644
--- a/.gitignore
+++ b/.gitignore
@@ -186,3 +186,4 @@
/less/less
/mutt/filters/markdown-to-html
/urxvt/ext/select
+/X/xsession
diff --git a/Makefile b/Makefile
index 8cf0e3e8..aeb45db5 100644
--- a/Makefile
+++ b/Makefile
@@ -41,7 +41,9 @@
install-pyenv \
install-rbenv \
install-readline \
+ install-redshift \
install-sh \
+ install-sxhkd \
install-subversion \
install-systemd \
install-terminfo \
@@ -274,7 +276,8 @@ all: $(BINS) \
$(GIT_TEMPLATE_HOOKS) \
git/config \
gnupg/profile.d/gnupg.sh \
- less/less
+ less/less \
+ X/xsession
clean distclean:
rm -f -- \
@@ -293,7 +296,7 @@ clean distclean:
less/less \
mutt/filters/markdown-to-html \
urxvt/ext/select \
- vim/dist/*
+ X/xsession
.awk:
sh bin/shb.sh awk -f < $< > $@
@@ -415,6 +418,7 @@ install-dillo: dillo/dillorc install-x
install-dunst: install-x
mkdir -p -- $(XDG_CONFIG_HOME)/dunst
cp -p -- dunst/dunstrc $(XDG_CONFIG_HOME)/dunst
+ cp -p -- dunst/xsession.d/* $(HOME)/.xsession.d
install-emacs: emacs/bin/emacsm install-sh
mkdir -p -- $(HOME)/.local/bin
@@ -550,6 +554,15 @@ install-rbenv: install-sh
install-readline:
cp -p -- readline/inputrc $(HOME)/.inputrc
+install-redshift: install-x
+ cp -p -- redshift/redshift.conf $(XDG_CONFIG_HOME)
+ cp -p -- redshift/xsession.d/* $(HOME)/.xsession.d
+
+install-sxhkd: install-x install-urxvt
+ mkdir -p -- $(XDG_CONFIG_HOME)/sxhkd
+ cp -p -- sxhkd/sxhkdrc $(XDG_CONFIG_HOME)/sxhkd
+ cp -p -- sxhkd/xsession.d/* $(HOME)/.xsession.d
+
install-sh: check-sh
mkdir -p -- $(HOME)/.profile.d $(HOME)/.shrc.d
cp -p -- sh/profile $(HOME)/.profile
@@ -588,9 +601,11 @@ install-tidy: install-sh
install-tmux: tmux/tmux.conf install-terminfo
cp -p -- tmux/tmux.conf $(HOME)/.tmux.conf
-install-urxvt: urxvt/ext/select
+install-urxvt: urxvt/ext/select install-x
mkdir -p -- $(HOME)/.urxvt/ext
- cp -- urxvt/ext/select $(HOME)/.urxvt/ext
+ cp -p -- urxvt/ext/select $(HOME)/.urxvt/ext
+ cp -p -- urxvt/Xresources.d/* $(HOME)/.Xresources.d
+ cp -p -- urxvt/xsession.d/* $(HOME)/.xsession.d
VIM = vim
VIMDIR = $(HOME)/.vim
@@ -629,15 +644,11 @@ install-wget: install-sh
mkdir -p -- $(XDG_CACHE_HOME)/wget $(XDG_CONFIG_HOME)/wget
cp -p -- wget/wgetrc $(XDG_CONFIG_HOME)/wget/wgetrc
-install-x: check-xsession
+install-x: X/xsession check-xsession
mkdir -p -- \
- $(XDG_CONFIG_HOME)/sxhkd \
$(HOME)/.xsession.d \
$(HOME)/.Xresources.d
- cp -p -- X/redshift.conf $(XDG_CONFIG_HOME)
- cp -p -- X/sxhkdrc $(XDG_CONFIG_HOME)/sxhkd
cp -p -- X/xsession $(HOME)/.xsession
- cp -p -- X/xsession.d/*.sh $(HOME)/.xsession.d
cp -p -- X/Xresources $(HOME)/.Xresources
cp -p -- X/Xresources.d/* $(HOME)/.Xresources.d
@@ -685,7 +696,7 @@ check-sh:
check-urxvt: urxvt/ext/select
sh check/urxvt.sh
-check-xsession:
+check-xsession: X/xsession
sh check/xsession.sh
check-zsh:
diff --git a/VERSION b/VERSION
index 937617a4..34785012 100644
--- a/VERSION
+++ b/VERSION
@@ -1,2 +1,2 @@
-tejr dotfiles v11.20.0
-Wed, 27 Apr 2022 09:50:29 +0000
+tejr dotfiles v11.21.0
+Sat, 30 Apr 2022 13:02:16 +0000
diff --git a/X/xsession b/X/xsession
deleted file mode 100644
index b8fdcce6..00000000
--- a/X/xsession
+++ /dev/null
@@ -1,15 +0,0 @@
-# If a file ~/.xrandrrc exists for monitor setup, source that first
-# shellcheck disable=SC1091
-[ -e "$HOME"/.xrandrrc ] && . "$HOME"/.xrandrrc
-
-# Faster mouse acceleration with a natural threshold
-xset mouse 5/2 0
-
-# Load all supplementary scripts in ~/.xsession.d
-for sh in "$HOME"/.xsession.d/*.sh ; do
- [ -e "$sh" ] && . "$sh"
-done
-unset -v sh
-
-# Start i3 window manager
-exec i3
diff --git a/X/xsession.d/background.sh b/X/xsession.d/background.sh
deleted file mode 100644
index 85a40889..00000000
--- a/X/xsession.d/background.sh
+++ /dev/null
@@ -1,7 +0,0 @@
-# If there's a ~/.fehbg, just run that; otherwise, try to apply a random
-# background image, if the relevant dir exists
-if [ -e "$HOME"/.fehbg ] ; then
- sh -- "$HOME"/.fehbg
-elif [ -d "${XBACKGROUNDS:-"$HOME"/.xbackgrounds}" ] ; then
- xrbg
-fi
diff --git a/X/xsession.d/browser.sh b/X/xsession.d/browser.sh
deleted file mode 100644
index 024075d6..00000000
--- a/X/xsession.d/browser.sh
+++ /dev/null
@@ -1,26 +0,0 @@
-# Choose a GUI browser with some rough heuristics
-
-# If LibreWolf or failing that Firefox is available, start by assuming that
-if command -v librewolf >/dev/null 2>&1 ; then
- BROWSER=librewolf
-elif command -v firefox >/dev/null 2>&1 ; then
- BROWSER=firefox
-fi
-
-# Consider a switch to Dillo...
-if (
- # No output, please
- exec >/dev/null 2>&1
- # Don't switch if it's not there
- command -v dillo || exit 1
- # Do switch if neither LibreWolf nor Firefox are there
- command -v librewolf || command -v firefox || exit 0
- # Do switch if procfs says we have less than 2GB of RAM
- awk '$1=="MemTotal:"&&$2<2^20{m++}END{exit!m}' < /proc/meminfo
-) ; then
- BROWSER=dillo
-fi
-
-# Export our choice of browser, if it isn't empty
-[ -n "$BROWSER" ] || return
-export BROWSER
diff --git a/X/xsession.d/redshift.sh b/X/xsession.d/redshift.sh
deleted file mode 100644
index d5d58d8a..00000000
--- a/X/xsession.d/redshift.sh
+++ /dev/null
@@ -1,3 +0,0 @@
-# Start redshift(1)
-command -v redshift >/dev/null 2>&1 || return
-redshift &
diff --git a/X/xsession.d/ssh.sh b/X/xsession.d/ssh.sh
deleted file mode 100644
index 005743fe..00000000
--- a/X/xsession.d/ssh.sh
+++ /dev/null
@@ -1,4 +0,0 @@
-# Set SSH_ASKPASS if we can find one
-command -v ssh-askpass >/dev/null 2>&1 || return
-SSH_ASKPASS=$(command -v ssh-askpass)
-export SSH_ASKPASS
diff --git a/X/xsession.d/sxhkd.sh b/X/xsession.d/sxhkd.sh
deleted file mode 100644
index 132d8f8a..00000000
--- a/X/xsession.d/sxhkd.sh
+++ /dev/null
@@ -1,3 +0,0 @@
-# Start sxhkd(1)
-command -v sxhkd >/dev/null 2>&1 || return
-sxhkd &
diff --git a/X/xsession.d/urxvt.sh b/X/xsession.d/urxvt.sh
deleted file mode 100644
index a5eb0940..00000000
--- a/X/xsession.d/urxvt.sh
+++ /dev/null
@@ -1,3 +0,0 @@
-# Start urxvtd(1)
-command -v urxvtd >/dev/null 2>&1 || return
-urxvtd -o -q &
diff --git a/X/xsession.d/xkb.sh b/X/xsession.d/xkb.sh
deleted file mode 100644
index a5142398..00000000
--- a/X/xsession.d/xkb.sh
+++ /dev/null
@@ -1,5 +0,0 @@
-# Map Caps Lock as a Ctrl key, use right alt as Compose, kill X server with
-# Ctrl+Alt+Backspace
-# <https://en.wikipedia.org/wiki/Compose_key#Common_compose_combinations>
-command -v setxkbmap >/dev/null 2>&1 || return
-setxkbmap -option compose:ralt,ctrl:nocaps,terminate:ctrl_alt_bksp
diff --git a/X/xsession.sh b/X/xsession.sh
new file mode 100644
index 00000000..9c0dcab7
--- /dev/null
+++ b/X/xsession.sh
@@ -0,0 +1,52 @@
+# Custom i3wm X session to fit into Debian's way of doing things
+
+# Monitor and wallpaper setup is very machine-specific, and isn't versioned in
+# here. Neither xrandr(1) nor xwallpaper(1) have config files, so we fake it
+# with xargs and looking for a file with argument tokens to read in
+# XDG_CONFIG_HOME, which will almost always be:
+#
+# - ~/.config/xrandr/config
+# - ~/.config/xwallpaper/config
+#
+# We figure each one out in a subshell, so that we can use a temporary variable
+# for the configuration path without polluting the namespace of the rest of
+# this script.
+#
+for program in xrandr xwallpaper ; do (
+ command -v "$program" >/dev/null 2>&1 || exit
+ config=${XDG_CONFIG_HOME:-"$HOME"/.config}/"$program"/config
+ [ -e "$config" ] || exit
+ xargs "$program" < "$config"
+) ; done
+
+# Set a few keyboard map options
+# - Remap right Alt as a Compose key
+# - Remap Caps Lock as another Control key
+# - Kill X server with Ctrl+Alt+Backspace
+setxkbmap \
+ -option compose:ralt \
+ -option ctrl:nocaps \
+ -option terminate:ctrl_alt_bksp &
+
+# Set fast mouse acceleration with a natural threshold
+xset mouse 5/2 0 &
+
+# Pick a GUI browser, depending on availability
+if command -v librewolf >/dev/null 2>&1 ; then
+ BROWSER=librewolf
+elif command -v firefox >/dev/null 2>&1 ; then
+ BROWSER=firefox
+fi
+if [ -n "$BROWSER" ] ; then
+ export BROWSER
+fi
+
+# Load all supplementary scripts in ~/.xsession.d
+for sh in "$HOME"/.xsession.d/*.sh ; do
+ [ -e "$sh" ] || continue
+ . "$sh"
+done
+unset -v sh
+
+# Start i3 window manager now that everything's ready
+exec i3
diff --git a/bash/bashrc.d/prompt.bash b/bash/bashrc.d/prompt.bash
index 86691a9c..bdea7ace 100644
--- a/bash/bashrc.d/prompt.bash
+++ b/bash/bashrc.d/prompt.bash
@@ -7,7 +7,7 @@ prompt() {
# Turn complex, colored PS1 and debugging PS4 prompts on
on)
# Set up pre-prompt command
- PROMPT_COMMAND='history -a'
+ PROMPT_COMMAND='PROMPT_RETURN=$?;history -a'
# If Bash 4.0 is available, trim very long paths in prompt
if ((BASH_VERSINFO[0] >= 4)) ; then
@@ -31,7 +31,7 @@ prompt() {
## Preload libraries as prefix
PS1='$(prompt preload)'$PS1
## VCS, job, and return status checks as suffixes
- PS1=$PS1'$(ret=$?;prompt vcs;prompt job;prompt ret)'
+ PS1=$PS1'$(prompt vcs;prompt job;prompt ret)'
# Add prefix and suffix
PS1='${PROMPT_PREFIX}'$PS1'${PROMPT_SUFFIX}'
@@ -267,8 +267,8 @@ prompt() {
# Show return status of previous command in angle brackets, if not zero
ret)
# shellcheck disable=SC2154
- ((ret)) || return
- printf '<%u>' "${ret//\\/\\\\}"
+ ((PROMPT_RETURN)) || return
+ printf '<%u>' "${PROMPT_RETURN//\\/\\\\}"
;;
# Show the count of background jobs in curly brackets, if not zero
diff --git a/bin/gscr.sh b/bin/gscr.sh
index 2fbee05a..26eafb12 100644..100755
--- a/bin/gscr.sh
+++ b/bin/gscr.sh
@@ -16,11 +16,16 @@ for arg in "${@:-.}" ; do (
;;
esac
+ # Remove any original refs from a prior rewrite
+ if [ -e refs/original ] ; then
+ rm -r -- refs/original || exit
+ fi
+
# Check for bad references or other integrity/sanity problems
- git fsck || exit
+ git fsck --full --no-reflogs || exit
# Expire dangling references
- git reflog expire --expire=now || exit
+ git reflog expire --all --expire=now --expire-unreachable=now || exit
# Remove dangling references
git gc --prune=now --aggressive || exit
diff --git a/check/xsession.sh b/check/xsession.sh
index 0e8db668..66ed611f 100644
--- a/check/xsession.sh
+++ b/check/xsession.sh
@@ -1,6 +1 @@
-set \
- X/xsession \
- X/xsession.d/*.sh
-for xsession do
- sh -n -- "$xsession" || exit
-done
+sh -n -- X/xsession
diff --git a/cpanm/profile.d/cpanm.sh b/cpanm/profile.d/cpanm.sh
index a7854e40..a860162e 100644
--- a/cpanm/profile.d/cpanm.sh
+++ b/cpanm/profile.d/cpanm.sh
@@ -1,2 +1,3 @@
+# Set home directory for cpanm files to be XDG-conformant
PERL_CPANM_HOME=${XDG_CACHE_HOME:-$HOME/.cache}/cpanm
export PERL_CPANM_HOME
diff --git a/X/xsession.d/dunst.sh b/dunst/xsession.d/dunst.sh
index bddaa1fe..6aad0c86 100644
--- a/X/xsession.d/dunst.sh
+++ b/dunst/xsession.d/dunst.sh
@@ -1,3 +1,2 @@
# Start dunst(1) to display libnotify messages
-command -v dunst >/dev/null 2>&1 || return
dunst &
diff --git a/git/config.mi5 b/git/config.mi5
index 78616077..cc7456b5 100644
--- a/git/config.mi5
+++ b/git/config.mi5
@@ -34,6 +34,9 @@
[status]
short = true
+[tag]
+ sort = -taggerdate
+
[user]
name = <% NAME %>
email = <% EMAIL %>
diff --git a/ksh/kshrc.d/prompt.ksh b/ksh/kshrc.d/prompt.ksh
index efc5c4e3..b0023670 100644
--- a/ksh/kshrc.d/prompt.ksh
+++ b/ksh/kshrc.d/prompt.ksh
@@ -31,8 +31,6 @@ function prompt {
esac
# Add sub-commands:
- ## Preload libraries as prefix
- PS1='$(prompt preload)'$PS1
## VCS, job, and return status checks as suffixes
PS1=$PS1'$(ret=$?;jobc=$(jobs -p|sed -n '\''$='\'');prompt pwd;prompt vcs;prompt job;prompt ret;:)'
@@ -208,21 +206,6 @@ function prompt {
fi
;;
- # Analyze LD_PRELOAD to see if we should report anything loaded
- preload)
- printf '%s:' "$LD_PRELOAD" |
- while read -d : -r ; do
- case $REPLY in
- (*/libip2unix.so)
- printf '[IP2Unix]'
- ;;
- (*/libtorsocks.so)
- printf '[Tor]'
- ;;
- esac
- done
- ;;
-
# Abbreviated working directory
pwd)
case $PWD in
diff --git a/lint/xsession.sh b/lint/xsession.sh
index fd60c864..4aa5c7ca 100644
--- a/lint/xsession.sh
+++ b/lint/xsession.sh
@@ -1,4 +1 @@
-set \
- X/xsession \
- X/xsession.d/*.sh
-shellcheck -e SC1090 -s sh -- "$@"
+shellcheck -e SC1090 -s sh -- X/xsession
diff --git a/X/redshift.conf b/redshift/redshift.conf
index 1e1de4ee..1e1de4ee 100644
--- a/X/redshift.conf
+++ b/redshift/redshift.conf
diff --git a/redshift/xsession.d/redshift.sh b/redshift/xsession.d/redshift.sh
new file mode 100644
index 00000000..929f564e
--- /dev/null
+++ b/redshift/xsession.d/redshift.sh
@@ -0,0 +1,2 @@
+# Start redshift(1)
+redshift &
diff --git a/X/sxhkdrc b/sxhkd/sxhkdrc
index c277855b..c277855b 100644
--- a/X/sxhkdrc
+++ b/sxhkd/sxhkdrc
diff --git a/sxhkd/xsession.d/sxhkd.sh b/sxhkd/xsession.d/sxhkd.sh
new file mode 100644
index 00000000..1b286c1f
--- /dev/null
+++ b/sxhkd/xsession.d/sxhkd.sh
@@ -0,0 +1,2 @@
+# Start sxhkd(1)
+sxhkd &
diff --git a/X/Xresources.d/URxvt b/urxvt/Xresources.d/URxvt
index f4c30d54..f4c30d54 100644
--- a/X/Xresources.d/URxvt
+++ b/urxvt/Xresources.d/URxvt
diff --git a/urxvt/xsession.d/urxvt.sh b/urxvt/xsession.d/urxvt.sh
new file mode 100644
index 00000000..34b9f904
--- /dev/null
+++ b/urxvt/xsession.d/urxvt.sh
@@ -0,0 +1,2 @@
+# Run urxvtd(1) in the background
+urxvtd --fork --opendisplay --quiet
diff --git a/vim/filetype.vim b/vim/filetype.vim
index c461e503..15603885 100644
--- a/vim/filetype.vim
+++ b/vim/filetype.vim
@@ -370,6 +370,9 @@ augroup filetypedetect
\,profile
\,shinit
\,shrc
+ \,xinitrc
+ \,xsession
+ \,xsessionrc
\,/etc/X11/xinit
\,/etc/X11/Xreset
\,/etc/X11/Xsession
diff --git a/zsh/zshrc.d/prompt.zsh b/zsh/zshrc.d/prompt.zsh
index 317aba56..eb43484f 100644
--- a/zsh/zshrc.d/prompt.zsh
+++ b/zsh/zshrc.d/prompt.zsh
@@ -22,8 +22,6 @@ prompt() {
esac
# Add sub-commands:
- ## Preload libraries as prefix
- PS1='$(prompt preload)'$PS1
## VCS, job, and return status checks as suffixes
PS1=$PS1'$(ret=$?;prompt vcs;prompt job;prompt ret)'
@@ -56,21 +54,6 @@ prompt() {
fi
;;
- # Analyze LD_PRELOAD to see if we should report anything loaded
- preload)
- printf '%s:' "$LD_PRELOAD" |
- while read -d : -r ; do
- case $REPLY in
- (*/libip2unix.so)
- printf '[IP2Unix]'
- ;;
- (*/libtorsocks.so)
- printf '[Tor]'
- ;;
- esac
- done
- ;;
-
git)
# Wrap as compound command; we don't want to see output from any of