Re: Override default SDDM for Stretch release
Hi Alf and all,
Le samedi 19 novembre 2016, 12:47:59 CET Alf Gaida a écrit :
>
> Am 18.11.2016 um 14:01 schrieb Maximiliano Curia:
> > ¡Hola Aurélien!
> >
> > I'm Ccing Alf Gaida and Matthias Klumpp as both are interested in sddm
> > and I would like to know their points of view about this.
> >
> > El 2016-11-18 a las 00:08 +0100, Aurélien COUDERC escribió:
> >> I’m working on implementing the Soft Waves theme selected for
> >> Stretch. The wallpaper setting for new user is done and I also have
> >> an SDDM theme ready, shipped in desktop-base 9.0.0~exp1. This SDDM
> >> theme is simply a copy of Breeze’s Main.qml overriding the wallpaper,
> >> and it uses the Breeze SDDM themes components as is (see attached
> >> screenshot).
> >
> > Nice.
> IMHO a default theme for debian should be based on maui - or better
> elarun
Here’s a patch.
I’ve made it for both maui and elarun hoping it can suit everyone’s needs. :)
This patch :
- builds 2 additional packages on top of sddm 0.14 git head :
· sddm-theme-debian-maui and sddm-theme-debian-elarun
· both recommend desktop-base (>= 9.0.0~) in addition to sddm used by existing theme packages
- builds these themes from upstream code only, with mostly CMakeList changes
- configures the background for both themes to use the selected theme from desktop-base
- makes both theme packages provide an alternative for /usr/share/sddm/themes/debian-theme each
- makes sddm choose debian-theme (instead of breeze in current Debian package) when no sddm.conf is present, sddm will still default to the embedded maui if debian-theme is not provided by any package
The idea is that desktop environment can depend / recommend their preferred sddm-theme-debian-* theme based on Debian artwork.
If the patch is suitable I’ll do the same for the debian-breeze theme.
Comments welcome !
Cheers,
--Aurélien
diff --git a/debian/control b/debian/control
index 03a6819..46c59fe 100644
--- a/debian/control
+++ b/debian/control
@@ -42,6 +42,17 @@ Description: modern display manager for X11
and beautiful. It uses modern technologies like QtQuick to create
smooth, animated user interfaces.
+Package: sddm-theme-debian-maui
+Architecture: all
+Depends: desktop-base,
+ ${misc:Depends}
+Recommends: sddm
+Provides: sddm-theme
+Breaks: sddm (<< ${source:Version})
+Description: 'Debian Maui' theme for SDDM X11 display manager
+ Maui theme for SDDM, using the active desktop-base theme for the
+ background
+
Package: sddm-theme-elarun
Architecture: all
Depends: ${misc:Depends}
@@ -51,6 +62,17 @@ Breaks: sddm (<< ${source:Version})
Description: 'Elarun' Theme for SDDM X11 display manager
Elarun theme for SDDM
+Package: sddm-theme-debian-elarun
+Architecture: all
+Depends: desktop-base,
+ ${misc:Depends}
+Recommends: sddm
+Provides: sddm-theme
+Breaks: sddm (<< ${source:Version})
+Description: 'Debian Elarun' Theme for SDDM X11 display manager
+ Elarun theme for SDDM, using the active desktop-base theme for the
+ background.
+
Package: sddm-theme-maldives
Architecture: all
Depends: ${misc:Depends}
diff --git a/debian/patches/02_kubuntu_use_breeze.diff b/debian/patches/02_use_debian_theme.diff
similarity index 87%
rename from debian/patches/02_kubuntu_use_breeze.diff
rename to debian/patches/02_use_debian_theme.diff
index b84b336..b97638e 100644
--- a/debian/patches/02_kubuntu_use_breeze.diff
+++ b/debian/patches/02_use_debian_theme.diff
@@ -5,7 +5,7 @@
Section(Theme,
Entry(ThemeDir, QString, _S(DATA_INSTALL_DIR "/themes"), _S("Theme directory path"));
- Entry(Current, QString, _S(""), _S("Current theme name"));
-+ Entry(Current, QString, _S("breeze"), _S("Current theme name"));
++ Entry(Current, QString, _S("debian-theme"), _S("Current theme name"));
Entry(FacesDir, QString, _S(DATA_INSTALL_DIR "/faces"), _S("Global directory for user avatars\n"
"The files should be named <username>.face.icon"));
Entry(CursorTheme, QString, QString(), _S("Cursor theme used in the greeter"));
diff --git a/debian/patches/05_add_debian_themes.diff b/debian/patches/05_add_debian_themes.diff
new file mode 100644
index 0000000..acfb568
--- /dev/null
+++ b/debian/patches/05_add_debian_themes.diff
@@ -0,0 +1,158 @@
+diff --git a/data/themes/CMakeLists.txt b/data/themes/CMakeLists.txt
+index 99e54ff..67da512 100644
+--- a/data/themes/CMakeLists.txt
++++ b/data/themes/CMakeLists.txt
+@@ -1,4 +1,24 @@
+-set(THEMES elarun maldives)
++# Copy Main.qml and image resources from upstream Maui to debian-maui
++file(COPY "../../src/greeter/theme/Main.qml" DESTINATION "${CMAKE_CURRENT_SOURCE_DIR}/debian-maui")
++file(GLOB MAUI_PNGS "../../src/greeter/theme/*.png")
++foreach(MAUI_PNG ${MAUI_PNGS})
++ file(COPY "${MAUI_PNG}" DESTINATION "${CMAKE_CURRENT_SOURCE_DIR}/debian-maui")
++endforeach(MAUI_PNG)
++# Replace default background source by config key config.background
++set(SED_EXPR "s=^\\([[:space:]]*source[[:space:]]*:[[:space:]]\\)\\\"qrc:/theme/background.png\\\"[[:space:]]*$=\\1config.background=")
++execute_process(COMMAND sed -i -e "${SED_EXPR}" "${CMAKE_CURRENT_SOURCE_DIR}/debian-maui/Main.qml" RESULT_VARIABLE RES OUTPUT_VARIABLE OUT)
++message("Result of sed replacement for Maui's background source: (Res: ${RES}, Out: ${OUT})")
++
++# Copy selected files from upstream Elarun to debian-elarun
++file(COPY "elarun/Main.qml" DESTINATION "${CMAKE_CURRENT_SOURCE_DIR}/debian-elarun")
++file(COPY "elarun/angle-down.png" DESTINATION "${CMAKE_CURRENT_SOURCE_DIR}/debian-elarun")
++file(COPY "elarun/elarun.jpg" DESTINATION "${CMAKE_CURRENT_SOURCE_DIR}/debian-elarun")
++file(GLOB ELARUN_IMGS "elarun/images/*")
++foreach(ELARUN_IMG ${ELARUN_IMGS})
++ file(COPY "${ELARUN_IMG}" DESTINATION "${CMAKE_CURRENT_SOURCE_DIR}/debian-elarun/images/")
++endforeach(ELARUN_IMG)
++
++set(THEMES elarun maldives debian-maui debian-elarun)
+
+ foreach(THEME ${THEMES})
+ # We assume that theme-specific translations are stored
+@@ -13,7 +33,7 @@ foreach(THEME ${THEMES})
+
+ qt5_add_translation(QM_FILES "${TRANSLATION_SOURCES}")
+
+- install(DIRECTORY "${THEME}" DESTINATION "${DATA_INSTALL_DIR}/themes" PATTERN "*.ts" EXCLUDE)
++ install(DIRECTORY "${THEME}" DESTINATION "${DATA_INSTALL_DIR}/themes" PATTERN "${THEME}/*.ts" EXCLUDE PATTERN "${THEME}/Main.qml" EXCLUDE)
+ install(DIRECTORY "${CMAKE_CURRENT_BINARY_DIR}/${THEME}" DESTINATION "${DATA_INSTALL_DIR}/themes")
+
+ list(APPEND THEMES_QM_FILES ${QM_FILES})
+diff --git a/data/themes/debian-elarun/README b/data/themes/debian-elarun/README
+new file mode 100644
+index 0000000..45dcb7b
+--- /dev/null
++++ b/data/themes/debian-elarun/README
+@@ -0,0 +1,9 @@
++This theme is based on the KDM Elarun theme, ported to SDDM theme.
++It was adapted to use the active Debian theme pack.
++Thanks to these people for their great works.
++Not all functionality from original theme are ported.
++
++Original KDM theme:
++Author=Roman Shtylman & Nuno Pinheiro
++Copyright=GPL 2010 Roman Shtylman | nuno@oxygen-icons.org, 2012 Nuno Pineheiro
++License=GPL
+diff --git a/data/themes/debian-elarun/metadata.desktop b/data/themes/debian-elarun/metadata.desktop
+new file mode 100644
+index 0000000..83d3353
+--- /dev/null
++++ b/data/themes/debian-elarun/metadata.desktop
+@@ -0,0 +1,49 @@
++[SddmGreeterTheme]
++Name=Debian Elarun
++Name[ca]=Debian Elarun
++Name[da]=Debian Elarun
++Name[de]=Debian Elarun
++Name[el]=Debian Elarun
++Name[es]=Debian Elarun
++Name[et]=Debian Elarun
++Name[fi]=Debian Elarun
++Name[ga]=Debian Elarun
++Name[gl]=Debian Elarun
++Name[hu]=Debian Elarun
++Name[ia]=Debian Elarun
++Name[kk]=Debian Еларун
++Name[ko]=Debian Elarun
++Name[mr]=Debian एलारन
++Name[nb]=Debian Elarun
++Name[nl]=Debian Elarun
++Name[pl]=Debian Elarun
++Name[pt]=Debian Elarun
++Name[pt_BR]=Debian Elarun
++Name[ro]=Debian Elarun
++Name[ru]=Debian Эларан
++Name[sk]=Debian Elarun
++Name[sl]=Debian Elarun
++Name[sr]=Debian Еларун
++Name[sr@ijekavian]=Еларун
++Name[sr@ijekavianlatin]=Debian Elarun
++Name[sr@latin]=Debian Elarun
++Name[sv]=Debian Elarun
++Name[uk]=Debian Еларан
++Name[x-test]=xxDebian Elarunxx
++Name[zh_CN]=Debian Elarun
++Name[zh_TW]=Debian Elarun
++
++Description=Elarun KDM theme ported to SDDM and adapted to use the active Debian theme. \nThe original theme is based on work of Roman Shtylman & Nuno Pinheiro
++Type=sddm-theme
++Author=Reza Fatahilah Shah
++Copyright=(c) 2013, Reza Fatahilah Shah
++Screenshot=elarun.jpg
++License=GPL
++Version=0.1
++MainScript=Main.qml
++ConfigFile=theme.conf
++TranslationsDirectory=translations
++Theme-Id=debian-elarun
++Theme-API=${COMPONENTS_VERSION}
++Website=https://github.com/sddm/sddm
++
+diff --git a/data/themes/debian-elarun/theme.conf b/data/themes/debian-elarun/theme.conf
+new file mode 100644
+index 0000000..c4bf093
+--- /dev/null
++++ b/data/themes/debian-elarun/theme.conf
+@@ -0,0 +1,2 @@
++[General]
++background=/usr/share/desktop-base/active-theme/login/background.svg
+diff --git a/data/themes/debian-maui/README b/data/themes/debian-maui/README
+new file mode 100644
+index 0000000..0d181c8
+--- /dev/null
++++ b/data/themes/debian-maui/README
+@@ -0,0 +1,5 @@
++This theme is an adaptation of the original Maui theme from upstream SDDM for
++Debian to use the active desktop-base theme.
++
++Check the src/greeter/theme folder from the SDDM source for more information.
++
+diff --git a/data/themes/debian-maui/metadata.desktop b/data/themes/debian-maui/metadata.desktop
+new file mode 100644
+index 0000000..e94ee0f
+--- /dev/null
++++ b/data/themes/debian-maui/metadata.desktop
+@@ -0,0 +1,16 @@
++[SddmGreeterTheme]
++Name=Debian Maui
++Description=Maui Theme for Debian
++Author=Abdurrahman AVCI
++Copyright=(c) 2013, Abdurrahman AVCI
++License=CC-BY-SA
++Type=sddm-theme
++Version=0.1
++Website=https://github.com/sddm/sddm
++Screenshot=maui.jpg
++MainScript=Main.qml
++ConfigFile=theme.conf
++TranslationsDirectory=translations
++Email=abdurrahmanavci@gmail.com
++Theme-Id=maui
++Theme-API=${COMPONENTS_VERSION}
+diff --git a/data/themes/debian-maui/theme.conf b/data/themes/debian-maui/theme.conf
+new file mode 100644
+index 0000000..d832f41
+--- /dev/null
++++ b/data/themes/debian-maui/theme.conf
+@@ -0,0 +1,2 @@
++[General]
++background=/usr/share/desktop-base/active-theme/login/background-nologo.svg
diff --git a/debian/patches/series b/debian/patches/series
index eb3a11c..356b831 100644
--- a/debian/patches/series
+++ b/debian/patches/series
@@ -1,4 +1,5 @@
01_sddm_systemctl.diff
-02_kubuntu_use_breeze.diff
+02_use_debian_theme.diff
03_vt7-minimum-vt.diff
04_set_default_path.diff
+05_add_debian_themes.diff
diff --git a/debian/sddm-theme-debian-elarun.install b/debian/sddm-theme-debian-elarun.install
new file mode 100644
index 0000000..c53cf31
--- /dev/null
+++ b/debian/sddm-theme-debian-elarun.install
@@ -0,0 +1 @@
+usr/share/sddm/themes/debian-elarun/
diff --git a/debian/sddm-theme-debian-elarun.postinst b/debian/sddm-theme-debian-elarun.postinst
new file mode 100644
index 0000000..f63c13c
--- /dev/null
+++ b/debian/sddm-theme-debian-elarun.postinst
@@ -0,0 +1,13 @@
+#!/bin/bash
+set -e
+
+if [[ "$1" = "configure" || "$1" = "abort-upgrade" || "$1" = "abort-remove" ]]; then
+ update-alternatives --install \
+ /usr/share/sddm/themes/debian-theme \
+ sddm-debian-theme \
+ /usr/share/sddm/themes/debian-elarun 30
+fi
+
+# Tag to allow some debhelper commands to inject relevant code
+#DEBHELPER#
+
diff --git a/debian/sddm-theme-debian-elarun.prerm b/debian/sddm-theme-debian-elarun.prerm
new file mode 100644
index 0000000..429089b
--- /dev/null
+++ b/debian/sddm-theme-debian-elarun.prerm
@@ -0,0 +1,12 @@
+#!/bin/sh -e
+set -e
+
+if [ "$1" = "remove" ] || [ "$1" = "deconfigure" ]; then
+ update-alternatives --remove \
+ sddm-debian-theme \
+ /usr/share/sddm/themes/debian-elarun
+fi
+
+# Tag to allow some debhelper commands to inject relevant code
+#DEBHELPER#
+
diff --git a/debian/sddm-theme-debian-maui.install b/debian/sddm-theme-debian-maui.install
new file mode 100644
index 0000000..94acce1
--- /dev/null
+++ b/debian/sddm-theme-debian-maui.install
@@ -0,0 +1 @@
+usr/share/sddm/themes/debian-maui/
diff --git a/debian/sddm-theme-debian-maui.postinst b/debian/sddm-theme-debian-maui.postinst
new file mode 100644
index 0000000..39fda5c
--- /dev/null
+++ b/debian/sddm-theme-debian-maui.postinst
@@ -0,0 +1,13 @@
+#!/bin/bash
+set -e
+
+if [[ "$1" = "configure" || "$1" = "abort-upgrade" || "$1" = "abort-remove" ]]; then
+ update-alternatives --install \
+ /usr/share/sddm/themes/debian-theme \
+ sddm-debian-theme \
+ /usr/share/sddm/themes/debian-maui 40
+fi
+
+# Tag to allow some debhelper commands to inject relevant code
+#DEBHELPER#
+
diff --git a/debian/sddm-theme-debian-maui.prerm b/debian/sddm-theme-debian-maui.prerm
new file mode 100644
index 0000000..b10b6da
--- /dev/null
+++ b/debian/sddm-theme-debian-maui.prerm
@@ -0,0 +1,12 @@
+#!/bin/sh -e
+set -e
+
+if [ "$1" = "remove" ] || [ "$1" = "deconfigure" ]; then
+ update-alternatives --remove \
+ sddm-debian-theme \
+ /usr/share/sddm/themes/debian-maui
+fi
+
+# Tag to allow some debhelper commands to inject relevant code
+#DEBHELPER#
+
Reply to: