feat(wezterm): update for wezterm nightly
This commit is contained in:
parent
4e5e4b5be5
commit
7079dd47ea
10 changed files with 115 additions and 73 deletions
46
flake.lock
46
flake.lock
|
@ -110,14 +110,16 @@
|
||||||
},
|
},
|
||||||
"nekowinston-nur": {
|
"nekowinston-nur": {
|
||||||
"inputs": {
|
"inputs": {
|
||||||
"nixpkgs": "nixpkgs"
|
"nixpkgs": [
|
||||||
|
"nixpkgs-unstable"
|
||||||
|
]
|
||||||
},
|
},
|
||||||
"locked": {
|
"locked": {
|
||||||
"lastModified": 1676351500,
|
"lastModified": 1677884572,
|
||||||
"narHash": "sha256-hqoge5a3xQwtmKkhDKyEbbD7mqZ40ag12LzrwFtXEDk=",
|
"narHash": "sha256-gUNEbGK6uq2qY41N9MHqXKPwDuzuTMkmd+UtAHvXeUo=",
|
||||||
"owner": "nekowinston",
|
"owner": "nekowinston",
|
||||||
"repo": "nur",
|
"repo": "nur",
|
||||||
"rev": "b56911487277ebc9f8ea36e175cc6a91f1edb68b",
|
"rev": "16fd8cf78df90179ad418aee3911b5b8967ca07a",
|
||||||
"type": "github"
|
"type": "github"
|
||||||
},
|
},
|
||||||
"original": {
|
"original": {
|
||||||
|
@ -128,16 +130,16 @@
|
||||||
},
|
},
|
||||||
"nixpkgs": {
|
"nixpkgs": {
|
||||||
"locked": {
|
"locked": {
|
||||||
"lastModified": 1675940568,
|
"lastModified": 1677624842,
|
||||||
"narHash": "sha256-epG6pOT9V0kS+FUqd7R6/CWkgnZx2DMT5Veqo+y6G3c=",
|
"narHash": "sha256-4DF9DbDuK4/+KYx0L6XcPBeDHUFVCtzok2fWtwXtb5w=",
|
||||||
"owner": "NixOS",
|
"owner": "nixos",
|
||||||
"repo": "nixpkgs",
|
"repo": "nixpkgs",
|
||||||
"rev": "6ccc4a59c3f1b56d039d93da52696633e641bc71",
|
"rev": "d70f5cd5c3bef45f7f52698f39e7cc7a89daa7f0",
|
||||||
"type": "github"
|
"type": "github"
|
||||||
},
|
},
|
||||||
"original": {
|
"original": {
|
||||||
"owner": "NixOS",
|
"owner": "nixos",
|
||||||
"ref": "nixpkgs-unstable",
|
"ref": "nixos-22.11",
|
||||||
"repo": "nixpkgs",
|
"repo": "nixpkgs",
|
||||||
"type": "github"
|
"type": "github"
|
||||||
}
|
}
|
||||||
|
@ -191,22 +193,6 @@
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"nixpkgs_2": {
|
"nixpkgs_2": {
|
||||||
"locked": {
|
|
||||||
"lastModified": 1677624842,
|
|
||||||
"narHash": "sha256-4DF9DbDuK4/+KYx0L6XcPBeDHUFVCtzok2fWtwXtb5w=",
|
|
||||||
"owner": "nixos",
|
|
||||||
"repo": "nixpkgs",
|
|
||||||
"rev": "d70f5cd5c3bef45f7f52698f39e7cc7a89daa7f0",
|
|
||||||
"type": "github"
|
|
||||||
},
|
|
||||||
"original": {
|
|
||||||
"owner": "nixos",
|
|
||||||
"ref": "nixos-22.11",
|
|
||||||
"repo": "nixpkgs",
|
|
||||||
"type": "github"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"nixpkgs_3": {
|
|
||||||
"locked": {
|
"locked": {
|
||||||
"lastModified": 1671271357,
|
"lastModified": 1671271357,
|
||||||
"narHash": "sha256-xRJdLbWK4v2SewmSStYrcLa0YGJpleufl44A19XSW8k=",
|
"narHash": "sha256-xRJdLbWK4v2SewmSStYrcLa0YGJpleufl44A19XSW8k=",
|
||||||
|
@ -222,7 +208,7 @@
|
||||||
"type": "github"
|
"type": "github"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"nixpkgs_4": {
|
"nixpkgs_3": {
|
||||||
"locked": {
|
"locked": {
|
||||||
"lastModified": 1677468890,
|
"lastModified": 1677468890,
|
||||||
"narHash": "sha256-V4MPvt4PKaHSInRLWpaF8ICdC91SH+5bdd0FGxalJIg=",
|
"narHash": "sha256-V4MPvt4PKaHSInRLWpaF8ICdC91SH+5bdd0FGxalJIg=",
|
||||||
|
@ -258,7 +244,7 @@
|
||||||
"flake-compat": "flake-compat",
|
"flake-compat": "flake-compat",
|
||||||
"flake-utils": "flake-utils_2",
|
"flake-utils": "flake-utils_2",
|
||||||
"gitignore": "gitignore",
|
"gitignore": "gitignore",
|
||||||
"nixpkgs": "nixpkgs_3",
|
"nixpkgs": "nixpkgs_2",
|
||||||
"nixpkgs-stable": "nixpkgs-stable"
|
"nixpkgs-stable": "nixpkgs-stable"
|
||||||
},
|
},
|
||||||
"locked": {
|
"locked": {
|
||||||
|
@ -281,7 +267,7 @@
|
||||||
"flake-utils": "flake-utils",
|
"flake-utils": "flake-utils",
|
||||||
"home-manager": "home-manager",
|
"home-manager": "home-manager",
|
||||||
"nekowinston-nur": "nekowinston-nur",
|
"nekowinston-nur": "nekowinston-nur",
|
||||||
"nixpkgs": "nixpkgs_2",
|
"nixpkgs": "nixpkgs",
|
||||||
"nixpkgs-unstable": "nixpkgs-unstable",
|
"nixpkgs-unstable": "nixpkgs-unstable",
|
||||||
"nur": "nur",
|
"nur": "nur",
|
||||||
"pre-commit-hooks": "pre-commit-hooks",
|
"pre-commit-hooks": "pre-commit-hooks",
|
||||||
|
@ -290,7 +276,7 @@
|
||||||
},
|
},
|
||||||
"sops": {
|
"sops": {
|
||||||
"inputs": {
|
"inputs": {
|
||||||
"nixpkgs": "nixpkgs_4",
|
"nixpkgs": "nixpkgs_3",
|
||||||
"nixpkgs-stable": "nixpkgs-stable_2"
|
"nixpkgs-stable": "nixpkgs-stable_2"
|
||||||
},
|
},
|
||||||
"locked": {
|
"locked": {
|
||||||
|
|
|
@ -16,6 +16,7 @@
|
||||||
};
|
};
|
||||||
nur.url = "github:nix-community/NUR";
|
nur.url = "github:nix-community/NUR";
|
||||||
nekowinston-nur.url = "github:nekowinston/nur";
|
nekowinston-nur.url = "github:nekowinston/nur";
|
||||||
|
nekowinston-nur.inputs.nixpkgs.follows = "nixpkgs-unstable";
|
||||||
sops.url = "github:Mic92/sops-nix";
|
sops.url = "github:Mic92/sops-nix";
|
||||||
|
|
||||||
# dev
|
# dev
|
||||||
|
@ -44,7 +45,11 @@
|
||||||
nur = import nur {
|
nur = import nur {
|
||||||
nurpkgs = prev;
|
nurpkgs = prev;
|
||||||
pkgs = prev;
|
pkgs = prev;
|
||||||
repoOverrides = {nekowinston = import nekowinston-nur {pkgs = prev;};};
|
repoOverrides = {
|
||||||
|
nekowinston = import nekowinston-nur {
|
||||||
|
pkgs = import nixpkgs-unstable {system = prev.system;};
|
||||||
|
};
|
||||||
|
};
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
in
|
in
|
||||||
|
|
|
@ -160,7 +160,7 @@ in {
|
||||||
}
|
}
|
||||||
];
|
];
|
||||||
workspaceAutoBackAndForth = true;
|
workspaceAutoBackAndForth = true;
|
||||||
terminal = "${lib.getExe pkgs.wezterm} start --always-new-process";
|
terminal = "wezterm start --always-new-process";
|
||||||
menu = "";
|
menu = "";
|
||||||
keybindings = let
|
keybindings = let
|
||||||
mod = config.xsession.windowManager.i3.config.modifier;
|
mod = config.xsession.windowManager.i3.config.modifier;
|
||||||
|
|
|
@ -47,7 +47,7 @@ in {
|
||||||
enable = true;
|
enable = true;
|
||||||
font = "Berkeley Mono 14";
|
font = "Berkeley Mono 14";
|
||||||
extraConfig.icon-theme = "Papirus-Dark";
|
extraConfig.icon-theme = "Papirus-Dark";
|
||||||
terminal = "${lib.getExe pkgs.wezterm}";
|
terminal = "wezterm";
|
||||||
theme = ./rofi/theme.rasi;
|
theme = ./rofi/theme.rasi;
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
|
@ -172,7 +172,6 @@ wezterm.on("smartpadding", function(window, pane)
|
||||||
end)
|
end)
|
||||||
|
|
||||||
-- custom status
|
-- custom status
|
||||||
---@diagnostic disable-next-line: unused-local
|
|
||||||
wezterm.on("update-status", function(window, pane)
|
wezterm.on("update-status", function(window, pane)
|
||||||
if wezterm.GLOBAL.smart_padding ~= nil then
|
if wezterm.GLOBAL.smart_padding ~= nil then
|
||||||
wezterm.emit("smartpadding", window, pane)
|
wezterm.emit("smartpadding", window, pane)
|
||||||
|
@ -186,6 +185,15 @@ wezterm.on("update-status", function(window, pane)
|
||||||
leader_text = " "
|
leader_text = " "
|
||||||
end
|
end
|
||||||
|
|
||||||
|
local mode_text = ""
|
||||||
|
local mode = window:active_key_table()
|
||||||
|
local modes = {
|
||||||
|
resize_mode = "RESIZE",
|
||||||
|
}
|
||||||
|
if modes[mode] ~= nil then
|
||||||
|
mode_text = modes[mode]
|
||||||
|
end
|
||||||
|
|
||||||
local divider_bg = first_tab_active and palette.ansi[2]
|
local divider_bg = first_tab_active and palette.ansi[2]
|
||||||
or palette.tab_bar.inactive_tab.bg_color
|
or palette.tab_bar.inactive_tab.bg_color
|
||||||
|
|
||||||
|
@ -193,6 +201,9 @@ wezterm.on("update-status", function(window, pane)
|
||||||
{ Foreground = { Color = palette.background } },
|
{ Foreground = { Color = palette.background } },
|
||||||
{ Background = { Color = palette.ansi[5] } },
|
{ Background = { Color = palette.ansi[5] } },
|
||||||
{ Text = leader_text },
|
{ Text = leader_text },
|
||||||
|
{ Attribute = { Intensity = "Bold" } },
|
||||||
|
{ Text = mode_text },
|
||||||
|
"ResetAttributes",
|
||||||
{ Background = { Color = divider_bg } },
|
{ Background = { Color = divider_bg } },
|
||||||
{ Foreground = { Color = palette.ansi[5] } },
|
{ Foreground = { Color = palette.ansi[5] } },
|
||||||
{ Text = DIVIDERS.RIGHT },
|
{ Text = DIVIDERS.RIGHT },
|
||||||
|
@ -200,8 +211,8 @@ wezterm.on("update-status", function(window, pane)
|
||||||
|
|
||||||
local time = wezterm.time.now():format("%H:%M")
|
local time = wezterm.time.now():format("%H:%M")
|
||||||
local sun_is_up = wezterm.time.now():sun_times(48.2, 16.366667).up
|
local sun_is_up = wezterm.time.now():sun_times(48.2, 16.366667).up
|
||||||
local icon = sun_is_up and " " or ""
|
local icon = sun_is_up and " " or " "
|
||||||
local text = string.format(" %s %s", icon, time)
|
local text = string.format("%s %s", icon, time)
|
||||||
|
|
||||||
window:set_right_status(wezterm.format({
|
window:set_right_status(wezterm.format({
|
||||||
{ Background = { Color = palette.tab_bar.background } },
|
{ Background = { Color = palette.tab_bar.background } },
|
||||||
|
|
|
@ -2,24 +2,16 @@ local wezterm = require("wezterm")
|
||||||
|
|
||||||
local M = {}
|
local M = {}
|
||||||
|
|
||||||
M.get_font = function(name)
|
-- fonts I like, with the settings I prefer
|
||||||
-- fonts I like, with the settings I prefer
|
-- kept separately from the rest of the config so that I can easily change them
|
||||||
-- kept separately from the rest of the config so that I can easily change them
|
local fonts = {
|
||||||
local fonts = {
|
|
||||||
berkeley = {
|
berkeley = {
|
||||||
font = {
|
font = "Berkeley Mono",
|
||||||
family = "Berkeley Mono",
|
|
||||||
-- weight = "Bold",
|
|
||||||
},
|
|
||||||
size = 16,
|
size = 16,
|
||||||
},
|
},
|
||||||
comic = {
|
comic = {
|
||||||
font = "Comic Code Ligatures",
|
font = "Comic Code Ligatures",
|
||||||
size = 18,
|
size = 16,
|
||||||
},
|
|
||||||
fantasque = {
|
|
||||||
font = "Fantasque Sans Mono",
|
|
||||||
size = 20,
|
|
||||||
},
|
},
|
||||||
victor = {
|
victor = {
|
||||||
font = {
|
font = {
|
||||||
|
@ -27,10 +19,11 @@ M.get_font = function(name)
|
||||||
weight = "DemiBold",
|
weight = "DemiBold",
|
||||||
harfbuzz_features = { "ss02=1" },
|
harfbuzz_features = { "ss02=1" },
|
||||||
},
|
},
|
||||||
size = 18,
|
size = 15,
|
||||||
},
|
},
|
||||||
}
|
}
|
||||||
|
|
||||||
|
M.get_font = function(name)
|
||||||
return {
|
return {
|
||||||
font = wezterm.font_with_fallback({
|
font = wezterm.font_with_fallback({
|
||||||
fonts[name].font,
|
fonts[name].font,
|
||||||
|
@ -40,4 +33,17 @@ M.get_font = function(name)
|
||||||
}
|
}
|
||||||
end
|
end
|
||||||
|
|
||||||
|
wezterm.on("switch-font", function(window, _)
|
||||||
|
local next_font = next(fonts, wezterm.GLOBAL.font)
|
||||||
|
if next_font == nil then
|
||||||
|
next_font = next(fonts)
|
||||||
|
end
|
||||||
|
wezterm.GLOBAL.font = next_font
|
||||||
|
|
||||||
|
window:set_config_overrides({
|
||||||
|
font = M.get_font(next_font).font,
|
||||||
|
font_size = M.get_font(next_font).size,
|
||||||
|
})
|
||||||
|
end)
|
||||||
|
|
||||||
return M
|
return M
|
||||||
|
|
|
@ -51,10 +51,9 @@ map("l", "LEADER|SHIFT", act.AdjustPaneSize({ "Right", 5 }))
|
||||||
-- spawn & close
|
-- spawn & close
|
||||||
map("c", "LEADER", act.SpawnTab("CurrentPaneDomain"))
|
map("c", "LEADER", act.SpawnTab("CurrentPaneDomain"))
|
||||||
map("x", "LEADER", act.CloseCurrentPane({ confirm = true }))
|
map("x", "LEADER", act.CloseCurrentPane({ confirm = true }))
|
||||||
map("t", "SHIFT|CTRL", act.SpawnTab("CurrentPaneDomain"))
|
map("t", { "SHIFT|CTRL", "SUPER" }, act.SpawnTab("CurrentPaneDomain"))
|
||||||
map("t", "SUPER", act.SpawnTab("CurrentPaneDomain"))
|
map("w", { "SHIFT|CTRL", "SUPER" }, act.CloseCurrentTab({ confirm = true }))
|
||||||
map("w", "SHIFT|CTRL", act.CloseCurrentTab({ confirm = true }))
|
map("n", { "SHIFT|CTRL", "SUPER" }, act.SpawnWindow)
|
||||||
map("w", "SUPER", act.CloseCurrentTab({ confirm = true }))
|
|
||||||
-- zoom states
|
-- zoom states
|
||||||
map("z", { "LEADER", "SUPER" }, act.TogglePaneZoomState)
|
map("z", { "LEADER", "SUPER" }, act.TogglePaneZoomState)
|
||||||
map("Z", { "LEADER", "SUPER" }, toggleTabBar)
|
map("Z", { "LEADER", "SUPER" }, toggleTabBar)
|
||||||
|
@ -64,26 +63,59 @@ map("c", { "SHIFT|CTRL", "SUPER" }, act.CopyTo("Clipboard"))
|
||||||
map("v", { "SHIFT|CTRL", "SUPER" }, act.PasteFrom("Clipboard"))
|
map("v", { "SHIFT|CTRL", "SUPER" }, act.PasteFrom("Clipboard"))
|
||||||
map("f", { "SHIFT|CTRL", "SUPER" }, act.Search("CurrentSelectionOrEmptyString"))
|
map("f", { "SHIFT|CTRL", "SUPER" }, act.Search("CurrentSelectionOrEmptyString"))
|
||||||
-- rotation
|
-- rotation
|
||||||
map("r", { "LEADER", "SUPER" }, act.RotatePanes("Clockwise"))
|
map("e", { "LEADER", "SUPER" }, act.RotatePanes("Clockwise"))
|
||||||
-- pickers
|
-- pickers
|
||||||
map(" ", "LEADER", act.QuickSelect)
|
map(" ", "LEADER", act.QuickSelect)
|
||||||
map("o", { "LEADER", "SUPER" }, openUrl)
|
map("o", { "LEADER", "SUPER" }, openUrl)
|
||||||
map("p", { "LEADER", "SUPER" }, act.PaneSelect({ alphabet = "asdfghjkl;" }))
|
map("p", { "LEADER", "SUPER" }, act.PaneSelect({ alphabet = "asdfghjkl;" }))
|
||||||
map("R", { "LEADER", "SUPER" }, act.ReloadConfiguration)
|
map("R", { "LEADER", "SUPER" }, act.ReloadConfiguration)
|
||||||
map("u", "SHIFT|CTRL", act.CharSelect)
|
map("u", "SHIFT|CTRL", act.CharSelect)
|
||||||
|
map("p", { "SHIFT|CTRL", "SHIFT|SUPER" }, act.ActivateCommandPalette)
|
||||||
-- view
|
-- view
|
||||||
map("Enter", "ALT", act.ToggleFullScreen)
|
map("Enter", "ALT", act.ToggleFullScreen)
|
||||||
map("-", { "CTRL", "SUPER" }, act.DecreaseFontSize)
|
map("-", { "CTRL", "SUPER" }, act.DecreaseFontSize)
|
||||||
map("=", { "CTRL", "SUPER" }, act.IncreaseFontSize)
|
map("=", { "CTRL", "SUPER" }, act.IncreaseFontSize)
|
||||||
map("0", { "CTRL", "SUPER" }, act.ResetFontSize)
|
map("0", { "CTRL", "SUPER" }, act.ResetFontSize)
|
||||||
-- OS defaults
|
-- switch fonts
|
||||||
map("n", "SHIFT|CTRL", act.SpawnWindow)
|
map("f", "LEADER", act.EmitEvent("switch-font"))
|
||||||
map("n", "SUPER", act.SpawnWindow)
|
|
||||||
-- debug
|
-- debug
|
||||||
map("l", "SHIFT|CTRL", act.ShowDebugOverlay)
|
map("l", "SHIFT|CTRL", act.ShowDebugOverlay)
|
||||||
|
|
||||||
|
map(
|
||||||
|
"r",
|
||||||
|
{ "LEADER", "SUPER" },
|
||||||
|
act.ActivateKeyTable({
|
||||||
|
name = "resize_mode",
|
||||||
|
one_shot = false,
|
||||||
|
})
|
||||||
|
)
|
||||||
|
|
||||||
|
local key_tables = {
|
||||||
|
resize_mode = {
|
||||||
|
{ key = "h", action = act.AdjustPaneSize({ "Left", 1 }) },
|
||||||
|
{ key = "j", action = act.AdjustPaneSize({ "Down", 1 }) },
|
||||||
|
{ key = "k", action = act.AdjustPaneSize({ "Up", 1 }) },
|
||||||
|
{ key = "l", action = act.AdjustPaneSize({ "Right", 1 }) },
|
||||||
|
{ key = "LeftArrow", action = act.AdjustPaneSize({ "Left", 1 }) },
|
||||||
|
{ key = "DownArrow", action = act.AdjustPaneSize({ "Down", 1 }) },
|
||||||
|
{ key = "UpArrow", action = act.AdjustPaneSize({ "Up", 1 }) },
|
||||||
|
{ key = "RightArrow", action = act.AdjustPaneSize({ "Right", 1 }) },
|
||||||
|
},
|
||||||
|
}
|
||||||
|
|
||||||
|
-- add a common escape sequence to all key tables
|
||||||
|
for k, _ in pairs(key_tables) do
|
||||||
|
table.insert(key_tables[k], { key = "Escape", action = "PopKeyTable" })
|
||||||
|
table.insert(key_tables[k], { key = "Enter", action = "PopKeyTable" })
|
||||||
|
table.insert(
|
||||||
|
key_tables[k],
|
||||||
|
{ key = "c", mods = "CTRL", action = "PopKeyTable" }
|
||||||
|
)
|
||||||
|
end
|
||||||
|
|
||||||
return {
|
return {
|
||||||
leader = { key = "s", mods = "CTRL", timeout_milliseconds = 5000 },
|
leader = { key = "s", mods = "CTRL", timeout_milliseconds = 5000 },
|
||||||
keys = shortcuts,
|
keys = shortcuts,
|
||||||
disable_default_key_bindings = true,
|
disable_default_key_bindings = true,
|
||||||
|
key_tables = key_tables,
|
||||||
}
|
}
|
||||||
|
|
|
@ -2,10 +2,11 @@ local wezterm = require("wezterm")
|
||||||
local theme = require("theme")
|
local theme = require("theme")
|
||||||
require("bar")
|
require("bar")
|
||||||
|
|
||||||
local font = require("fonts").get_font("berkeley")
|
|
||||||
wezterm.GLOBAL = {
|
wezterm.GLOBAL = {
|
||||||
|
font = "berkeley",
|
||||||
enable_tab_bar = true,
|
enable_tab_bar = true,
|
||||||
}
|
}
|
||||||
|
local font = require("fonts").get_font(wezterm.GLOBAL.font)
|
||||||
|
|
||||||
local options = {
|
local options = {
|
||||||
set_environment_variables = {
|
set_environment_variables = {
|
||||||
|
|
|
@ -59,6 +59,7 @@ in {
|
||||||
for conf in "${functionsDir}"/**/*.zsh; do
|
for conf in "${functionsDir}"/**/*.zsh; do
|
||||||
source "$conf"
|
source "$conf"
|
||||||
done
|
done
|
||||||
|
[[ "$TERM_PROGRAM" == "WezTerm" ]] && TERM=wezterm
|
||||||
'';
|
'';
|
||||||
|
|
||||||
envExtra = ''
|
envExtra = ''
|
||||||
|
|
|
@ -51,7 +51,7 @@ in {
|
||||||
nur.repos.nekowinston.org-stats
|
nur.repos.nekowinston.org-stats
|
||||||
(nerdfonts.override {fonts = ["NerdFontsSymbolsOnly"];})
|
(nerdfonts.override {fonts = ["NerdFontsSymbolsOnly"];})
|
||||||
victor-mono
|
victor-mono
|
||||||
unstable.wezterm
|
nur.repos.nekowinston.wezterm-nightly
|
||||||
]
|
]
|
||||||
++ lib.optionals isLinux [
|
++ lib.optionals isLinux [
|
||||||
_1password-gui
|
_1password-gui
|
||||||
|
|
Loading…
Reference in a new issue