+++ /dev/null
-alias ls="ls --color=auto"
-
-alias hibernate_safe="command systemctl hibernate || systemctl poweroff"
-systemctl () {
- local MSG="Use 'hibernate_safe' instead."
- [ "$@" = "hibernate" ] && echo "${MSG}" && return 1
- command systemctl "$@"
-}
--- /dev/null
+# /etc/systemd/system/sytemd-hibernate.service.d/60-poweroff-on-failure.conf
+# is bypassed by pure "systemctl hibernate", so only allow wrap with poweroff
+alias hibernate_safe="command systemctl hibernate || systemctl poweroff"
+systemctl () {
+ local MSG="Use 'hibernate_safe' instead."
+ [ "$@" = "hibernate" ] && echo "${MSG}" && return 1
+ command systemctl "$@"
+}
+++ /dev/null
-alias ls="ls --color=auto"
-
-alias hibernate_safe="sudo /bin/sh -lc hibernate_safe"
-sudo() {
- local MSG="Use 'hibernate_safe' instead."
- [ "$1 $2" = "systemctl hibernate" ] && echo "${MSG}" && return 1
- command sudo "$@"
-}
include msg
link_home() {
- local PATH_SKEL="${PATH_REPO}/home/$1"
- local DOT_ALIASFILE='. ${HOME}/.aliases'
+ local LOOP_ALIASFILES=\
+'for FILE in ${HOME}/.aliases_etc.*; do . "${FILE}"; done'
local PATH_PROFILE="${HOME}/${FNAME_PROFILE}"
- msg 'Linking %s files into home directory …' "${PATH_SKEL}"
- find "${PATH_SKEL}" -mindepth 1 -maxdepth 1 | while IFS= read -r SRC; do
- DEST="${HOME}/$(basename "${SRC}")"
- if [ -e "${DEST}" ] || [ -L "${DEST}" ]; then
- msg 'Skipping already-found %s …' "${DEST}"
- else
- ln -v -s "${SRC}" "${DEST}"
- fi
+ for DIRNAME in any "$1"; do
+ local PATH_SKEL="${PATH_REPO}/home/${DIRNAME}"
+ msg 'Linking %s files into home directory …' "${PATH_SKEL}"
+ find "${PATH_SKEL}" -mindepth 1 -maxdepth 1 \
+ | while IFS= read -r SRC; do
+ DEST="${HOME}/$(basename "${SRC}")"
+ if [ -e "${DEST}" ] || [ -L "${DEST}" ]; then
+ msg 'Skipping already-found %s …' "${DEST}"
+ else
+ ln -v -s "${SRC}" "${DEST}"
+ fi
+ done
done
msg 'Augmenting user %s …' "${FNAME_PROFILE}"
# test ensures idempotency
- grep -qxF "${DOT_ALIASFILE}" "${PATH_PROFILE}" 2>/dev/null\
- || printf '\n%s\n' "${DOT_ALIASFILE}" >> "${PATH_PROFILE}"
+ grep -qxF "${LOOP_ALIASFILES}" "${PATH_PROFILE}" 2>/dev/null\
+ || printf '\n%s\n' "${LOOP_ALIASFILES}" >> "${PATH_PROFILE}"
}