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

View file

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

View file

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

View file

@ -19,7 +19,8 @@ in
extraHomeModule = { ... }: {
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 = { ... }: {
local.polybar.wifiDevice = "wlp2s0";
local.alacritty.fontSize = 6.0;
# local.alacritty.fontSize = 6.0;
local.wezterm.fontSize = 9.0;
};
};

View file

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