From f56fa1259c1ce4423c0df15391e6949905403d0a Mon Sep 17 00:00:00 2001 From: js0ny Date: Sat, 22 Nov 2025 18:43:51 +0000 Subject: [PATCH] nixify: hyprland & kitty --- home/.chezmoiignore.tmpl | 2 + home/dot_config/nvim/lua/plugins/misc.lua | 16 ++ home/dot_config/nvim/lua/plugins/mod/mc.lua | 12 +- nixcfgs/.gitignore | 2 - nixcfgs/hosts/zephyrus/default.nix | 3 +- nixcfgs/modules/nixos/desktop/de/hyprland.nix | 2 +- nixcfgs/users/js0ny/config.nix | 3 +- nixcfgs/users/js0ny/packages/gui.nix | 2 + .../programs/desktop/wayland-wm/hyprland.nix | 8 - .../desktop/wayland-wm/hyprland/default.nix | 137 ++++++++++++++++++ .../desktop/wayland-wm/hyprland/keymaps.nix | 101 +++++++++++++ .../wayland-wm/hyprland/window-rules.nix | 43 ++++++ .../programs/desktop/wayland-wm/kanshi.nix | 2 +- .../desktop/wayland-wm/niri/default.nix | 2 +- .../programs/desktop/wayland-wm/packages.nix | 8 + .../desktop/wayland-wm/waybar/default.nix | 40 ++++- nixcfgs/users/js0ny/programs/ghostty.nix | 1 - nixcfgs/users/js0ny/programs/kitty.nix | 81 +++++++++++ nixcfgs/users/js0ny/programs/obs-studio.nix | 1 + nixcfgs/users/js0ny/programs/shell/zsh.nix | 3 + nixcfgs/users/js0ny/programs/tmux.nix | 4 +- nixcfgs/users/js0ny/zephyrus.nix | 5 +- 22 files changed, 449 insertions(+), 29 deletions(-) delete mode 100644 nixcfgs/.gitignore delete mode 100644 nixcfgs/users/js0ny/programs/desktop/wayland-wm/hyprland.nix create mode 100644 nixcfgs/users/js0ny/programs/desktop/wayland-wm/hyprland/default.nix create mode 100644 nixcfgs/users/js0ny/programs/desktop/wayland-wm/hyprland/keymaps.nix create mode 100644 nixcfgs/users/js0ny/programs/desktop/wayland-wm/hyprland/window-rules.nix create mode 100644 nixcfgs/users/js0ny/programs/kitty.nix diff --git a/home/.chezmoiignore.tmpl b/home/.chezmoiignore.tmpl index 5630238..cc4f176 100644 --- a/home/.chezmoiignore.tmpl +++ b/home/.chezmoiignore.tmpl @@ -75,6 +75,8 @@ vim:ft=gotmpl .config/aichat .config/libvirt .config/tmux + .config/dunst + .config/kitty .local/share/kio/** .local/share/fonts/** {{ end }} diff --git a/home/dot_config/nvim/lua/plugins/misc.lua b/home/dot_config/nvim/lua/plugins/misc.lua index c4bcd02..2268def 100644 --- a/home/dot_config/nvim/lua/plugins/misc.lua +++ b/home/dot_config/nvim/lua/plugins/misc.lua @@ -30,4 +30,20 @@ return { build = ":Cord update", -- opts = {} }, + { + "mikesmithgh/kitty-scrollback.nvim", + enabled = true, + lazy = true, + cmd = { + "KittyScrollbackGenerateKittens", + "KittyScrollbackCheckHealth", + "KittyScrollbackGenerateCommandLineEditing", + }, + event = { "User KittyScrollbackLaunch" }, + -- version = '*', -- latest stable version, may have breaking changes if major version changed + -- version = '^6.0.0', -- pin major version, include fixes and features that do not have breaking changes + config = function() + require("kitty-scrollback").setup() + end, + }, } diff --git a/home/dot_config/nvim/lua/plugins/mod/mc.lua b/home/dot_config/nvim/lua/plugins/mod/mc.lua index c78cdb9..9b61d32 100644 --- a/home/dot_config/nvim/lua/plugins/mod/mc.lua +++ b/home/dot_config/nvim/lua/plugins/mod/mc.lua @@ -38,12 +38,12 @@ return { }, config = function() require("multiple-cursors").setup({ - pre_hook = function() - require("nvim-autopairs").disable() - end, - post_hook = function() - require("nvim-autopairs").enable() - end, + -- pre_hook = function() + -- require("blink.pairs.mapping").disable() + -- end, + -- post_hook = function() + -- require("blink.pairs.mapping").enable() + -- end, }) end, } diff --git a/nixcfgs/.gitignore b/nixcfgs/.gitignore deleted file mode 100644 index 1e9c618..0000000 --- a/nixcfgs/.gitignore +++ /dev/null @@ -1,2 +0,0 @@ -secrets # TODO -users/js0ny/programs/desktop/wayland-wm/hyprland/ diff --git a/nixcfgs/hosts/zephyrus/default.nix b/nixcfgs/hosts/zephyrus/default.nix index 85f3514..f04a366 100644 --- a/nixcfgs/hosts/zephyrus/default.nix +++ b/nixcfgs/hosts/zephyrus/default.nix @@ -25,8 +25,7 @@ ../../modules/nixos/desktop/xremap.nix # desktop environment and display manager - ../../modules/nixos/desktop/dm/sddm.nix - ../../modules/nixos/desktop/de/kde.nix + ../../modules/nixos/desktop/dm/ly.nix ../../modules/nixos/desktop/de/niri.nix ../../modules/nixos/desktop/de/hyprland.nix diff --git a/nixcfgs/modules/nixos/desktop/de/hyprland.nix b/nixcfgs/modules/nixos/desktop/de/hyprland.nix index 5bcfe91..77c84ed 100644 --- a/nixcfgs/modules/nixos/desktop/de/hyprland.nix +++ b/nixcfgs/modules/nixos/desktop/de/hyprland.nix @@ -1,7 +1,7 @@ {pkgs, ...}: { programs.hyprland = { enable = true; - withUWSM = false; + withUWSM = true; xwayland.enable = true; }; diff --git a/nixcfgs/users/js0ny/config.nix b/nixcfgs/users/js0ny/config.nix index d46b3cb..c6efc9a 100644 --- a/nixcfgs/users/js0ny/config.nix +++ b/nixcfgs/users/js0ny/config.nix @@ -1,8 +1,7 @@ { currentUser = { defaultShell = "zsh"; - defaultTerminal = "ghostty"; - defaultTerminalRunner = "alacritty"; + defaultTerminal = "kitty"; iconTheme = "Papirus"; defaultExplorer = "dolphin"; defaultTerminalExplorer = "yazi"; diff --git a/nixcfgs/users/js0ny/packages/gui.nix b/nixcfgs/users/js0ny/packages/gui.nix index 9b6ec7d..0a86560 100644 --- a/nixcfgs/users/js0ny/packages/gui.nix +++ b/nixcfgs/users/js0ny/packages/gui.nix @@ -108,6 +108,8 @@ in { blender logisim-evolution onlyoffice-desktopeditors + wayland-bongocat + nur.repos.lonerOrz.antigravity ] ++ (mkFcitxIM [ pkgs.neovim-qt diff --git a/nixcfgs/users/js0ny/programs/desktop/wayland-wm/hyprland.nix b/nixcfgs/users/js0ny/programs/desktop/wayland-wm/hyprland.nix deleted file mode 100644 index 9fcd687..0000000 --- a/nixcfgs/users/js0ny/programs/desktop/wayland-wm/hyprland.nix +++ /dev/null @@ -1,8 +0,0 @@ -{pkgs, ...}: { - home.packages = with pkgs; [ - grimblast - ]; - imports = [ - ./packages.nix - ]; -} diff --git a/nixcfgs/users/js0ny/programs/desktop/wayland-wm/hyprland/default.nix b/nixcfgs/users/js0ny/programs/desktop/wayland-wm/hyprland/default.nix new file mode 100644 index 0000000..942fe27 --- /dev/null +++ b/nixcfgs/users/js0ny/programs/desktop/wayland-wm/hyprland/default.nix @@ -0,0 +1,137 @@ +{pkgs, ...}: { + home.packages = with pkgs; [ + grimblast + ]; + imports = [ + ../packages.nix + ./keymaps.nix + ./window-rules.nix + ]; + wayland.windowManager.hyprland = { + enable = true; + portalPackage = pkgs.xdg-desktop-portal-hyprland; + systemd.enableXdgAutostart = true; + xwayland.enable = true; + # extraConfig = '' + # source=~/.config/hypr/debug.conf + # ''; + settings = { + ecosystem = { + no_update_news = true; + }; + exec-once = [ + "waybar" + "dunst" + "${pkgs.hyprpolkitagent}/libexec/hyprpolkitagent" + ]; + general = { + gaps_in = 0; + gaps_out = 0; + + border_size = 5; + + # https://wiki.hyprland.org/Configuring/Variables/#variable-types for info about colors + "col.active_border" = "$lavender $pink 45deg"; + "col.inactive_border" = "$overlay1"; + + # Set to true enable resizing windows by clicking and dragging on borders and gaps + resize_on_border = true; + + # Please see https://wiki.hyprland.org/Configuring/Tearing/ before you turn this on + allow_tearing = false; + + layout = "dwindle"; + + no_border_on_floating = false; + }; + xwayland = { + force_zero_scaling = true; + }; + input = { + follow_mouse = 1; + + sensitivity = 0; # -1.0 - 1.0, 0 means no modification. + + touchpad = { + natural_scroll = true; + scroll_factor = 0.2; + }; + }; + misc = { + force_default_wallpaper = -1; + disable_hyprland_logo = true; + }; + + dwindle = { + pseudotile = true; # Master switch for pseudotiling. Enabling is bound to mainMod + P in the keybinds section below + preserve_split = true; # You probably want this + }; + + # See https://wiki.hyprland.org/Configuring/Master-Layout/ for more + master = { + new_status = "slave"; + }; + + animations = { + enabled = true; + + # Default animations, see https://wiki.hyprland.org/Configuring/Animations/ for more + + bezier = [ + "easeOutQuint,0.23,1,0.32,1" + "easeInOutCubic,0.65,0.05,0.36,1" + "linear,0,0,1,1" + "almostLinear,0.5,0.5,0.75,1.0" + "quick,0.15,0,0.1,1" + ]; + + animation = [ + "global, 1, 10, default" + "border, 1, 5.39, easeOutQuint" + "windows, 1, 4.79, easeOutQuint" + "windowsIn, 1, 4.1, easeOutQuint, popin 87%" + # "windowsIn, 1, 4.1, easeOutQuint, popin 87%" + "windowsOut, 1, 1.49, linear, popin 87%" + "fadeIn, 1, 1.73, almostLinear" + "fadeOut, 1, 1.46, almostLinear" + "fade, 1, 3.03, quick" + "layers, 1, 3.81, easeOutQuint" + "layersIn, 1, 4, easeOutQuint, fade" + "layersOut, 1, 1.5, linear, fade" + "fadeLayersIn, 1, 1.79, almostLinear" + "fadeLayersOut, 1, 1.39, almostLinear" + "workspaces, 1, 1.94, almostLinear, slide" + "workspacesIn, 1, 1.21, almostLinear, fade" + "workspacesOut, 1, 1.94, almostLinear, fade" + "specialWorkspace, 1, 1.94, almostLinear, fade" + ]; + }; + + decoration = { + rounding = 20; + + # Change transparency of focused and unfocused windows + # active_opacity = 1 + # inactive_opacity = 0.9 + active_opacity = 0.9; + inactive_opacity = 0.85; + + shadow = { + enabled = true; + range = 4; + render_power = 3; + color = "$base"; + }; + + # https://wiki.hyprland.org/Configuring/Variables/#blur + blur = { + enabled = true; + size = 10; + passes = 2; + + vibrancy = 0.1696; + }; + }; + }; + }; +} diff --git a/nixcfgs/users/js0ny/programs/desktop/wayland-wm/hyprland/keymaps.nix b/nixcfgs/users/js0ny/programs/desktop/wayland-wm/hyprland/keymaps.nix new file mode 100644 index 0000000..46001e5 --- /dev/null +++ b/nixcfgs/users/js0ny/programs/desktop/wayland-wm/hyprland/keymaps.nix @@ -0,0 +1,101 @@ +{config, ...}: let + term = config.currentUser.defaultTerminal; + termRunner = config.currentUser.defaultTerminalRunner; + iconTheme = config.currentUser.iconTheme; + explorer = config.currentUser.defaultExplorer; + explorerTerm = config.currentUser.defaultTerminalExplorer; + launcher = "rofi"; + kbdBacklightDev = config.currentHost.keyboardBacklightDevice; + kbdBacklightStep = config.currentHost.keyboardBacklightStep; + mainMod = "SUPER"; + screenshotPath = "$HOME/Pictures/Screenshots/\"$(%Y-%m-%d_%H-%M-%S.png)\""; +in { + wayland.windowManager.hyprland.settings = { + "$mainMod" = "${mainMod}"; + bind = [ + "$mainMod, return, exec, ${term}" + "$mainMod, Q, killactive" + ''$mainMod SHIFT, F, exec, hyprctl --batch "dispatch togglefloating ; dispatch resizeactive exact 1440 810 ; dispatch centerwindow 1;"'' + "$mainMod SHIFT, M, fullscreen" + "$mainMod, W, exec, ${launcher} -show window -icon-theme ${iconTheme} -show-icons" + "$mainMod, V, exec, cliphist list | ${launcher} -dmenu | cliphist decode | wl-copy" + "alt, space, exec, ${launcher} -show drun -icon-theme ${iconTheme} -show-icons" + "$mainMod, E, exec, ${explorer}" + "$mainMod SHIFT, E, exec, ${termRunner} -e ${explorerTerm}" + "$mainMod, P, pseudo" + "$mainMod, X, togglesplit" + "$mainMod, left, movefocus, l" + "$mainMod, right, movefocus, r" + "$mainMod, up, movefocus, u" + "$mainMod, down, movefocus, d" + "$mainMod, H, movefocus, l" + "$mainMod, L, movefocus, r" + "$mainMod, K, movefocus, u" + "$mainMod, J, movefocus, d" + "$mainMod SHIFT, H, swapwindow, l" + "$mainMod SHIFT, L, swapwindow, r" + "$mainMod SHIFT, K, swapwindow, u" + "$mainMod SHIFT, J, swapwindow, d" + "$mainMod CTRL, H, resizeactive, 10 0" + "$mainMod CTRL, L, resizeactive, -10 0" + "$mainMod CTRL, K, resizeactive, 0 10" + "$mainMod CTRL, J, resizeactive, 0 10" + "$mainMod, s, exec, grimblast copysave active ${screenshotPath}" + "$mainMod SHIFT, s, exec, grimblast copysave area ${screenshotPath}" + "alt, PRINT, exec, grimblast copysave active ${screenshotPath}" + ",PRINT, exec, grimblast copysave active ${screenshotPath}" + "$mainMod SHIFT, c, exec, notify-send \"Color: $(hyprpicker)\"" + "$mainMod, 1, workspace, 1" + "$mainMod, 2, workspace, 2" + "$mainMod, 3, workspace, 3" + "$mainMod, 4, workspace, 4" + "$mainMod, 5, workspace, 5" + "$mainMod, 6, workspace, 6" + "$mainMod, 7, workspace, 7" + "$mainMod, 8, workspace, 8" + "$mainMod, 9, workspace, 9" + "$mainMod, 0, workspace, 10" + "$mainMod SHIFT, 1, movetoworkspace, 1" + "$mainMod SHIFT, 2, movetoworkspace, 2" + "$mainMod SHIFT, 3, movetoworkspace, 3" + "$mainMod SHIFT, 4, movetoworkspace, 4" + "$mainMod SHIFT, 5, movetoworkspace, 5" + "$mainMod SHIFT, 6, movetoworkspace, 6" + "$mainMod SHIFT, 7, movetoworkspace, 7" + "$mainMod SHIFT, 8, movetoworkspace, 8" + "$mainMod SHIFT, 9, movetoworkspace, 9" + "$mainMod SHIFT, 0, movetoworkspace, 10" + "$mainMod, GRAVE, togglespecialworkspace, magic" + "$mainMod SHIFT, GRAVE, movetoworkspace, special:magic" + "$mainMod, mouse_down, workspace, e+1" + "$mainMod, mouse_up, workspace, e-1" + ]; + # m: Mouse: Will work with mouse buttons + bindm = [ + "$mainMod, mouse:272, movewindow" + "$mainMod, mouse:273, resizewindow" + ]; + # l: locked: Will work when an input inhibitor is active (e.g. lock screen) + bindl = [ + ",XF86AudioNext, exec, playerctl next" + ",XF86AudioPrev, exec, playerctl previous" + ",XF86AudioPlay, exec, playerctl play-pause" + ",XF86AudioPause, exec, playerctl play-pause" + ]; + # e: repeat: Will repeat when the key is held down + bindel = [ + ", XF86AudioRaiseVolume, exec, wpctl set-volume @DEFAULT_AUDIO_SINK@ 5%+" + ", XF86AudioLowerVolume, exec, wpctl set-volume @DEFAULT_AUDIO_SINK@ 5%-" + ", XF86AudioMute, exec, wpctl set-mute @DEFAULT_AUDIO_SINK@ toggle" + ", XF86MonBrightnessUp, exec, brightnessctl set +10%" + ", XF86MonBrightnessDown, exec, brightnessctl set 10%-" + ", XF86KbdBrightnessUp, exec, brightnessctl --device ${kbdBacklightDev} set ${kbdBacklightStep}+" + ", XF86KbdBrightnessDown, exec, brightnessctl --device ${kbdBacklightDev} set ${kbdBacklightStep}-" + ", XF86Launch4, exec, powerprofiles-next" + ", XF86Launch1, exec, ${launcher} -show drun -icon-theme ${iconTheme} -show-icons" + ]; + gesture = [ + "4, horizontal, workspace" + ]; + }; +} diff --git a/nixcfgs/users/js0ny/programs/desktop/wayland-wm/hyprland/window-rules.nix b/nixcfgs/users/js0ny/programs/desktop/wayland-wm/hyprland/window-rules.nix new file mode 100644 index 0000000..b261201 --- /dev/null +++ b/nixcfgs/users/js0ny/programs/desktop/wayland-wm/hyprland/window-rules.nix @@ -0,0 +1,43 @@ +{...}: { + wayland.windowManager.hyprland.settings = { + windowrule = [ + # windowrule = match:class mpv, float on, move (monitor_w-20-window_w) (monitor_h-20-window_h), pin on + ]; + windowrulev2 = [ + "suppressevent maximize, class:.*" + # Right Bottom + "float, pin, size 25%, move 73% 73%, title:^([Pp]icture[-\s]?[Ii]n[-\s]?[Pp]icture)(.*)$" + "float, pin, size 25%, move 73% 73%, title:^(画中画)(.*)$" + + # Right Top + "float, pin, size 25%, move 73% 10%, class:^(org.pulseaudio.pavucontrol)$" + # Right Top + no focus + "noinitialfocus, float, pin, size 25%, move 73% 10%, class:^(org.kde.(dolphin|ark))$, title:^(Extracting|Compressing)(.*)$" + "noinitialfocus, float, pin, size 25%, move 73% 10%, class:^(thunar)$, title:^(File Operation Progress)$" + # Centered + "float, center, size 50%, class:^(com.(telegram|ayugram).desktop)$, title:^(Media viewer)$" + "float, center, size 50%, class:^(io.github.kukuruzka165.materialgram)$, title:^(Media viewer)$" + "float, center, size 50%, class:^(wechat)$, title:^(图片和视频)$" + "float, center, size 50%, class:^(QQ)$, title:^(图片查看器)$" + "float, center, size 50%, class:^(QQ)$, title:^(群聊的聊天记录)$" + "float, center, size 50%, class:^(CherryStudio)$, title:^(Cherry Studio Quick Assistant)$" + "float, center, size 50%, class:^(anki)$, title:^(Add)$" + "float, center, title:^(Open File|打开文件|Select a File|选择文件|Choose wallpaper|Open Folder|Save As|保存|Library|File Upload)(.*)$" + "float, center, class:^(qt6ct)$" + # no focus + "float, noinitialfocus, center, class:^(gimp)$, title:^(GIMP Startup)$" + "float, noinitialfocus, center, class:^(wechat)$, title:^(wechat)$" + # Pin + Stay focused + "float, pin, stayfocused, class:^(rofi)$" + + # Workspace 1 - Master + "workspace 1, class:^(firefox)$" + # Workspace 2 - Project + "workspace 2, class:^(code|dev.zed.Zed|Vitis IDE|Vivado)$" + # Workspace 3 - Info + "workspace 3, class:^(discord|thunderbird|QQ|wechat|com.(telegram|ayugram).desktop|io.github.kukuruzka165.materialgram)$" + # Workspace 9 - Background + "workspace 9, class:^(feishin|Cider)$" + ]; + }; +} diff --git a/nixcfgs/users/js0ny/programs/desktop/wayland-wm/kanshi.nix b/nixcfgs/users/js0ny/programs/desktop/wayland-wm/kanshi.nix index dce39f2..e63ca8a 100644 --- a/nixcfgs/users/js0ny/programs/desktop/wayland-wm/kanshi.nix +++ b/nixcfgs/users/js0ny/programs/desktop/wayland-wm/kanshi.nix @@ -19,7 +19,7 @@ in { criteria = lg4k60; alias = "lg4k60"; mode = "3840x2160@59.997"; - scale = 1.75; + scale = 1.6666; }; } # Profiles diff --git a/nixcfgs/users/js0ny/programs/desktop/wayland-wm/niri/default.nix b/nixcfgs/users/js0ny/programs/desktop/wayland-wm/niri/default.nix index 55177d2..89e76a5 100644 --- a/nixcfgs/users/js0ny/programs/desktop/wayland-wm/niri/default.nix +++ b/nixcfgs/users/js0ny/programs/desktop/wayland-wm/niri/default.nix @@ -25,8 +25,8 @@ {argv = ["waybar"];} {argv = ["dunst"];} {argv = ["fcitx5"];} + {argv = ["swww-daemon"];} # polkit/portal helpers - {argv = ["${pkgs.kdePackages.xdg-desktop-portal-kde}/libexec/xdg-desktop-portal-kde"];} {argv = ["${pkgs.hyprpolkitagent}/libexec/hyprpolkitagent"];} ]; diff --git a/nixcfgs/users/js0ny/programs/desktop/wayland-wm/packages.nix b/nixcfgs/users/js0ny/programs/desktop/wayland-wm/packages.nix index 5838c51..526fd42 100644 --- a/nixcfgs/users/js0ny/programs/desktop/wayland-wm/packages.nix +++ b/nixcfgs/users/js0ny/programs/desktop/wayland-wm/packages.nix @@ -55,4 +55,12 @@ in { services.cliphist.enable = true; services.dunst.enable = true; catppuccin.dunst.enable = false; + home.pointerCursor = { + enable = true; + gtk.enable = true; + x11.enable = true; + size = 24; + package = pkgs.bibata-cursors; + name = "Bibata-Modern-Ice"; + }; } diff --git a/nixcfgs/users/js0ny/programs/desktop/wayland-wm/waybar/default.nix b/nixcfgs/users/js0ny/programs/desktop/wayland-wm/waybar/default.nix index 2d914b1..547413d 100644 --- a/nixcfgs/users/js0ny/programs/desktop/wayland-wm/waybar/default.nix +++ b/nixcfgs/users/js0ny/programs/desktop/wayland-wm/waybar/default.nix @@ -9,10 +9,21 @@ enable = true; style = '' * { - font-family: "Font Awesome 7 Free", "JetBrainsMono Nerd Font"; + font-family: "LXGW Neo XiHei", "Font Awesome 7 Free", "JetBrainsMono Nerd Font"; font-size: 14px; font-feature-settings: "tnum"; } + + window#waybar { + background-color: @base; + padding: 0px; + } + + #workspaces { + color: #f0f0ff; + background-color: rgba(30, 30, 46, 0.6); + } + #workspaces button:hover { background: @pink; } @@ -20,6 +31,33 @@ #workspaces button.urgent { background-color: @red; } + + + #custom-osicon { + color: @blue; + padding: 0 6px; + } + + #clock, + #tray, + #battery, + #cpu, + #memory, + #disk, + #temperature, + #backlight, + #network, + #pulseaudio, + #wireplumber, + #custom-media, + #mode, + #idle_inhibitor, + #scratchpad, + #mpd { + padding: 0 10px; + color: @text; + background-color: @base; + } ''; }; } diff --git a/nixcfgs/users/js0ny/programs/ghostty.nix b/nixcfgs/users/js0ny/programs/ghostty.nix index 5d7d4b0..b022a3a 100644 --- a/nixcfgs/users/js0ny/programs/ghostty.nix +++ b/nixcfgs/users/js0ny/programs/ghostty.nix @@ -46,7 +46,6 @@ "alt+shift+_=new_split:down" "alt+shift+enter=new_split:auto" "global:super+backquote=toggle_quick_terminal" - "alt+shift+n=new_window" ]; ### Misc diff --git a/nixcfgs/users/js0ny/programs/kitty.nix b/nixcfgs/users/js0ny/programs/kitty.nix new file mode 100644 index 0000000..6ba5734 --- /dev/null +++ b/nixcfgs/users/js0ny/programs/kitty.nix @@ -0,0 +1,81 @@ +{ + config, + pkgs, + ... +}: let + alt = + if pkgs.stdenv.isDarwin + then "cmd" + else "alt"; +in { + programs.kitty = { + enable = true; + shellIntegration = { + enableBashIntegration = true; + enableZshIntegration = true; + enableFishIntegration = true; + }; + environment = { + "TERM_PROGRAM" = "kitty"; + }; + font = { + size = 12; + name = "Maple Mono NF CN"; + }; + settings = { + # Font + disable_ligatures = "never"; + # Cursor Trail + cursor_trail = 1; + cursor_trail_decay = "0.1 0.4"; + cursor_trail_start_threshold = 2; + # Tab Bar + tab_bar_edge = "top"; + tab_bar_align = "left"; + tab_bar_style = "powerline"; + # Hide tab bar when there is only one tab + tab_bar_min_tabs = 2; + tab_title_template = "{f'{title[:30]}…' if title.rindex(title[-1]) + 1 > 30 else (title.center(6) if (title.rindex(title[-1]) + 1) % 2 == 0 else title.center(5))}"; + active_tab_font_style = "bold"; + # macOS # TODO: true or "yes", untested + macos_option_as_alt = true; + macos_quit_when_last_window_closed = true; + enabled_layouts = "splits"; + }; + keybindings = { + "cmd+c" = "copy_and_clear_or_interrupt"; + "ctrl+c" = "copy_and_clear_or_interrupt"; + "${alt}+1" = "goto_tab 1"; + "${alt}+2" = "goto_tab 2"; + "${alt}+3" = "goto_tab 3"; + "${alt}+4" = "goto_tab 4"; + "${alt}+5" = "goto_tab 5"; + "${alt}+6" = "goto_tab 6"; + "${alt}+7" = "goto_tab 7"; + "${alt}+8" = "goto_tab 8"; + "${alt}+9" = "goto_tab 9"; # if less than 9 tabs, goes to last tab + "${alt}+0" = "goto_tab -1"; # previously active tab + "${alt}+shift+\\" = "launch --location=hsplit"; + "${alt}+shift+-" = "launch --location=vsplit"; + "ctrl+shift+h" = "kitty_scrollback_nvim"; + "ctrl+shift+g" = "kitty_scrollback_nvim --config ksb_builtin_last_cmd_output"; + "alt+shift+h" = "move_window left"; + "alt+shift+l" = "move_window right"; + "alt+shift+k" = "move_window up"; + "alt+shift+j" = "move_window down"; + "ctrl+q>h" = "move_window left"; + "ctrl+q>l" = "move_window right"; + "ctrl+q>k" = "move_window up"; + "ctrl+q>j" = "move_window down"; + }; + extraConfig = '' + mouse_map ctrl+shift+right press ungrabbed combine : mouse_select_command_output : kitty_scrollback_nvim --config ksb_builtin_last_visited_cmd_output + ''; + actionAliases = + if config.programs.neovim.enable + then { + "kitty_scrollback_nvim" = "kitten /home/js0ny/.local/share/nvim/lazy/kitty-scrollback.nvim/python/kitty_scrollback_nvim.py"; + } + else {}; + }; +} diff --git a/nixcfgs/users/js0ny/programs/obs-studio.nix b/nixcfgs/users/js0ny/programs/obs-studio.nix index fef44a8..304816a 100644 --- a/nixcfgs/users/js0ny/programs/obs-studio.nix +++ b/nixcfgs/users/js0ny/programs/obs-studio.nix @@ -7,6 +7,7 @@ enable = true; plugins = with pkgs.obs-studio-plugins; [ input-overlay + wlrobs ]; }; diff --git a/nixcfgs/users/js0ny/programs/shell/zsh.nix b/nixcfgs/users/js0ny/programs/shell/zsh.nix index 8416541..d81549c 100644 --- a/nixcfgs/users/js0ny/programs/shell/zsh.nix +++ b/nixcfgs/users/js0ny/programs/shell/zsh.nix @@ -118,6 +118,9 @@ in { bindkey '^[#' pound-insert # Alt-# to comment line + bindkey '^]' vi-find-next-char + bindkey '^[^]' vi-find-prev-char + # Misc # ======== # source ${pkgs.zsh-fzf-tab}/share/fzf-tab/fzf-tab.plugin.zsh diff --git a/nixcfgs/users/js0ny/programs/tmux.nix b/nixcfgs/users/js0ny/programs/tmux.nix index b515bdc..09d82b9 100644 --- a/nixcfgs/users/js0ny/programs/tmux.nix +++ b/nixcfgs/users/js0ny/programs/tmux.nix @@ -1,8 +1,8 @@ {pkgs, ...}: { programs.tmux = { enable = true; - prefix = "C-q"; - shortcut = "q"; + prefix = "C-a"; + shortcut = "a"; keyMode = "vi"; historyLimit = 10000; mouse = true; diff --git a/nixcfgs/users/js0ny/zephyrus.nix b/nixcfgs/users/js0ny/zephyrus.nix index bb69be8..02681d2 100644 --- a/nixcfgs/users/js0ny/zephyrus.nix +++ b/nixcfgs/users/js0ny/zephyrus.nix @@ -23,7 +23,7 @@ # Personal Program ./programs/chromium.nix ./programs/firefox - # ./programs/emacs.nix + ./programs/emacs.nix ./programs/vscode.nix ./programs/xilinx.nix ./programs/mime.nix @@ -52,11 +52,12 @@ ./programs/obsidian ./programs/aichat.nix ./programs/tmux.nix + ./programs/kitty.nix # Desktop Linux ./programs/desktop/plasma ./programs/desktop/wayland-wm/niri - ./programs/desktop/wayland-wm/hyprland.nix + ./programs/desktop/wayland-wm/hyprland ../../modules/home/do-not-track.nix