From 1d08f5106891a1b6db454e31fac9b7c6aacdad1c Mon Sep 17 00:00:00 2001 From: Youwen Wu Date: Mon, 5 Aug 2024 17:57:29 -0700 Subject: [PATCH 1/7] feat: hide window decorations for kitty on darwin --- modules/home-manager/darwin/overrides.nix | 3 +++ 1 file changed, 3 insertions(+) create mode 100644 modules/home-manager/darwin/overrides.nix diff --git a/modules/home-manager/darwin/overrides.nix b/modules/home-manager/darwin/overrides.nix new file mode 100644 index 0000000..160067f --- /dev/null +++ b/modules/home-manager/darwin/overrides.nix @@ -0,0 +1,3 @@ +{ + programs.kitty.config.hide_window_decorations = "titlebar-only"; +} From 35873a5b7cc4a725609757d214f2db05ba3bc529 Mon Sep 17 00:00:00 2001 From: Youwen Wu Date: Mon, 5 Aug 2024 18:11:20 -0700 Subject: [PATCH 2/7] fix: partially revert 1056a696 and add kitty back also adds titlebar-only hide_window_decoration --- modules/home-manager/darwin/darwin-home.nix | 15 +++++++++++++++ modules/home-manager/darwin/overrides.nix | 3 --- 2 files changed, 15 insertions(+), 3 deletions(-) delete mode 100644 modules/home-manager/darwin/overrides.nix diff --git a/modules/home-manager/darwin/darwin-home.nix b/modules/home-manager/darwin/darwin-home.nix index 34d7975..85b20ec 100644 --- a/modules/home-manager/darwin/darwin-home.nix +++ b/modules/home-manager/darwin/darwin-home.nix @@ -53,6 +53,21 @@ programs.bash.enable = true; programs.zsh.enable = true; + programs.kitty = { + enable = true; + theme = "Tokyo Night"; + font.name = "CaskaydiaCove Nerd Font"; + settings = { + font_size = 12; + window_padding_width = "8 8 0"; + confirm_os_window_close = -1; + shell_integration = "enabled"; + enable_audio_bell = "no"; + background_opacity = "0.8"; + hide_window_decorations = "titlebar-only"; + }; + }; + # This value determines the home Manager release that your # configuration is compatible with. This helps avoid breakage # when a new home Manager release introduces backwards diff --git a/modules/home-manager/darwin/overrides.nix b/modules/home-manager/darwin/overrides.nix deleted file mode 100644 index 160067f..0000000 --- a/modules/home-manager/darwin/overrides.nix +++ /dev/null @@ -1,3 +0,0 @@ -{ - programs.kitty.config.hide_window_decorations = "titlebar-only"; -} From f7e40aa164cbe81d7eeb15180fd668a3423dfb18 Mon Sep 17 00:00:00 2001 From: Youwen Wu Date: Mon, 5 Aug 2024 18:42:42 -0700 Subject: [PATCH 3/7] feat: add styles to yabai --- modules/darwin/yabai.nix | 2 ++ 1 file changed, 2 insertions(+) diff --git a/modules/darwin/yabai.nix b/modules/darwin/yabai.nix index 3e39586..ec5df38 100644 --- a/modules/darwin/yabai.nix +++ b/modules/darwin/yabai.nix @@ -25,6 +25,8 @@ services.jankyborders = { enable = true; hidpi = true; + inactive_color = "gradient(top_right=0x9992B3F5,bottom_left=0x9992B3F5)"; + blur_radius = 5.0; }; } From 5c35fda9718df689d162be6d94d4a91b979f5291 Mon Sep 17 00:00:00 2001 From: Youwen Wu Date: Mon, 5 Aug 2024 18:46:25 -0700 Subject: [PATCH 4/7] feat: add skhd keybinds for yabai --- modules/darwin/skhd.nix | 69 ++++++++++++++++++++++++++++++++++++++++ modules/darwin/yabai.nix | 1 - 2 files changed, 69 insertions(+), 1 deletion(-) create mode 100644 modules/darwin/skhd.nix diff --git a/modules/darwin/skhd.nix b/modules/darwin/skhd.nix new file mode 100644 index 0000000..0b41257 --- /dev/null +++ b/modules/darwin/skhd.nix @@ -0,0 +1,69 @@ +{ + services.skhd = { + enable = true; + config = '' + # opens iTerm2 + alt - return : kitty + + # Navigation + alt - y : yabai -m window --focus west + alt - u : yabai -m window --focus south + alt - i : yabai -m window --focus north + alt - o : yabai -m window --focus east + + # Moving windows + shift + alt - y : yabai -m window --warp west + shift + alt - u : yabai -m window --warp south + shift + alt - i : yabai -m window --warp north + shift + alt - o : yabai -m window --warp east + + # Move focus container to workspace + shift + alt - m : yabai -m window --space last; yabai -m space --focus last + shift + alt - p : yabai -m window --space prev; yabai -m space --focus prev + shift + alt - n : yabai -m window --space next; yabai -m space --focus next + shift + alt - 1 : yabai -m window --space 1; yabai -m space --focus 1 + shift + alt - 2 : yabai -m window --space 2; yabai -m space --focus 2 + shift + alt - 3 : yabai -m window --space 3; yabai -m space --focus 3 + shift + alt - 4 : yabai -m window --space 4; yabai -m space --focus 4 + + # Resize windows + lctrl + alt - y : yabai -m window --resize left:-50:0; \ + yabai -m window --resize right:-50:0 + lctrl + alt - u : yabai -m window --resize bottom:0:50; \ + yabai -m window --resize top:0:50 + lctrl + alt - i : yabai -m window --resize top:0:-50; \ + yabai -m window --resize bottom:0:-50 + lctrl + alt - o : yabai -m window --resize right:50:0; \ + yabai -m window --resize left:50:0 + + # Equalize size of windows + lctrl + alt - e : yabai -m space --balance + + # Enable / Disable gaps in current workspace + lctrl + alt - g : yabai -m space --toggle padding; yabai -m space --toggle gap + + # Rotate windows clockwise and anticlockwise + alt - r : yabai -m space --rotate 270 + shift + alt - r : yabai -m space --rotate 90 + + # Rotate on X and Y Axis + shift + alt - x : yabai -m space --mirror x-axis + shift + alt - y : yabai -m space --mirror y-axis + + # Set insertion point for focused container + shift + lctrl + alt - h : yabai -m window --insert west + shift + lctrl + alt - j : yabai -m window --insert south + shift + lctrl + alt - k : yabai -m window --insert north + shift + lctrl + alt - l : yabai -m window --insert east + + # Float / Unfloat window + shift + alt - space : \ + yabai -m window --toggle float; \ + yabai -m window --toggle border + + # Make window native fullscreen + alt - f : yabai -m window --toggle zoom-fullscreen + shift + alt - f : yabai -m window --toggle native-fullscreen + ''; + }; +} diff --git a/modules/darwin/yabai.nix b/modules/darwin/yabai.nix index ec5df38..81a6627 100644 --- a/modules/darwin/yabai.nix +++ b/modules/darwin/yabai.nix @@ -21,7 +21,6 @@ mouse_drop_action = "swap"; }; }; - services.skhd = { enable = true; }; services.jankyborders = { enable = true; hidpi = true; From 4aa3ffcafd1cdc1c3ffd345c48d3dd545fc27da7 Mon Sep 17 00:00:00 2001 From: Youwen Wu Date: Thu, 8 Aug 2024 02:52:28 -0700 Subject: [PATCH 5/7] style: minor adjustments to kitty and fonts --- flake.nix | 1 + modules/darwin/skhd.nix | 2 +- modules/home-manager/darwin/darwin-home.nix | 3 ++- 3 files changed, 4 insertions(+), 2 deletions(-) diff --git a/flake.nix b/flake.nix index 66fadd1..9237bb4 100755 --- a/flake.nix +++ b/flake.nix @@ -96,6 +96,7 @@ nix-homebrew.darwinModules.nix-homebrew ./modules/darwin/homebrew.nix ./modules/darwin/yabai.nix + ./modules/darwin/skhd.nix ]; }; }; diff --git a/modules/darwin/skhd.nix b/modules/darwin/skhd.nix index 0b41257..465f2de 100644 --- a/modules/darwin/skhd.nix +++ b/modules/darwin/skhd.nix @@ -1,7 +1,7 @@ { services.skhd = { enable = true; - config = '' + skhdConfig = '' # opens iTerm2 alt - return : kitty diff --git a/modules/home-manager/darwin/darwin-home.nix b/modules/home-manager/darwin/darwin-home.nix index 85b20ec..2dc26c4 100644 --- a/modules/home-manager/darwin/darwin-home.nix +++ b/modules/home-manager/darwin/darwin-home.nix @@ -58,13 +58,14 @@ theme = "Tokyo Night"; font.name = "CaskaydiaCove Nerd Font"; settings = { - font_size = 12; + font_size = 13; window_padding_width = "8 8 0"; confirm_os_window_close = -1; shell_integration = "enabled"; enable_audio_bell = "no"; background_opacity = "0.8"; hide_window_decorations = "titlebar-only"; + background_blur = 32; }; }; From 55883730942f7a6f1c66d2bd2d118ad01a35d50e Mon Sep 17 00:00:00 2001 From: Youwen Wu Date: Thu, 8 Aug 2024 02:59:19 -0700 Subject: [PATCH 6/7] refactor(phobos): switch to correct hostname and use new hosts convention --- flake.nix | 4 ++-- .../darwin-configuration.nix => hosts/phobos/default.nix | 0 2 files changed, 2 insertions(+), 2 deletions(-) rename modules/darwin/darwin-configuration.nix => hosts/phobos/default.nix (100%) diff --git a/flake.nix b/flake.nix index a8b0626..26f567d 100755 --- a/flake.nix +++ b/flake.nix @@ -107,10 +107,10 @@ formatter.aarch64-linux = nixpkgs.legacyPackages.aarch64-linux.nixfmt; # Build darwin flake using: # $ darwin-rebuild build --flake .#Youwens-MacBook-Pro - darwinConfigurations."Youwens-MacBook-Pro" = nix-darwin.lib.darwinSystem { + darwinConfigurations.phobos = nix-darwin.lib.darwinSystem { specialArgs = { inherit inputs; }; modules = [ - ./modules/darwin/darwin-configuration.nix + ./hosts/phobos home-manager.darwinModules.home-manager { home-manager.useGlobalPkgs = true; diff --git a/modules/darwin/darwin-configuration.nix b/hosts/phobos/default.nix similarity index 100% rename from modules/darwin/darwin-configuration.nix rename to hosts/phobos/default.nix From 42a823e70dca5264e20a9c4440c093a0621ba5b0 Mon Sep 17 00:00:00 2001 From: Youwen Wu Date: Thu, 8 Aug 2024 02:59:45 -0700 Subject: [PATCH 7/7] chore: run nix fmt --- flake.nix | 4 ++-- modules/darwin/skhd.nix | 22 +++++++++---------- .../youwen/linux/hyprland/laptop/default.nix | 5 ++--- users/youwen/linux/laptop/default.nix | 12 +++------- 4 files changed, 18 insertions(+), 25 deletions(-) diff --git a/flake.nix b/flake.nix index 26f567d..b1dc6ae 100755 --- a/flake.nix +++ b/flake.nix @@ -110,7 +110,7 @@ darwinConfigurations.phobos = nix-darwin.lib.darwinSystem { specialArgs = { inherit inputs; }; modules = [ - ./hosts/phobos + ./hosts/phobos home-manager.darwinModules.home-manager { home-manager.useGlobalPkgs = true; @@ -127,7 +127,7 @@ nix-homebrew.darwinModules.nix-homebrew ./modules/darwin/homebrew.nix ./modules/darwin/yabai.nix - ./modules/darwin/skhd.nix + ./modules/darwin/skhd.nix ]; }; }; diff --git a/modules/darwin/skhd.nix b/modules/darwin/skhd.nix index 465f2de..9cf1077 100644 --- a/modules/darwin/skhd.nix +++ b/modules/darwin/skhd.nix @@ -4,19 +4,19 @@ skhdConfig = '' # opens iTerm2 alt - return : kitty - + # Navigation alt - y : yabai -m window --focus west alt - u : yabai -m window --focus south alt - i : yabai -m window --focus north alt - o : yabai -m window --focus east - + # Moving windows shift + alt - y : yabai -m window --warp west shift + alt - u : yabai -m window --warp south shift + alt - i : yabai -m window --warp north shift + alt - o : yabai -m window --warp east - + # Move focus container to workspace shift + alt - m : yabai -m window --space last; yabai -m space --focus last shift + alt - p : yabai -m window --space prev; yabai -m space --focus prev @@ -25,7 +25,7 @@ shift + alt - 2 : yabai -m window --space 2; yabai -m space --focus 2 shift + alt - 3 : yabai -m window --space 3; yabai -m space --focus 3 shift + alt - 4 : yabai -m window --space 4; yabai -m space --focus 4 - + # Resize windows lctrl + alt - y : yabai -m window --resize left:-50:0; \ yabai -m window --resize right:-50:0 @@ -35,32 +35,32 @@ yabai -m window --resize bottom:0:-50 lctrl + alt - o : yabai -m window --resize right:50:0; \ yabai -m window --resize left:50:0 - + # Equalize size of windows lctrl + alt - e : yabai -m space --balance - + # Enable / Disable gaps in current workspace lctrl + alt - g : yabai -m space --toggle padding; yabai -m space --toggle gap - + # Rotate windows clockwise and anticlockwise alt - r : yabai -m space --rotate 270 shift + alt - r : yabai -m space --rotate 90 - + # Rotate on X and Y Axis shift + alt - x : yabai -m space --mirror x-axis shift + alt - y : yabai -m space --mirror y-axis - + # Set insertion point for focused container shift + lctrl + alt - h : yabai -m window --insert west shift + lctrl + alt - j : yabai -m window --insert south shift + lctrl + alt - k : yabai -m window --insert north shift + lctrl + alt - l : yabai -m window --insert east - + # Float / Unfloat window shift + alt - space : \ yabai -m window --toggle float; \ yabai -m window --toggle border - + # Make window native fullscreen alt - f : yabai -m window --toggle zoom-fullscreen shift + alt - f : yabai -m window --toggle native-fullscreen diff --git a/users/youwen/linux/hyprland/laptop/default.nix b/users/youwen/linux/hyprland/laptop/default.nix index ca15dae..61765f7 100644 --- a/users/youwen/linux/hyprland/laptop/default.nix +++ b/users/youwen/linux/hyprland/laptop/default.nix @@ -1,6 +1,5 @@ -{ lib, ... }: -{ - imports = [ ../common.nix ]; +{ lib, ... }: { + imports = [ ../common.nix ]; wayland.windowManager.hyprland.settings.input.touchpad = { natural_scroll = true; disable_while_typing = true; diff --git a/users/youwen/linux/laptop/default.nix b/users/youwen/linux/laptop/default.nix index a1c714c..6becfb1 100644 --- a/users/youwen/linux/laptop/default.nix +++ b/users/youwen/linux/laptop/default.nix @@ -1,12 +1,6 @@ -{ pkgs, ... }: -{ - imports = [ - ../theming - ../home.nix - ../programs - ../hyprland/laptop - ../waybar/laptop - ]; +{ pkgs, ... }: { + imports = + [ ../theming ../home.nix ../programs ../hyprland/laptop ../waybar/laptop ]; # some overrides for laptop specifically programs.kitty.settings.font_size = pkgs.lib.mkForce 11;