*.rpm
plymouth
plymouth-populate-initrd
-plymouth-set-default-plugin
+plymouth-set-default-theme
plymouth-log-viewer
plymouthd
*.pc
-SUBDIRS = src images scripts
+SUBDIRS = src themes images scripts
DISTCHECK_CONFIGURE_FLAGS = --disable-tests --without-system-root-install
EXTRA_DIST = ChangeLog \
WARN_CFLAGS="$plymouth_cv_warn_cflags"
PLYMOUTH_CFLAGS="$PLYMOUTH_CFLAGS $WARN_CFLAGS"
+PLYMOUTH_THEME_PATH=$datadir/plymouth/themes
+AC_SUBST(PLYMOUTH_THEME_PATH)
+
AC_OUTPUT([Makefile
src/libply/Makefile
src/libplybootsplash/Makefile
src/tests/Makefile
src/libply/tests/Makefile
src/client/tests/Makefile
+ themes/Makefile
+ themes/spinfinity/Makefile
+ themes/fade-in/Makefile
+ themes/text/Makefile
+ themes/pulser/Makefile
+ themes/details/Makefile
+ themes/solar/Makefile
+ themes/glow/Makefile
images/Makefile
scripts/Makefile
])
initrdscript_SCRIPTS = plymouth-update-initrd plymouth-populate-initrd
sbinscriptsdir = $(sbindir)
-sbinscripts_SCRIPTS = plymouth-set-default-plugin
+sbinscripts_SCRIPTS = plymouth-set-default-theme
plymouth-populate-initrd: $(srcdir)/plymouth-populate-initrd.in
sed -e 's,[@]logofile[@],$(logofile),g' \
-e 's,[@]plymouthdaemondir[@],$(plymouthdaemondir),g' \
$(srcdir)/plymouth-populate-initrd.in > plymouth-populate-initrd
-plymouth-set-default-plugin: $(srcdir)/plymouth-set-default-plugin.in
+plymouth-set-default-theme: $(srcdir)/plymouth-set-default-theme.in
sed -e 's,[@]logofile[@],$(logofile),g' \
-e 's,[@]plymouthclientdir[@],$(plymouthclientdir),g' \
-e 's,[@]plymouthdaemondir[@],$(plymouthdaemondir),g' \
- $(srcdir)/plymouth-set-default-plugin.in > plymouth-set-default-plugin
+ $(srcdir)/plymouth-set-default-theme.in > plymouth-set-default-theme
EXTRA_DIST= plymouth-update-initrd \
plymouth-populate-initrd.in \
- plymouth-set-default-plugin.in \
+ plymouth-set-default-theme.in \
$(noinst_SCRIPTS) \
default.cfg
-CLEANFILES = plymouth-populate-initrd plymouth-set-default-plugin
-MAINTAINERCLEANFILES = Makefile.in plymouth-populate-initrd plymouth-set-default-plugin
+CLEANFILES = plymouth-populate-initrd plymouth-set-default-theme
+MAINTAINERCLEANFILES = Makefile.in plymouth-populate-initrd plymouth-set-default-theme
[ -z "$BINDIR" ] && BINDIR="/usr/bin"
[ -z "$GRUB_MENU_TITLE" ] && GRUB_MENU_TITLE="Graphical Bootup"
[ -z "$PLYMOUTH_LOGO_FILE" ] && PLYMOUTH_LOGO_FILE="@logofile@"
-[ -z "$PLYMOUTH_PLUGIN_NAME" ] && PLYMOUTH_PLUGIN_NAME=$(plymouth-set-default-plugin)
+[ -z "$PLYMOUTH_THEME_NAME" ] && PLYMOUTH_THEME_NAME=$(plymouth-set-default-theme)
if [ -f "${LIBEXECDIR}/initrd-functions" ]; then
. "${LIBEXECDIR}/initrd-functions"
[ -z "$INITRDDIR" ] && usage error
-inst @plymouthdaemondir@/plymouthd $INITRDDIR /bin/plymouthd
-inst @plymouthclientdir@/plymouth $INITRDDIR
+mkdir -p ${INITRDDIR}${DATADIR}/plymouth/themes
+inst /sbin/plymouthd $INITRDDIR /bin/plymouthd
+inst /bin/plymouth $INITRDDIR
+inst ${DATADIR}/plymouth/themes/text/text.plymouth $INITRDDIR
inst ${LIBDIR}/plymouth/text.so $INITRDDIR
+inst ${DATADIR}/plymouth/themes/details/details.plymouth $INITRDDIR
inst ${LIBDIR}/plymouth/details.so $INITRDDIR
inst ${PLYMOUTH_LOGO_FILE} $INITRDDIR
inst /etc/system-release $INITRDDIR
-mkdir -p ${INITRDDIR}${DATADIR}/plymouth
-if [ -z "$PLYMOUTH_PLUGIN_NAME" ]; then
+if [ -z "$PLYMOUTH_THEME_NAME" ]; then
echo "No default plymouth plugin is set" > /dev/stderr
exit 1
fi
-if [ ! -f ${LIBDIR}/plymouth/${PLYMOUTH_PLUGIN_NAME}.so ]; then
- echo "The default plymouth plugin (${PLYMOUTH_PLUGIN_NAME}) doesn't exist" > /dev/stderr
+PLYMOUTH_MODULE_NAME=$(grep "ModuleName *= *" ${DATADIR}/plymouth/themes/${PLYMOUTH_THEME_NAME}/${PLYMOUTH_THEME_NAME}.plymouth | sed 's/ModuleName *= *//')
+
+if [ ! -f ${LIBDIR}/plymouth/${PLYMOUTH_MODULE_NAME}.so ]; then
+ echo "The default plymouth plugin (${PLYMOUTH_MODULE_NAME}) doesn't exist" > /dev/stderr
exit 1
fi
-inst ${LIBDIR}/plymouth/${PLYMOUTH_PLUGIN_NAME}.so $INITRDDIR
-
-if [ -f ${LIBDIR}/plymouth/default.so ]; then
- inst ${LIBDIR}/plymouth/default.so $INITRDDIR
-fi
+inst ${LIBDIR}/plymouth/${PLYMOUTH_MODULE_NAME}.so $INITRDDIR
-if [ -d ${DATADIR}/plymouth/${PLYMOUTH_PLUGIN_NAME} ]; then
- for x in ${DATADIR}/plymouth/${PLYMOUTH_PLUGIN_NAME}/* ; do
+if [ -d ${DATADIR}/plymouth/themes/${PLYMOUTH_THEME_NAME} ]; then
+ for x in ${DATADIR}/plymouth/themes/${PLYMOUTH_THEME_NAME}/* ; do
[ ! -f "$x" ] && break
inst $x $INITRDDIR
done
fi
+if [ -L ${DATADIR}/plymouth/themes/default.plymouth ]; then
+ cp -a ${DATADIR}/plymouth/themes/default.plymouth $INITRDDIR${DATADIR}/plymouth/themes
+fi
+
# vim:ts=8:sw=4:sts=4:et
function usage ()
{
- echo "usage: plymouth-set-default-plugin { --list | --reset | <plugin-name> [ --rebuild-initrd ] }"
+ echo "usage: plymouth-set-default-theme { --list | --reset | <theme-name> [ --rebuild-initrd ] }"
}
-function list_plugins ()
+function list_themes ()
{
- for plugin in ${LIBDIR}/plymouth/*.so; do
- [ -f $plugin ] || continue;
- [ -L $plugin ] && continue;
-
- if $(nm -D $plugin | grep -q ply_boot_splash_plugin_get_interface); then
- echo "$(basename $plugin .so)"
- fi
+ for theme in ${DATADIR}/plymouth/themes/*/*.plymouth; do
+ [ -f $theme ] || continue;
+ echo "$(basename $theme .plymouth)"
done
}
-function get_default_plugin ()
+function get_default_theme ()
{
- PLUGIN_NAME=$(basename $(readlink ${LIBDIR}/plymouth/default.so) .so)
- if [ "$PLUGIN_NAME" = ".so" ]; then
+ THEME_NAME=$(basename $(readlink ${DATADIR}/plymouth/themes/default.plymouth) .plymouth)
+ if [ "$THEME_NAME" = ".plymouth" ]; then
$0 --reset
- PLUGIN_NAME=$(basename $(readlink ${LIBDIR}/plymouth/default.so) .so)
+ THEME_NAME=$(basename $(readlink ${DATADIR}/plymouth/themes/default.plymouth) .plymouth)
fi
- [ "$PLUGIN_NAME" = ".so" ] || echo $PLUGIN_NAME && exit 1
+ [ "$THEME_NAME" = ".so" ] || echo $THEME_NAME && exit 1
}
DO_RESET=0
DO_INITRD_REBUILD=0
DO_LIST=0
-PLUGIN_NAME=""
+THEME_NAME=""
while [ $# -gt 0 ]; do
case "$1" in
--list)
- if [ -n "$PLUGIN_NAME" ]; then
- echo "You can only specify --list or a plugin name, not both" > /dev/stderr
+ if [ -n "$THEME_NAME" ]; then
+ echo "You can only specify --list or a theme name, not both" > /dev/stderr
echo $(usage) > /dev/stderr
exit 1
fi
;;
--reset|default)
- if [ -n "$PLUGIN_NAME" ]; then
- echo "You can only specify --reset or a plugin name, not both" > /dev/stderr
+ if [ -n "$THEME_NAME" ]; then
+ echo "You can only specify --reset or a theme name, not both" > /dev/stderr
echo $(usage) > /dev/stderr
exit 1
fi
;;
*)
- if [ -n "$PLUGIN_NAME" ]; then
- echo "You can only specify one plugin at a time" > /dev/stderr
+ if [ -n "$THEME_NAME" ]; then
+ echo "You can only specify one theme at a time" > /dev/stderr
echo $(usage) > /dev/stderr
exit 1
fi
if [ $DO_RESET -ne 0 ]; then
- echo "You can only specify --reset or a plugin name, not both" > /dev/stderr
+ echo "You can only specify --reset or a theme name, not both" > /dev/stderr
echo $(usage) > /dev/stderr
exit 1
fi
if [ $DO_LIST -ne 0 ]; then
- echo "You can only specify --list or a plugin name, not both" > /dev/stderr
+ echo "You can only specify --list or a theme name, not both" > /dev/stderr
echo $(usage) > /dev/stderr
exit 1
fi
- PLUGIN_NAME="$1"
+ THEME_NAME="$1"
;;
esac
shift
done
if [ $DO_LIST -ne 0 ]; then
- list_plugins
+ list_themes
exit $?
fi
-if [ $DO_RESET -eq 0 ] && [ $DO_INITRD_REBUILD -eq 0 ] && [ -z $PLUGIN_NAME ]; then
- get_default_plugin
+if [ $DO_RESET -eq 0 ] && [ $DO_INITRD_REBUILD -eq 0 ] && [ -z $THEME_NAME ]; then
+ get_default_theme
exit $?
fi
fi
if [ $DO_RESET -ne 0 ]; then
- PLUGIN_NAME=$(basename $(ls -1 -t ${LIBDIR}/plymouth/*.so 2> /dev/null | grep -v default.so | grep -v label.so | tail -n 1) .so)
- if [ $PLUGIN_NAME = .so ]; then
- rm -f ${LIBDIR}/plymouth/default.so
+ THEME_NAME=$(basename $(ls -1 -t ${DATADIR}/plymouth/themes/*/*.plymouth 2> /dev/null | tail -n 1) .plymouth)
+ if [ $THEME_NAME = .plymouth ]; then
+ rm -f ${DATADIR}/plymouth/themes/default.plymouth
exit 0
fi
fi
-if [ ! -e ${LIBDIR}/plymouth/${PLUGIN_NAME}.so ]; then
- echo "${LIBDIR}/plymouth/${PLUGIN_NAME}.so does not exist" > /dev/stderr
+if [ ! -e ${DATADIR}/plymouth/themes/${THEME_NAME}/${THEME_NAME}.plymouth ]; then
+ echo "${DATADIR}/plymouth/themes/${THEME_NAME}/${THEME_NAME}.plymouth does not exist" > /dev/stderr
+ exit 1
+fi
+
+MODULE_NAME=$(grep "ModuleName *= *" ${DATADIR}/plymouth/themes/${THEME_NAME}/${THEME_NAME}.plymouth | sed 's/ModuleName *= *//')
+
+if [ ! -e ${LIBDIR}/plymouth/${MODULE_NAME}.so ]; then
+ echo "${LIBDIR}/plymouth/${MODULE_NAME}.so does not exist" > /dev/stderr
exit 1
fi
-(cd ${LIBDIR}/plymouth;
- ln -sf ${PLUGIN_NAME}.so default.so && \
+(cd ${DATADIR}/plymouth/themes;
+ ln -sf ${THEME_NAME}/${THEME_NAME}.plymouth default.plymouth && \
([ $DO_INITRD_REBUILD -ne 0 ] && \
$LIBEXECDIR/plymouth/plymouth-update-initrd) || :)
plymouthdbindir = $(plymouthdaemondir)
plymouthdbin_PROGRAMS = plymouthd
-plymouthd_CFLAGS = $(PLYMOUTH_CFLAGS) -DPLYMOUTH_PLUGIN_PATH=\"$(libdir)/plymouth/\"
+plymouthd_CFLAGS = $(PLYMOUTH_CFLAGS) \
+ -DPLYMOUTH_PLUGIN_PATH=\"$(libdir)/plymouth/\" \
+ -DPLYMOUTH_THEME_PATH=\"$(PLYMOUTH_THEME_PATH)/\"
plymouthd_LDADD = $(PLYMOUTH_LIBS) libply/libply.la libplybootsplash/libplybootsplash.la
plymouthd_SOURCES = \
ply-boot-protocol.h \
#include "ply-buffer.h"
#include "ply-event-loop.h"
#include "ply-trigger.h"
+#include "ply-key-file.h"
#include "ply-window.h"
typedef enum
typedef struct
{
- ply_boot_splash_plugin_t * (* create_plugin) (void);
+ ply_boot_splash_plugin_t * (* create_plugin) (ply_key_file_t *key_file);
void (* destroy_plugin) (ply_boot_splash_plugin_t *plugin);
void (* add_window) (ply_boot_splash_plugin_t *plugin,
} state_t;
static ply_boot_splash_t *start_boot_splash (state_t *state,
- const char *module_path);
+ const char *theme_path);
static ply_window_t *create_window (state_t *state,
const char *tty_name);
ply_trace ("Showing detailed splash screen");
state->boot_splash = start_boot_splash (state,
- PLYMOUTH_PLUGIN_PATH "details.so");
+ PLYMOUTH_THEME_PATH "details/details.plymouth");
if (state->boot_splash == NULL)
{
ply_trace ("Showing splash screen");
state->boot_splash = start_boot_splash (state,
- PLYMOUTH_PLUGIN_PATH "default.so");
+ PLYMOUTH_THEME_PATH "default.plymouth");
if (state->boot_splash == NULL)
{
ply_trace ("Could not start graphical splash screen,"
"showing text splash screen");
state->boot_splash = start_boot_splash (state,
- PLYMOUTH_PLUGIN_PATH "text.so");
+ PLYMOUTH_THEME_PATH "text/text.plymouth");
}
if (state->boot_splash == NULL)
static ply_boot_splash_t *
start_boot_splash (state_t *state,
- const char *module_path)
+ const char *theme_path)
{
ply_boot_splash_t *splash;
ply_boot_splash_mode_t splash_mode;
- ply_trace ("Loading boot splash plugin '%s'",
- module_path);
+ ply_trace ("Loading boot splash theme '%s'",
+ theme_path);
- splash = ply_boot_splash_new (module_path, state->boot_buffer);
+ splash = ply_boot_splash_new (theme_path, PLYMOUTH_PLUGIN_PATH, state->boot_buffer);
if (!ply_boot_splash_load (splash))
{
#include "ply-boot-splash-plugin.h"
#include "ply-buffer.h"
#include "ply-event-loop.h"
+#include "ply-key-file.h"
#include "ply-list.h"
#include "ply-logger.h"
#include "ply-frame-buffer.h"
};
ply_boot_splash_plugin_t *
-create_plugin (void)
+create_plugin (ply_key_file_t *key_file)
{
ply_boot_splash_plugin_t *plugin;
../../../libplybootsplash/libplybootsplash.la
fade_in_la_SOURCES = $(srcdir)/plugin.c
-plymouthdir = $(datadir)/plymouth/fade-in
-plymouth_DATA = star.png bullet.png entry.png lock.png
-
-EXTRA_DIST = $(plymouth_DATA)
MAINTAINERCLEANFILES = Makefile.in
#include "ply-logger.h"
#include "ply-frame-buffer.h"
#include "ply-image.h"
+#include "ply-key-file.h"
#include "ply-trigger.h"
#include "ply-utils.h"
#include "ply-window.h"
};
ply_boot_splash_plugin_t *
-create_plugin (void)
+create_plugin (ply_key_file_t *key_file)
{
ply_boot_splash_plugin_t *plugin;
+ char *image_dir, *image_path;
srand ((int) ply_get_timestamp ());
plugin = calloc (1, sizeof (ply_boot_splash_plugin_t));
plugin->start_time = 0.0;
plugin->logo_image = ply_image_new (PLYMOUTH_LOGO_FILE);
- plugin->star_image = ply_image_new (PLYMOUTH_IMAGE_DIR "fade-in/star.png");
- plugin->lock_image = ply_image_new (PLYMOUTH_IMAGE_DIR "fade-in/lock.png");
- plugin->entry = ply_entry_new (PLYMOUTH_IMAGE_DIR "fade-in");
+ image_dir = ply_key_file_get_value (key_file, "fade-in", "ImageDir");
+
+ asprintf (&image_path, "%s/star.png", image_dir);
+ plugin->star_image = ply_image_new (image_path);
+ free (image_path);
+
+ asprintf (&image_path, "%s/lock.png", image_dir);
+ plugin->lock_image = ply_image_new (image_path);
+ free (image_path);
+
+ plugin->entry = ply_entry_new (image_dir);
+ free (image_dir);
+
plugin->state = PLY_BOOT_SPLASH_DISPLAY_NORMAL;
plugin->stars = ply_list_new ();
../../../libplybootsplash/libplybootsplash.la
glow_la_SOURCES = $(srcdir)/plugin.c
-plymouthdir = $(datadir)/plymouth/glow
-plymouth_DATA = \
- images/box.png \
- images/bullet.png \
- images/entry.png \
- images/lock.png \
- images/progress-00.png \
- images/progress-01.png \
- images/progress-02.png \
- images/progress-03.png \
- images/progress-04.png \
- images/progress-05.png \
- images/progress-06.png \
- images/progress-07.png \
- images/progress-08.png \
- images/progress-09.png \
- images/progress-10.png \
- images/progress-11.png \
- images/progress-12.png \
- images/progress-13.png \
- images/progress-14.png \
- images/progress-15.png \
- images/progress-16.png \
- images/progress-17.png \
- images/progress-18.png \
- images/progress-19.png \
- images/progress-20.png \
- images/progress-21.png \
- images/progress-22.png \
- images/progress-23.png \
- images/progress-24.png \
- images/progress-25.png \
- images/progress-26.png \
- images/progress-27.png \
- images/progress-28.png \
- images/progress-29.png \
- images/progress-30.png \
- images/progress-31.png \
- images/progress-32.png \
- images/throbber-00.png \
- images/throbber-01.png \
- images/throbber-02.png \
- images/throbber-03.png \
- images/throbber-04.png \
- images/throbber-05.png \
- images/throbber-06.png \
- images/throbber-07.png \
- images/throbber-08.png \
- images/throbber-09.png \
- images/throbber-10.png \
- images/throbber-11.png \
- images/throbber-12.png \
- images/throbber-13.png \
- images/throbber-14.png \
- images/throbber-15.png \
- images/throbber-16.png \
- images/throbber-17.png \
- images/throbber-18.png \
- images/throbber-19.png
-
-EXTRA_DIST = $(plymouth_DATA)
MAINTAINERCLEANFILES = Makefile.in
#include "ply-logger.h"
#include "ply-frame-buffer.h"
#include "ply-image.h"
+#include "ply-key-file.h"
#include "ply-trigger.h"
#include "ply-utils.h"
#include "ply-window.h"
ply_label_t *label;
ply_boot_splash_display_type_t state;
+ double animation_horizontal_alignment;
+ double animation_vertical_alignment;
+ char *animation_dir;
+
ply_trigger_t *idle_trigger;
uint32_t root_is_mounted : 1;
static void detach_from_event_loop (ply_boot_splash_plugin_t *plugin);
ply_boot_splash_plugin_t *
-create_plugin (void)
+create_plugin (ply_key_file_t *key_file)
{
ply_boot_splash_plugin_t *plugin;
+ char *image_dir, *image_path;
+ char *alignment;
srand ((int) ply_get_timestamp ());
plugin = calloc (1, sizeof (ply_boot_splash_plugin_t));
- plugin->lock_image = ply_image_new (PLYMOUTH_IMAGE_DIR "glow/lock.png");
- plugin->box_image = ply_image_new (PLYMOUTH_IMAGE_DIR "glow/box.png");
+ image_dir = ply_key_file_get_value (key_file, "glow", "ImageDir");
- plugin->entry = ply_entry_new (PLYMOUTH_IMAGE_DIR "glow");
- plugin->animation = ply_animation_new (PLYMOUTH_IMAGE_DIR "glow",
- "throbber-");
- plugin->progress_animation = ply_progress_animation_new (PLYMOUTH_IMAGE_DIR "glow",
- "progress-");
+ asprintf (&image_path, "%s/lock.png", image_dir);
+ plugin->lock_image = ply_image_new (image_path);
+ free (image_path);
+
+ asprintf (&image_path, "%s/box.png", image_dir);
+ plugin->box_image = ply_image_new (image_path);
+ free (image_path);
+
+ plugin->entry = ply_entry_new (image_dir);
plugin->label = ply_label_new ();
+ plugin->animation_dir = image_dir;
+
+ alignment = ply_key_file_get_value (key_file, "glow", "HorizontalAlignment");
+ if (alignment != NULL)
+ plugin->animation_horizontal_alignment = strtod (alignment, NULL);
+ else
+ plugin->animation_horizontal_alignment = .5;
+ free (alignment);
+
+ alignment = ply_key_file_get_value (key_file, "glow", "VerticalAlignment");
+ if (alignment != NULL)
+ plugin->animation_vertical_alignment = strtod (alignment, NULL);
+ else
+ plugin->animation_vertical_alignment = .5;
+ free (alignment);
return plugin;
}
plugin->loop,
plugin->window,
trigger,
- area.width / 4.0 - width / 2.0,
- area.height / 2 - height / 2.0);
+ plugin->animation_horizontal_alignment * area.width - width / 2.0,
+ plugin->animation_vertical_alignment * area.height - height / 2.0);
}
static void
height = ply_progress_animation_get_height (plugin->progress_animation);
ply_progress_animation_show (plugin->progress_animation,
plugin->window,
- area.width / 4.0 - width / 2.0,
- area.height / 2 - height / 2.0);
+ plugin->animation_horizontal_alignment * area.width - width / 2.0,
+ plugin->animation_vertical_alignment * area.height - height / 2.0);
plugin->is_animating = true;
}
plugin->loop = loop;
plugin->mode = mode;
+ plugin->animation = ply_animation_new (plugin->animation_dir,
+ "throbber-");
+ plugin->progress_animation = ply_progress_animation_new (plugin->animation_dir,
+ "progress-");
+
ply_trace ("loading lock image");
if (!ply_image_load (plugin->lock_image))
return false;
ply_label_show (plugin->label, plugin->window, x, y);
}
-
}
void
#include "ply-boot-splash-plugin.h"
#include "ply-buffer.h"
#include "ply-event-loop.h"
+#include "ply-key-file.h"
#include "ply-list.h"
#include "ply-logger.h"
#include "ply-frame-buffer.h"
static void remove_handlers (ply_boot_splash_plugin_t *plugin);
ply_boot_splash_plugin_t *
-create_plugin (void)
+create_plugin (ply_key_file_t *key_file)
{
ply_boot_splash_plugin_t *plugin;
../../../libplybootsplash/libplybootsplash.la
solar_la_SOURCES = $(srcdir)/plugin.c
-plymouthdir = $(datadir)/plymouth/solar
-plymouth_DATA = bullet.png entry.png lock.png \
- star.png box.png \
- progress_bar.png
-# planet1.png planet2.png planet3.png planet4.png planet5.png
-
-EXTRA_DIST = $(plymouth_DATA)
MAINTAINERCLEANFILES = Makefile.in
#include "ply-buffer.h"
#include "ply-entry.h"
#include "ply-event-loop.h"
+#include "ply-key-file.h"
#include "ply-label.h"
#include "ply-list.h"
#include "ply-logger.h"
ply_boot_splash_plugin_t *
-create_plugin (void)
+create_plugin (ply_key_file_t *key_file)
{
ply_boot_splash_plugin_t *plugin;
+ char *image_dir, *image_path;
srand ((int) ply_get_timestamp ());
plugin = calloc (1, sizeof (ply_boot_splash_plugin_t));
plugin->logo_image = ply_image_new (PLYMOUTH_LOGO_FILE);
- plugin->lock_image = ply_image_new (PLYMOUTH_IMAGE_DIR "solar/lock.png");
- plugin->box_image = ply_image_new (PLYMOUTH_IMAGE_DIR "solar/box.png");
+
+ image_dir = ply_key_file_get_value (key_file, "solar", "ImageDir");
+
+ asprintf (&image_path, "%s/lock.png", image_dir);
+ plugin->lock_image = ply_image_new (image_path);
+ free (image_path);
+
+ asprintf (&image_path, "%s/box.png", image_dir);
+ plugin->box_image = ply_image_new (image_path);
+ free (image_path);
+
plugin->scaled_background_image = NULL;
- plugin->star_image = ply_image_new (PLYMOUTH_IMAGE_DIR "solar/star.png");
+
+ asprintf (&image_path, "%s/star.png", image_dir);
+ plugin->star_image = ply_image_new (image_path);
+ free (image_path);
+
#ifdef SHOW_PLANETS
- plugin->planet_image[0] = ply_image_new (PLYMOUTH_IMAGE_DIR "solar/planet1.png");
- plugin->planet_image[1] = ply_image_new (PLYMOUTH_IMAGE_DIR "solar/planet2.png");
- plugin->planet_image[2] = ply_image_new (PLYMOUTH_IMAGE_DIR "solar/planet3.png");
- plugin->planet_image[3] = ply_image_new (PLYMOUTH_IMAGE_DIR "solar/planet4.png");
- plugin->planet_image[4] = ply_image_new (PLYMOUTH_IMAGE_DIR "solar/planet5.png");
+
+ asprintf (&image_path, "%s/plant1.png", image_dir);
+ plugin->planet_image[0] = ply_image_new (image_path);
+ free (image_path);
+
+ asprintf (&image_path, "%s/plant2.png", image_dir);
+ plugin->planet_image[1] = ply_image_new (image_path);
+ free (image_path);
+
+ asprintf (&image_path, "%s/plant3.png", image_dir);
+ plugin->planet_image[2] = ply_image_new (image_path);
+ free (image_path);
+
+ asprintf (&image_path, "%s/plant4.png", image_dir);
+ plugin->planet_image[3] = ply_image_new (image_path);
+ free (image_path);
+
+ asprintf (&image_path, "%s/plant5.png", image_dir);
+ plugin->planet_image[4] = ply_image_new (image_path);
+ free (image_path);
+
#endif
#ifdef SHOW_PROGRESS_BAR
- plugin->progress_barimage = ply_image_new (PLYMOUTH_IMAGE_DIR "solar/progress_bar.png");
+
+ asprintf (&image_path, "%s/progress_bar.png", image_dir);
+ plugin->progress_barimage = ply_image_new (image_path);
+ free (image_path);
#endif
- plugin->entry = ply_entry_new (PLYMOUTH_IMAGE_DIR "solar");
+ plugin->entry = ply_entry_new (image_dir);
plugin->label = ply_label_new ();
plugin->state = PLY_BOOT_SPLASH_DISPLAY_NORMAL;
plugin->sprites = ply_list_new();
../../../libplybootsplash/libplybootsplash.la
spinfinity_la_SOURCES = $(srcdir)/plugin.c
-throbber_frames = \
- throbber-00.png \
- throbber-01.png \
- throbber-02.png \
- throbber-03.png \
- throbber-04.png \
- throbber-05.png \
- throbber-06.png \
- throbber-07.png \
- throbber-08.png \
- throbber-09.png \
- throbber-10.png \
- throbber-11.png \
- throbber-12.png \
- throbber-13.png \
- throbber-14.png \
- throbber-15.png \
- throbber-16.png \
- throbber-17.png \
- throbber-18.png \
- throbber-19.png \
- throbber-20.png \
- throbber-21.png \
- throbber-22.png \
- throbber-23.png \
- throbber-24.png \
- throbber-25.png \
- throbber-26.png \
- throbber-27.png \
- throbber-28.png \
- throbber-29.png \
- throbber-30.png \
- throbber-31.png \
- throbber-32.png \
- throbber-33.png
-
-plymouthdir = $(datadir)/plymouth/spinfinity
-plymouth_DATA = bullet.png entry.png lock.png box.png $(throbber_frames)
-
-EXTRA_DIST = $(plymouth_DATA)
MAINTAINERCLEANFILES = Makefile.in
#include "ply-buffer.h"
#include "ply-entry.h"
#include "ply-event-loop.h"
+#include "ply-key-file.h"
#include "ply-label.h"
#include "ply-list.h"
#include "ply-progress-bar.h"
static void detach_from_event_loop (ply_boot_splash_plugin_t *plugin);
ply_boot_splash_plugin_t *
-create_plugin (void)
+create_plugin (ply_key_file_t *key_file)
{
ply_boot_splash_plugin_t *plugin;
+ char *image_dir, *image_path;
srand ((int) ply_get_timestamp ());
plugin = calloc (1, sizeof (ply_boot_splash_plugin_t));
plugin->logo_image = ply_image_new (PLYMOUTH_LOGO_FILE);
- plugin->lock_image = ply_image_new (PLYMOUTH_IMAGE_DIR "spinfinity/lock.png");
- plugin->box_image = ply_image_new (PLYMOUTH_IMAGE_DIR "spinfinity/box.png");
+ image_dir = ply_key_file_get_value (key_file, "spinfinity", "ImageDir");
- plugin->entry = ply_entry_new (PLYMOUTH_IMAGE_DIR "spinfinity");
- plugin->throbber = ply_throbber_new (PLYMOUTH_IMAGE_DIR "spinfinity",
- "throbber-");
+ asprintf (&image_path, "%s/lock.png", image_dir);
+ plugin->lock_image = ply_image_new (image_path);
+ free (image_path);
+
+ asprintf (&image_path, "%s/box.png", image_dir);
+ plugin->box_image = ply_image_new (image_path);
+ free (image_path);
+
+ plugin->entry = ply_entry_new (image_dir);
+ plugin->throbber = ply_throbber_new (image_dir, "throbber-");
plugin->label = ply_label_new ();
plugin->progress_bar = ply_progress_bar_new ();
#include "ply-boot-splash-plugin.h"
#include "ply-buffer.h"
#include "ply-event-loop.h"
+#include "ply-key-file.h"
#include "ply-list.h"
#include "ply-logger.h"
#include "ply-frame-buffer.h"
static void remove_handlers (ply_boot_splash_plugin_t *plugin);
ply_boot_splash_plugin_t *
-create_plugin (void)
+create_plugin (ply_key_file_t *key_file)
{
ply_boot_splash_plugin_t *plugin;
#include "ply-trigger.h"
#include "ply-utils.h"
#include "ply-progress.h"
+#include "ply-key-file.h"
#ifndef UPDATES_PER_SECOND
#define UPDATES_PER_SECOND 30
ply_buffer_t *boot_buffer;
ply_trigger_t *idle_trigger;
- char *module_name;
+ char *theme_path;
+ char *plugin_dir;
char *status;
ply_progress_t *progress;
(* get_plugin_interface_function_t) (void);
ply_boot_splash_t *
-ply_boot_splash_new (const char *module_name,
+ply_boot_splash_new (const char *theme_path,
+ const char *plugin_dir,
ply_buffer_t *boot_buffer)
{
ply_boot_splash_t *splash;
- assert (module_name != NULL);
+ assert (theme_path != NULL);
splash = calloc (1, sizeof (ply_boot_splash_t));
splash->loop = NULL;
- splash->module_name = strdup (module_name);
+ splash->theme_path = strdup (theme_path);
+ splash->plugin_dir = strdup (plugin_dir);
splash->module_handle = NULL;
splash->is_shown = false;
bool
ply_boot_splash_load (ply_boot_splash_t *splash)
{
+ ply_key_file_t *key_file;
+ char *module_name;
+ char *module_path;
+
assert (splash != NULL);
- assert (splash->module_name != NULL);
get_plugin_interface_function_t get_boot_splash_plugin_interface;
- splash->module_handle = ply_open_module (splash->module_name);
+ key_file = ply_key_file_new (splash->theme_path);
- if (splash->module_handle == NULL)
+ if (!ply_key_file_load (key_file))
return false;
+ module_name = ply_key_file_get_value (key_file, "Plymouth Theme", "ModuleName");
+
+ asprintf (&module_path, "%s%s.so",
+ splash->plugin_dir, module_name);
+ free (module_name);
+
+ splash->module_handle = ply_open_module (module_path);
+
+ free (module_path);
+
+ if (splash->module_handle == NULL)
+ {
+ ply_key_file_free (key_file);
+ return false;
+ }
+
get_boot_splash_plugin_interface = (get_plugin_interface_function_t)
ply_module_look_up_function (splash->module_handle,
"ply_boot_splash_plugin_get_interface");
ply_save_errno ();
ply_close_module (splash->module_handle);
splash->module_handle = NULL;
+ ply_key_file_free (key_file);
ply_restore_errno ();
return false;
}
ply_save_errno ();
ply_close_module (splash->module_handle);
splash->module_handle = NULL;
+ ply_key_file_free (key_file);
ply_restore_errno ();
return false;
}
- splash->plugin = splash->plugin_interface->create_plugin ();
+ splash->plugin = splash->plugin_interface->create_plugin (key_file);
+
+ ply_key_file_free (key_file);
assert (splash->plugin != NULL);
if (splash->module_handle != NULL)
ply_boot_splash_unload (splash);
- free (splash->module_name);
+ free (splash->theme_path);
+ free (splash->plugin_dir);
free (splash);
}
ply_boot_splash_mode_t mode)
{
assert (splash != NULL);
- assert (splash->module_name != NULL);
+ assert (splash->module_handle != NULL);
assert (splash->loop != NULL);
if (splash->is_shown)
int exit_code;
test_state_t state;
char *tty_name;
- const char *module_name;
+ const char *theme_path;
exit_code = 0;
state.loop = ply_event_loop_new ();
if (argc > 1)
- module_name = argv[1];
+ theme_path = argv[1];
else
- module_name = "../splash-plugins/fade-in/.libs/fade-in.so";
+ theme_path = PLYMOUTH_THEME_PATH "/fade-in/fade-in.plymouth";
tty_name = strdup("tty");
if (argc > 2) {
(ply_window_escape_handler_t) on_quit, &state);
state.buffer = ply_buffer_new ();
- state.splash = ply_boot_splash_new (module_name, state.buffer);
+ state.splash = ply_boot_splash_new (theme_path, PLYMOUTH_PLUGIN_PATH, state.buffer);
if (!ply_boot_splash_load (state.splash))
{
perror ("could not load splash screen");
typedef void (* ply_boot_splash_on_idle_handler_t) (void *user_data);
#ifndef PLY_HIDE_FUNCTION_DECLARATIONS
-ply_boot_splash_t *ply_boot_splash_new (const char *module_name,
+ply_boot_splash_t *ply_boot_splash_new (const char *theme_path,
+ const char *plugin_dir,
ply_buffer_t *boot_buffer);
bool ply_boot_splash_load (ply_boot_splash_t *splash);
void ply_boot_splash_unload (ply_boot_splash_t *splash);
libdir=@libdir@
includedir=@includedir@
pluginsdir=@libdir@/plymouth-1
+themesdir=@PLYMOUTH_PLUGIN_PATH@
Name: Plymouth
Description: Utility Library for Boot Splash Plugins
--- /dev/null
+SUBDIRS = spinfinity fade-in text details solar pulser glow
+MAINTAINERCLEANFILES = Makefile.in
--- /dev/null
+themedir = $(datadir)/plymouth/themes/details
+dist_theme_DATA = details.plymouth
+
+MAINTAINERCLEANFILES = Makefile.in
--- /dev/null
+[Plymouth Theme]
+Name=Details
+Description=Verbose fallback theme
+ModuleName=details
--- /dev/null
+themedir = $(datadir)/plymouth/themes/fade-in
+dist_theme_DATA = fade-in.plymouth star.png bullet.png entry.png lock.png
+
+MAINTAINERCLEANFILES = Makefile.in fade-in.plymouth
+CLEANFILES = fade-in.plymouth
+
+fade-in.plymouth: $(srcdir)/fade-in.plymouth.in
+ sed -e 's,[@]PLYMOUTH_THEME_PATH[@],$(PLYMOUTH_THEME_PATH),g' \
+ $(srcdir)/fade-in.plymouth.in > fade-in.plymouth
--- /dev/null
+[Plymouth Theme]
+Name=Fade In
+Description=Simple theme that fades in and out with shimmering stars
+ModuleName=fade-in
+
+[fade-in]
+ImageDir=@PLYMOUTH_THEME_PATH@/fade-in
--- /dev/null
+themedir = $(datadir)/plymouth/themes/glow
+dist_theme_DATA = \
+ glow.plymouth \
+ box.png \
+ bullet.png \
+ entry.png \
+ lock.png \
+ progress-00.png \
+ progress-01.png \
+ progress-02.png \
+ progress-03.png \
+ progress-04.png \
+ progress-05.png \
+ progress-06.png \
+ progress-07.png \
+ progress-08.png \
+ progress-09.png \
+ progress-10.png \
+ progress-11.png \
+ progress-12.png \
+ progress-13.png \
+ progress-14.png \
+ progress-15.png \
+ progress-16.png \
+ progress-17.png \
+ progress-18.png \
+ progress-19.png \
+ progress-20.png \
+ progress-21.png \
+ progress-22.png \
+ progress-23.png \
+ progress-24.png \
+ progress-25.png \
+ progress-26.png \
+ progress-27.png \
+ progress-28.png \
+ progress-29.png \
+ progress-30.png \
+ progress-31.png \
+ progress-32.png \
+ throbber-00.png \
+ throbber-01.png \
+ throbber-02.png \
+ throbber-03.png \
+ throbber-04.png \
+ throbber-05.png \
+ throbber-06.png \
+ throbber-07.png \
+ throbber-08.png \
+ throbber-09.png \
+ throbber-10.png \
+ throbber-11.png \
+ throbber-12.png \
+ throbber-13.png \
+ throbber-14.png \
+ throbber-15.png \
+ throbber-16.png \
+ throbber-17.png \
+ throbber-18.png \
+ throbber-19.png
+
+MAINTAINERCLEANFILES = Makefile.in glow.plymouth
+CLEANFILES = glow.plymouth
+
+glow.plymouth: $(srcdir)/glow.plymouth.in
+ sed -e 's,[@]PLYMOUTH_THEME_PATH[@],$(PLYMOUTH_THEME_PATH),g' \
+ $(srcdir)/glow.plymouth.in > glow.plymouth
+
--- /dev/null
+[Plymouth Theme]
+Name=Bizcom Glow
+Description=Corporate theme with pie chart boot progress followed by a glowing emerging logo
+ModuleName=glow
+
+[glow]
+ImageDir=@PLYMOUTH_THEME_PATH@/glow
+HorizontalAlignment=.25
+VerticalAlignment=.5
--- /dev/null
+themedir = $(datadir)/plymouth/themes/pulser
+dist_theme_DATA = pulser.plymouth
+
+MAINTAINERCLEANFILES = Makefile.in
--- /dev/null
+[Plymouth Theme]
+Name=Pulser
+Description=Ugly text mode plugin with cylon like pulsing progress bar
+ModuleName=pulser
--- /dev/null
+themedir = $(datadir)/plymouth/themes/solar
+dist_theme_DATA = \
+ solar.plymouth \
+ box.png \
+ bullet.png \
+ entry.png \
+ lock.png \
+ progress_bar.png \
+ star.png
+
+
+
+MAINTAINERCLEANFILES = Makefile.in solar.plymouth
+CLEANFILES = solar.plymouth
+
+solar.plymouth: $(srcdir)/solar.plymouth.in
+ sed -e 's,[@]PLYMOUTH_THEME_PATH[@],$(PLYMOUTH_THEME_PATH),g' \
+ $(srcdir)/solar.plymouth.in > solar.plymouth
+
+
--- /dev/null
+[Plymouth Theme]
+Name=Solar
+Description=Space theme with violent flaring blue star
+ModuleName=solar
+
+[solar]
+ImageDir=@PLYMOUTH_THEME_PATH@/solar
--- /dev/null
+themedir = $(datadir)/plymouth/themes/spinfinity
+dist_theme_DATA = \
+ spinfinity.plymouth \
+ box.png \
+ bullet.png \
+ entry.png \
+ lock.png \
+ throbber-00.png \
+ throbber-01.png \
+ throbber-02.png \
+ throbber-03.png \
+ throbber-04.png \
+ throbber-05.png \
+ throbber-06.png \
+ throbber-07.png \
+ throbber-08.png \
+ throbber-09.png \
+ throbber-10.png \
+ throbber-11.png \
+ throbber-12.png \
+ throbber-13.png \
+ throbber-14.png \
+ throbber-15.png \
+ throbber-16.png \
+ throbber-17.png \
+ throbber-18.png \
+ throbber-19.png \
+ throbber-20.png \
+ throbber-21.png \
+ throbber-22.png \
+ throbber-23.png \
+ throbber-24.png \
+ throbber-25.png \
+ throbber-26.png \
+ throbber-27.png \
+ throbber-28.png \
+ throbber-29.png \
+ throbber-30.png \
+ throbber-31.png \
+ throbber-32.png \
+ throbber-33.png
+
+MAINTAINERCLEANFILES = Makefile.in spinfinity.plymouth
+CLEANFILES = spinfinity.plymouth
+
+spinfinity.plymouth: $(srcdir)/spinfinity.plymouth.in
+ sed -e 's,[@]PLYMOUTH_THEME_PATH[@],$(PLYMOUTH_THEME_PATH),g' \
+ $(srcdir)/spinfinity.plymouth.in > spinfinity.plymouth
+
+
--- /dev/null
+[Plymouth Theme]
+Name=Spinfinity
+Description=Simple theme that shows a rotating infinity sign in the center of the screen
+ModuleName=spinfinity
+
+[spinfinity]
+ImageDir=@PLYMOUTH_THEME_PATH@/spinfinity
--- /dev/null
+themedir = $(datadir)/plymouth/themes/text
+dist_theme_DATA = text.plymouth
+
+MAINTAINERCLEANFILES = Makefile.in
--- /dev/null
+[Plymouth Theme]
+Name=Text
+Description=Text mode theme with tricolor progress bar
+ModuleName=text