summaryrefslogtreecommitdiffstats
path: root/os-plugins/plugins/theme
diff options
context:
space:
mode:
authorOliver Tappe2008-01-27 13:37:13 +0100
committerOliver Tappe2008-01-27 13:37:13 +0100
commit224da813f0632c67a7437762fae6871704fc341d (patch)
tree75f038e20fe80c213d886956a19c13926004a6ed /os-plugins/plugins/theme
parentadjusted following the recent discussion on the devel list: (diff)
downloadcore-224da813f0632c67a7437762fae6871704fc341d.tar.gz
core-224da813f0632c67a7437762fae6871704fc341d.tar.xz
core-224da813f0632c67a7437762fae6871704fc341d.zip
* renamed all plugins to lowercase in order to be consistent with
the attribute names git-svn-id: http://svn.openslx.org/svn/openslx/trunk@1497 95ad53e4-c205-0410-b2fa-d234c58c8868
Diffstat (limited to 'os-plugins/plugins/theme')
-rw-r--r--os-plugins/plugins/theme/OpenSLX/OSPlugin/theme.pm94
-rw-r--r--os-plugins/plugins/theme/XX_theme.sh22
-rw-r--r--os-plugins/plugins/theme/init-hooks/05-have-kernelvars/theme.sh11
-rw-r--r--os-plugins/plugins/theme/init-hooks/15-have-ip-config/theme.sh1
-rw-r--r--os-plugins/plugins/theme/init-hooks/25-have-network-root/theme.sh1
-rw-r--r--os-plugins/plugins/theme/init-hooks/40-started-hw-config/theme.sh1
-rw-r--r--os-plugins/plugins/theme/init-hooks/50-have-layered-fs/theme.sh1
-rw-r--r--os-plugins/plugins/theme/init-hooks/60-have-servconfig/theme.sh1
-rw-r--r--os-plugins/plugins/theme/init-hooks/70-before-plugins/theme.sh1
-rw-r--r--os-plugins/plugins/theme/init-hooks/80-after-plugins/theme.sh19
-rw-r--r--os-plugins/plugins/theme/init-hooks/99-handing-over/theme.sh1
11 files changed, 153 insertions, 0 deletions
diff --git a/os-plugins/plugins/theme/OpenSLX/OSPlugin/theme.pm b/os-plugins/plugins/theme/OpenSLX/OSPlugin/theme.pm
new file mode 100644
index 00000000..17170fbf
--- /dev/null
+++ b/os-plugins/plugins/theme/OpenSLX/OSPlugin/theme.pm
@@ -0,0 +1,94 @@
+# Copyright (c) 2007 - OpenSLX GmbH
+#
+# This program is free software distributed under the GPL version 2.
+# See http://openslx.org/COPYING
+#
+# If you have any feedback please consult http://openslx.org/feedback and
+# send your suggestions, praise, or complaints to feedback@openslx.org
+#
+# General information about OpenSLX can be found at http://openslx.org/
+# -----------------------------------------------------------------------------
+# theme.pm
+# - implementation of the 'theme' plugin, which applies theming to the
+# following places:
+# + bootsplash (via splashy)
+# + displaymanager (gdm, kdm, ...)
+# + desktop (to be done)
+# -----------------------------------------------------------------------------
+package OpenSLX::OSPlugin::theme;
+
+use strict;
+use warnings;
+
+use base qw(OpenSLX::OSPlugin::Base);
+
+use OpenSLX::Basics;
+use OpenSLX::Utils;
+
+sub new
+{
+ my $class = shift;
+
+ my $self = {};
+
+ return bless $self, $class;
+}
+
+sub getInfo
+{
+ my $self = shift;
+
+ return {
+ description => unshiftHereDoc(<<' End-of-Here'),
+ applies a graphical theme to the bootsplash and the displaymanager
+ End-of-Here
+ mustRunAfter => [],
+ };
+}
+
+sub getAttrInfo
+{ # returns a hash-ref with information about all attributes supported
+ # by this specific plugin
+ my $self = shift;
+
+ # This default configuration will be added as attributes to the default
+ # system, such that it can be overruled for any specific system by means
+ # of slxconfig.
+ return {
+ # attribute 'active' is mandatory for all plugins
+ 'theme::active' => {
+ applies_to_systems => 1,
+ applies_to_clients => 0,
+ description => unshiftHereDoc(<<' End-of-Here'),
+ should the 'theme'-plugin be executed during boot?
+ End-of-Here
+ content_regex => qr{^(0|1)$},
+ content_descr => '1 means active - 0 means inactive',
+ default => '1',
+ },
+ # attribute 'precedence' is mandatory for all plugins
+ 'theme::precedence' => {
+ applies_to_systems => 1,
+ applies_to_clients => 0,
+ description => unshiftHereDoc(<<' End-of-Here'),
+ the execution precedence of the 'theme' plugin
+ End-of-Here
+ content_regex => qr{^\d\d$},
+ content_descr => 'allowed range is from 01-99',
+ default => 30,
+ },
+
+ 'theme::name' => {
+ applies_to_systems => 1,
+ applies_to_clients => 0,
+ description => unshiftHereDoc(<<' End-of-Here'),
+ the name of the theme to apply (or unset for no theme)
+ End-of-Here
+ content_regex => undef,
+ content_descr => undef,
+ default => 'openslx',
+ },
+ };
+}
+
+1;
diff --git a/os-plugins/plugins/theme/XX_theme.sh b/os-plugins/plugins/theme/XX_theme.sh
new file mode 100644
index 00000000..4d166c13
--- /dev/null
+++ b/os-plugins/plugins/theme/XX_theme.sh
@@ -0,0 +1,22 @@
+#! /bin/sh
+#
+# stage3 part of 'theme' plugin - the runlevel script
+#
+. /etc/functions
+. /etc/sysconfig/config
+if [ -e /initramfs/plugin-conf/theme.conf ]; then
+ . /initramfs/plugin-conf/theme.conf
+ if [ $Theme_active -ne 0 ]; then
+ [ $DEBUGLEVEL -gt 0 ] && echo "executing the 'theme' os-plugin ...";
+
+ testmkd /mnt/var/lib/openslx/themes/displaymanager
+ testmkd /mnt/var/lib/openslx/bin
+ if [ -d /usr/share/themes/displaymanager ]; then
+ cp -a /usr/share/themes/displaymanager \
+ /mnt/var/lib/openslx/themes
+ sed -i "s,UseTheme=false,UseTheme=true," /mnt/${D_KDMRCPATH}/kdmrc
+ fi
+
+ [ $DEBUGLEVEL -gt 0 ] && echo "done with 'theme' os-plugin ...";
+ fi
+fi
diff --git a/os-plugins/plugins/theme/init-hooks/05-have-kernelvars/theme.sh b/os-plugins/plugins/theme/init-hooks/05-have-kernelvars/theme.sh
new file mode 100644
index 00000000..e1f2b31d
--- /dev/null
+++ b/os-plugins/plugins/theme/init-hooks/05-have-kernelvars/theme.sh
@@ -0,0 +1,11 @@
+# splashy depends on /proc/fb with VESA
+# only activate with kernel option quiet and no debuglevel
+if grep -E "(VESA|VGA)" /proc/fb > /dev/null 2>&1 \
+ && grep -qi " quiet " /proc/cmdline > /dev/null 2>&1 \
+ && [ $DEBUGLEVEL -eq 0 ] ; then
+ export theme_nosplash=0
+else
+ export theme_nosplash=1
+fi
+
+[ ${theme_nosplash} -eq 0 ] && /bin/splashy boot 2>/dev/null
diff --git a/os-plugins/plugins/theme/init-hooks/15-have-ip-config/theme.sh b/os-plugins/plugins/theme/init-hooks/15-have-ip-config/theme.sh
new file mode 100644
index 00000000..cb89362e
--- /dev/null
+++ b/os-plugins/plugins/theme/init-hooks/15-have-ip-config/theme.sh
@@ -0,0 +1 @@
+[ ${theme_nosplash} = 0 ] && /bin/splashy_update "progress 15" >/dev/null 2>&1
diff --git a/os-plugins/plugins/theme/init-hooks/25-have-network-root/theme.sh b/os-plugins/plugins/theme/init-hooks/25-have-network-root/theme.sh
new file mode 100644
index 00000000..369f8d45
--- /dev/null
+++ b/os-plugins/plugins/theme/init-hooks/25-have-network-root/theme.sh
@@ -0,0 +1 @@
+[ ${theme_nosplash} = 0 ] && /bin/splashy_update "progress 25" >/dev/null 2>&1
diff --git a/os-plugins/plugins/theme/init-hooks/40-started-hw-config/theme.sh b/os-plugins/plugins/theme/init-hooks/40-started-hw-config/theme.sh
new file mode 100644
index 00000000..ac91157f
--- /dev/null
+++ b/os-plugins/plugins/theme/init-hooks/40-started-hw-config/theme.sh
@@ -0,0 +1 @@
+[ ${theme_nosplash} = 0 ] && /bin/splashy_update "progress 40" >/dev/null 2>&1
diff --git a/os-plugins/plugins/theme/init-hooks/50-have-layered-fs/theme.sh b/os-plugins/plugins/theme/init-hooks/50-have-layered-fs/theme.sh
new file mode 100644
index 00000000..85a8279a
--- /dev/null
+++ b/os-plugins/plugins/theme/init-hooks/50-have-layered-fs/theme.sh
@@ -0,0 +1 @@
+[ ${theme_nosplash} -eq 0 ] && /bin/splashy_update "progress 50" >/dev/null 2>&1
diff --git a/os-plugins/plugins/theme/init-hooks/60-have-servconfig/theme.sh b/os-plugins/plugins/theme/init-hooks/60-have-servconfig/theme.sh
new file mode 100644
index 00000000..91a0ed45
--- /dev/null
+++ b/os-plugins/plugins/theme/init-hooks/60-have-servconfig/theme.sh
@@ -0,0 +1 @@
+[ ${theme_nosplash} = 0 ] && /bin/splashy_update "progress 60" >/dev/null 2>&1
diff --git a/os-plugins/plugins/theme/init-hooks/70-before-plugins/theme.sh b/os-plugins/plugins/theme/init-hooks/70-before-plugins/theme.sh
new file mode 100644
index 00000000..170fba3e
--- /dev/null
+++ b/os-plugins/plugins/theme/init-hooks/70-before-plugins/theme.sh
@@ -0,0 +1 @@
+[ ${theme_nosplash} = 0 ] && /bin/splashy_update "progress 70" >/dev/null 2>&1
diff --git a/os-plugins/plugins/theme/init-hooks/80-after-plugins/theme.sh b/os-plugins/plugins/theme/init-hooks/80-after-plugins/theme.sh
new file mode 100644
index 00000000..5d62b21f
--- /dev/null
+++ b/os-plugins/plugins/theme/init-hooks/80-after-plugins/theme.sh
@@ -0,0 +1,19 @@
+if [ ${theme_nosplash} -eq 0 ]; then
+
+ /bin/splashy_update "progress 80" >/dev/null 2>&1
+
+ # make the splashy_update binary available in stage4 ...
+ mkdir -p /mnt/var/lib/openslx/bin
+ cp -a /bin/splashy_update /mnt/var/lib/openslx/bin
+
+ # ... and create a runlevelscript that will stop splashy somewhere near
+ # the end of stage4
+ d_mkrlscript init splashy.stop "Stopping Splashy ..."
+ echo -e "\t/var/lib/openslx/bin/splashy_update exit 2>/dev/null \
+ \n\ttype killall >/dev/null 2>&1 && killall -9 splashy \
+ \n\trm -f /var/lib/openslx/bin/splashy_update 2>/dev/null" \
+ >>/mnt/etc/${D_INITDIR}/splashy.stop
+ d_mkrlscript close splashy.stop ""
+ D_INITSCRIPTS="${D_INITSCRIPTS} splashy.stop"
+
+fi \ No newline at end of file
diff --git a/os-plugins/plugins/theme/init-hooks/99-handing-over/theme.sh b/os-plugins/plugins/theme/init-hooks/99-handing-over/theme.sh
new file mode 100644
index 00000000..4f01b512
--- /dev/null
+++ b/os-plugins/plugins/theme/init-hooks/99-handing-over/theme.sh
@@ -0,0 +1 @@
+[ ${theme_nosplash} -eq 0 ] && /bin/splashy_update "progress 100" >/dev/null 2>&1