From: Plom Heller Date: Sat, 19 Sep 2026 09:21:41 +0000 (+0200) Subject: Declutter home directories from .profile.* by move into ~/.profile.d/. X-Git-Url: https://plomlompom.com/repos/test?a=commitdiff_plain;h=2228506f23891fbb3723f6290bd320724ef2ee08;p=confplom Declutter home directories from .profile.* by move into ~/.profile.d/. --- diff --git a/home/any/.profile.aliases b/home/any/.profile.aliases deleted file mode 100644 index f0ff635..0000000 --- a/home/any/.profile.aliases +++ /dev/null @@ -1,2 +0,0 @@ -alias ls="ls --color=auto" - diff --git a/home/any/.profile.d/aliases b/home/any/.profile.d/aliases new file mode 100644 index 0000000..f0ff635 --- /dev/null +++ b/home/any/.profile.d/aliases @@ -0,0 +1,2 @@ +alias ls="ls --color=auto" + diff --git a/home/root/.profile.d/hibernation b/home/root/.profile.d/hibernation new file mode 100644 index 0000000..8f1a3c5 --- /dev/null +++ b/home/root/.profile.d/hibernation @@ -0,0 +1,8 @@ +# /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 "$@" +} diff --git a/home/root/.profile.hibernation b/home/root/.profile.hibernation deleted file mode 100644 index 8f1a3c5..0000000 --- a/home/root/.profile.hibernation +++ /dev/null @@ -1,8 +0,0 @@ -# /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 "$@" -} diff --git a/home/user/.profile.d/hibernation b/home/user/.profile.d/hibernation new file mode 100644 index 0000000..da7ef8f --- /dev/null +++ b/home/user/.profile.d/hibernation @@ -0,0 +1,6 @@ +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 "$@" +} diff --git a/home/user/.profile.d/prompt b/home/user/.profile.d/prompt new file mode 100644 index 0000000..c543779 --- /dev/null +++ b/home/user/.profile.d/prompt @@ -0,0 +1,20 @@ +_dot_profile_dot_prompt() { + local COLOR_NUMBER=2 + local COLOR_ON + local COLOR_OFF + COLOR_ON="$(tput setaf "${COLOR_NUMBER}" 2>/dev/null)$(tput bold 2>/dev/null)" + COLOR_OFF="$(tput sgr0 2>/dev/null)" + # Bash confuses the line length when not told not to count escape + # sequences. PS3 is printed verbatim by "select", so it must get the + # unwrapped codes. + PS3="${COLOR_ON}select: ${COLOR_OFF}" + if [ -n "${BASH:-}" ]; then + COLOR_ON="\[${COLOR_ON}\]" + COLOR_OFF="\[${COLOR_OFF}\]" + fi + PS1="${COLOR_ON}[\D{%Y-%m-%d/%H:%M:%S/%Z} \u@\h:\w]\$ ${COLOR_OFF}" + PS2="${COLOR_ON}> ${COLOR_OFF}" + PS4="${COLOR_ON}+ ${COLOR_OFF}" +} +_dot_profile_dot_prompt +unset -f _dot_profile_dot_prompt diff --git a/home/user/.profile.d/ssh-agent b/home/user/.profile.d/ssh-agent new file mode 100644 index 0000000..6fec6f9 --- /dev/null +++ b/home/user/.profile.d/ssh-agent @@ -0,0 +1 @@ +[ -z "${SSH_AGENT_PID}" ] && eval $(ssh-agent) > /dev/null && ssh-add -q diff --git a/home/user/.profile.hibernation b/home/user/.profile.hibernation deleted file mode 100644 index da7ef8f..0000000 --- a/home/user/.profile.hibernation +++ /dev/null @@ -1,6 +0,0 @@ -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 "$@" -} diff --git a/home/user/.profile.prompt b/home/user/.profile.prompt deleted file mode 100644 index c543779..0000000 --- a/home/user/.profile.prompt +++ /dev/null @@ -1,20 +0,0 @@ -_dot_profile_dot_prompt() { - local COLOR_NUMBER=2 - local COLOR_ON - local COLOR_OFF - COLOR_ON="$(tput setaf "${COLOR_NUMBER}" 2>/dev/null)$(tput bold 2>/dev/null)" - COLOR_OFF="$(tput sgr0 2>/dev/null)" - # Bash confuses the line length when not told not to count escape - # sequences. PS3 is printed verbatim by "select", so it must get the - # unwrapped codes. - PS3="${COLOR_ON}select: ${COLOR_OFF}" - if [ -n "${BASH:-}" ]; then - COLOR_ON="\[${COLOR_ON}\]" - COLOR_OFF="\[${COLOR_OFF}\]" - fi - PS1="${COLOR_ON}[\D{%Y-%m-%d/%H:%M:%S/%Z} \u@\h:\w]\$ ${COLOR_OFF}" - PS2="${COLOR_ON}> ${COLOR_OFF}" - PS4="${COLOR_ON}+ ${COLOR_OFF}" -} -_dot_profile_dot_prompt -unset -f _dot_profile_dot_prompt diff --git a/home/user/.profile.ssh-agent b/home/user/.profile.ssh-agent deleted file mode 100644 index 6fec6f9..0000000 --- a/home/user/.profile.ssh-agent +++ /dev/null @@ -1 +0,0 @@ -[ -z "${SSH_AGENT_PID}" ] && eval $(ssh-agent) > /dev/null && ssh-add -q diff --git a/scripts/lib/link_home.sh b/scripts/lib/link_home.sh index 0ecbb84..146e8fa 100644 --- a/scripts/lib/link_home.sh +++ b/scripts/lib/link_home.sh @@ -3,7 +3,7 @@ include PATH_REPO include msg link_home() { - local LOOP_PROFILES='for FILE in ${HOME}/.profile.*; do . "${FILE}"; done' + local LOOP_PROFILES='for FILE in ${HOME}/.profile.d/*; do . "${FILE}"; done' local PATH_PROFILE="${HOME}/${FNAME_PROFILE}" for DIRNAME in any "$1"; do local PATH_SKEL="${PATH_REPO}/home/${DIRNAME}"