aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorEuAndreh <eu@euandre.org>2023-02-20 17:38:59 -0300
committerEuAndreh <eu@euandre.org>2023-02-20 17:38:59 -0300
commit1ac547bf987fa137d13774d1700686cd3b049328 (patch)
treec8c522501e32b51f6d3011df01db45939e5154e7
parentetc/sh/rc: Join both "if $DISPLAY" sections (diff)
downloaddotfiles-1ac547bf987fa137d13774d1700686cd3b049328.tar.gz
dotfiles-1ac547bf987fa137d13774d1700686cd3b049328.tar.xz
etc/sh/rc: Show hostname in $PS1 if on SSH session on different desktop
-rw-r--r--etc/sh/rc10
1 files changed, 9 insertions, 1 deletions
diff --git a/etc/sh/rc b/etc/sh/rc
index a6ff24b..b49440a 100644
--- a/etc/sh/rc
+++ b/etc/sh/rc
@@ -243,8 +243,16 @@ in_nix_shell() {
printf ')'
}
+in_ssh_session() {
+ if [ -n "${SSH_CLIENT:-}" ]; then
+ color -c blackb '\\u'
+ printf '@'
+ color -c purple '\\H'
+ fi
+}
+
PS1='`error_marker`'$(timestamp)' '$(path)' `shell_status``vcs ps1``guix_env``in_nix_shell`
-$ '
+'$(in_ssh_session)'$ '