Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Distinguish between focused and unfocused clients in Tmux

Vladimir Bauer edited this pageJan 15, 2021 ·1 revision

Althoughtmux highlights active pane's borders and even lets to customize them viapane-active-border-style option, it's sometimes more desirable to instantly distinguish between focused and unfocused clients, as tiny borders are not so visible. Here is a script to achieve this via toggling status line background color:

# StatusLine face toggle# ‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾declare-option -hidden str last_focus_indeclare-option -hidden str focus_out_face "rgb:FDFDFD,rgb:8e908c"hook global -group status-line-face-toggle FocusIn .* %{    set-option global last_focus_in %val{client}    unset-face window StatusLine    evaluate-commands %sh{        for client in $kak_client_list; do            if [ "$client" != "$kak_hook_param" ]; then                printf "eval -no-hooks -client %s 'set-face window StatusLine %s'\n" \                "$client" "$kak_opt_focus_out_face"            fi        done    }}hook global -group status-line-face-toggle WinDisplay .* %{    evaluate-commands %sh{        if [ "$kak_client" == "$kak_opt_last_focus_in" ]; then            echo "unset-face window StatusLine"        elif [ -n "$kak_opt_last_focus_in" ]; then            printf "set-face window StatusLine %s\n" "$kak_opt_focus_out_face"        fi    }}

Relevant discussion

Clone this wiki locally

[8]ページ先頭

©2009-2025 Movatter.jp