mirror of
https://github.com/Theaninova/TheaninovOS.git
synced 2025-12-12 11:36:20 +00:00
improvements
This commit is contained in:
41
modules/nixos/shell/firefox-pip.nix
Normal file
41
modules/nixos/shell/firefox-pip.nix
Normal file
@@ -0,0 +1,41 @@
|
||||
{
|
||||
config,
|
||||
lib,
|
||||
username,
|
||||
...
|
||||
}:
|
||||
|
||||
let
|
||||
cfg = config.shell.components.firefox-pip;
|
||||
homeConfig = config.home-manager.users.${username};
|
||||
in
|
||||
{
|
||||
options.shell.components.firefox-pip = {
|
||||
enable = lib.mkEnableOption (lib.mdDoc "Enable firefox-pip");
|
||||
};
|
||||
|
||||
config = lib.mkIf cfg.enable {
|
||||
home-manager.users.${username} = {
|
||||
wayland.windowManager.hyprland.settings = {
|
||||
windowrulev2 =
|
||||
let
|
||||
firefoxPip = "class:^(firefox)$,title:^(Picture-in-Picture)$";
|
||||
firefoxPipInitial = "class:^(firefox)$,title:^(Firefox)$";
|
||||
pipPadding = toString (homeConfig.theme.md3-evo.padding * 2);
|
||||
in
|
||||
[
|
||||
"keepaspectratio,${firefoxPip}"
|
||||
"noborder,${firefoxPip}"
|
||||
"float,${firefoxPip}"
|
||||
"float,${firefoxPipInitial}"
|
||||
"pin,${firefoxPip}"
|
||||
"pin,${firefoxPipInitial}"
|
||||
"fullscreenstate 2 0,${firefoxPip}"
|
||||
"fullscreenstate 2 0,${firefoxPipInitial}"
|
||||
"move ${pipPadding} ${pipPadding},${firefoxPip}"
|
||||
"move ${pipPadding} ${pipPadding},${firefoxPipInitial}"
|
||||
];
|
||||
};
|
||||
};
|
||||
};
|
||||
}
|
||||
Reference in New Issue
Block a user