Skip to content

Commit

Permalink
fix(hyprland): screenshare
Browse files Browse the repository at this point in the history
Probably had to do with bitdepth of 10 not working with Discord
  • Loading branch information
gekoke committed Mar 11, 2025
1 parent 32a6753 commit 42a0703
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 28 deletions.
35 changes: 10 additions & 25 deletions modules/nixos/desktop/hyprland/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -21,45 +21,29 @@ in
};

config = mkIf cfg.enable {
programs.hyprland = {
enable = true;
};

xdg.portal = {
enable = true;

# xdg-desktop-portal 1.17 reworked how portal implementations are loaded, you
# should either set `xdg.portal.config` or `xdg.portal.configPackages`
# to specify which portal backend to use for the requested interface.

# https://github.com/flatpak/xdg-desktop-portal/blob/1.18.1/doc/portals.conf.rst.in
programs.hyprland.enable = true;

# If you simply want to keep the behaviour in < 1.17, which uses the first
# portal implementation found in lexicographical order, use the following:

# xdg.portal.config.common.default = "*";
config.common.default = "*";

# See https://github.com/NixOS/nixpkgs/issues/239886
# Enable xdg-desktop-portal-gtk unless we already have it from Gnome DE
extraPortals = lib.optionals (!config.services.xserver.desktopManager.gnome.enable) [
pkgs.xdg-desktop-portal-gtk
];
};
# Fixes bugs I guess? https://github.com/NixOS/nixpkgs/issues/160923
xdg.portal.xdgOpenUsePortal = true;

elementary = {
services.udiskie = enabled;

desktop = {
hyprland.extraHomeManagerOptions = {
enable = true;
package = null;
portalPackage = null;
extraConfig =
let
applyVibrance = ''
exec-once = ${lib.getExe pkgs.hyprshade} on vibrance
'';
screenshareDiscord = ''
exec-once = ${lib.getExe pkgs.kdePackages.xwaylandvideobridge}
'';
in
builtins.readFile ./hyprland.conf + applyVibrance;
builtins.readFile ./hyprland.conf + applyVibrance + screenshareDiscord;
};
addons = {
waybar = enabled // {
Expand All @@ -81,6 +65,7 @@ in
};

home.sessionVariables = {
MOZ_ENABLE_WAYLAND = 1;
WLR_NO_HARDWARE_CURSORS = 1;
# FIXME: remove when https://github.com/nix-community/home-manager/issues/4486 is fixed
NIXOS_OZONE_WL = 1;
Expand Down
2 changes: 1 addition & 1 deletion modules/nixos/desktop/hyprland/hyprland.conf
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# Prefer high refresh rate
monitor=,highrr,auto,1,bitdepth,10
monitor=,highrr,auto,1,bitdepth,8

input {
# 0 - Cursor movement will not change focus.
Expand Down
2 changes: 0 additions & 2 deletions modules/nixos/programs/firefox/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,6 @@
cfg = config.elementary.programs.firefox;
in
mkIf cfg.enable {
elementary.home.sessionVariables.MOZ_ENABLE_WAYLAND = 1;

elementary.home.programs.firefox = {
enable = true;
package = pkgs.firefox-wayland;
Expand Down

0 comments on commit 42a0703

Please sign in to comment.