show window title in swaybar. set title in prompt

This commit is contained in:
Daniel Lundin 2020-03-08 17:22:59 +01:00
parent e0a1aa3162
commit 75c5b20eb7
No known key found for this signature in database
GPG key ID: 6AB527C9196ACDCC
2 changed files with 3 additions and 3 deletions

View file

@ -3,7 +3,7 @@ separator_block_width=40
[window]
align=left
command=swaymsg -t subscribe -m '["window"]' | jq --unbuffered -M -r '.container.name' | stdbuf -oL cut -c -80 | stdbuf -oL sed -e 's/ *$//'
command=swaymsg -t subscribe -m '["window"]' | stdbuf -oL jq --unbuffered -M -r '.container.name // empty' | stdbuf -oL cut -c -80 | stdbuf -oL sed -e 's/ *$//'
interval=persist
background=#000000cc

4
.zshrc
View file

@ -187,14 +187,14 @@ export PROMPT_LEAN_COLOR1=78
export PROMPT_LEAN_COLOR2=67
local ret_status="%(?:%B%F{#607D8B]}%%:%B%F{#F4511E}%%)"
PROMPT='%F{#455A64}${HOST}:%F{#78909C}%}$(short_pwd)%f$(git_prompt_info)%f${ret_status}%f%b '
PROMPT='$(_title_prompt)%F{#455A64}${HOST}:%F{#78909C}%}$(short_pwd)%f$(git_prompt_info)%f${ret_status}%f%b '
ZSH_THEME_GIT_PROMPT_PREFIX=" %F{#795548}⟨%F{#8D6E63}"
ZSH_THEME_GIT_PROMPT_SUFFIX="%F{#795548}⟩%f"
ZSH_THEME_GIT_PROMPT_DIRTY="%F{#F57F17}⋆"
ZSH_THEME_GIT_PROMPT_CLEAN=""
function _title_prompt() {
function precmd {
print -Pn "\033]0;${HOST}:${PWD}\007"
}