2006-11-26 23:00:30 +00:00
|
|
|
{stdenv, splashutils, backgrounds}:
|
|
|
|
|
|
|
|
rec {
|
|
|
|
name = "tty-backgrounds";
|
|
|
|
|
2006-11-26 23:54:49 +00:00
|
|
|
unpackTheme = theme: import ../helpers/unpack-theme.nix {
|
|
|
|
inherit stdenv theme;
|
2006-11-26 23:00:30 +00: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 14:08:01 +01:00
|
|
|
extraEtc = [
|
|
|
|
{ source = themesUnpacked;
|
|
|
|
target = "splash";
|
|
|
|
}
|
|
|
|
];
|
|
|
|
|
2006-11-26 23:00:30 +00:00
|
|
|
job = "
|
|
|
|
start on hardware-scan
|
|
|
|
|
2006-11-26 23:26:37 +00:00
|
|
|
start script
|
2006-11-26 23:00:30 +00:00
|
|
|
|
|
|
|
# Critical: tell the kernel where to find splash_helper. It calls
|
|
|
|
# this program every time we switch between consoles.
|
|
|
|
echo ${splashutils}/bin/splash_helper > /proc/sys/kernel/fbsplash
|
|
|
|
|
2007-01-09 13:56:54 +00:00
|
|
|
# For each console...
|
2006-11-26 23:00:30 +00:00
|
|
|
for tty in ${toString (map (x: x.tty) backgrounds)}; do
|
2007-01-09 13:56:54 +00:00
|
|
|
# Make sure that the console exists.
|
|
|
|
echo -n '' > /dev/tty$tty
|
|
|
|
|
|
|
|
# Set the theme as determined by tty-backgrounds-combine.sh
|
|
|
|
# above.
|
2006-11-26 23:00:30 +00:00
|
|
|
theme=$(readlink ${themesUnpacked}/$tty)
|
|
|
|
${splashutils}/bin/splash_util --tty $tty -c setcfg -t $theme || true
|
|
|
|
${splashutils}/bin/splash_util --tty $tty -c setpic -t $theme || true
|
|
|
|
${splashutils}/bin/splash_util --tty $tty -c on || true
|
|
|
|
done
|
|
|
|
|
|
|
|
end script
|
2006-11-26 23:26:37 +00:00
|
|
|
|
|
|
|
respawn sleep 10000 # !!! Hack
|
|
|
|
|
|
|
|
stop script
|
|
|
|
# Disable the theme on each console.
|
|
|
|
for tty in ${toString (map (x: x.tty) backgrounds)}; do
|
|
|
|
${splashutils}/bin/splash_util --tty $tty -c off || true
|
|
|
|
done
|
|
|
|
end script
|
|
|
|
|
2006-11-26 23:00:30 +00:00
|
|
|
";
|
|
|
|
|
|
|
|
}
|