hyprland xdg-portal and displays conf

This commit is contained in:
Tristan 2024-01-05 12:27:21 +00:00
parent c882579a90
commit f08e55abe2
4 changed files with 18 additions and 9 deletions

View file

@ -95,15 +95,11 @@
];
displays.displays = {
"hp" = {
name = "DP-1";
wallpaper = ../images/demonslayer.png;
workspaces = {
start = 6;
end = 10;
};
};
"asus" = {
enable = false;
};
"hp" = {
enable = true;
name = "HDMI-A-1";
wallpaper = ../images/nier2.jpg;
workspaces = {
@ -112,6 +108,7 @@
};
};
"internal" = {
enable = true;
name = "eDP-1";
description = "BOE 0x07D8";
workspaces = {

View file

@ -105,6 +105,7 @@
displays = {
displays."hp" = {
enable = true;
name = "DP-1";
wallpaper = ../images/demonslayer.png;
workspaces = {
@ -113,6 +114,7 @@
};
};
displays."asus" = {
enable = true;
name = "HDMI-A-1";
wallpaper = ../images/nier2.jpg;
workspaces = {

View file

@ -7,7 +7,7 @@
with lib; let
cfg = config.displays;
renderDisplaysForHyprland = displays: (map displayHyprlandSetting displays);
renderDisplaysForHyprland = displays: (map displayHyprlandSetting (builtins.filter (d: d.enable) displays ));
displayHyprlandSetting = display:
specificDisplay display
@ -91,8 +91,10 @@ with lib; let
displayType = types.submodule {
options = {
enable = mkEnableOption "enable this display";
name = mkOption {
description = "name of the display";
default = "";
};
description = mkOption {
description = "description of display from hyprctl monitors";
@ -129,9 +131,11 @@ with lib; let
options = {
start = mkOption {
type = types.int;
default = 1;
};
end = mkOption {
type = types.int;
default = 1;
};
};
};

View file

@ -33,6 +33,12 @@ in {
home-manager.users.${user}.imports = [
{
xdg.portal = {
enable = true;
config.common.default = ["hyprland"];
extraPortals = if cfg.hyprland then [ pkgs.xdg-desktop-portal-hyprland ] else if cfg.sway then [ pkgs.xdg-desktop-portal-sway ] else [];
};
wayland.windowManager.hyprland = mkIf cfg.hyprland {
enable = true;
systemd.enable = true;