wezterm: improved activity indicator
This commit is contained in:
parent
abd1d0fdee
commit
f33903a4dd
1 changed files with 36 additions and 18 deletions
|
@ -14,7 +14,8 @@
|
||||||
:nvim "#019833"
|
:nvim "#019833"
|
||||||
:nix "#7EBAE4"
|
:nix "#7EBAE4"
|
||||||
:reddit "#FA4400"
|
:reddit "#FA4400"
|
||||||
:ssh "#F4C82D"}
|
:ssh "#F4C82D"
|
||||||
|
:shell "#F8F8F2"}
|
||||||
enable-ligatures-flags [:calt=1 :clig=1 :liga=1]
|
enable-ligatures-flags [:calt=1 :clig=1 :liga=1]
|
||||||
disable-ligatures-flags [:calt=0 :clig=0 :liga=0]]
|
disable-ligatures-flags [:calt=0 :clig=0 :liga=0]]
|
||||||
(var ligature-panes [])
|
(var ligature-panes [])
|
||||||
|
@ -27,9 +28,12 @@
|
||||||
|
|
||||||
(fn extract-tab-info [title]
|
(fn extract-tab-info [title]
|
||||||
(match title
|
(match title
|
||||||
(where t (t:find "^nvim%s"))
|
(where t (t:find "^nvim%s")) {:title (t:gsub "^nvim%s(.*)" "%1")
|
||||||
{:title (t:gsub "^nvim%s(.*)" "%1") :icon " " :color colors.nvim}
|
:icon " "
|
||||||
(where t (t:find :^nvim$)) {: title :icon " " :color colors.nvim}
|
:color colors.nvim
|
||||||
|
:ignore-activity true}
|
||||||
|
(where t (t:find :^nvim$))
|
||||||
|
{: title :icon " " :color colors.nvim :ignore-activity true}
|
||||||
(where t (t:find "^git%s"))
|
(where t (t:find "^git%s"))
|
||||||
{:title (t:gsub "^git%s(.*)" "%1") :icon " " :color "#F25029"}
|
{:title (t:gsub "^git%s(.*)" "%1") :icon " " :color "#F25029"}
|
||||||
(where t (t:find "^mix%s"))
|
(where t (t:find "^mix%s"))
|
||||||
|
@ -50,22 +54,35 @@
|
||||||
(where t (t:find "^et%s")) {: title :icon " " :color colors.et}
|
(where t (t:find "^et%s")) {: title :icon " " :color colors.et}
|
||||||
(where t (t:find "^just%s")) {: title :icon " " :color "#C87D57"}
|
(where t (t:find "^just%s")) {: title :icon " " :color "#C87D57"}
|
||||||
(where t (t:find :^ytdl)) {: title :icon " " :color "#FF0000"}
|
(where t (t:find :^ytdl)) {: title :icon " " :color "#FF0000"}
|
||||||
(where t (t:find :^instagram-)) {: title :icon " " :color "#FB2179"}
|
(where t (t:find :^instagram-))
|
||||||
(where t (t:find "^gallery-dl%s"))
|
{: title :icon " " :color "#FB2179" :ignore-activity true}
|
||||||
{:title (t:gsub "^gallery-dl%s(.*)" "%1") :icon " " :color "#009900"}
|
(where t (t:find "^gallery-dl%s")) {:title (t:gsub "^gallery-dl%s(.*)"
|
||||||
(where t (t:find :^discord-)) {: title :icon " " :color "#5865F2"}
|
"%1")
|
||||||
(where t (t:find "^bdfr%s"))
|
:icon " "
|
||||||
{:title (t:gsub "^bdfr%s(.*)" "%1") :icon " " :color colors.reddit}
|
:color "#009900"
|
||||||
(where t (t:find "^bdfr-%w+%s")) {: title
|
:ignore-activity true}
|
||||||
:icon " "
|
(where t (t:find :^discord-))
|
||||||
:color colors.reddit}
|
{: title :icon " " :color "#5865F2" :ignore-activity true}
|
||||||
(where t (t:find "^rexit%s")) {: title :icon " " :color colors.reddit}
|
(where t (t:find "^bdfr%s")) {:title (t:gsub "^bdfr%s(.*)" "%1")
|
||||||
|
:icon " "
|
||||||
|
:color colors.reddit
|
||||||
|
:ignore-activity true}
|
||||||
|
(where t (t:find "^bdfr-%w+%s"))
|
||||||
|
{: title :icon " " :color colors.reddit :ignore-activity true}
|
||||||
|
(where t (t:find "^rexit%s"))
|
||||||
|
{: title :icon " " :color colors.reddit :ignore-activity true}
|
||||||
(where t (t:find :^redis-)) {: title :icon " " :color "#DC372C"}
|
(where t (t:find :^redis-)) {: title :icon " " :color "#DC372C"}
|
||||||
(where t (t:find "^%[%w+%]%s")) {: title :icon " " :color colors.ssh}
|
(where t (t:find "^%[%w+%]%s")) {: title :icon " " :color colors.ssh}
|
||||||
(where t (t:find "^%w+@%w+:%s")) {: title :icon " " :color colors.ssh}
|
(where t (t:find "^%w+@%w+:%s")) {: title :icon " " :color colors.ssh}
|
||||||
(where t (t:find "^%w+-dev")) {: title :icon " " :color "#0099CC"}
|
(where t (t:find "^%w+-dev"))
|
||||||
(where t (t:find "^%w+-dl%s")) {: title :icon " " :color "#22BC00"}
|
{: title :icon " " :color "#0099CC" :ignore-activity true}
|
||||||
_ {: title :icon " " :color "#F8F8F2"}))
|
(where t (t:find "^%w+-dl%s"))
|
||||||
|
{: title :icon " " :color "#22BC00" :ignore-activity true}
|
||||||
|
(where t (t:find "^~"))
|
||||||
|
{: title :icon " " :color colors.shell :ignore-activity true}
|
||||||
|
(where t (t:find :^zsh$))
|
||||||
|
{: title :icon " " :color colors.shell :ignore-activity true}
|
||||||
|
_ {: title :icon " " :color colors.shell}))
|
||||||
|
|
||||||
(fn show-tab-activity-indicator [panes]
|
(fn show-tab-activity-indicator [panes]
|
||||||
(each [_ pane (ipairs panes)]
|
(each [_ pane (ipairs panes)]
|
||||||
|
@ -78,7 +95,8 @@
|
||||||
tab-info (extract-tab-info raw-title)
|
tab-info (extract-tab-info raw-title)
|
||||||
title (wezterm.truncate_right tab-info.title
|
title (wezterm.truncate_right tab-info.title
|
||||||
(- max-width 5))
|
(- max-width 5))
|
||||||
(activity-indicator activity-color) (if (show-tab-activity-indicator tab.panes)
|
(activity-indicator activity-color) (if (and (not tab-info.ignore-activity)
|
||||||
|
(show-tab-activity-indicator tab.panes))
|
||||||
(values " "
|
(values " "
|
||||||
"#FFB86C")
|
"#FFB86C")
|
||||||
(values " " nil))]
|
(values " " nil))]
|
||||||
|
|
Loading…
Reference in a new issue