home-manager/gui: Add brainrot screensavers
Some checks failed
CI / Check, build and cache nixfiles (push) Failing after 30m15s
Some checks failed
CI / Check, build and cache nixfiles (push) Failing after 30m15s
This commit is contained in:
parent
584abd4991
commit
bc74fb4968
@ -2,6 +2,7 @@
|
|||||||
let
|
let
|
||||||
inherit (lib) genAttrs mkIf mkMerge mkForce mapAttrs mkOptionDefault;
|
inherit (lib) genAttrs mkIf mkMerge mkForce mapAttrs mkOptionDefault;
|
||||||
inherit (lib.my) mkBoolOpt';
|
inherit (lib.my) mkBoolOpt';
|
||||||
|
inherit (lib.my.c) pubDomain;
|
||||||
|
|
||||||
cfg = config.my.gui;
|
cfg = config.my.gui;
|
||||||
|
|
||||||
@ -15,13 +16,24 @@ let
|
|||||||
url = "https://distro.ibiblio.org/slitaz/sources/packages/d/doom1.wad";
|
url = "https://distro.ibiblio.org/slitaz/sources/packages/d/doom1.wad";
|
||||||
hash = "sha256-HX1DvlAeZ9kn5BXguPPinDvzMHXoWXIYFvZSpSbKx3E=";
|
hash = "sha256-HX1DvlAeZ9kn5BXguPPinDvzMHXoWXIYFvZSpSbKx3E=";
|
||||||
};
|
};
|
||||||
|
subwaySurfers = pkgs.fetchurl {
|
||||||
|
url = "https://p.${pubDomain}/video/subway-surfers.mkv";
|
||||||
|
hash = "sha256-apn/0DPeihXj+nP6ytVkH/SlZRelxIpRXOUOfxHczl8=";
|
||||||
|
};
|
||||||
|
minecraftParkour = pkgs.fetchurl {
|
||||||
|
url = "https://p.${pubDomain}/video/minecraft-parkour.mkv";
|
||||||
|
hash = "sha256-1fJZyi9N4g/QyoL1Pk7akL0jTDjxReYmN31EOUHhHXk=";
|
||||||
|
};
|
||||||
|
|
||||||
doomsaver = pkgs.runCommand "doomsaver" {
|
doomsaver = pkgs.runCommand "doomsaver" {
|
||||||
inherit (pkgs) windowtolayer;
|
inherit (pkgs) windowtolayer;
|
||||||
chocoDoom = pkgs.chocolate-doom2xx;
|
chocoDoom = pkgs.chocolate-doom2xx;
|
||||||
|
ffmpeg = pkgs.ffmpeg-full;
|
||||||
python = pkgs.python3.withPackages (ps: [ ps.filelock ]);
|
python = pkgs.python3.withPackages (ps: [ ps.filelock ]);
|
||||||
|
|
||||||
inherit doomWad;
|
inherit doomWad;
|
||||||
enojy = ./enojy.jpg;
|
enojy = ./enojy.jpg;
|
||||||
|
inherit subwaySurfers minecraftParkour;
|
||||||
} ''
|
} ''
|
||||||
mkdir -p "$out"/bin
|
mkdir -p "$out"/bin
|
||||||
substituteAll ${./screensaver.py} "$out"/bin/doomsaver
|
substituteAll ${./screensaver.py} "$out"/bin/doomsaver
|
||||||
|
@ -86,6 +86,22 @@ class TTESaver(Screensaver):
|
|||||||
self.running = False
|
self.running = False
|
||||||
self.proc.terminate()
|
self.proc.terminate()
|
||||||
|
|
||||||
|
class FFmpegCACASaver(Screensaver):
|
||||||
|
def __init__(self, video, weight=1.5):
|
||||||
|
super().__init__(
|
||||||
|
['@ffmpeg@/bin/ffmpeg', '-hide_banner', '-loglevel', 'error',
|
||||||
|
'-i', video,
|
||||||
|
'-pix_fmt', 'rgb24', '-window_size', '80x80',
|
||||||
|
'-f', 'caca', '-'],
|
||||||
|
env={
|
||||||
|
'CACA_DRIVER': 'ncurses',
|
||||||
|
},
|
||||||
|
weight=weight,
|
||||||
|
)
|
||||||
|
|
||||||
|
def stop(self):
|
||||||
|
super().stop(kill=True)
|
||||||
|
|
||||||
class MultiSaver:
|
class MultiSaver:
|
||||||
savers = [
|
savers = [
|
||||||
DoomSaver(0),
|
DoomSaver(0),
|
||||||
@ -100,6 +116,9 @@ class MultiSaver:
|
|||||||
TTESaver('ss -nltu'),
|
TTESaver('ss -nltu'),
|
||||||
TTESaver('ss -ntu'),
|
TTESaver('ss -ntu'),
|
||||||
TTESaver('jp2a --width=100 @enojy@'),
|
TTESaver('jp2a --width=100 @enojy@'),
|
||||||
|
|
||||||
|
FFmpegCACASaver('@subwaySurfers@'),
|
||||||
|
FFmpegCACASaver('@minecraftParkour@'),
|
||||||
]
|
]
|
||||||
state_filename = 'screensaver.json'
|
state_filename = 'screensaver.json'
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user