From c385720f58950714e3a5836a8f9d3985a28cd342 Mon Sep 17 00:00:00 2001 From: Daniel Lundin Date: Sun, 8 Mar 2020 17:22:59 +0100 Subject: [PATCH] show window title in swaybar. set title in prompt --- .config/i3blocks/config | 6 ++++++ .config/sway/config | 2 +- .tmux.conf | 6 +++--- .zshrc | 6 +++++- 4 files changed, 15 insertions(+), 5 deletions(-) diff --git a/.config/i3blocks/config b/.config/i3blocks/config index 2cf422c..7cb2d78 100644 --- a/.config/i3blocks/config +++ b/.config/i3blocks/config @@ -1,6 +1,12 @@ separator=true 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/ *$//' +interval=persist +background=#000000cc + [battery] background=#000000cc command=~/.config/i3blocks/battery-plus diff --git a/.config/sway/config b/.config/sway/config index bf76dd5..e361d67 100644 --- a/.config/sway/config +++ b/.config/sway/config @@ -49,7 +49,7 @@ bindsym Mod4+Shift+c kill bindsym Mod4+Shift+q exit bindsym Mod4+Return exec $term bindsym Mod4+Shift+Return exec $term tmux attach -t0 -bindsym Mod4+Control+Return exec "autossh -M21001 -f -A -T home-dev sleep inf; alacritty -e mosh -p 2022 home tmux attach" +bindsym Mod4+Control+Return exec "autossh -M21001 -f -A -T home-dev sleep inf; $term mosh -p 2022 home tmux attach" bindsym Mod4+p exec rofi -show run bindsym Mod4+e exec rofi -show emoji -modi emoji bindsym Mod4+l exec $lock diff --git a/.tmux.conf b/.tmux.conf index 578439c..9a57f27 100644 --- a/.tmux.conf +++ b/.tmux.conf @@ -25,8 +25,8 @@ setw -g mode-keys vi set -g status-justify left set -g status-left-length 30 set -g status-right-length 90 -set -g set-titles off -set -g set-titles-string "###I : #T" +set -g set-titles on +set -g set-titles-string "#T" # Key bindings bind -n M-Left select-pane -L @@ -80,7 +80,7 @@ bind C-k clear-history bind -n C-l send-keys C-l \; clear-history setw -g window-status-format "" -setw -g window-status-current-format "#W" +setw -g window-status-current-format "#T" setw -g window-status-separator "" set -g status-fg "#B0BEC5" diff --git a/.zshrc b/.zshrc index b451cb1..5b1628e 100644 --- a/.zshrc +++ b/.zshrc @@ -187,13 +187,17 @@ 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() { + print -Pn "\033]0;${HOST}:${PWD}\007" +} + # Outputs current branch info in prompt format function git_prompt_info() { local ref