Switch to Kitty to try it out

This commit is contained in:
Thomas Avé 2024-10-22 17:06:42 +02:00
parent 4c9272c685
commit e5410cc440
6 changed files with 27 additions and 23 deletions

View File

@ -42,19 +42,19 @@
font = { font = {
size = pkgs.lib.mkDefault 15; size = pkgs.lib.mkDefault 15;
bold = { bold = {
family = "Iosevka Extended"; family = "FiraCode Nerd Font";
style = "Bold"; style = "Bold";
}; };
bold_italic = { bold_italic = {
family = "Iosevka Extended"; family = "FiraCode Nerd Font";
style = "Bold Italic"; style = "Bold Italic";
}; };
italic = { italic = {
family = "Iosevka Extended"; family = "FiraCode Nerd Font";
style = "Italic"; style = "Italic";
}; };
normal = { normal = {
family = "Iosevka Extended"; family = "FiraCode Nerd Font";
style = "Regular"; style = "Regular";
}; };
}; };

View File

@ -5,7 +5,8 @@ let
nautilus = "${pkgs.nautilus}/bin/nautilus"; nautilus = "${pkgs.nautilus}/bin/nautilus";
gnome-calendar = "${pkgs.gnome-calendar}/bin/gnome-calendar"; gnome-calendar = "${pkgs.gnome-calendar}/bin/gnome-calendar";
wpctl = "${pkgs.wireplumber}/bin/wpctl"; wpctl = "${pkgs.wireplumber}/bin/wpctl";
alacritty = "${pkgs.alacritty}/bin/alacritty"; terminal-name = ".kitty-wrapped";
terminal = "${pkgs.kitty}/bin/kitty";
swaylock = "${pkgs.swaylock-fancy}/bin/swaylock-fancy"; swaylock = "${pkgs.swaylock-fancy}/bin/swaylock-fancy";
rofi = "${pkgs.rofi}/bin/rofi"; rofi = "${pkgs.rofi}/bin/rofi";
jq = "${pkgs.jq}/bin/jq"; jq = "${pkgs.jq}/bin/jq";
@ -25,7 +26,7 @@ let
# workspace_command_prefix = ""; # workspace_command_prefix = "";
# hyprland_plugins = []; # hyprland_plugins = [];
launch_alacritty = pkgs.writeShellScriptBin "launch_alacritty" '' launch_terminal = pkgs.writeShellScriptBin "launch_terminal" ''
function find_leaf_pid(){ function find_leaf_pid(){
local PID=$1 local PID=$1
local CHILD_PID=$(pgrep -P "$PID") local CHILD_PID=$(pgrep -P "$PID")
@ -50,21 +51,21 @@ let
CLIENT=$(echo "$SSH_COMMAND" | awk '{ print $5 }') CLIENT=$(echo "$SSH_COMMAND" | awk '{ print $5 }')
PREVIOUS_SESSION_ID=$(grep -z "SSH_SESSION_ID" "/proc/$LEAF_PID/environ" | xargs -0 -n 1 | grep -oP "[0-9]*") PREVIOUS_SESSION_ID=$(grep -z "SSH_SESSION_ID" "/proc/$LEAF_PID/environ" | xargs -0 -n 1 | grep -oP "[0-9]*")
SSH_SESSION_ID=$RANDOM SSH_SESSION_ID=$RANDOM
${alacritty} -e zsh -c "SSH_SESSION_ID=$SSH_SESSION_ID waypipe ssh -t \"$CLIENT\" env SSH_SESSION_ID=\"$SSH_SESSION_ID\" PREVIOUS_SESSION_ID=\"$PREVIOUS_SESSION_ID\" \"zsh --login\"" ${terminal} -e zsh -c "SSH_SESSION_ID=$SSH_SESSION_ID waypipe ssh -t \"$CLIENT\" env SSH_SESSION_ID=\"$SSH_SESSION_ID\" PREVIOUS_SESSION_ID=\"$PREVIOUS_SESSION_ID\" \"zsh --login\""
else else
${alacritty} -e zsh -c "ssh -t \"$(echo "$SSH_COMMAND" | awk '{ print $2 }')\"" ${terminal} -e zsh -c "ssh -t \"$(echo "$SSH_COMMAND" | awk '{ print $2 }')\""
fi fi
else # Not an ssh session else # Not an ssh session
if [ "$(ps -p "$1" -o comm=)" == "alacritty" ]; then if [ "$(ps -p "$1" -o comm=)" == "${terminal-name}" ]; then
CWD=$(readlink -e /proc/"$LEAF_PID"/cwd) CWD=$(readlink -e /proc/"$LEAF_PID"/cwd)
if [ "$CWD" != "" ]; then if [ "$CWD" != "" ]; then
${alacritty} --working-directory "$CWD" ${terminal} --working-directory "$CWD"
else else
${alacritty} ${terminal}
fi fi
else else
${alacritty} ${terminal}
fi fi
fi fi
''; '';
@ -106,7 +107,7 @@ in {
]; ];
env = [ env = [
"WLR_NO_HARDWARE_CURSORS,1" "WLR_NO_HARDWARE_CURSORS,1"
"TERMINAL,${alacritty}" "TERMINAL,${terminal}"
"WLR_RENDERER_ALLOW_SOFTWARE,1" "WLR_RENDERER_ALLOW_SOFTWARE,1"
]; ];
debug = { disable_logs = false; }; debug = { disable_logs = false; };
@ -172,8 +173,8 @@ in {
"$mainMod, mouse:273, resizewindow" "$mainMod, mouse:273, resizewindow"
]; ];
bind = [ bind = [
"$mainMod, return, exec, ${launch_alacritty}/bin/launch_alacritty $(hyprctl activewindow -j | ${jq} .pid)" "$mainMod, return, exec, ${launch_terminal}/bin/launch_terminal $(hyprctl activewindow -j | ${jq} .pid)"
"$mainMod SHIFT, return, exec, ${alacritty}" "$mainMod SHIFT, return, exec, ${terminal}"
"$mainMod, Q, killactive," "$mainMod, Q, killactive,"
"$mainMod, A, exec, ${nautilus}" "$mainMod, A, exec, ${nautilus}"
"$mainMod, S, exec, LC_TIME=\"en_GB.UTF-8\" ${gnome-calendar}" "$mainMod, S, exec, LC_TIME=\"en_GB.UTF-8\" ${gnome-calendar}"

View File

@ -1,18 +1,20 @@
{ config, pkgs, ... }: { config, pkgs, lib, ... }:
{ {
programs.kitty = { programs.kitty = {
enable = true; enable = true;
shellIntegration.enableZshIntegration = true; shellIntegration.enableZshIntegration = true;
font = { font = {
name = "Iosevka Extended"; name = "'ZedMono Nerd Font' style='Extended Light' features=+ss05";
size = 15; size = lib.mkDefault 15;
}; };
settings = { settings = {
cursor_shape = "block"; cursor_shape = "block";
cursor_beam_thickness = 10; cursor_beam_thickness = 1;
scrollback_lines = 100000; scrollback_lines = 100000;
enable_audio_bell = "no";
"modify_font" = "cell_height 115%";
# Theme # Theme
background = "#000010"; background = "#000010";

View File

@ -20,8 +20,8 @@ return {
color_overrides = { color_overrides = {
mocha = { mocha = {
-- this 16 colors are changed to onedark -- this 16 colors are changed to onedark
base = "#11121D", base = "#1A1B26",
text = "#abb2bf", text = "#A6ADD2",
rosewater = "#b6bdca", rosewater = "#b6bdca",
lavender = "#ed8897", lavender = "#ed8897",
red = "#e06c75", red = "#e06c75",

View File

@ -5,7 +5,7 @@ return {
}, },
build = ":TSUpdate", build = ":TSUpdate",
opts = { opts = {
ensure_installed_sync = { "typst", "cpp", "c", "lua", "vim", "dockerfile", "python", "java", "cmake", "diff", "gitcommit", "html", "css", "javascript", "json", "rust", "sql", "yaml", "markdown", "markdown_inline", "nix" }, ensure_installed_sync = { "typst", "cpp", "c", "lua", "vim", "dockerfile", "python", "java", "cmake", "diff", "gitcommit", "html", "css", "javascript", "json", "rust", "sql", "yaml", "markdown", "markdown_inline", "nix", "bibtex" },
auto_install = true, auto_install = true,
highlight = { highlight = {
enable = true, enable = true,

View File

@ -35,7 +35,8 @@
iosevka iosevka
roboto roboto
font-awesome font-awesome
(nerdfonts.override { fonts = [ "FiraCode" "Ubuntu" ]; }) nerdfonts
# (nerdfonts.override { fonts = [ "FiraCode" "Ubuntu" ]; })
]; ];
environment.systemPackages = with pkgs; [ environment.systemPackages = with pkgs; [