Replace alacritty with wezterm
as alacritty doesn't support ligatures. See https://github.com/alacritty/alacritty/issues/50
This commit is contained in:
parent
83e5e56a6b
commit
711c0eb0f0
7 changed files with 55 additions and 172 deletions
|
|
@ -3,6 +3,7 @@
|
||||||
{
|
{
|
||||||
console.font = "Lat2-Terminus16";
|
console.font = "Lat2-Terminus16";
|
||||||
fonts.packages = with pkgs; lib.mkIf config.jalr.gui.enable [
|
fonts.packages = with pkgs; lib.mkIf config.jalr.gui.enable [
|
||||||
|
nerd-fonts.fira-code
|
||||||
nerd-fonts.iosevka
|
nerd-fonts.iosevka
|
||||||
nerd-fonts.iosevka-term
|
nerd-fonts.iosevka-term
|
||||||
nerd-fonts.iosevka-term-slab
|
nerd-fonts.iosevka-term-slab
|
||||||
|
|
|
||||||
|
|
@ -1,158 +0,0 @@
|
||||||
{ lib, pkgs, nixosConfig, ... }:
|
|
||||||
let
|
|
||||||
solarized = import ./solarized.nix;
|
|
||||||
tomlFormat = pkgs.formats.toml { };
|
|
||||||
|
|
||||||
colorschemes = {
|
|
||||||
# https://github.com/alacritty/alacritty/wiki/Color-schemes#solarized
|
|
||||||
solarized-dark = {
|
|
||||||
# Default colors
|
|
||||||
primary = {
|
|
||||||
background = solarized.base03.hex;
|
|
||||||
foreground = solarized.base0.hex;
|
|
||||||
};
|
|
||||||
|
|
||||||
# Cursor colors
|
|
||||||
cursor = {
|
|
||||||
text = solarized.base03.hex;
|
|
||||||
cursor = solarized.base0.hex;
|
|
||||||
};
|
|
||||||
|
|
||||||
# Normal colors
|
|
||||||
normal = {
|
|
||||||
black = solarized.base02.hex;
|
|
||||||
red = solarized.red.hex;
|
|
||||||
green = solarized.green.hex;
|
|
||||||
yellow = solarized.yellow.hex;
|
|
||||||
blue = solarized.blue.hex;
|
|
||||||
magenta = solarized.magenta.hex;
|
|
||||||
cyan = solarized.cyan.hex;
|
|
||||||
white = solarized.base2.hex;
|
|
||||||
};
|
|
||||||
|
|
||||||
# Bright colors
|
|
||||||
bright = {
|
|
||||||
black = solarized.base03.hex;
|
|
||||||
red = solarized.orange.hex;
|
|
||||||
green = solarized.base01.hex;
|
|
||||||
yellow = solarized.base00.hex;
|
|
||||||
blue = solarized.base0.hex;
|
|
||||||
magenta = solarized.violet.hex;
|
|
||||||
cyan = solarized.base1.hex;
|
|
||||||
white = solarized.base3.hex;
|
|
||||||
};
|
|
||||||
};
|
|
||||||
|
|
||||||
solarized-light = {
|
|
||||||
# Default colors
|
|
||||||
primary = {
|
|
||||||
background = solarized.base3.hex;
|
|
||||||
foreground = solarized.base00.hex;
|
|
||||||
};
|
|
||||||
|
|
||||||
# Cursor colors
|
|
||||||
cursor = {
|
|
||||||
text = solarized.base3.hex;
|
|
||||||
cursor = solarized.base00.hex;
|
|
||||||
};
|
|
||||||
|
|
||||||
# Normal colors
|
|
||||||
normal = {
|
|
||||||
black = solarized.base02.hex;
|
|
||||||
red = solarized.red.hex;
|
|
||||||
green = solarized.green.hex;
|
|
||||||
yellow = solarized.yellow.hex;
|
|
||||||
blue = solarized.blue.hex;
|
|
||||||
magenta = solarized.magenta.hex;
|
|
||||||
cyan = solarized.cyan.hex;
|
|
||||||
white = solarized.base2.hex;
|
|
||||||
};
|
|
||||||
|
|
||||||
# Bright colors
|
|
||||||
bright = {
|
|
||||||
black = solarized.base03.hex;
|
|
||||||
red = solarized.orange.hex;
|
|
||||||
green = solarized.base01.hex;
|
|
||||||
yellow = solarized.base00.hex;
|
|
||||||
blue = solarized.base0.hex;
|
|
||||||
magenta = solarized.violet.hex;
|
|
||||||
cyan = solarized.base1.hex;
|
|
||||||
white = solarized.base3.hex;
|
|
||||||
};
|
|
||||||
};
|
|
||||||
};
|
|
||||||
commonSettings = {
|
|
||||||
font = {
|
|
||||||
normal = {
|
|
||||||
family = "Inconsolata for Powerline";
|
|
||||||
style = "Regular";
|
|
||||||
};
|
|
||||||
size = 12;
|
|
||||||
};
|
|
||||||
|
|
||||||
mouse.hide_when_typing = true;
|
|
||||||
|
|
||||||
keyboard.bindings = [
|
|
||||||
{
|
|
||||||
key = "F1";
|
|
||||||
mods = "Control";
|
|
||||||
action = "DecreaseFontSize";
|
|
||||||
}
|
|
||||||
{
|
|
||||||
key = "F2";
|
|
||||||
mods = "Control";
|
|
||||||
action = "IncreaseFontSize";
|
|
||||||
}
|
|
||||||
];
|
|
||||||
|
|
||||||
bell = {
|
|
||||||
duration = 100;
|
|
||||||
color = "#000000";
|
|
||||||
};
|
|
||||||
|
|
||||||
window.dynamic_title = true;
|
|
||||||
|
|
||||||
scrolling.history = 100000;
|
|
||||||
|
|
||||||
window.opacity = 0.9;
|
|
||||||
};
|
|
||||||
settings = {
|
|
||||||
dark = commonSettings // {
|
|
||||||
colors = colorschemes.solarized-dark;
|
|
||||||
};
|
|
||||||
light = commonSettings // {
|
|
||||||
colors = colorschemes.solarized-light;
|
|
||||||
};
|
|
||||||
};
|
|
||||||
in
|
|
||||||
{
|
|
||||||
|
|
||||||
programs.alacritty = {
|
|
||||||
inherit (nixosConfig.jalr.gui) enable;
|
|
||||||
};
|
|
||||||
|
|
||||||
xdg.configFile = lib.attrsets.mapAttrs'
|
|
||||||
(colorScheme: cfg:
|
|
||||||
let name = "alacritty-${colorScheme}.toml";
|
|
||||||
in
|
|
||||||
lib.attrsets.nameValuePair "alacritty/${name}" {
|
|
||||||
source = tomlFormat.generate name cfg;
|
|
||||||
target = "alacritty/${name}";
|
|
||||||
}
|
|
||||||
)
|
|
||||||
settings;
|
|
||||||
|
|
||||||
programs.fish.functions = {
|
|
||||||
ssh = {
|
|
||||||
description = "ssh wrapper function";
|
|
||||||
wraps = "ssh";
|
|
||||||
body = ''
|
|
||||||
if [ "$TERM" = alacritty ]
|
|
||||||
TERM=xterm-256color command ssh $argv
|
|
||||||
else
|
|
||||||
command ssh $argv
|
|
||||||
end
|
|
||||||
'';
|
|
||||||
};
|
|
||||||
};
|
|
||||||
}
|
|
||||||
|
|
@ -2,7 +2,6 @@
|
||||||
imports = [
|
imports = [
|
||||||
./3d-modeling.nix
|
./3d-modeling.nix
|
||||||
./3d-printing.nix
|
./3d-printing.nix
|
||||||
./alacritty.nix
|
|
||||||
./ardour.nix
|
./ardour.nix
|
||||||
./aws.nix
|
./aws.nix
|
||||||
./cli
|
./cli
|
||||||
|
|
@ -43,5 +42,6 @@
|
||||||
./trilium.nix
|
./trilium.nix
|
||||||
./vdirsyncer.nix
|
./vdirsyncer.nix
|
||||||
./vesc-tool.nix
|
./vesc-tool.nix
|
||||||
|
./wezterm.nix
|
||||||
];
|
];
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -7,12 +7,6 @@ let
|
||||||
done < "$1"
|
done < "$1"
|
||||||
'';
|
'';
|
||||||
applicationConfig = [
|
applicationConfig = [
|
||||||
{
|
|
||||||
dir = "~/.config/alacritty";
|
|
||||||
light = "alacritty-light.toml";
|
|
||||||
dark = "alacritty-dark.toml";
|
|
||||||
target = "alacritty.toml";
|
|
||||||
}
|
|
||||||
{
|
{
|
||||||
dir = "~/.config/wofi";
|
dir = "~/.config/wofi";
|
||||||
light = "color-light";
|
light = "color-light";
|
||||||
|
|
|
||||||
|
|
@ -3,18 +3,18 @@
|
||||||
let
|
let
|
||||||
solarized = import ../solarized.nix;
|
solarized = import ../solarized.nix;
|
||||||
terminalEmulator =
|
terminalEmulator =
|
||||||
pkgs.writeShellScript "alacritty-sway-cwd" ''
|
pkgs.writeShellScript "wezterm-sway-cwd" ''
|
||||||
this_alacritty_pid="$(${pkgs.sway}/bin/swaymsg -t get_tree | ${pkgs.jq}/bin/jq -e 'recurse(.nodes[]?) | select((.focused==true) and (.app_id=="Alacritty")).pid')"
|
this_wezterm_pid="$(${pkgs.sway}/bin/swaymsg -t get_tree --raw | ${pkgs.jq}/bin/jq -e 'recurse(.nodes[]?) | select((.focused==true) and (.app_id=="org.wezfurlong.wezterm")).pid')"
|
||||||
|
|
||||||
if [ "$this_alacritty_pid" ]; then
|
if [ "$this_wezterm_pid" ]; then
|
||||||
child_pid="$(pgrep -P "$this_alacritty_pid")"
|
child_pid="$(pgrep -P "$this_wezterm_pid")"
|
||||||
cwd="$(readlink /proc/$child_pid/cwd)"
|
cwd="$(readlink /proc/$child_pid/cwd)"
|
||||||
fi
|
fi
|
||||||
if [ -e "$cwd" ]; then
|
if [ -e "$cwd" ]; then
|
||||||
exec ${pkgs.alacritty}/bin/alacritty --working-directory "$cwd"
|
exec ${pkgs.wezterm}/bin/wezterm start --cwd "$cwd"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
exec ${pkgs.alacritty}/bin/alacritty
|
exec ${pkgs.wezterm}/bin/wezterm
|
||||||
'';
|
'';
|
||||||
cfg = config.wayland.windowManager.sway.config;
|
cfg = config.wayland.windowManager.sway.config;
|
||||||
wallpaper = pkgs.fetchurl {
|
wallpaper = pkgs.fetchurl {
|
||||||
|
|
|
||||||
|
|
@ -176,7 +176,7 @@ in
|
||||||
format-disconnected = "Disconnected ⚠ ";
|
format-disconnected = "Disconnected ⚠ ";
|
||||||
format-alt = "{ifname}: {ipaddr}/{cidr}";
|
format-alt = "{ifname}: {ipaddr}/{cidr}";
|
||||||
tooltip = false;
|
tooltip = false;
|
||||||
on-click-right = "${config.programs.alacritty.package}/bin/alacritty -e ${pkgs.networkmanager}/bin/nmtui";
|
on-click-right = "${config.programs.wezterm.package}/bin/wezterm start -e ${pkgs.networkmanager}/bin/nmtui";
|
||||||
};
|
};
|
||||||
memory = {
|
memory = {
|
||||||
interval = 2;
|
interval = 2;
|
||||||
|
|
|
||||||
46
users/jalr/modules/wezterm.nix
Normal file
46
users/jalr/modules/wezterm.nix
Normal file
|
|
@ -0,0 +1,46 @@
|
||||||
|
{ config, lib, nixosConfig, ... }:
|
||||||
|
|
||||||
|
let
|
||||||
|
weztermConfig = {
|
||||||
|
hide_tab_bar_if_only_one_tab = true;
|
||||||
|
#color_scheme = "Solarized (dark) (terminal.sexy)";
|
||||||
|
#color_scheme = "Solarized (light) (terminal.sexy)";
|
||||||
|
font = "FiraCode Nerd Font Mono";
|
||||||
|
font_size = 12;
|
||||||
|
};
|
||||||
|
in
|
||||||
|
{
|
||||||
|
programs.wezterm = {
|
||||||
|
inherit (nixosConfig.jalr.gui) enable;
|
||||||
|
extraConfig = ''
|
||||||
|
local wezterm = require 'wezterm'
|
||||||
|
${lib.generators.toLua {asBindings=true;} {config=weztermConfig;}}
|
||||||
|
config.font = wezterm.font(config.font)
|
||||||
|
|
||||||
|
function get_appearance()
|
||||||
|
if wezterm.gui then
|
||||||
|
return wezterm.gui.get_appearance()
|
||||||
|
end
|
||||||
|
return 'Light'
|
||||||
|
end
|
||||||
|
|
||||||
|
function scheme_for_appearance(appearance)
|
||||||
|
if appearance:find 'Dark' then
|
||||||
|
return 'Builtin Solarized Dark'
|
||||||
|
else
|
||||||
|
return 'Builtin Solarized Light'
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
|
config.color_scheme = scheme_for_appearance(get_appearance())
|
||||||
|
|
||||||
|
return config
|
||||||
|
'';
|
||||||
|
};
|
||||||
|
/*
|
||||||
|
file = io.open("${config.xdg.configHome}/wezterm/color_scheme.txt", "r")
|
||||||
|
io.input(file)
|
||||||
|
config.color_scheme = io.read()
|
||||||
|
io.close(file)
|
||||||
|
*/
|
||||||
|
}
|
||||||
Loading…
Add table
Add a link
Reference in a new issue