mpv: Make the primary screen configurable

This commit is contained in:
PapaTutuWawa 2021-08-25 12:06:38 +02:00
parent 949e0d0950
commit d71afad094
2 changed files with 20 additions and 5 deletions

View File

@ -50,6 +50,10 @@
# Enable notification sounds
propagatedBuildInputs = old.propagatedBuildInputs ++ [ prev.gsound ];
});
animedl = prev.animedl.overrideAttrs (old: {
extraPkgs = pkgs: with pkgs; [ mpv ];
});
})
# Unstable, NUR, ...
@ -95,6 +99,8 @@
};
};
programs.mpv.primaryScreen = "C27F398";
networking = {
interfaces.enp6s0.useDHCP = false;
hostName = "miku";

View File

@ -1,4 +1,4 @@
{ config, pkgs, ... }:
{ config, lib, pkgs, ... }:
let
makeMpvProfile = { shader, additional ? {} }: {
@ -12,11 +12,20 @@ let
video-sync = "display-resample";
interpolation = "";
tscale = "oversample";
# TODO: Make those two configurable
screen-name = "C27F398";
fs-screen-name = "C27F398"; # Make mpv pop up on the primary screen
} // additional;
} // additional // (if config.programs.mpv != "" then {
# Make mpv pop up on the primary screen
screen-name = config.programs.mpv.primaryScreen;
fs-screen-name = config.programs.mpv.primaryScreen;
} else {});
in {
options.programs.mpv = {
primaryScreen = lib.mkOption {
type = lib.types.str;
default = "";
description = "The name of the screen to use for fullscreen";
};
};
config = {
environment.systemPackages = with pkgs; [ mpv ];