X-Git-Url: https://iankelling.org/git/?a=blobdiff_plain;f=brc;h=bd8429e1d526b6252367f3d38b65005bca5d3337;hb=5856bb416776ef23746dcaf166f68cda7ffee711;hp=e589dfb8a3740f35a400903fb1d8addc8614f92d;hpb=fa28664e5e5ee51f58f9933e80d18ebd12d51991;p=distro-setup diff --git a/brc b/brc index e589dfb..bd8429e 100644 --- a/brc +++ b/brc @@ -112,13 +112,13 @@ if [[ $- == *i* ]]; then # sakura == xterm-256color # konsole == xterm if [[ $TERM == "xterm" ]]; then - # make ctrl-backspace work - stty werase '^?' # control + arrow keys. for other terminals, see http://unix.stackexchange.com/questions/10806/how-to-change-previous-next-word-shortcut-in-bash bind '"\e[1;5C": shell-forward-word' 2>/dev/null bind '"\e[1;5D": shell-backward-word' 2>/dev/null else - #stty werase '^h' + # make ctrl-backspace work. for konsole, i fixed it through +# /home/iank/.local/share/konsole/default.keytab + stty werase '^h' bind '"\eOc": shell-forward-word' bind '"\eOd": shell-backward-word' fi @@ -1856,22 +1856,15 @@ if [[ $- == *i* ]]; then PS1="\h $PS1" fi - prompt_command() { + + + + prompt-command() { local return=$? # this MUST COME FIRST local psc pst ps_char ps_color stale_subvol unset IFS history -a # save history - # for titlebar - if [[ $TERM == *(screen*|xterm*|rxvt*) ]]; then - # from the screen man page - if [[ $TERM == screen* ]]; then - local title_escape="\033]..2;" - else - local title_escape="\033]0;" - fi - echo -ne "$title_escape${PWD/#$HOME/~} $USER@$HOSTNAME\007" - fi case $return in @@ -1901,18 +1894,36 @@ if [[ $- == *i* ]]; then # emacs completion doesn't like the git prompt atm, so disabling it. #PS1="${PS1%"${PS1#*[wW]}"}$(__git_ps1 ' (%s)') \[$ps_color\]$ps_char\[$(get_term_color nocolor)\] " } - PROMPT_COMMAND=prompt_command + PROMPT_COMMAND=prompt-command + + settitle () { + if [[ $TERM == screen* ]]; then + local title_escape="\033]..2;" + else + local title_escape="\033]0;" + fi + if [[ $* != prompt-command ]]; then + echo -ne "$title_escape$USER@$HOSTNAME ${PWD/#$HOME/~} $*\007" + fi + } + + # for titlebar + # condition from the screen man page i think + if [[ $TERM == *(screen*|xterm*|rxvt*) ]]; then + trap 'settitle "$BASH_COMMAND"' DEBUG + else + trap DEBUG + fi + fi reset-konsole() { # we also have a file in /a/c/...konsole... - setini ShowMenuBarByDefault false KonsoleWindow $HOME/.config/konsolerc - while read k v; do - setini $k $v TabBar $HOME/.config/konsolerc - done <<'EOF' -TabBarVisibility ShowTabBarWhenNeeded -TabBarPosition Top -EOF + local f=$HOME/.config/konsolerc + setini DefaultProfile profileian.profile "Desktop Entry" $f + setini Favorites profileian.profile "Favorite Profiles" $f + setini ShowMenuBarByDefault false KonsoleWindow $f + setini TabBarPosition Top TabBar $f } reset-sakura() {