diff options
-rw-r--r-- | alacritty.yml | 41 | ||||
-rw-r--r-- | bashrc | 15 | ||||
-rw-r--r-- | zsh/zshrc | 13 |
3 files changed, 23 insertions, 46 deletions
diff --git a/alacritty.yml b/alacritty.yml index 4dbd66f..4338dce 100644 --- a/alacritty.yml +++ b/alacritty.yml @@ -94,47 +94,6 @@ font: family: FiraCode NF style: Bold Italic -# Bell -# -# The bell is rung every time the BEL control character is received. -bell: - # Visual Bell Animation - # - # Animation effect for flashing the screen when the visual bell is rung. - # - # Values for `animation`: - # - Ease - # - EaseOut - # - EaseOutSine - # - EaseOutQuad - # - EaseOutCubic - # - EaseOutQuart - # - EaseOutQuint - # - EaseOutExpo - # - EaseOutCirc - # - Linear - animation: EaseOutExpo - - # Duration of the visual bell flash in milliseconds. A `duration` of `0` will - # disable the visual bell animation. - duration: 100 - -# Visual bell animation color. -#color: '#ffffff' - -# Bell Command -# -# This program is executed whenever the bell is rung. -# -# When set to `command: None`, no command will be executed. -# -# Example: -# command: -# program: notify-send -# args: ["Hello, World!"] -# -#command: None - selection: # This string contains all characters that are used as separators for # "semantic words" in Alacritty. @@ -7,7 +7,18 @@ if [ -d "$comp_dir" ]; then for f in "$comp_dir"/*; do source $f; done; fi command -v starship >/dev/null 2>&1 && eval "$(starship init bash)" -function set_win_title() { - echo -ne "\033]0;$USER@$HOSTNAME: ${PWD/$HOME/'~'}\007" +set_win_title() { + local prefix + + if [ "$USER" != "tobyv" ]; then + prefix="${USER} in " + fi + + if [ -n "$SSH_CLIENT" ] || [ -n "$SSH_TTY" ]; then + prefix="${prefix/in/on}${HOSTNAME} in " + fi + + echo -ne "\033]0;${prefix}${PWD/$HOME/~}\007" } + starship_precmd_user_func="set_win_title" @@ -43,10 +43,17 @@ eval "$(starship init zsh 2>/dev/null)" eval "$(navi widget zsh 2>/dev/null)" set_win_title() { - folder=$(sed "s/$USER/~/g" <<<$PWD:t) + local prefix - window_title="\033]0;$USER@$HOST: $folder\007" - echo -ne "$window_title" + if [ "$USER" != "tobyv" ]; then + prefix="${USER} in " + fi + + if [ -n "$SSH_CLIENT" ] || [ -n "$SSH_TTY" ]; then + prefix="${prefix/in/on}${HOSTNAME} in " + fi + + echo -ne "\033]0;${prefix}${PWD/$HOME/~}\007" } precmd_functions+=(set_win_title) |