new starship and wezterm statuses
This commit is contained in:
parent
96744317ff
commit
a9f9653d1f
2 changed files with 105 additions and 84 deletions
|
|
@ -50,17 +50,9 @@
|
||||||
tmux = {
|
tmux = {
|
||||||
enable = true;
|
enable = true;
|
||||||
clock24 = true;
|
clock24 = true;
|
||||||
terminal = "tmux-256color";
|
terminal = "xterm-256color";
|
||||||
mouse = true;
|
mouse = true;
|
||||||
keyMode = "vi";
|
keyMode = "vi";
|
||||||
extraConfig = ''
|
|
||||||
set-option -ga terminal-overrides ",alacritty:Tc"
|
|
||||||
'';
|
|
||||||
};
|
|
||||||
|
|
||||||
zellij = {
|
|
||||||
enable = true;
|
|
||||||
enableBashIntegration = true;
|
|
||||||
};
|
};
|
||||||
|
|
||||||
starship = {
|
starship = {
|
||||||
|
|
@ -69,68 +61,19 @@
|
||||||
enableFishIntegration = true;
|
enableFishIntegration = true;
|
||||||
settings = {
|
settings = {
|
||||||
add_newline = false;
|
add_newline = false;
|
||||||
format = ''
|
format = "$git_branch$git_status$nix_shell[ ](bold green)";
|
||||||
[░▒▓](main)$os[](fg:main bg:cyan)$directory[](fg:cyan bg:blue)$git_branch$git_status[](fg:blue bg:purple)$nix_shell$rust[](fg:purple bg:yellow)$time[](fg:yellow)$fill[](fg:yellow)$cmd_duration[](fg:purple bg:yellow)[](fg:blue bg:purple)[](fg:cyan bg:blue)$hostname[▓▒░](main)
|
|
||||||
[ ](blue)'';
|
|
||||||
palette = "stylix";
|
palette = "stylix";
|
||||||
os = {
|
git_branch.symbol = " ";
|
||||||
disabled = false;
|
|
||||||
style = "bg:main fg:background";
|
|
||||||
symbols.NixOS = " ";
|
|
||||||
};
|
|
||||||
directory = {
|
|
||||||
format = "[ $path ]($style)";
|
|
||||||
style = "fg:background bg:cyan";
|
|
||||||
truncation_length = 3;
|
|
||||||
truncation_symbol = " ";
|
|
||||||
substitutions = {
|
|
||||||
Documents = " ";
|
|
||||||
Downloads = " ";
|
|
||||||
Music = " ";
|
|
||||||
Pictures = " ";
|
|
||||||
Videos = " ";
|
|
||||||
};
|
|
||||||
};
|
|
||||||
git_branch = {
|
|
||||||
format = "[[ $symbol $branch ](fg:background bg:blue)]($style)";
|
|
||||||
style = "bg:blue";
|
|
||||||
symbol = "";
|
|
||||||
};
|
|
||||||
git_status = {
|
|
||||||
format =
|
|
||||||
"[[($all_status$ahead_behind )](fg:background bg:blue)]($style)";
|
|
||||||
style = "bg:blue";
|
|
||||||
};
|
|
||||||
right_format = "$character";
|
|
||||||
nix_shell = {
|
nix_shell = {
|
||||||
format = "[[ $symbol ](fg:background bg:purple)]($style)";
|
format = "via [$symbol $state]($style) ";
|
||||||
heuristic = true;
|
heuristic = true;
|
||||||
style = "bg:purple";
|
|
||||||
symbol = "";
|
symbol = "";
|
||||||
};
|
};
|
||||||
rust = {
|
right_format = "$cmd_duration$character";
|
||||||
format = "[[ $symbol ($version) ](fg:background bg:purple)]($style)";
|
|
||||||
style = "bg:purple";
|
|
||||||
symbol = "";
|
|
||||||
};
|
|
||||||
time = {
|
|
||||||
disabled = false;
|
|
||||||
format = "[[ $time ](fg:background bg:yellow)]($style)";
|
|
||||||
style = "bg:yellow";
|
|
||||||
time_format = "%R";
|
|
||||||
};
|
|
||||||
fill.symbol = " ";
|
|
||||||
cmd_duration = {
|
cmd_duration = {
|
||||||
format = "[[ $duration ](fg:background bg:yellow)]($style)";
|
format = "[ $duration ]($style)";
|
||||||
min_time = 0;
|
style = "yellow";
|
||||||
style = "bg:yellow";
|
min_time = 10;
|
||||||
};
|
|
||||||
hostname = {
|
|
||||||
format =
|
|
||||||
"[[$ssh_symbol](fg:background bg:cyan)[](bg:cyan fg:main)$hostname ]($style)";
|
|
||||||
ssh_only = false;
|
|
||||||
ssh_symbol = " ";
|
|
||||||
style = "fg:background bg:main";
|
|
||||||
};
|
};
|
||||||
character = {
|
character = {
|
||||||
error_symbol = "[✗](bold red)";
|
error_symbol = "[✗](bold red)";
|
||||||
|
|
@ -138,6 +81,7 @@
|
||||||
};
|
};
|
||||||
palettes.stylix = {
|
palettes.stylix = {
|
||||||
background = config.lib.stylix.colors.withHashtag.base00;
|
background = config.lib.stylix.colors.withHashtag.base00;
|
||||||
|
backgroundAlt = config.lib.stylix.colors.withHashtag.base01;
|
||||||
green = config.lib.stylix.colors.withHashtag.base0B;
|
green = config.lib.stylix.colors.withHashtag.base0B;
|
||||||
cyan = config.lib.stylix.colors.withHashtag.base0C;
|
cyan = config.lib.stylix.colors.withHashtag.base0C;
|
||||||
yellow = config.lib.stylix.colors.withHashtag.base0A;
|
yellow = config.lib.stylix.colors.withHashtag.base0A;
|
||||||
|
|
@ -145,6 +89,8 @@
|
||||||
blue = config.lib.stylix.colors.withHashtag.base0D;
|
blue = config.lib.stylix.colors.withHashtag.base0D;
|
||||||
purple = config.lib.stylix.colors.withHashtag.base0E;
|
purple = config.lib.stylix.colors.withHashtag.base0E;
|
||||||
main = config.lib.stylix.colors.withHashtag.base05;
|
main = config.lib.stylix.colors.withHashtag.base05;
|
||||||
|
seco = config.lib.stylix.colors.withHashtag.base04;
|
||||||
|
tert = config.lib.stylix.colors.withHashtag.base06;
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
|
||||||
|
|
@ -5,42 +5,117 @@
|
||||||
enable = true;
|
enable = true;
|
||||||
extraConfig = # lua
|
extraConfig = # lua
|
||||||
''
|
''
|
||||||
local act = wezterm.action
|
local act = wezterm.action
|
||||||
local function get_initial_cols_by_hostname()
|
local function get_initial_cols_by_hostname()
|
||||||
local hostname = wezterm.hostname()
|
local hostname = wezterm.hostname()
|
||||||
if hostname == "rotterdam" then
|
if hostname == "rotterdam" then
|
||||||
return 111
|
return 111
|
||||||
elseif hostname == "io" then
|
elseif hostname == "io" then
|
||||||
return 93
|
return 93
|
||||||
else
|
else
|
||||||
return 100
|
return 100
|
||||||
end
|
|
||||||
end
|
end
|
||||||
return {
|
end
|
||||||
|
wezterm.on('update-right-status', function(window, pane)
|
||||||
|
-- Each element holds the text for a cell in a "powerline" style << fade
|
||||||
|
local cells = {}
|
||||||
|
|
||||||
|
-- Figure out the cwd and host of the current pane.
|
||||||
|
-- This will pick up the hostname for the remote host if your
|
||||||
|
-- shell is using OSC 7 on the remote host.
|
||||||
|
local cwd_uri = pane:get_current_working_dir()
|
||||||
|
if cwd_uri then
|
||||||
|
local cwd = ""
|
||||||
|
local hostname = ""
|
||||||
|
|
||||||
|
cwd = cwd_uri.file_path
|
||||||
|
hostname = cwd_uri.host or wezterm.hostname()
|
||||||
|
|
||||||
|
-- Remove the domain name portion of the hostname
|
||||||
|
local dot = hostname:find '[.]'
|
||||||
|
if dot then
|
||||||
|
hostname = hostname:sub(1, dot - 1)
|
||||||
|
end
|
||||||
|
if hostname == "" then
|
||||||
|
hostname = wezterm.hostname()
|
||||||
|
end
|
||||||
|
|
||||||
|
table.insert(cells, cwd)
|
||||||
|
table.insert(cells, hostname)
|
||||||
|
end
|
||||||
|
|
||||||
|
local date = wezterm.strftime '%H:%M'
|
||||||
|
table.insert(cells, date)
|
||||||
|
|
||||||
|
-- An entry for each battery (typically 0 or 1 battery)
|
||||||
|
for _, b in ipairs(wezterm.battery_info()) do
|
||||||
|
table.insert(cells, string.format('%.0f%%', b.state_of_charge * 100))
|
||||||
|
end
|
||||||
|
|
||||||
|
local SOLID_LEFT_ARROW = ''
|
||||||
|
|
||||||
|
-- Color palette for the backgrounds of each cell
|
||||||
|
local colors = {
|
||||||
|
'${config.lib.stylix.colors.withHashtag.base01}',
|
||||||
|
'${config.lib.stylix.colors.withHashtag.base02}',
|
||||||
|
'${config.lib.stylix.colors.withHashtag.base03}',
|
||||||
|
'${config.lib.stylix.colors.withHashtag.base04}',
|
||||||
|
'${config.lib.stylix.colors.withHashtag.base04}',
|
||||||
|
}
|
||||||
|
|
||||||
|
-- Foreground color for the text across the fade
|
||||||
|
local text_fg = '${config.lib.stylix.colors.withHashtag.base05}'
|
||||||
|
|
||||||
|
-- The elements to be formatted
|
||||||
|
local elements = {}
|
||||||
|
-- How many cells have been formatted
|
||||||
|
local num_cells = 0
|
||||||
|
|
||||||
|
-- Translate a cell into elements
|
||||||
|
function push(text, is_last)
|
||||||
|
local cell_no = num_cells + 1
|
||||||
|
table.insert(elements, { Foreground = { Color = text_fg } })
|
||||||
|
table.insert(elements, { Background = { Color = colors[cell_no] } })
|
||||||
|
table.insert(elements, { Text = text .. ' ' })
|
||||||
|
if not is_last then
|
||||||
|
table.insert(elements, { Foreground = { Color = colors[cell_no + 1] } })
|
||||||
|
table.insert(elements, { Text = SOLID_LEFT_ARROW })
|
||||||
|
end
|
||||||
|
num_cells = num_cells + 1
|
||||||
|
end
|
||||||
|
|
||||||
|
while #cells > 0 do
|
||||||
|
local cell = table.remove(cells, 1)
|
||||||
|
push(cell, #cells == 0)
|
||||||
|
end
|
||||||
|
|
||||||
|
window:set_right_status(wezterm.format(elements))
|
||||||
|
end)
|
||||||
|
return {
|
||||||
disable_default_key_bindings = true,
|
disable_default_key_bindings = true,
|
||||||
window_padding = {
|
window_padding = {
|
||||||
left = "2pt",
|
left = "2pt",
|
||||||
right = "2pt",
|
right = "2pt",
|
||||||
bottom = 0,
|
bottom = "2pt",
|
||||||
top = 0,
|
top = "2pt",
|
||||||
},
|
},
|
||||||
use_fancy_tab_bar = true,
|
|
||||||
command_palette_font_size = 12,
|
command_palette_font_size = 12,
|
||||||
initial_cols = get_initial_cols_by_hostname(),
|
initial_cols = get_initial_cols_by_hostname(),
|
||||||
initial_rows = 32,
|
initial_rows = 32,
|
||||||
inactive_pane_hsb = {
|
inactive_pane_hsb = {
|
||||||
saturation = 0.7,
|
brightness = 0.5,
|
||||||
brightness = 0.5
|
|
||||||
},
|
},
|
||||||
hide_tab_bar_if_only_one_tab = false,
|
hide_tab_bar_if_only_one_tab = false,
|
||||||
show_new_tab_button_in_tab_bar = true,
|
show_new_tab_button_in_tab_bar = false,
|
||||||
|
tab_bar_at_bottom = true,
|
||||||
|
use_fancy_tab_bar = false,
|
||||||
front_end = "WebGpu",
|
front_end = "WebGpu",
|
||||||
keys = {
|
keys = {
|
||||||
{ key = 'Tab', mods = 'CTRL', action = act.ActivateTabRelative(1) },
|
{ key = 'Tab', mods = 'CTRL', action = act.ActivateTabRelative(1) },
|
||||||
{ key = 'Tab', mods = 'SHIFT|CTRL', action = act.ActivateTabRelative(-1) },
|
{ key = 'Tab', mods = 'SHIFT|CTRL', action = act.ActivateTabRelative(-1) },
|
||||||
{ key = 'Enter', mods = 'ALT', action = act.ToggleFullScreen },
|
{ key = 'Enter', mods = 'ALT', action = act.ToggleFullScreen },
|
||||||
{ key = ':', mods = 'SHIFT|CTRL', action = act.SplitVertical{ domain = 'CurrentPaneDomain' } },
|
{ key = ':', mods = 'SHIFT|CTRL', action = act.SplitVertical{ domain = 'CurrentPaneDomain' } },
|
||||||
{ key = '?', mods = 'SHIFT|CTRL', action = act.SplitHorizontal{ domain = 'CurrentPaneDomain' } },
|
{ key = '?', mods = 'SHIFT|CTRL', action = act.SplitHorizontal{ domain = 'CurrentPaneDomain' } },
|
||||||
{ key = '+', mods = 'CTRL', action = act.IncreaseFontSize },
|
{ key = '+', mods = 'CTRL', action = act.IncreaseFontSize },
|
||||||
{ key = '=', mods = 'CTRL', action = act.IncreaseFontSize },
|
{ key = '=', mods = 'CTRL', action = act.IncreaseFontSize },
|
||||||
{ key = '-', mods = 'CTRL', action = act.DecreaseFontSize },
|
{ key = '-', mods = 'CTRL', action = act.DecreaseFontSize },
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue