diff --git a/custom/qa-test-day-welcome.js b/custom/qa-test-day-welcome.js new file mode 100644 index 0000000..2f73781 --- /dev/null +++ b/custom/qa-test-day-welcome.js @@ -0,0 +1,123 @@ +/* Fedora Test Day welcome screen. + * + * Based on Fedora LiveCD welcome screen from Cosimo Cecchi: + * http://git.fedorahosted.org/cgit/anaconda.git/tree/data/liveinst/gnome?h=f18-branch + */ + +const Gdk = imports.gi.Gdk; +const GdkPixbuf = imports.gi.GdkPixbuf; +const Gio = imports.gi.Gio; +const GLib = imports.gi.GLib; +const Gtk = imports.gi.Gtk; +const Lang = imports.lang; +const Pango = imports.gi.Pango; + +const Gettext = imports.gettext; +const _ = imports.gettext.gettext; + +const LOCALE_DIR = '/usr/share/locale'; + +let anacondaApp = null; + +function makeLabel(label, button) { + let widget = new Gtk.Label(); + + if (button) + widget.set_markup( + '' + label + ''); + else { + widget.set_line_wrap(true); + widget.set_justify(Gtk.Justification.CENTER); + widget.set_margin_top(32); + widget.set_margin_bottom(32); + + widget.set_markup( + '' + label + ''); + } + + return widget; +} + +const WelcomeWindow = new Lang.Class({ + Name: 'WelcomeWindow', + + _init: function(application) { + this.window = new Gtk.ApplicationWindow({ + application: application, + type: Gtk.WindowType.TOPLEVEL, + default_width: 600, + default_height: 550, + title: _("Welcome to Fedora Test Day"), + window_position: Gtk.WindowPosition.CENTER }); + this.window.connect('key-press-event', Lang.bind(this, + function(w, event) { + let key = event.get_keyval()[1]; + + if (key == Gdk.KEY_Escape) + this.window.destroy(); + + return false; + })); + + let mainGrid = new Gtk.Grid({ + orientation: Gtk.Orientation.VERTICAL, + row_spacing: 16, + vexpand: true, + hexpand: true, + halign: Gtk.Align.CENTER, + valign: Gtk.Align.CENTER }); + this.window.add(mainGrid); + + let buttonBox = new Gtk.Grid({ + orientation: Gtk.Orientation.HORIZONTAL, + column_spacing: 16, + halign: Gtk.Align.CENTER }); + mainGrid.add(buttonBox); + + let tryContent = new Gtk.Box({ + orientation: Gtk.Orientation.VERTICAL, spacing: 16 }); + let firefoxpix = GdkPixbuf.Pixbuf.new_from_file_at_size( + '/usr/share/icons/Fedora/256x256/places/start-here.png',256, 256); + tryContent.add(new Gtk.Image({ pixbuf: firefoxpix })); + tryContent.add(makeLabel(_("Participate in the Test Day"), true)); + let tryButton = new Gtk.Button({ child: tryContent }); + buttonBox.add(tryButton); + + this._label = makeLabel(_( + "Click the button to open a browser with the current Test Day " + + "wiki page containing instructions and an IRC chat to discuss " + + "any issues and questions you might have." + ), false); + mainGrid.add(this._label); + + tryButton.connect('clicked', Lang.bind(this, + function() { + GLib.spawn_command_line_async('firefox'); + this.window.destroy(); + })); + } +}); + +Gettext.bindtextdomain('anaconda', LOCALE_DIR); +Gettext.textdomain('anaconda'); + +GLib.set_prgname('test-day-welcome'); +Gtk.init(null, null); +Gtk.Settings.get_default().gtk_application_prefer_dark_theme = true; + +let application = new Gtk.Application({ + application_id: 'org.fedoraproject.welcome-screen', + flags: Gio.ApplicationFlags.FLAGS_NONE }); +let welcomeWindow = null; + +application.connect('startup', Lang.bind(this, + function() { + welcomeWindow = new WelcomeWindow(application); + })); +application.connect('activate', Lang.bind(this, + function() { + welcomeWindow.window.show_all(); + })); + +application.run(ARGV); + diff --git a/custom/qa-test-day.ks b/custom/qa-test-day.ks index 0239edc..455ea35 100644 --- a/custom/qa-test-day.ks +++ b/custom/qa-test-day.ks @@ -1,117 +1,173 @@ +### Fedora Test Day LiveCD ### +# Read more at: https://fedoraproject.org/wiki/QA/Test_Days/Live_Image +# Contact QA team if you have any improvements for this kickstart: +# https://fedoraproject.org/wiki/QA + %include ../fedora-livecd-desktop.ks + +## System configuration +# Warn about SELinux issues, but don't block +selinux --permissive + + +## Repositories +# If you want, you can enable updates-testing +#repo --name=updates-testing --mirrorlist=http://mirrors.fedoraproject.org/mirrorlist?repo=updates-testing-f$releasever&arch=$basearch +# You can also define your own repository here with custom/bleeding-edge packages +#repo --name=test-day --baseurl=http://server/path + + +## Packages %packages +# Remove Anaconda, this image is not intended for installation (we modify the +# image a lot, removing lots of software and changing some system defaults). +# TCs/RCs are intended for installation instead. Of course you can put the +# installer back for a specific Test Day, if needed, but make sure to communicate +# well to people that it is intended for testing purposes, not for real usage. +-@anaconda-tools +-anaconda + +# Strip as many packages as possible, so that our testers don't need to download +# large ISOs. Only leave those packages that are generally useful for Test Days. +# Test Day organizers can adjust the kickstart and add specific packages they +# need for a particular Test Day. +-@libreoffice +-@printing +-aisleriot +-authconfig +-brasero* +-cheese +-colord +-colord-gtk +-deja-dup +-evolution +-evolution-ews +-fedora-release-notes +-firewall-config +-firstboot +-gnome-backgrounds +-gnome-boxes +-gnome-color-manager +-gnome-clocks +-gnome-contacts +-gnome-dictionary +-gnome-documents +-gnome-font-viewer +-gnome-getting-started-docs +-gnome-icon-theme-extras +-gnome-initial-setup +-gnome-photos +-gucharmap +-initial-setup +-libsane-hpaio +-nautilus-sendto +-orca +-realmd +-rhythmbox +-sane-backends* +-sendmail +-shotwell +-simple-scan +-system-config-* +-tmpwatch +-transmission-gtk +-vinagre +-yum-langpacks + +# Add some smaller alternatives for the stripped packages +abiword + +# Add packages useful for testing and debugging problems gdb strace ltrace -libdrm -pidgin +gtk-recordmydesktop +gconf-editor +dconf-editor +nautilus-open-terminal +iotop +htop + +# Add favorite power-user tools mc vim nano wget -xorg-x11-apps -gtk-recordmydesktop -gconf-editor -gimp -nautilus-open-terminal -abiword -# save some space --empathy --gnome-games --brasero* --sound-juicer --gthumb --gnome-backgrounds --desktop-backgrounds* --evolution --shotwell --planner --openoffice* --java* -# brand as fedora test spin -fedora-logos --generic-logos -# glib2 is needed to set up favorites -glib2 -# zip and unzip are needed to tweak firefox settings -zip -unzip + +# Add dependencies for the welcome screen +# (this makes it run also on non-GNOME systems) +gjs +firefox + %end + +## LiveCD environment adjustments %post +# The following changes are executed only during LiveCD boot and wouldn't affect +# the installed system. This image is not intended for installation, but you +# never know what your users might do. + cat >> /etc/rc.d/init.d/livesys << EOF -# Note the following needs to be done twice, once for the live environment -# to override what live-desktop does (so it executes after it) and a second -# time to make a persistant config, so that tests after install still -# have the settings to faciliate testing. +# Create Test Day welcome screen +# Note that shebang must be written this way, else it is considered as comment +echo "#!/usr/bin/env gjs-console" > /tmp/test-day-welcome +cat >> /tmp/test-day-welcome << FOE +%include qa-test-day-welcome.js +FOE +chmod +x /tmp/test-day-welcome -# Change the favorites using a vendor override. (Adding a profile would +cat > /usr/share/applications/test-day-welcome.desktop << FOE +[Desktop Entry] +Name=Welcome to Fedora Test Day +Exec=/tmp/test-day-welcome +Icon=/usr/share/icons/Fedora/256x256/places/start-here.png +Type=Application +StartupNotify=true +NoDisplay=true +X-GNOME-Autostart-enabled=true +FOE +ln -s /usr/share/applications/test-day-welcome.desktop /etc/xdg/autostart/ +# Remove anaconda welcome screen (if it exists), it would display instead of ours +rm -f /home/liveuser/.config/autostart/fedora-welcome.desktop + +# Change Firefox start page to open Test Day wiki and IRC chat +mkdir -p /tmp/chrome/en-US/locale/branding +cat << FOE > /tmp/chrome/en-US/locale/branding/browserconfig.properties +browser.startup.homepage=https://fedoraproject.org/wiki/Test_Day:Current | http://webchat.freenode.net/?channels=fedora-test-day +FOE + +# Set up a few more properties +unzip /usr/lib*/firefox/omni.ja defaults/preferences/firefox-branding.js -d /tmp +cat << FOE >> /tmp/defaults/preferences/firefox-branding.js +pref("startup.homepage_welcome_url",""); +pref("startup.homepage_override_url",""); +pref("browser.rights.3.shown", true); +FOE + +(cd /tmp; zip /usr/lib*/firefox/omni.ja chrome/en-US/locale/branding/browserconfig.properties \ + defaults/preferences/firefox-branding.js) +rm -rf /tmp/chrome /tmp/defaults + +# Adjust launchers in dash using a vendor override. (Adding a profile would # be another way to do this.) cat << FOE >> /usr/share/glib-2.0/schemas/org.gnome.shell.gschema.override [org.gnome.shell] -favorite-apps=['testday-wiki.desktop', 'testday-irc.desktop', 'liveinst.desktop', 'nautilus.desktop', 'gnome-terminal.desktop'] +favorite-apps=['test-day-welcome.desktop', 'firefox.desktop', 'nautilus.desktop', 'gnome-terminal.desktop'] FOE + +# Disable screen blanking, there's no benefit on a Test Day image and it's irritating +cat << FOE >> /usr/share/glib-2.0/schemas/org.gnome.desktop.session.gschema.override +[org.gnome.desktop.session] +idle-delay=0 +FOE + +# Rebuild schema cache with any overrides we installed glib-compile-schemas /usr/share/glib-2.0/schemas/ EOF -# Note the following config setups persist after install. I think this is -# good for qa-testday purposes, but is bad for most other purposes. - -# Turn off alternate pages on first firefox use or after updates -unzip /usr/lib/firefox-*/omni.jar defaults/preferences/firefox-branding.js -d /tmp -cat << EOF >> /tmp/defaults/preferences/firefox-branding.js -pref("startup.homepage_welcome_url",""); -pref("startup.homepage_override_url",""); -EOF - -# Set Test_Day:Current as default browser homepage -mkdir -p /tmp/chrome/en-US/locale/branding -cat << EOF > /tmp/chrome/en-US/locale/branding/browserconfig.properties -browser.startup.homepage=https://fedoraproject.org/wiki/Test_Day:Current -EOF - -(cd /tmp; zip /usr/lib/firefox-*/omni.jar chrome/en-US/locale/branding/browserconfig.properties defaults/preferences/firefox-branding.js) -rm -rf /tmp/chrome /tmp/defaults - -# Create a directory to store global custom favorites -mkdir -p /etc/skel/.local/share/applications - -# Create a favorite for the current test day wiki page -cat << EOF > /etc/skel/.local/share/applications/testday-wiki.desktop -[Desktop Entry] -Name=Participate in a Test Day -Type=Application -Exec=firefox "https://fedoraproject.org/wiki/Test_Day:Current" -Icon=firefox -EOF - -# Create a favorite for Test Day IRC chat -cat << EOF > /etc/skel/.local/share/applications/testday-irc.desktop -[Desktop Entry] -Name=Connect to a Test Day chat -Type=Application -Exec=firefox "http://webchat.freenode.net/?channels=fedora-test-day" -Icon=firefox -EOF - -# Create a favorite for liveinst -cat << EOF > /etc/skel/.local/share/applications/liveinst.desktop -[Desktop Entry] -Name=Install to hard drive -Type=Application -Exec=liveinst -Icon=anaconda -EOF - -# Change the favorites using a vendor override. (Adding a profile would -# be another way to do this.) -cat << EOF >> /usr/share/glib-2.0/schemas/org.gnome.shell.gschema.override -[org.gnome.shell] -favorite-apps=['testday-wiki.desktop', 'testday-irc.desktop', 'liveinst.desktop', 'nautilus.desktop', 'gnome-terminal.desktop'] -EOF -glib-compile-schemas /usr/share/glib-2.0/schemas/ %end