diff --git a/pkgbuild/pkgbuild.install b/pkgbuild/pkgbuild.install index ac384f8..a415779 100644 --- a/pkgbuild/pkgbuild.install +++ b/pkgbuild/pkgbuild.install @@ -5,21 +5,36 @@ ## arg 1: the new package version post_install() { - if [ ! -e "/etc/systemd/user/default.target.wants/sddm-wallpaper.path" ];then - ln -s /usr/lib/systemd/user/sddm-wallpaper.path /etc/systemd/user/default.target.wants/sddm-wallpaper.path - fi + systemctl --global enable sddm-wallpaper.path + # Each user's sddm-wallpaper.service copies their wallpaper over it. chmod 666 /usr/share/sddm/wallpaper/image.png - user=$(awk -F':' '{ if ($3 >= 1000 && $1 != "nobody") print $1 }' /etc/passwd | head -n1) - sudo -u $user XDG_RUNTIME_DIR=/run/user/$(id -u $user) systemctl --user daemon-reload - sudo -u $user XDG_RUNTIME_DIR=/run/user/$(id -u $user) systemctl -q --user start sddm-wallpaper.service - - systemctl enable --now sddm-fix.service + + # Generated by big-first-boot and the live session, with x11 after sddm-verify. + # It would override sddm-theme-biglinux.conf and start maliit-keyboard, which + # is not installed. Other content is the administrator's. + wayland_config=/etc/sddm.conf.d/10-wayland.conf + generated='[General] +DisplayServer=wayland +GreeterEnvironment=QT_WAYLAND_SHELL_INTEGRATION=layer-shell + +[Wayland] +CompositorCommand=kwin_wayland --drm --no-lockscreen --no-global-shortcuts --locale1 --inputmethod maliit-keyboard' + if [ -f "$wayland_config" ] && + [ "$(grep -v -e '^# Generated by big-first-boot;' -e '^# Generated by biglinux-livecd;' "$wayland_config" | + sed 's/^DisplayServer=x11$/DisplayServer=wayland/')" = "$generated" ]; then + rm -f "$wayland_config" + fi } ## arg 2: the old package version -#pre_upgrade() { - # do something here -#} +pre_upgrade() { + # sddm-fix.service wanted sddm.service; drop its enablement while the unit exists. + if [ -e /usr/lib/systemd/system/sddm-fix.service ]; then + systemctl disable --no-reload sddm-fix.service + fi + # The X11 greeter's NumLock setting, written by sddm-fix. + rm -f /etc/sddm.conf.d/enable_numlock.conf +} ## arg 2: the old package version post_upgrade() { diff --git a/sddm-theme-biglinux/usr/bin/sddm-fix b/sddm-theme-biglinux/usr/bin/sddm-fix index cf69d21..27dcd81 100755 --- a/sddm-theme-biglinux/usr/bin/sddm-fix +++ b/sddm-theme-biglinux/usr/bin/sddm-fix @@ -8,16 +8,6 @@ if [ ! -e "/usr/share/sddm/wallpaper/image.png" ];then cp "$(grep -m1 -Po "(?<=^Image=).*" "/home/$user/.config/plasma-org.kde.plasma.desktop-appletsrc" | tr -d '"' | tr -d ';')" /usr/share/sddm/wallpaper/image.png fi -OLD_IFS=$IFS -IFS=$'\n' -for user in $(awk -F':' '{ if ($3 >= 1000 && $1 != "nobody") print $1 }' /etc/passwd); do - if [ ! -e "/var/lib/AccountsService/icons/$user" ];then - cp "$(shuf -n 1 -e $(ls /usr/share/plasma/avatars/*.png))" /var/lib/AccountsService/icons/$user - fi -done -IFS=$OLD_IFS - - ##### Numlock ####### # Verify if last login user select auto enable numlock in kwin if grep -qi "NumLock=0" "/home/$(grep User= /var/lib/sddm/state.conf | sed 's|User=||g;s| ||g')/.config/kcminputrc"; then @@ -43,11 +33,3 @@ else fi fi - -# Numlock X11 -if [[ "$NumLockUser" = "true" ]]; then - echo '[General] -Numlock=on' > /etc/sddm.conf.d/enable_numlock.conf -else - rm -f /etc/sddm.conf.d/enable_numlock.conf -fi diff --git a/sddm-theme-biglinux/usr/lib/sddm/sddm.conf.d/sddm-theme-biglinux.conf b/sddm-theme-biglinux/usr/lib/sddm/sddm.conf.d/sddm-theme-biglinux.conf new file mode 100644 index 0000000..45e0454 --- /dev/null +++ b/sddm-theme-biglinux/usr/lib/sddm/sddm.conf.d/sddm-theme-biglinux.conf @@ -0,0 +1,7 @@ +# A file in /etc/sddm.conf.d overrides these values. +[General] +DisplayServer=wayland +GreeterEnvironment=QT_WAYLAND_SHELL_INTEGRATION=layer-shell + +[Wayland] +CompositorCommand=kwin_wayland --drm --no-lockscreen --no-global-shortcuts --locale1 --inputmethod plasma-keyboard diff --git a/sddm-theme-biglinux/usr/lib/systemd/system/sddm-fix.service b/sddm-theme-biglinux/usr/lib/systemd/system/sddm-fix.service deleted file mode 100644 index c86b3b0..0000000 --- a/sddm-theme-biglinux/usr/lib/systemd/system/sddm-fix.service +++ /dev/null @@ -1,11 +0,0 @@ -[Unit] -Description=Ensures that SDDM wallpaper is correct -Before=sddm.service -Wants=sddm.service - -[Service] -Type=simple -ExecStart=/usr/bin/sddm-fix - -[Install] -WantedBy=graphical.target diff --git a/sddm-theme-biglinux/usr/lib/systemd/system/sddm.service.d/sddm-theme-biglinux.conf b/sddm-theme-biglinux/usr/lib/systemd/system/sddm.service.d/sddm-theme-biglinux.conf new file mode 100644 index 0000000..f35eb6f --- /dev/null +++ b/sddm-theme-biglinux/usr/lib/systemd/system/sddm.service.d/sddm-theme-biglinux.conf @@ -0,0 +1,4 @@ +# Part of sddm.service rather than a unit of its own, so that it runs only where +# SDDM is the display manager and never starts SDDM itself. +[Service] +ExecStartPre=-/usr/bin/sddm-fix diff --git a/sddm-theme-biglinux/usr/lib/systemd/user/sddm-wallpaper.path b/sddm-theme-biglinux/usr/lib/systemd/user/sddm-wallpaper.path index 4474b36..36bd07d 100644 --- a/sddm-theme-biglinux/usr/lib/systemd/user/sddm-wallpaper.path +++ b/sddm-theme-biglinux/usr/lib/systemd/user/sddm-wallpaper.path @@ -1,6 +1,7 @@ [Unit] Description=SDDM change WallPaper -ConditionUser=!root +# System accounts, the greeter's among them, have no desktop. +ConditionUser=!@system [Path] PathModified=%h/.config/plasma-org.kde.plasma.desktop-appletsrc diff --git a/sddm-theme-biglinux/usr/lib/systemd/user/sddm-wallpaper.service b/sddm-theme-biglinux/usr/lib/systemd/user/sddm-wallpaper.service index 7bfada3..c068194 100644 --- a/sddm-theme-biglinux/usr/lib/systemd/user/sddm-wallpaper.service +++ b/sddm-theme-biglinux/usr/lib/systemd/user/sddm-wallpaper.service @@ -1,10 +1,10 @@ [Unit] Description=SDDM change WallPaper -ConditionUser=!root +ConditionUser=!@system +# Plasma writes its settings several times per change; a start limit would fail +# the path unit and end the sync for the session. +StartLimitIntervalSec=0 [Service] Type=oneshot ExecStart=/usr/share/sddm/wallpaper/change-wallpaper.sh - -[Install] -WantedBy=default.target diff --git a/sddm-theme-biglinux/usr/share/libalpm/scripts/remove-avatar-biglinux b/sddm-theme-biglinux/usr/share/libalpm/scripts/remove-avatar-biglinux index 0180607..6a16614 100755 --- a/sddm-theme-biglinux/usr/share/libalpm/scripts/remove-avatar-biglinux +++ b/sddm-theme-biglinux/usr/share/libalpm/scripts/remove-avatar-biglinux @@ -1,5 +1,5 @@ #!/usr/bin/env bash +# Drops the KDE mascot avatars and stock photos plasma-workspace ships, leaving +# the BigLinux avatars as the choice offered for new accounts. -rm /usr/share/plasma/avatars/*Konqi* -rm /usr/share/plasma/avatars/*Katie* -rm -r /usr/share/plasma/avatars/photos +rm -rf /usr/share/plasma/avatars/*Konqi* /usr/share/plasma/avatars/*Katie* /usr/share/plasma/avatars/photos diff --git a/sddm-theme-biglinux/usr/share/libalpm/scripts/sddm-theme-biglinux b/sddm-theme-biglinux/usr/share/libalpm/scripts/sddm-theme-biglinux index 963e92a..14a27af 100755 --- a/sddm-theme-biglinux/usr/share/libalpm/scripts/sddm-theme-biglinux +++ b/sddm-theme-biglinux/usr/share/libalpm/scripts/sddm-theme-biglinux @@ -6,9 +6,3 @@ cp -f /usr/share/biglinux/themes/biglinux-dark/.config/plasmarc /var/lib/sddm/.c cp -f /etc/skel/.config/kcminputrc /var/lib/sddm/.config/kcminputrc chown -R sddm:sddm /var/lib/sddm/ -cp -f /usr/share/sddm/scripts/Xsetup-big /usr/share/sddm/scripts/Xsetup - -# Revert fix from update 0.20.0-2 -if grep -q 'InputMethod=qtvirtualkeyboard,compose *$' /etc/sddm.conf; then - sed -i 's|InputMethod=qtvirtualkeyboard,compose|InputMethod=qtvirtualkeyboard|g' /etc/sddm.conf -fi diff --git a/sddm-theme-biglinux/usr/share/sddm/scripts/Xsetup-big b/sddm-theme-biglinux/usr/share/sddm/scripts/Xsetup-big deleted file mode 100755 index 5e72537..0000000 --- a/sddm-theme-biglinux/usr/share/sddm/scripts/Xsetup-big +++ /dev/null @@ -1,19 +0,0 @@ -#!/bin/sh -# Xsetup - run as root before the login dialog appears - - -#/usr/share/sddm/scripts/numlock - -# if [ "$(grep LANG= /etc/locale.conf | grep pt)" != "" ]; then -# sed -i 's|Name=.*|Name=Central de Controle|g' /usr/share/xsessions/bigcontrolcenter.desktop -# sed -i 's|lookandfeel", ".*%1"|lookandfeel", "Selecione o desktop: %1"|' /usr/share/sddm/themes/biglinux/SessionButton.qml -# else -# sed -i 's|Name=.*|Name=Control Center|g' /usr/share/xsessions/bigcontrolcenter.desktop -# sed -i 's|lookandfeel", ".*%1"|lookandfeel", "Change desktop: %1"|' /usr/share/sddm/themes/biglinux/SessionButton.qml -# fi - - -# nvidia prime support -if [ -f "/sbin/prime-offload" ]; then - /sbin/prime-offload -fi diff --git a/sddm-theme-biglinux/usr/share/sddm/themes/biglinux-image-3d/Main.qml b/sddm-theme-biglinux/usr/share/sddm/themes/biglinux-image-3d/Main.qml index 6cb785f..28bc96e 100755 --- a/sddm-theme-biglinux/usr/share/sddm/themes/biglinux-image-3d/Main.qml +++ b/sddm-theme-biglinux/usr/share/sddm/themes/biglinux-image-3d/Main.qml @@ -54,6 +54,9 @@ Item { width: parent.width source: config.type == "color" || !config.background ? config.auto_background : config.background asynchronous: false + // Decoded at the screen's size and cropped like the Plasma desktop. + sourceSize: Qt.size(width * Screen.devicePixelRatio, height * Screen.devicePixelRatio) + fillMode: Image.PreserveAspectCrop cache: true clip: true visible: true diff --git a/sddm-theme-biglinux/usr/share/sddm/themes/biglinux-image-3d/components/VirtualKeyboard.qml b/sddm-theme-biglinux/usr/share/sddm/themes/biglinux-image-3d/components/VirtualKeyboard.qml deleted file mode 100755 index 73f46ab..0000000 --- a/sddm-theme-biglinux/usr/share/sddm/themes/biglinux-image-3d/components/VirtualKeyboard.qml +++ /dev/null @@ -1,69 +0,0 @@ -/* - SPDX-FileCopyrightText: 2017 Martin Gräßlin - - SPDX-License-Identifier: GPL-2.0-or-later -*/ - -import QtQuick -import QtQuick.VirtualKeyboard as QtVK - -import org.kde.kirigami as Kirigami - -QtVK.InputPanel { - id: inputPanel - property bool activated: false - active: activated && InputMethod.visible - width: parent.width - - states: [ - State { - name: "visible" - when: inputPanel.active - PropertyChanges { - inputPanel.y: inputPanel.parent.height - inputPanel.height - inputPanel.opacity: 1 - inputPanel.visible: true - } - }, - State { - name: "hidden" - when: !inputPanel.active - PropertyChanges { - inputPanel.y: inputPanel.parent.height - inputPanel.opacity: 0 - inputPanel.visible:false - } - } - ] - - transitions: [ - Transition { - to: "visible" - ParallelAnimation { - YAnimator { - // NOTE this is necessary as otherwise the keyboard always starts the transition with Y as 0, due to the internal reparenting happening when becomes active - from: inputPanel.parent.height - duration: Kirigami.Units.longDuration - easing.type: Easing.OutQuad - } - OpacityAnimator { - duration: Kirigami.Units.longDuration - easing.type: Easing.OutQuad - } - } - }, - Transition { - to: "hidden" - ParallelAnimation { - YAnimator { - duration: Kirigami.Units.longDuration - easing.type: Easing.InQuad - } - OpacityAnimator { - duration: Kirigami.Units.longDuration - easing.type: Easing.InQuad - } - } - } - ] -} diff --git a/sddm-theme-biglinux/usr/share/sddm/themes/biglinux-image-3d/components/VirtualKeyboardLoader.qml b/sddm-theme-biglinux/usr/share/sddm/themes/biglinux-image-3d/components/VirtualKeyboardLoader.qml index 82a58a1..32c0ef3 100644 --- a/sddm-theme-biglinux/usr/share/sddm/themes/biglinux-image-3d/components/VirtualKeyboardLoader.qml +++ b/sddm-theme-biglinux/usr/share/sddm/themes/biglinux-image-3d/components/VirtualKeyboardLoader.qml @@ -24,9 +24,7 @@ Loader { state = state === "hidden" ? "visible" : "hidden"; } - source: Qt.platform.pluginName.includes("wayland") - ? Qt.resolvedUrl("./VirtualKeyboard_wayland.qml") - : Qt.resolvedUrl("./VirtualKeyboard.qml") + source: Qt.resolvedUrl("./VirtualKeyboard_wayland.qml") onKeyboardActiveChanged: { if (keyboardActive) { diff --git a/sddm-theme-biglinux/usr/share/sddm/themes/biglinux-image/Main.qml b/sddm-theme-biglinux/usr/share/sddm/themes/biglinux-image/Main.qml index 0d76ede..d83e070 100755 --- a/sddm-theme-biglinux/usr/share/sddm/themes/biglinux-image/Main.qml +++ b/sddm-theme-biglinux/usr/share/sddm/themes/biglinux-image/Main.qml @@ -54,6 +54,9 @@ Item { width: parent.width source: config.type == "color" || !config.background ? config.auto_background : config.background asynchronous: false + // Decoded at the screen's size and cropped like the Plasma desktop. + sourceSize: Qt.size(width * Screen.devicePixelRatio, height * Screen.devicePixelRatio) + fillMode: Image.PreserveAspectCrop cache: true clip: true visible: true diff --git a/sddm-theme-biglinux/usr/share/sddm/themes/biglinux-image/components/VirtualKeyboard.qml b/sddm-theme-biglinux/usr/share/sddm/themes/biglinux-image/components/VirtualKeyboard.qml deleted file mode 100755 index 73f46ab..0000000 --- a/sddm-theme-biglinux/usr/share/sddm/themes/biglinux-image/components/VirtualKeyboard.qml +++ /dev/null @@ -1,69 +0,0 @@ -/* - SPDX-FileCopyrightText: 2017 Martin Gräßlin - - SPDX-License-Identifier: GPL-2.0-or-later -*/ - -import QtQuick -import QtQuick.VirtualKeyboard as QtVK - -import org.kde.kirigami as Kirigami - -QtVK.InputPanel { - id: inputPanel - property bool activated: false - active: activated && InputMethod.visible - width: parent.width - - states: [ - State { - name: "visible" - when: inputPanel.active - PropertyChanges { - inputPanel.y: inputPanel.parent.height - inputPanel.height - inputPanel.opacity: 1 - inputPanel.visible: true - } - }, - State { - name: "hidden" - when: !inputPanel.active - PropertyChanges { - inputPanel.y: inputPanel.parent.height - inputPanel.opacity: 0 - inputPanel.visible:false - } - } - ] - - transitions: [ - Transition { - to: "visible" - ParallelAnimation { - YAnimator { - // NOTE this is necessary as otherwise the keyboard always starts the transition with Y as 0, due to the internal reparenting happening when becomes active - from: inputPanel.parent.height - duration: Kirigami.Units.longDuration - easing.type: Easing.OutQuad - } - OpacityAnimator { - duration: Kirigami.Units.longDuration - easing.type: Easing.OutQuad - } - } - }, - Transition { - to: "hidden" - ParallelAnimation { - YAnimator { - duration: Kirigami.Units.longDuration - easing.type: Easing.InQuad - } - OpacityAnimator { - duration: Kirigami.Units.longDuration - easing.type: Easing.InQuad - } - } - } - ] -} diff --git a/sddm-theme-biglinux/usr/share/sddm/themes/biglinux-image/components/VirtualKeyboardLoader.qml b/sddm-theme-biglinux/usr/share/sddm/themes/biglinux-image/components/VirtualKeyboardLoader.qml index 82a58a1..32c0ef3 100644 --- a/sddm-theme-biglinux/usr/share/sddm/themes/biglinux-image/components/VirtualKeyboardLoader.qml +++ b/sddm-theme-biglinux/usr/share/sddm/themes/biglinux-image/components/VirtualKeyboardLoader.qml @@ -24,9 +24,7 @@ Loader { state = state === "hidden" ? "visible" : "hidden"; } - source: Qt.platform.pluginName.includes("wayland") - ? Qt.resolvedUrl("./VirtualKeyboard_wayland.qml") - : Qt.resolvedUrl("./VirtualKeyboard.qml") + source: Qt.resolvedUrl("./VirtualKeyboard_wayland.qml") onKeyboardActiveChanged: { if (keyboardActive) { diff --git a/sddm-theme-biglinux/usr/share/sddm/themes/biglinux-parallax/components/VirtualKeyboard.qml b/sddm-theme-biglinux/usr/share/sddm/themes/biglinux-parallax/components/VirtualKeyboard.qml deleted file mode 100755 index 73f46ab..0000000 --- a/sddm-theme-biglinux/usr/share/sddm/themes/biglinux-parallax/components/VirtualKeyboard.qml +++ /dev/null @@ -1,69 +0,0 @@ -/* - SPDX-FileCopyrightText: 2017 Martin Gräßlin - - SPDX-License-Identifier: GPL-2.0-or-later -*/ - -import QtQuick -import QtQuick.VirtualKeyboard as QtVK - -import org.kde.kirigami as Kirigami - -QtVK.InputPanel { - id: inputPanel - property bool activated: false - active: activated && InputMethod.visible - width: parent.width - - states: [ - State { - name: "visible" - when: inputPanel.active - PropertyChanges { - inputPanel.y: inputPanel.parent.height - inputPanel.height - inputPanel.opacity: 1 - inputPanel.visible: true - } - }, - State { - name: "hidden" - when: !inputPanel.active - PropertyChanges { - inputPanel.y: inputPanel.parent.height - inputPanel.opacity: 0 - inputPanel.visible:false - } - } - ] - - transitions: [ - Transition { - to: "visible" - ParallelAnimation { - YAnimator { - // NOTE this is necessary as otherwise the keyboard always starts the transition with Y as 0, due to the internal reparenting happening when becomes active - from: inputPanel.parent.height - duration: Kirigami.Units.longDuration - easing.type: Easing.OutQuad - } - OpacityAnimator { - duration: Kirigami.Units.longDuration - easing.type: Easing.OutQuad - } - } - }, - Transition { - to: "hidden" - ParallelAnimation { - YAnimator { - duration: Kirigami.Units.longDuration - easing.type: Easing.InQuad - } - OpacityAnimator { - duration: Kirigami.Units.longDuration - easing.type: Easing.InQuad - } - } - } - ] -} diff --git a/sddm-theme-biglinux/usr/share/sddm/themes/biglinux-parallax/components/VirtualKeyboardLoader.qml b/sddm-theme-biglinux/usr/share/sddm/themes/biglinux-parallax/components/VirtualKeyboardLoader.qml index 82a58a1..32c0ef3 100644 --- a/sddm-theme-biglinux/usr/share/sddm/themes/biglinux-parallax/components/VirtualKeyboardLoader.qml +++ b/sddm-theme-biglinux/usr/share/sddm/themes/biglinux-parallax/components/VirtualKeyboardLoader.qml @@ -24,9 +24,7 @@ Loader { state = state === "hidden" ? "visible" : "hidden"; } - source: Qt.platform.pluginName.includes("wayland") - ? Qt.resolvedUrl("./VirtualKeyboard_wayland.qml") - : Qt.resolvedUrl("./VirtualKeyboard.qml") + source: Qt.resolvedUrl("./VirtualKeyboard_wayland.qml") onKeyboardActiveChanged: { if (keyboardActive) { diff --git a/sddm-theme-biglinux/usr/share/sddm/themes/biglinux-pong/components/VirtualKeyboard.qml b/sddm-theme-biglinux/usr/share/sddm/themes/biglinux-pong/components/VirtualKeyboard.qml deleted file mode 100755 index 73f46ab..0000000 --- a/sddm-theme-biglinux/usr/share/sddm/themes/biglinux-pong/components/VirtualKeyboard.qml +++ /dev/null @@ -1,69 +0,0 @@ -/* - SPDX-FileCopyrightText: 2017 Martin Gräßlin - - SPDX-License-Identifier: GPL-2.0-or-later -*/ - -import QtQuick -import QtQuick.VirtualKeyboard as QtVK - -import org.kde.kirigami as Kirigami - -QtVK.InputPanel { - id: inputPanel - property bool activated: false - active: activated && InputMethod.visible - width: parent.width - - states: [ - State { - name: "visible" - when: inputPanel.active - PropertyChanges { - inputPanel.y: inputPanel.parent.height - inputPanel.height - inputPanel.opacity: 1 - inputPanel.visible: true - } - }, - State { - name: "hidden" - when: !inputPanel.active - PropertyChanges { - inputPanel.y: inputPanel.parent.height - inputPanel.opacity: 0 - inputPanel.visible:false - } - } - ] - - transitions: [ - Transition { - to: "visible" - ParallelAnimation { - YAnimator { - // NOTE this is necessary as otherwise the keyboard always starts the transition with Y as 0, due to the internal reparenting happening when becomes active - from: inputPanel.parent.height - duration: Kirigami.Units.longDuration - easing.type: Easing.OutQuad - } - OpacityAnimator { - duration: Kirigami.Units.longDuration - easing.type: Easing.OutQuad - } - } - }, - Transition { - to: "hidden" - ParallelAnimation { - YAnimator { - duration: Kirigami.Units.longDuration - easing.type: Easing.InQuad - } - OpacityAnimator { - duration: Kirigami.Units.longDuration - easing.type: Easing.InQuad - } - } - } - ] -} diff --git a/sddm-theme-biglinux/usr/share/sddm/themes/biglinux-pong/components/VirtualKeyboardLoader.qml b/sddm-theme-biglinux/usr/share/sddm/themes/biglinux-pong/components/VirtualKeyboardLoader.qml index 82a58a1..32c0ef3 100644 --- a/sddm-theme-biglinux/usr/share/sddm/themes/biglinux-pong/components/VirtualKeyboardLoader.qml +++ b/sddm-theme-biglinux/usr/share/sddm/themes/biglinux-pong/components/VirtualKeyboardLoader.qml @@ -24,9 +24,7 @@ Loader { state = state === "hidden" ? "visible" : "hidden"; } - source: Qt.platform.pluginName.includes("wayland") - ? Qt.resolvedUrl("./VirtualKeyboard_wayland.qml") - : Qt.resolvedUrl("./VirtualKeyboard.qml") + source: Qt.resolvedUrl("./VirtualKeyboard_wayland.qml") onKeyboardActiveChanged: { if (keyboardActive) { diff --git a/sddm-theme-biglinux/usr/share/sddm/themes/biglinux/Main.qml b/sddm-theme-biglinux/usr/share/sddm/themes/biglinux/Main.qml index d4a006e..d431681 100755 --- a/sddm-theme-biglinux/usr/share/sddm/themes/biglinux/Main.qml +++ b/sddm-theme-biglinux/usr/share/sddm/themes/biglinux/Main.qml @@ -56,6 +56,9 @@ Item { width: parent.width source: config.type == "color" || !config.background ? config.auto_background : config.background asynchronous: false + // Decoded at the screen's size and cropped like the Plasma desktop. + sourceSize: Qt.size(width * Screen.devicePixelRatio, height * Screen.devicePixelRatio) + fillMode: Image.PreserveAspectCrop cache: true clip: true visible: true diff --git a/sddm-theme-biglinux/usr/share/sddm/themes/biglinux/components/VirtualKeyboard.qml b/sddm-theme-biglinux/usr/share/sddm/themes/biglinux/components/VirtualKeyboard.qml deleted file mode 100755 index 73f46ab..0000000 --- a/sddm-theme-biglinux/usr/share/sddm/themes/biglinux/components/VirtualKeyboard.qml +++ /dev/null @@ -1,69 +0,0 @@ -/* - SPDX-FileCopyrightText: 2017 Martin Gräßlin - - SPDX-License-Identifier: GPL-2.0-or-later -*/ - -import QtQuick -import QtQuick.VirtualKeyboard as QtVK - -import org.kde.kirigami as Kirigami - -QtVK.InputPanel { - id: inputPanel - property bool activated: false - active: activated && InputMethod.visible - width: parent.width - - states: [ - State { - name: "visible" - when: inputPanel.active - PropertyChanges { - inputPanel.y: inputPanel.parent.height - inputPanel.height - inputPanel.opacity: 1 - inputPanel.visible: true - } - }, - State { - name: "hidden" - when: !inputPanel.active - PropertyChanges { - inputPanel.y: inputPanel.parent.height - inputPanel.opacity: 0 - inputPanel.visible:false - } - } - ] - - transitions: [ - Transition { - to: "visible" - ParallelAnimation { - YAnimator { - // NOTE this is necessary as otherwise the keyboard always starts the transition with Y as 0, due to the internal reparenting happening when becomes active - from: inputPanel.parent.height - duration: Kirigami.Units.longDuration - easing.type: Easing.OutQuad - } - OpacityAnimator { - duration: Kirigami.Units.longDuration - easing.type: Easing.OutQuad - } - } - }, - Transition { - to: "hidden" - ParallelAnimation { - YAnimator { - duration: Kirigami.Units.longDuration - easing.type: Easing.InQuad - } - OpacityAnimator { - duration: Kirigami.Units.longDuration - easing.type: Easing.InQuad - } - } - } - ] -} diff --git a/sddm-theme-biglinux/usr/share/sddm/themes/biglinux/components/VirtualKeyboardLoader.qml b/sddm-theme-biglinux/usr/share/sddm/themes/biglinux/components/VirtualKeyboardLoader.qml index 82a58a1..32c0ef3 100644 --- a/sddm-theme-biglinux/usr/share/sddm/themes/biglinux/components/VirtualKeyboardLoader.qml +++ b/sddm-theme-biglinux/usr/share/sddm/themes/biglinux/components/VirtualKeyboardLoader.qml @@ -24,9 +24,7 @@ Loader { state = state === "hidden" ? "visible" : "hidden"; } - source: Qt.platform.pluginName.includes("wayland") - ? Qt.resolvedUrl("./VirtualKeyboard_wayland.qml") - : Qt.resolvedUrl("./VirtualKeyboard.qml") + source: Qt.resolvedUrl("./VirtualKeyboard_wayland.qml") onKeyboardActiveChanged: { if (keyboardActive) { diff --git a/sddm-theme-biglinux/usr/share/sddm/wallpaper/change-wallpaper.sh b/sddm-theme-biglinux/usr/share/sddm/wallpaper/change-wallpaper.sh index 757de9b..ab8537e 100755 --- a/sddm-theme-biglinux/usr/share/sddm/wallpaper/change-wallpaper.sh +++ b/sddm-theme-biglinux/usr/share/sddm/wallpaper/change-wallpaper.sh @@ -1,3 +1,30 @@ #!/usr/bin/env bash +# Copies the user's Plasma wallpaper to the image the greeter shows +# (auto_background in each theme's theme.conf). -cp "$(grep -m1 -Po "(?<=^Image=).*" "$HOME/.config/plasma-org.kde.plasma.desktop-appletsrc" | tr -d '"' | tr -d ';')" /usr/share/sddm/wallpaper/image.png +target=/usr/share/sddm/wallpaper/image.png + +# Only the user of the seat's active session copies: each copy wakes the path +# unit of every other logged-in user, and two different wallpapers would copy +# over each other without end. +session=$(loginctl show-seat seat0 --property=ActiveSession --value) +[[ -n $session && $(loginctl show-session "$session" --property=User --value) == "$UID" ]] || exit 0 + +image=$(grep -m1 -Po '(?<=^Image=).*' "$HOME/.config/plasma-org.kde.plasma.desktop-appletsrc") +image=${image//[\";]/} +if [[ $image == file://* ]]; then + # Qt keeps %, # and ? percent-encoded in a file URL. + image=${image#file://} + image=${image//\\/\\\\} + printf -v image '%b' "${image//%/\\x}" +fi +# A wallpaper package holds one image per resolution; take the largest file. +if [[ -d $image ]]; then + image=$(ls -S "$image"/contents/images/* 2>/dev/null | head -n1) +fi +# A plain color or a slideshow has no image. +[[ -f $image ]] || exit 0 + +# The path unit also watches the target, so an upgrade that restores the +# default image has it replaced again. +cmp -s "$image" "$target" || cp "$image" "$target"