feat(rafiq/hyprland): set monitor resolution

This commit is contained in:
Mohammad Rafiq 2025-05-18 18:37:22 +08:00
parent ee129ea287
commit 182dd20f88
No known key found for this signature in database
3 changed files with 21 additions and 0 deletions

View file

@ -1,4 +1,7 @@
{config, lib, osConfig, ...}:
let
mainMonitor = osConfig.desktop.mainMonitor;
in
{
xdg.configFile."uwsm/env".text = # sh
''
@ -9,6 +12,12 @@
systemd.enable = false;
settings = {
"$hypr" = "CTRL_SUPER_ALT_SHIFT";
monitor = [
"${mainMonitor.id}, ${mainMonitor.resolution}@${mainMonitor.refresh-rate}, auto, ${mainMonitor.scale}"
", preferred, auto, 1"
];
bind = [
"$hypr, Q, exec, uwsm stop"
"SUPER, W, killactive"

View file

@ -5,6 +5,12 @@
];
options.desktop = {
mainMonitor = {
id = lib.pantheon.mkStrOption;
scale = lib.pantheon.mkStrOption;
resolution = lib.pantheon.mkStrOption;
refresh-rate = lib.pantheon.mkStrOption;
};
windowManager = lib.pantheon.mkStrOption;
};
}

View file

@ -12,6 +12,12 @@
hardware.gpu = "nvidia";
desktop.windowManager = "hyprland";
desktop.mainMonitor = {
id = "HDMI-A-1";
scale = "2";
resolution = "3840x2160";
refresh-rate = "60";
};
nixpkgs.hostPlatform = lib.mkDefault "x86_64-linux";
}