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

View File

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