# 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
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
# 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() {