2006-11-27 00:00:30 +01:00
|
|
|
{stdenv, splashutils, backgrounds}:
|
|
|
|
|
|
|
|
rec {
|
|
|
|
name = "tty-backgrounds";
|
|
|
|
|
2006-11-27 00:54:49 +01:00
|
|
|
unpackTheme = theme: import ../helpers/unpack-theme.nix {
|
|
|
|
inherit stdenv theme;
|
2006-11-27 00:00:30 +01:00
|
|
|
};
|
|
|
|
|
|
|
|
themesUnpacked = stdenv.mkDerivation {
|
|
|
|
name = "splash-themes";
|
|
|
|
builder = ./tty-backgrounds-combine.sh;
|
|
|
|
# !!! Should use XML here.
|
|
|
|
ttys = map (x: x.tty) backgrounds;
|
|
|
|
themes = map (x: if x ? theme then (unpackTheme x.theme) else "default") backgrounds;
|
|
|
|
};
|
|
|
|
|
2007-03-30 15:08:01 +02:00
|
|
|
extraEtc = [
|
|
|
|
{ source = themesUnpacked;
|
|
|
|
target = "splash";
|
|
|
|
}
|
|
|
|
];
|
|
|
|
|
2008-06-10 18:10:23 +02:00
|
|
|
job = ''
|
2008-07-02 23:19:04 +02:00
|
|
|
start on udev
|
2008-06-10 18:10:23 +02:00
|
|
|
|
|
|
|
start script
|
|
|
|
|
|
|
|
# Critical: tell the kernel where to find splash_helper. It calls
|
|
|
|
# this program every time we switch between consoles.
|
|
|
|
echo ${splashutils}/${splashutils.helperName} > ${splashutils.helperProcFile}
|
|
|
|
|
|
|
|
# For each console...
|
|
|
|
for tty in ${toString (map (x: x.tty) backgrounds)}; do
|
|
|
|
# Make sure that the console exists.
|
|
|
|
echo -n "" > /dev/tty$tty
|
|
|
|
|
|
|
|
# Set the theme as determined by tty-backgrounds-combine.sh
|
|
|
|
# above.
|
|
|
|
theme=$(readlink ${themesUnpacked}/$tty)
|
|
|
|
${splashutils}/${splashutils.controlName} --tty $tty -c setcfg -t $theme || true
|
|
|
|
${splashutils}/${splashutils.controlName} --tty $tty -c setpic -t $theme || true
|
|
|
|
${splashutils}/${splashutils.controlName} --tty $tty -c on || true
|
|
|
|
done
|
|
|
|
|
|
|
|
end script
|
|
|
|
|
|
|
|
respawn sleep 10000 # !!! Hack
|
|
|
|
|
|
|
|
stop script
|
|
|
|
# Disable the theme on each console.
|
|
|
|
for tty in ${toString (map (x: x.tty) backgrounds)}; do
|
|
|
|
${splashutils}/${splashutils.controlName} --tty $tty -c off || true
|
|
|
|
done
|
|
|
|
end script
|
|
|
|
'';
|
2006-11-27 00:00:30 +01:00
|
|
|
|
|
|
|
}
|