hm: move from wezterm to alacritty

This commit is contained in:
Alexandre Cavalheiro S. Tiago da Silva 2024-07-17 11:30:04 -03:00
parent 9982f28a36
commit 3cfff1dd71
Signed by: wizardlink
GPG key ID: A5767B54367CFBDF
5 changed files with 41 additions and 56 deletions

View file

@ -7,6 +7,7 @@
# Import configurations for better modularity.
imports = [
./programs/alacritty.nix
./programs/emacs
./programs/fish
./programs/git.nix
@ -18,7 +19,6 @@
./programs/spotify
./programs/tmux
./programs/waybar.nix
./programs/wezterm
];
# Home Manager needs a bit of information about you and the paths it should

38
programs/alacritty.nix Normal file
View file

@ -0,0 +1,38 @@
{ pkgs, ... }:
let
catppuccin-theme = pkgs.fetchFromGitHub {
owner = "catppuccin";
repo = "alacritty";
rev = "94800165c13998b600a9da9d29c330de9f28618e";
hash = "sha256-Pi1Hicv3wPALGgqurdTzXEzJNx7vVh+8B9tlqhRpR2Y=";
};
in
{
programs.alacritty = {
enable = true;
settings = {
import = [ "${catppuccin-theme}/catppuccin-frappe.toml" ];
font = {
normal = {
family = "FantasqueSansM Nerd Font";
style = "Regular";
};
size = 13;
};
window = {
decorations = "None";
opacity = 0.88;
blur = true;
padding = {
x = 18;
y = 18;
};
};
};
};
}

View file

@ -203,7 +203,7 @@
bind = $mainMod, M, exit
bind = $mainMod, O, togglesplit # dwindle
bind = $mainMod, P, pseudo # dwindle
bind = $mainMod, Q, exec, wezterm
bind = $mainMod, Q, exec, alacritty
bind = $mainMod, R, exec, rofi -show drun
bind = $mainMod, V, togglefloating

View file

@ -20,7 +20,7 @@
modi = "run,drun,window";
show-icons = true;
sidebar-mode = true;
terminal = "wezterm";
terminal = "alacritty";
};
theme = ./catppuccin-frappe.rasi;

View file

@ -1,53 +0,0 @@
{ ... }:
{
programs.wezterm = {
enable = true;
extraConfig = # lua
''
local wezterm = require("wezterm")
-- Needed for folke's ZenMode in neovim
wezterm.on('user-var-changed', function(window, pane, name, value)
local overrides = window:get_config_overrides() or {}
if name == "ZEN_MODE" then
local incremental = value:find("+")
local number_value = tonumber(value)
if incremental ~= nil then
while (number_value > 0) do
window:perform_action(wezterm.action.IncreaseFontSize, pane)
number_value = number_value - 1
end
overrides.enable_tab_bar = false
elseif number_value < 0 then
window:perform_action(wezterm.action.ResetFontSize, pane)
overrides.font_size = nil
overrides.enable_tab_bar = true
else
overrides.font_size = number_value
overrides.enable_tab_bar = false
end
end
window:set_config_overrides(overrides)
end)
return {
color_scheme = "Catppuccin Frappe",
-- Unfortunately broken on Hyprland, AGAIN
-- see https://github.com/wez/wezterm/issues/5604
enable_wayland = false,
font = wezterm.font("FantasqueSansM Nerd Font"),
font_size = 13,
hide_tab_bar_if_only_one_tab = true,
hide_mouse_cursor_when_typing = false,
window_background_opacity = 0.88,
window_padding = {
left = 18,
right = 18,
top = 18,
bottom = 18,
},
}
'';
};
}