From 2363ddbc12a3a40bfe3aa2ff9fe3440ec68d5ea4 Mon Sep 17 00:00:00 2001 From: Kopatz <7265381+Kropatz@users.noreply.github.com> Date: Sun, 15 Sep 2024 15:42:04 +0200 Subject: [PATCH] hyprland and ime --- home-manager/hyprland/hyprland-settings.nix | 18 +++++++++------- home-manager/kitty.nix | 1 + modules/graphical/ime.nix | 23 +++++++++------------ 3 files changed, 21 insertions(+), 21 deletions(-) diff --git a/home-manager/hyprland/hyprland-settings.nix b/home-manager/hyprland/hyprland-settings.nix index 821bcf9..6851cf2 100644 --- a/home-manager/hyprland/hyprland-settings.nix +++ b/home-manager/hyprland/hyprland-settings.nix @@ -1,9 +1,13 @@ { config, osConfig, pkgs, inputs, lib, ... }: -let cfg = osConfig.custom.graphical.hyprland; +let + cfg = osConfig.custom.graphical.hyprland; + isPc = osConfig.networking.hostName == "kop-pc"; + isLaptop = osConfig.networking.hostName == "nix-laptop"; in { config = lib.mkIf cfg.enable { - home.file.".config/hypr/hyprshade.toml".source = ../../.config/hypr/hyprshade.toml; + home.file.".config/hypr/hyprshade.toml".source = + ../../.config/hypr/hyprshade.toml; #programs.swaylock.enable = true; wayland.windowManager.hyprland = { enable = true; @@ -16,12 +20,11 @@ in { # # See https://wiki.hyprland.org/Configuring/Monitors/ - monitor = if osConfig.networking.hostName == "kop-pc" then [ - # PC + monitor = if isPc then [ "HDMI-A-1,1920x1080@60,0x0,1" "DP-1,2560x1440@165,1920x0,1" "Unknown-1,disable" - ] else if osConfig.networking.hostName == "nix-laptop" then [ + ] else if isLaptop then [ # laptop "eDP-1,1920x1080@60,0x0,1" #"DP-3,1920x1080@60,1920x0,1" @@ -80,9 +83,7 @@ in { 0; # -1.0 - 1.0, 0 means no modification. }; - cursor = { - no_hardware_cursors = true; - }; + cursor = { no_hardware_cursors = true; }; render = { explicit_sync = 1; @@ -103,6 +104,7 @@ in { }; misc = { vfr = true; }; + xwayland = lib.mkIf isPc { force_zero_scaling = true; }; decoration = { # See https://wiki.hyprland.org/Configuring/Variables/ for more diff --git a/home-manager/kitty.nix b/home-manager/kitty.nix index bfbbeec..3fd45a1 100644 --- a/home-manager/kitty.nix +++ b/home-manager/kitty.nix @@ -18,6 +18,7 @@ }; extraConfig = '' map ctrl+shift+t new_tab_with_cwd + map ctrl+shift+enter new_window_with_cwd ''; }; } diff --git a/modules/graphical/ime.nix b/modules/graphical/ime.nix index 8610a7f..a5c0913 100644 --- a/modules/graphical/ime.nix +++ b/modules/graphical/ime.nix @@ -1,18 +1,15 @@ { config, lib, pkgs, ... }: with lib; -let - cfg = config.custom.graphical.ime; -in -{ - options.custom.graphical.ime = { - enable = mkEnableOption "Enables ime"; - }; - +let cfg = config.custom.graphical.ime; +in { + options.custom.graphical.ime = { enable = mkEnableOption "Enables ime"; }; + config = mkIf cfg.enable { - i18n.inputMethod.type = "fcitx5"; #deprecated - ## new - #i18n.enable = true; - #i18n.inputMethod.type = "fcitx5"; - i18n.inputMethod.fcitx5.addons = [ pkgs.fcitx5-mozc ]; + i18n.inputMethod = { + enable = true; + type = "fcitx5"; + fcitx5.waylandFrontend = true; + fcitx5.addons = [ pkgs.fcitx5-mozc ]; + }; }; }