From 5f1c35e04524237dbeba9eaf982e472604507485 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Philip=20M=C3=BCller?= Date: Fri, 26 Aug 2022 10:27:35 +0200 Subject: [PATCH] [util-iso] enable new branding --- lib/util-iso-image.sh | 241 +++++++++++++++++++++++++++++++++++++++++- lib/util-iso.sh | 5 +- 2 files changed, 244 insertions(+), 2 deletions(-) diff --git a/lib/util-iso-image.sh b/lib/util-iso-image.sh index 124fab4..3a86c9a 100644 --- a/lib/util-iso-image.sh +++ b/lib/util-iso-image.sh @@ -107,7 +107,7 @@ configure_lsb(){ fi } -configure_branding(){ +configure_branding_old(){ msg2 "Configuring branding" echo "--- componentName: manjaro @@ -215,6 +215,245 @@ style: sidebarTextHighlight: "\"${sidebartexthighlight}"\"" > $1/usr/share/calamares/branding/manjaro/branding.desc } +configure_branding(){ + msg2 "Configuring branding" + echo "# SPDX-FileCopyrightText: no +# SPDX-License-Identifier: CC0-1.0 +# +# Product branding information. This influences some global +# user-visible aspects of Calamares, such as the product +# name, window behavior, and the slideshow during installation. +# +# Additional styling can be done using the stylesheet.qss +# file, also in the branding directory. +--- +componentName: manjaro + + +### WELCOME / OVERALL WORDING +# +# These settings affect some overall phrasing and looks, +# which are most visible in the welcome page. + +# This selects between different welcome texts. When false, uses +# the traditional "Welcome to the %1 installer.", and when true, +# uses "Welcome to the Calamares installer for %1." This allows +# to distinguish this installer from other installers for the +# same distribution. +welcomeStyleCalamares: ${welcomestyle} + +# Should the welcome image (productWelcome, below) be scaled +# up beyond its natural size? If false, the image does not grow +# with the window but remains the same size throughout (this +# may have surprising effects on HiDPI monitors). +welcomeExpandingLogo: ${welcomelogo} + +### WINDOW CONFIGURATION +# +# The settings here affect the placement of the Calamares +# window through hints to the window manager and initial +# sizing of the Calamares window. + +# Size and expansion policy for Calamares. +# - "normal" or unset, expand as needed, use *windowSize* +# - "fullscreen", start as large as possible, ignore *windowSize* +# - "noexpand", don't expand automatically, use *windowSize* +windowExpanding: ${windowexp} + +# Size of Calamares window, expressed as w,h. Both w and h +# may be either pixels (suffix px) or font-units (suffix em). +# e.g. "800px,600px" +# "60em,480px" +# This setting is ignored if "fullscreen" is selected for +# *windowExpanding*, above. If not set, use constants defined +# in CalamaresUtilsGui, 800x520. +windowSize: ${windowsize} + +# Placement of Calamares window. Either "center" or "free". +# Whether "center" actually works does depend on the window +# manager in use (and only makes sense if you're not using +# *windowExpanding* set to "fullscreen"). +windowPlacement: ${windowplacement} + +### PANELS CONFIGURATION +# +# Calamares has a main content area, and two panels (navigation +# and progress / sidebar). The panels can be controlled individually, +# or switched off. If both panels are switched off, the layout of +# the main content area loses its margins, on the assumption that +# you're doing something special. + +# Kind of sidebar (panel on the left, showing progress). +# - "widget" or unset, use traditional sidebar (logo, items) +# - "none", hide it entirely +# - "qml", use calamares-sidebar.qml from branding folder +# In addition, you **may** specify a side, separated by a comma, +# from the kind. Valid sides are: +# - "left" (if not specified, uses this) +# - "right" +# - "top" +# - "bottom" +# For instance, "widget,right" is valid; so is "qml", which defaults +# to putting the sidebar on the left. Also valid is "qml,top". +# While "widget,top" is valid, the widgets code is **not** flexible +# and results will be terrible. +sidebar: qml + +# Kind of navigation (button panel on the bottom). +# - "widget" or unset, use traditional navigation +# - "none", hide it entirely +# - "qml", use calamares-navigation.qml from branding folder +# In addition, you **may** specify a side, separated by a comma, +# from the kind. The same sides are valid as for *sidebar*, +# except the default is *bottom*. +navigation: widget + + +### STRINGS, IMAGES AND COLORS +# +# This section contains the "branding proper" of names +# and images, rather than global-look settings. + +# These are strings shown to the user in the user interface. +# There is no provision for translating them -- since they +# are names, the string is included as-is. +# +# The four Url strings are the Urls used by the buttons in +# the welcome screen, and are not shown to the user. Clicking +# on the "Support" button, for instance, opens the link supportUrl. +# If a Url is empty, the corresponding button is not shown. +# +# bootloaderEntryName is how this installation / distro is named +# in the boot loader (e.g. in the GRUB menu). +# +# These strings support substitution from /etc/os-release +# if KDE Frameworks 5.58 are available at build-time. When +# enabled, @{var-name} is replaced by the equivalent value +# from os-release. All the supported var-names are in all-caps, +# and are listed on the FreeDesktop.org site, +# https://www.freedesktop.org/software/systemd/man/os-release.html +# Note that ANSI_COLOR and CPE_NAME don't make sense here, and +# are not supported (the rest are). Remember to quote the string +# if it contains substitutions, or you'll get YAML exceptions. +# +# The *Url* entries are used on the welcome page, and they +# are visible as buttons there if the corresponding *show* keys +# are set to "true" (they can also be overridden). +strings: + productName: ${dist_name} Linux + shortProductName: ${dist_name} + version: ${dist_release} + shortVersion: ${dist_release} + versionedName: ${dist_name} Linux ${dist_release} "\"${dist_codename}"\" + shortVersionedName: ${dist_name} ${dist_release} + bootloaderEntryName: ${dist_name} + + +# These images are loaded from the branding module directory. +# +# productBanner is an optional image, which if present, will be shown +# on the welcome page of the application, above the welcome text. +# It is intended to have a width much greater than height. +# It is displayed at 64px height (also on HiDPI). +# Recommended size is 64px tall, and up to 460px wide. +# productIcon is used as the window icon, and will (usually) be used +# by the window manager to represent the application. This image +# should be square, and may be displayed by the window manager +# as small as 16x16 (but possibly larger). +# productLogo is used as the logo at the top of the left-hand column +# which shows the steps to be taken. The image should be square, +# and is displayed at 80x80 pixels (also on HiDPI). +# productWallpaper is an optional image, which if present, will replace +# the normal solid background on every page of the application. +# It can be any size and proportion, +# and will be tiled to fit the entire window. +# For a non-tiled wallpaper, the size should be the same as +# the overall window, see *windowSize* above (800x520). +# productWelcome is shown on the welcome page of the application in +# the middle of the window, below the welcome text. It can be +# any size and proportion, and will be scaled to fit inside +# the window. Use `welcomeExpandingLogo` to make it non-scaled. +# Recommended size is 320x150. +# +# These filenames can also use substitutions from os-release (see above). +images: + # productBanner: "banner.png" + productIcon: "logo_small.svg" + productLogo: "logo.svg" + # productWallpaper: "wallpaper.png" + productWelcome: "welcome/mascot.svg" + +# Colors for text and background components. +# +# - SidebarBackground is the background of the sidebar +# - SidebarText is the (foreground) text color +# - SidebarBackgroundCurrent sets the background of the current step. +# Optional, and defaults to the application palette. +# - SidebarTextCurrent is the text color of the current step. +# +# These colors can **also** be set through the stylesheet, if the +# branding component also ships a stylesheet.qss. Then they are +# the corresponding CSS attributes of #sidebarApp. +style: + sidebarBackground: "\"${sidebarbackground}"\" + sidebarText: "\"${sidebartext}"\" + sidebarTextSelect: "\"${sidebartextselect}"\" + sidebarTextHighlight: "\"${sidebartexthighlight}"\" + +### SLIDESHOW +# +# The slideshow is displayed during execution steps (e.g. when the +# installer is actually writing to disk and doing other slow things). + +# The slideshow can be a QML file (recommended) which can display +# arbitrary things -- text, images, animations, or even play a game -- +# during the execution step. The QML **is** abruptly stopped when the +# execution step is done, though, so maybe a game isn't a great idea. +# +# The slideshow can also be a sequence of images (not recommended unless +# you don't want QML at all in your Calamares). The images are displayed +# at a rate of 1 every 2 seconds during the execution step. +# +# To configure a QML file, list a single filename: +# slideshow: "show.qml" +# To configure images, like the filenames (here, as an inline list): +# slideshow: [ "/etc/calamares/slideshow/0.png", "/etc/logo.png" ] +slideshow: "slideshow/SlideShow.qml" + +# There are two available APIs for a QML slideshow: +# - 1 (the default) loads the entire slideshow when the installation- +# slideshow page is shown and starts the QML then. The QML +# is never stopped (after installation is done, times etc. +# continue to fire). +# - 2 loads the slideshow on startup and calls onActivate() and +# onLeave() in the root object. After the installation is done, +# the show is stopped (first by calling onLeave(), then destroying +# the QML components). +# +# An image slideshow does not need to have the API defined. +slideshowAPI: 2 + + +# These options are to customize online uploading of logs to pastebins: +# - type : Defines the kind of pastebin service to be used. Currently +# it accepts two values: +# - none : disables the pastebin functionality +# - fiche : use fiche pastebin server +# - url : Defines the address of pastebin service to be used. +# Takes string as input. Important bits are the host and port, +# the scheme is not used. +# - sizeLimit : Defines maximum size limit (in KiB) of log file to be pasted. +# The option must be set, to have the log option work. +# Takes integer as input. If < 0, no limit will be forced, +# else only last (approximately) 'n' KiB of log file will be pasted. +# Please note that upload size may be slightly over the limit (due +# to last minute logging), so provide a suitable value. +uploadServer : + type : "fiche" + url : "http://termbin.com:9999" + sizeLimit : -1" > $1/usr/share/calamares/branding/manjaro/branding.desc +} + configure_polkit_user_rules(){ msg2 "Configuring polkit user rules" echo "/* Stop asking the user for a password while they are in a live session diff --git a/lib/util-iso.sh b/lib/util-iso.sh index 3931e55..832d60a 100644 --- a/lib/util-iso.sh +++ b/lib/util-iso.sh @@ -358,9 +358,12 @@ make_image_desktop() { cp "${path}/desktopfs-pkgs.txt" ${iso_dir}/$(gen_iso_fn)-pkgs.txt [[ -e ${profile_dir}/desktop-overlay ]] && copy_overlay "${profile_dir}/desktop-overlay" "${path}" - if [[ -e "${path}/usr/share/calamares/branding/manjaro/branding.desc" ]]; then + if [[ -e "${path}/usr/share/calamares/branding/manjaro/calamares-sidebar.qml" ]]; then configure_branding "${path}" msg "Done [Distribution: Release ${dist_release} Codename ${dist_codename}]" + elif [[ -e "${path}/usr/share/calamares/branding/manjaro/show.qml" ]]; then + configure_branding_old "${path}" + msg "Done [Distribution: Release ${dist_release} Codename ${dist_codename}]" fi reset_pac_conf "${path}"