Force change to dynamic title

Uses the last word of the last command run. That provides some small amount of insight. It seem to be the easiest available way to differentiate terminals, for example using wofi-alt-tab.sh
This commit is contained in:
John Mertz 2022-07-21 01:52:50 -04:00
parent 3bf3c5111d
commit 0df21404d2
1 changed files with 7 additions and 2 deletions

View File

@ -44,10 +44,12 @@ if ! shopt -oq posix; then
fi
fi
# Bell when prompt is returned to mark as urgent
PROMPT_COMMAND='printf "\a"; history -a'
# Set window title to last command
PROMPT_COMMAND='echo -e -n "\033]2;$_\007"'
# Reconfigure prompt after each return
PROMPT_COMMAND="$PROMPT_COMMAND; source ${HOME}/.dotfiles/bash/prompt.sh"
# Bell when prompt is returned to mark as urgent
PROMPT_COMMAND="$PROMPT_COMMAND;printf \"\a\"; history -a"
# Enable color support if possible
if [ -x /usr/bin/dircolors ]; then
@ -102,3 +104,6 @@ export XDG_DATA_DIRS="$XDG_DATA_DIRS:${HOME}/.config/flatpak/exports/share"
export SWAYSOCK=`sway --get-socketpath`
export CHROME_EXECUTABLE="/usr/bin/chromium"
export FLATPAK_IDE_LOG_LEVEL="0"
# Set initial title
echo -e -n "\033]2;Welcome to Bash\007"