af14e1efbc
- /home/.chezmoiscripts/qubes/run_onchange_before_16-update-template-vms.tmpl - /home/.chezmoiscripts/qubes/run_onchange_before_17-install-mirage-firewall.tmpl - /home/.chezmoiscripts/qubes/run_onchange_before_18-configure-sys-usb.tmpl - /home/.chezmoiscripts/qubes/run_onchange_before_19-setup-sys-gui - /home/dot_config/shell/functions.sh - /home/dot_config/shell/motd.sh - /home/dot_config/shell/profile.sh - /home/.chezmoiscripts/qubes/run_onchange_before_16-update-template-vms.sh.tmpl - /home/.chezmoiscripts/qubes/run_onchange_before_17-install-mirage-firewall.sh.tmpl - /home/.chezmoiscripts/qubes/run_onchange_before_18-configure-sys-usb.sh.tmpl - /home/.chezmoiscripts/qubes/run_onchange_before_19-setup-sys-gui.sh.tmpl - /home/dot_config/shell/aliases.sh.tmpl - /home/dot_config/shell/exports.sh.tmpl - /home/dot_config/shell/functions.sh.tmpl - /home/dot_config/shell/motd.sh.tmpl - /home/dot_config/shell/private_private.sh.tmpl - /home/dot_config/shell/profile.sh.tmpl
32 lines
1.5 KiB
Bash
32 lines
1.5 KiB
Bash
#!/usr/bin/env sh
|
|
# @file Shell MOTD
|
|
# @brief Incorporates the MOTD functionality that is leveraged by the `~/.bashrc` and `~/.zshrc` files
|
|
# @description
|
|
# This script is included by `~/.bashrc` and `~/.zshrc` to print a MOTD whenever a terminal session
|
|
# is invoked.
|
|
|
|
### MOTD
|
|
# Add file named .hushlogin in the user's home directory to disable the MOTD
|
|
if [ "$BASH_SUPPORT" = 'true' ] && [ ! -f ~/.hushlogin ] && [ "$SHLVL" -eq 1 ]; then
|
|
if [ -f "$HOME/.local/scripts/motd.bash" ] && { [ -n "$SSH_CONNECTION" ] && [[ $- == *i* ]]; } || command -v qubes-vmexec > /dev/null || command -v qubes-dom0-update > /dev/null || { [ -d /Applications ] && [ -d /System ]; }; then
|
|
if { [ -z "$MOTD" ] || [ "$MOTD" -ne 0 ]; } && [[ "$(hostname)" != *'-minimal' ]]; then
|
|
. "$HOME/.local/scripts/motd.bash"
|
|
# TODO - -- services
|
|
if [ -n "$SSH_CONNECTION" ]; then
|
|
# SSH
|
|
bash_motd --banner --processor --memory --diskspace --docker --updates --letsencrypt --login
|
|
elif command -v qubes-vmexec > /dev/null; then
|
|
# Qubes AppVM
|
|
bash_motd --banner --memory --diskspace --docker --updates
|
|
elif command -v qubes-dom0-update > /dev/null; then
|
|
# Qubes dom0
|
|
bash_motd --banner --updates
|
|
elif [ -d /Applications ] && [ -d /System ]; then
|
|
# macOS
|
|
bash_motd --banner
|
|
else
|
|
bash_motd --banner --processor --memory --diskspace --docker --updates --letsencrypt --login
|
|
fi
|
|
fi
|
|
fi
|
|
fi
|