Commit f23c3ab3 authored by nimrod's avatar nimrod
Browse files

Default value for set_title.

Use the basename for the current directory as the default title.
parent 7ab6ad7e
Loading
Loading
Loading
Loading
Loading
+6 −1
Original line number Diff line number Diff line
@@ -136,7 +136,6 @@ alias restart-kodi='ssh kodi.shore.co.il "sudo systemctl kill --kill-who=all --s
# shellcheck disable=SC2032
alias rm='rm --dir'
alias screenshot-cleanup='find "$HOME/Pictures" -name "Screenshot from *.png" -delete'
alias set_title='printf "\033]0;%s\007"'
alias smtp-server='python3 -m smtpd -ndc DebuggingServer'
alias sudo="sudo "
alias sudome="sudome "
@@ -207,6 +206,12 @@ prune_ssh_sockets () {
        -execdir sh -c 'lsof -t "$1" >/dev/null || rm "$1"' _ {} \;
}

set_title () {
    local default_title
    default_title="$(basename "$PWD")"
    printf "\033]0;%s\007" "${1:-$default_title}"
}

ssh_keyscan_add () {
    ssh-keyscan "$@" >> "$HOME/.ssh/known_hosts"
    sort -uo "$HOME/.ssh/known_hosts" "$HOME/.ssh/known_hosts"