home: change default terminal to wezterm

This commit is contained in:
Dmitriy Pleshevskiy 2023-07-31 00:09:57 +03:00
parent 1d4760974f
commit b06cb8ee3a
Signed by: pleshevskiy
GPG key ID: 79C4487B44403985
7 changed files with 93 additions and 19 deletions

View file

@ -0,0 +1,66 @@
{ lib, config, pkgs, ... }:
let
cfg = config.local.wezterm;
themeCfg = config.local.theme;
in
{
options.local.wezterm = with lib; {
fontSize = mkOption {
type = types.number;
default = 11.0;
description = "Wezterm font size";
};
};
config = {
programs.wezterm = {
enable = true;
colorSchemes = {
myCoolTheme = {
ansi = [
themeCfg.window.regular.color0
themeCfg.window.regular.color1
themeCfg.window.regular.color2
themeCfg.window.regular.color3
themeCfg.window.regular.color4
themeCfg.window.regular.color5
themeCfg.window.regular.color6
themeCfg.window.regular.color7
];
brights = [
themeCfg.window.bold.color8
themeCfg.window.bold.color9
themeCfg.window.bold.color10
themeCfg.window.bold.color11
themeCfg.window.bold.color12
themeCfg.window.bold.color13
themeCfg.window.bold.color14
themeCfg.window.bold.color15
];
indexed = {
"16" = themeCfg.window.extended.color16;
"17" = themeCfg.window.extended.color17;
"18" = themeCfg.window.extended.color18;
"19" = themeCfg.window.extended.color19;
};
background = themeCfg.window.background;
foreground = themeCfg.window.mainText;
cursor_bg = themeCfg.window.cursor;
cursor_border = themeCfg.window.cursor;
cursor_fg = themeCfg.window.cursorText;
selection_bg = themeCfg.window.selection;
selection_fg = themeCfg.window.selectionText;
};
};
extraConfig = ''
return {
font = wezterm.font("monospace"),
font_size = ${toString cfg.fontSize},
color_scheme = "myCoolTheme",
hide_tab_bar_if_only_one_tab = true,
}
'';
};
};
}

View file

@ -52,7 +52,7 @@ import XMonad.Util.Run
-- The preferred terminal program, which is used in a binding below and by -- The preferred terminal program, which is used in a binding below and by
-- certain contrib modules. -- certain contrib modules.
-- --
myTerminal = "alacritty" myTerminal = "wezterm start"
-- Whether focus follows the mouse pointer. -- Whether focus follows the mouse pointer.
myFocusFollowsMouse = False myFocusFollowsMouse = False
@ -230,12 +230,17 @@ myEventHook = mempty
-- --
myManageHook = manageApps myManageHook = manageApps
where where
anyOf :: [Query Bool] -> Query Bool
anyOf = foldl (<||>) (pure False)
role = stringProperty "WM_WINDOW_ROLE" role = stringProperty "WM_WINDOW_ROLE"
isPopup = role =? "pop-up" isPopup = role =? "pop-up"
isPinentry = anyOf [className =? "Gcr-promter", className =? "Pinentry"] isPinentry = anyOf [className =? "Gcr-promter", className =? "Pinentry"]
isWezterm = className =? "org.wezfurlong.wezterm"
isAlacritty = className =? "Alacritty" isAlacritty = className =? "Alacritty"
anyOf :: [Query Bool] -> Query Bool isTerminal = anyOf [isWezterm, isAlacritty]
anyOf = foldl (<||>) (pure False)
tileBelow = insertPosition Below Newer tileBelow = insertPosition Below Newer
manageApps = manageApps =
composeOne composeOne
@ -253,7 +258,7 @@ myManageHook = manageApps
isPinentry isPinentry
] ]
-?> doCenterFloat, -?> doCenterFloat,
isAlacritty -?> tileBelow isTerminal -?> tileBelow
] ]
------------------------------------------------------------------------ ------------------------------------------------------------------------
@ -404,9 +409,9 @@ myProjects =
terminal' wd' cmd' = terminal' wd' cmd' =
myTerminal ++ workdir ++ command myTerminal ++ workdir ++ command
where where
workdir = " --working-directory " ++ wd' workdir = " --cwd " ++ wd'
command = case cmd' of command = case cmd' of
Just c -> " --command " ++ c Just c -> " -- " ++ c
_ -> "" _ -> ""
myPromptConfig :: XPConfig myPromptConfig :: XPConfig

View file

@ -6,7 +6,8 @@
./git ./git
../../modules/window_manager ../../modules/window_manager
../../modules/terminal.nix ../../modules/terminal/wezterm.nix
../../modules/terminal/alacritty.nix
../../modules/shell.nix ../../modules/shell.nix
../../modules/notifications ../../modules/notifications

View file

@ -3,7 +3,7 @@
{ {
imports = [ imports = [
../../modules/window_manager ../../modules/window_manager
../../modules/terminal.nix ../../modules/terminal/wezterm.nix
../../modules/shell.nix ../../modules/shell.nix
../../modules/notifications ../../modules/notifications

View file

@ -19,7 +19,8 @@ in
extraHomeModule = { ... }: { extraHomeModule = { ... }: {
local.polybar.wifiDevice = "wlp11s0f3u2"; local.polybar.wifiDevice = "wlp11s0f3u2";
local.alacritty.fontSize = 8.0; # local.alacritty.fontSize = 8.0;
local.wezterm.fontSize = 11.0;
}; };
}; };
@ -36,7 +37,8 @@ in
extraHomeModule = { ... }: { extraHomeModule = { ... }: {
local.polybar.wifiDevice = "wlp2s0"; local.polybar.wifiDevice = "wlp2s0";
local.alacritty.fontSize = 6.0; # local.alacritty.fontSize = 6.0;
local.wezterm.fontSize = 9.0;
}; };
}; };

View file

@ -31,11 +31,11 @@ User configurations are included.
### Core Programs ### Core Programs
| Type | Program | | Type | Program |
| :------------- | :-------- | | :------------- | :------ |
| Status Bar | Polybar | | Status Bar | Polybar |
| Window Manager | XMonad | | Window Manager | XMonad |
| Launcher | Dmenu | | Launcher | Dmenu |
| Terminal | Alacritty | | Terminal | Wezterm |
| Editor | Neovim | | Editor | Neovim |
| File Manager | vifm | | File Manager | vifm |
| Shell | Zsh | | Shell | Zsh |