nixpkgs/modules/tasks/tty-backgrounds-combine.sh
Eelco Dolstra e450e4551f * tty-backgrounds: don't do a setcfg action on the console if the
current theme is the same.  This prevents the console from being
  blanked during boot.

svn path=/nixos/trunk/; revision=22092
2010-06-01 18:30:17 +00:00

33 lines
662 B
Bash

source $stdenv/setup
ttys=($ttys)
themes=($themes)
ensureDir $out
defaultName=$(cd $default && ls | grep -v default)
echo $defaultName
ln -s $default/default $out/default
ln -s $defaultName $out/$defaultName
for ((n = 0; n < ${#ttys[*]}; n++)); do
tty=${ttys[$n]}
theme=${themes[$n]}
echo "TTY $tty -> $theme"
if [ "$theme" != default ]; then
themeName=$(cd $theme && ls | grep -v default)
ln -sfn $theme/$themeName $out/$themeName
else
themeName=default
fi
if test -e $out/$tty; then
echo "Multiple themes defined for the same TTY!"
exit 1
fi
ln -sfn $themeName $out/$tty
done