diff options
| author | Mitch Riedstra <mitch@riedstra.us> | 2019-09-12 23:10:58 -0400 |
|---|---|---|
| committer | Mitch Riedstra <mitch@riedstra.us> | 2019-09-12 23:10:58 -0400 |
| commit | 75ed7b4f86cd883f32b88d5613ff46d8a21f6794 (patch) | |
| tree | d38260dd255458b2a02193d4e0e2e0f6fe9f6027 /shell/ash | |
| parent | 879d857e0eafa1f716d9e156862154baf49d7655 (diff) | |
| download | dotfiles-75ed7b4f86cd883f32b88d5613ff46d8a21f6794.tar.gz dotfiles-75ed7b4f86cd883f32b88d5613ff46d8a21f6794.tar.xz | |
Split my shell configuration into multiple files and a build script to generate for multiple shells
Diffstat (limited to 'shell/ash')
| -rw-r--r-- | shell/ash | 23 |
1 files changed, 23 insertions, 0 deletions
diff --git a/shell/ash b/shell/ash new file mode 100644 index 0000000..638c58a --- /dev/null +++ b/shell/ash @@ -0,0 +1,23 @@ + +set_pager +set_editor +setaliases + +set_ash_title() { + _load="Load Avg: $(_sys_load)" + _free_mem="M Free: $(free -m | sed -n 2p | awk '{print $3}')" + _uptime="Uptime: $(_sys_uptime)" + set_title "$(id -un)[$(hostname)] -- $_load $_free_mem $_uptime" +} + +function nonzero_return() { + RETVAL=$? + [ $RETVAL -ne 0 ] && echo "$RETVAL:" +} + +export PS1="\[\`set_ash_title\`\]\`nonzero_return\`[\t] <\u@\H> \w \\$ " + +# Same thing but red user/host combo +if [ $(id -u) -eq 0 ] ; then + export PS1="\[\`set_ash_title\`\]\`nonzero_return\`[\t] <\[\e[31m\]\u\[\e[m\]\[\e[31m\]@\[\e[m\]\[\e[31m\]\H\[\e[m\]> \w \\$ " +fi |
