home · contact · privacy
To Buster EeePC setup, add bashrc.
authorChristian Heller <c.heller@plomlompom.de>
Sun, 7 Apr 2019 18:00:20 +0000 (20:00 +0200)
committerChristian Heller <c.heller@plomlompom.de>
Sun, 7 Apr 2019 18:00:20 +0000 (20:00 +0200)
buster/apt-mark/eeepc
buster/home_files/.bashrc [new file with mode: 0644]
buster/setup_scripts/setup_eeepc.sh

index 5181ac4c62b3603bdcbcd3aaa7cfd97b6ef5cc5d..5defcf0a7ddbfe91cc8e2f3ccea55f974a838374 100644 (file)
@@ -30,6 +30,7 @@ firefox-esr
 # for xterm and browser unicode display
 ttf-unifont
 # also useful
+vim
 sudo
 less
 man-db
diff --git a/buster/home_files/.bashrc b/buster/home_files/.bashrc
new file mode 100644 (file)
index 0000000..85c2e22
--- /dev/null
@@ -0,0 +1,26 @@
+# Settings for interactive shells.
+
+# Fancy colors for ls.
+alias ls="ls --color=auto"
+
+# Use vim as default editor for anything.
+export VISUAL=vim
+export EDITOR=$VISUAL
+
+# Colored prompt with username, hostname, date/time, directory.
+colornumber=7 # Default to white if no color set via colornumber dotfile.
+colornumber_file=~/.shell_prompt_color
+if [ -f $colornumber_file ]; then
+    colornumber=`cat $colornumber_file`
+fi
+tput_color="$(tput setaf $colornumber)$(tput bold)"
+tput_reset="$(tput sgr0)"
+# Bash confuses the line length when not told to not count escape sequences.
+if [ ! "$BASH" = "" ]; then
+    tput_color="\[$tput_color\]"
+    tput_reset="\[$tput_reset\]"
+fi
+PS1="${tput_color}["\$\(date\ +%Y-%m-%d/%H:%M:%S/%Z\)" $USER@$(hostname):"\$\(pwd\)"]$ $tput_reset"
+PS2="${tput_color}> $tput_reset"
+PS3="${tput_color}select: $tput_reset"
+PS4="${tput_color}+ $tput_reset"
index f7710b5c319486708c8a677b79a037f411fb59c9..289a1a5f486ab03f6ce6342fc00c6cb1a6a7f739 100755 (executable)
@@ -19,4 +19,5 @@ if [ ! -d "/home/plom" ]; then
     usermod -a -G sudo plom
     su -c "cd && git clone https://plomlompom.com/repos/clone/config" plom
     su -c "~/config/buster/setup_scripts/copy_dirtree.sh ~/config/buster/home_files ~ eeepc" plom
+    su -c "echo 2 > ~/.shell_prompt_color"
 fi