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

View file

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

View file

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

View file

@ -33,6 +33,12 @@ in {
home-manager.users.${user}.imports = [ 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 { wayland.windowManager.hyprland = mkIf cfg.hyprland {
enable = true; enable = true;
systemd.enable = true; systemd.enable = true;