aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKylie McClain <kylie@somas.is>2021-06-24 18:16:00 -0400
committerKylie McClain <kylie@somas.is>2021-06-24 18:28:39 -0400
commit193786e39f7d6aacbe7d5a114edc817e3170b103 (patch)
tree1bf03f8bee9f7ff912d1b5e44093afd912d953f2
parentb66da95fd5d56e4ce0126ffe875536d9bc09ac2c (diff)
downloadme-193786e39f7d6aacbe7d5a114edc817e3170b103.tar.gz
me-193786e39f7d6aacbe7d5a114edc817e3170b103.tar.xz
me-193786e39f7d6aacbe7d5a114edc817e3170b103.zip
prompt: add a chroot rule
-rw-r--r--etc/sh/rc.d/commands.sh3
-rw-r--r--etc/sh/rc.d/prompt.sh6
2 files changed, 3 insertions, 6 deletions
diff --git a/etc/sh/rc.d/commands.sh b/etc/sh/rc.d/commands.sh
index 97df433..b04b4a8 100644
--- a/etc/sh/rc.d/commands.sh
+++ b/etc/sh/rc.d/commands.sh
@@ -9,9 +9,6 @@ alias vi='$EDITOR'
alias gitolite='ssh git@rosa'
alias laminar='ssh rosa laminarc'
-alias mutiny='doas chroot /mnt/mutiny su -l somasis'
-alias exherbo='doas chroot /mnt/exherbo su -l somasis'
-
# Quick aliases for posting to my site.
if [ -d ~/src/www/somas.is ]; then
alias note='kak $(make -C ~/src/www/somas.is -s note-new)'
diff --git a/etc/sh/rc.d/prompt.sh b/etc/sh/rc.d/prompt.sh
index c7184be..4afac80 100644
--- a/etc/sh/rc.d/prompt.sh
+++ b/etc/sh/rc.d/prompt.sh
@@ -1,7 +1,7 @@
#!/bin/sh
# prompt - Set variables such as $PS1. See sh(1).
-PS1='\[\e[0m\]'
+PS1='\[\e[0m\]${CHROOT:+\[\e[1;31m\]${CHROOT} }'
case "$(id -un)" in
somasis)
@@ -12,8 +12,8 @@ esac
# Set terminal title.
PS1="${PS1}"'\[$(printf %b "\e]0;${SSH_CONNECTION:+ssh [${USER}@${HOSTNAME}]: }${PWD}\a")\]'
-# Show hostname only over ssh(1) connections.
-[ -n "${SSH_CONNECTION}" ] && PS1="${PS1}"'@\[\e[0;35m\]\h\[\e[0m\]'
+# Show hostname only over ssh(1) connections or chroots.
+[ -n "${SSH_CONNECTION}${CHROOT}" ] && PS1="${PS1}"'@\[\e[0;35m\]\h\[\e[0m\]'
PS1="${PS1}"' \[\e[1;39m\]\w\[\e[0m\]'