feat: switch term to foot
All checks were successful
Discord / discord commits (push) Has been skipped

This commit is contained in:
matt1432 2024-01-15 00:19:17 -05:00
parent a597274c8d
commit 74e6f417cd
4 changed files with 95 additions and 104 deletions

View file

@ -1,5 +1,5 @@
[General]
TerminalApplication=alacritty
TerminalApplication=foot
[KFileDialog Settings]
Allow Expansion=false

View file

@ -1,101 +0,0 @@
{config, ...}: let
inherit (config.vars) fontSize;
in {
programs.alacritty = {
enable = true;
settings = {
env = {
# fix wrong colors in tmux
TERM = "xterm-256color";
};
keyboard.bindings = [
{
key = "Return";
mods = "Control|Shift";
action = "SpawnNewInstance";
}
];
window = {
padding = {
x = 0;
y = 10;
};
opacity = 0.8;
};
font = {
normal = {
family = "JetBrainsMono Nerd Font";
style = "Regular";
};
bold = {
family = "JetBrainsMono Nerd Font";
style = "Bold";
};
italic = {
family = "JetBrainsMono Nerd Font";
style = "Italic";
};
size = fontSize;
};
# https://github.com/dracula/alacritty/blob/05faff15c0158712be87d200081633d9f4850a7d/dracula.yml
colors = {
primary = {
background = "#282a36";
foreground = "#f8f8f2";
bright_foreground = "#ffffff";
};
cursor = {
text = "CellBackground";
cursor = "CellForeground";
};
vi_mode_cursor = {
text = "CellBackground";
cursor = "CellForeground";
};
search = {
matches = {
foreground = "#44475a";
background = "#50fa7b";
};
focused_match = {
foreground = "#44475a";
background = "#ffb86c";
};
};
hints = {
start = {
foreground = "#282a36";
background = "#f1fa8c";
};
end = {
foreground = "#f1fa8c";
background = "#282a36";
};
};
line_indicator = {
foreground = "None";
background = "None";
};
selection = {
text = "CellForeground";
background = "#44475a";
};
normal = {
black = "#21222c";
red = "#ff5555";
green = "#50fa7b";
yellow = "#f1fa8c";
blue = "#bd93f9";
magenta = "#ff79c6";
cyan = "#8be9fd";
white = "#f8f8f2";
};
};
};
};
}

92
home/foot.nix Normal file
View file

@ -0,0 +1,92 @@
{
config,
lib,
...
}: let
inherit (config.vars) fontSize;
in {
programs = {
# https://codeberg.org/dnkl/foot/wiki#spawning-new-terminal-instances-in-the-current-working-directory
bash.bashrcExtra =
/*
bash
*/
''
osc7_cwd() {
local strlen=''${#PWD}
local encoded=""
local pos c o
for (( pos=0; pos<strlen; pos++ )); do
c=''${PWD:$pos:1}
case "$c" in
[-/:_.!\'\(\)~[:alnum:]] ) o="$c" ;;
* ) printf -v o '%%%02X' "'$c" ;;
esac
encoded+="''${o}"
done
printf '\e]7;file://%s%s\e\\' "''${HOSTNAME}" "''${encoded}"
}
PROMPT_COMMAND=''${PROMPT_COMMAND:+$PROMPT_COMMAND; }osc7_cwd
'';
foot = {
enable = true;
settings = {
main = {
term = "xterm-256color";
# FIXME: Figure out font size with Dpi-aware
font = "JetBrainsMono Nerd Font:size=${
lib.strings.floatToString (fontSize - 5)
}";
dpi-aware = true;
pad = "0x10";
};
key-bindings = {
spawn-terminal = "Control+Shift+Return";
};
bell = {
urgent = false;
notify = false;
visual = false;
command = null;
command-focused = false;
};
colors = {
# BG transparency
alpha = 0.8;
background = "282a36";
foreground = "f8f8f2";
regular0 = "21222c"; # black
regular1 = "ff5555"; # red
regular2 = "50fa7b"; # green
regular3 = "f1fa8c"; # yellow
regular4 = "bd93f9"; # blue
regular5 = "ff79c6"; # magenta
regular6 = "8be9fd"; # cyan
regular7 = "f8f8f2"; # white
bright0 = "6272a4"; # bright black
bright1 = "ff6e6e"; # bright red
bright2 = "69ff94"; # bright green
bright3 = "ffffa5"; # bright yellow
bright4 = "d6acff"; # bright blue
bright5 = "ff92df"; # bright magenta
bright6 = "a4ffff"; # bright cyan
bright7 = "ffffff"; # bright white
selection-foreground = "ffffff";
selection-background = "44475a";
urls = "8be9fd";
};
};
};
};
}

View file

@ -42,7 +42,7 @@ in {
# HOME-MANAGER CONFIG
home-manager.users.${mainUser} = {
imports = [
../../home/alacritty.nix
../../home/foot.nix
../../home/dconf.nix
../../home/mpv
../../home/obs.nix
@ -142,7 +142,7 @@ in {
bind = [
# Defaults
"$mainMod, L, exec, lock"
"$mainMod, Q, exec, alacritty"
"$mainMod, Q, exec, foot"
"$mainMod, F, fullscreen"
"$mainMod, C, killactive, "
"$mainMod SHIFT, SPACE, togglefloating, "