Use the Blob login theme in SDDM
This commit is contained in:
1 parent
008b25147a
commit
53cf9c31fa
9 files changed
+282
-8
No files matched your search
@@ -95,7 +95,7 @@ It runs these steps, in this order, and every one of them is idempotent:
|
|||||||
| 6. User units | installs the session services into `~/.config/systemd/user` and enables them |
|
| 6. User units | installs the session services into `~/.config/systemd/user` and enables them |
|
||||||
| 7. systemd drop-ins | writes the shutdown timeouts, oomd thresholds, plocate prune paths, and sleep hooks under `/etc` |
|
| 7. systemd drop-ins | writes the shutdown timeouts, oomd thresholds, plocate prune paths, and sleep hooks under `/etc` |
|
||||||
| 8. System services | enables NetworkManager, resolved, bluetooth, cups, avahi, docker, power-profiles-daemon, and oomd, masks `NetworkManager-wait-online`, sets the boot splash to `branding/blob_boot.png`, and sets GRUB up with every other installed OS in its menu |
|
| 8. System services | enables NetworkManager, resolved, bluetooth, cups, avahi, docker, power-profiles-daemon, and oomd, masks `NetworkManager-wait-online`, sets the boot splash to `branding/blob_boot.png`, and sets GRUB up with every other installed OS in its menu |
|
||||||
| 9. Login screen | installs the session entry and the SDDM config, enables `sddm.service`, and sets the default target to `graphical.target` |
|
| 9. Login screen | installs the session entry, the SDDM config and the Blob login theme, enables `sddm.service`, and sets the default target to `graphical.target` |
|
||||||
| 10. Reload | reloads systemd, restarts the running user services, and in a running session re-renders the theme, reloads Hyprland, and restarts the Blob shell |
|
| 10. Reload | reloads systemd, restarts the running user services, and in a running session re-renders the theme, reloads Hyprland, and restarts the Blob shell |
|
||||||
| 11. Launch | offers a reboot, or starts the login screen straight away if you decline |
|
| 11. Launch | offers a reboot, or starts the login screen straight away if you decline |
|
||||||
|
|
||||||
|
|||||||
@@ -206,7 +206,7 @@ run_root_transaction() {
|
|||||||
)
|
)
|
||||||
plymouth_default_assets=("${plymouth_theme_assets[@]}" logos/oma.png)
|
plymouth_default_assets=("${plymouth_theme_assets[@]}" logos/oma.png)
|
||||||
sddm_theme_assets=(Main.qml bullet.png entry-failed.png entry.png lock-failed.png lock.png logo.png)
|
sddm_theme_assets=(Main.qml bullet.png entry-failed.png entry.png lock-failed.png lock.png logo.png)
|
||||||
sddm_default_assets=("${sddm_theme_assets[@]}" metadata.desktop theme.conf)
|
sddm_default_assets=(Main.qml metadata.desktop theme.conf)
|
||||||
|
|
||||||
plymouth_assets=()
|
plymouth_assets=()
|
||||||
sddm_assets=()
|
sddm_assets=()
|
||||||
|
|||||||
@@ -0,0 +1,242 @@
|
|||||||
|
import QtQuick
|
||||||
|
|
||||||
|
Rectangle {
|
||||||
|
id: root
|
||||||
|
|
||||||
|
readonly property color backgroundColor: "#1a1b26"
|
||||||
|
readonly property color textColor: "#ffffff"
|
||||||
|
readonly property color errorColor: "#f7768e"
|
||||||
|
readonly property string fontFamily: "monospace"
|
||||||
|
|
||||||
|
property int sessionIndex: sessionModel.lastIndex >= 0 ? sessionModel.lastIndex : 0
|
||||||
|
property string statusMessage: ""
|
||||||
|
property bool loggingIn: false
|
||||||
|
|
||||||
|
width: 1920
|
||||||
|
height: 1080
|
||||||
|
color: root.backgroundColor
|
||||||
|
|
||||||
|
function sessionName(index) {
|
||||||
|
var session = sessionNames.itemAt(index)
|
||||||
|
return session ? session.sessionName : ""
|
||||||
|
}
|
||||||
|
|
||||||
|
function nextSession() {
|
||||||
|
if (sessionNames.count > 0) root.sessionIndex = (root.sessionIndex + 1) % sessionNames.count
|
||||||
|
}
|
||||||
|
|
||||||
|
function login() {
|
||||||
|
if (root.loggingIn) return
|
||||||
|
if (usernameInput.text.length === 0) {
|
||||||
|
usernameInput.forceActiveFocus()
|
||||||
|
return
|
||||||
|
}
|
||||||
|
root.loggingIn = true
|
||||||
|
root.statusMessage = ""
|
||||||
|
sddm.login(usernameInput.text, passwordInput.text, root.sessionIndex)
|
||||||
|
}
|
||||||
|
|
||||||
|
Repeater {
|
||||||
|
id: sessionNames
|
||||||
|
model: sessionModel
|
||||||
|
|
||||||
|
Item {
|
||||||
|
required property string name
|
||||||
|
readonly property string sessionName: name
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
Connections {
|
||||||
|
target: sddm
|
||||||
|
|
||||||
|
function onLoginFailed() {
|
||||||
|
root.loggingIn = false
|
||||||
|
root.statusMessage = "Wrong password"
|
||||||
|
passwordInput.text = ""
|
||||||
|
passwordInput.forceActiveFocus()
|
||||||
|
}
|
||||||
|
|
||||||
|
function onLoginSucceeded() {
|
||||||
|
root.statusMessage = ""
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
Column {
|
||||||
|
anchors.centerIn: parent
|
||||||
|
spacing: 28
|
||||||
|
|
||||||
|
Image {
|
||||||
|
id: logo
|
||||||
|
anchors.horizontalCenter: parent.horizontalCenter
|
||||||
|
source: "logo.png"
|
||||||
|
sourceSize.width: 160
|
||||||
|
sourceSize.height: 160
|
||||||
|
fillMode: Image.PreserveAspectFit
|
||||||
|
onStatusChanged: if (status === Image.Error && source.toString().endsWith("logo.png")) source = "logo.svg"
|
||||||
|
}
|
||||||
|
|
||||||
|
Text {
|
||||||
|
anchors.horizontalCenter: parent.horizontalCenter
|
||||||
|
text: Qt.formatTime(clock.now, "HH:mm")
|
||||||
|
color: root.textColor
|
||||||
|
font.family: root.fontFamily
|
||||||
|
font.pixelSize: 56
|
||||||
|
}
|
||||||
|
|
||||||
|
Column {
|
||||||
|
anchors.horizontalCenter: parent.horizontalCenter
|
||||||
|
spacing: 12
|
||||||
|
|
||||||
|
Rectangle {
|
||||||
|
width: 320
|
||||||
|
height: 44
|
||||||
|
radius: 6
|
||||||
|
color: "transparent"
|
||||||
|
border.width: 1
|
||||||
|
border.color: usernameInput.activeFocus ? root.textColor : Qt.rgba(root.textColor.r, root.textColor.g, root.textColor.b, 0.35)
|
||||||
|
|
||||||
|
TextInput {
|
||||||
|
id: usernameInput
|
||||||
|
anchors.fill: parent
|
||||||
|
anchors.leftMargin: 14
|
||||||
|
anchors.rightMargin: 14
|
||||||
|
verticalAlignment: TextInput.AlignVCenter
|
||||||
|
text: userModel.lastUser
|
||||||
|
color: root.textColor
|
||||||
|
font.family: root.fontFamily
|
||||||
|
font.pixelSize: 16
|
||||||
|
clip: true
|
||||||
|
KeyNavigation.tab: passwordInput
|
||||||
|
Keys.onReturnPressed: passwordInput.forceActiveFocus()
|
||||||
|
Keys.onEnterPressed: passwordInput.forceActiveFocus()
|
||||||
|
|
||||||
|
Text {
|
||||||
|
anchors.verticalCenter: parent.verticalCenter
|
||||||
|
visible: usernameInput.text.length === 0
|
||||||
|
text: "Username"
|
||||||
|
color: Qt.rgba(root.textColor.r, root.textColor.g, root.textColor.b, 0.5)
|
||||||
|
font: usernameInput.font
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
Rectangle {
|
||||||
|
width: 320
|
||||||
|
height: 44
|
||||||
|
radius: 6
|
||||||
|
color: "transparent"
|
||||||
|
border.width: 1
|
||||||
|
border.color: root.statusMessage.length > 0 ? root.errorColor
|
||||||
|
: passwordInput.activeFocus ? root.textColor
|
||||||
|
: Qt.rgba(root.textColor.r, root.textColor.g, root.textColor.b, 0.35)
|
||||||
|
|
||||||
|
TextInput {
|
||||||
|
id: passwordInput
|
||||||
|
anchors.fill: parent
|
||||||
|
anchors.leftMargin: 14
|
||||||
|
anchors.rightMargin: 14
|
||||||
|
verticalAlignment: TextInput.AlignVCenter
|
||||||
|
echoMode: TextInput.Password
|
||||||
|
passwordCharacter: "•"
|
||||||
|
color: root.textColor
|
||||||
|
font.family: root.fontFamily
|
||||||
|
font.pixelSize: 16
|
||||||
|
clip: true
|
||||||
|
focus: usernameInput.text.length > 0
|
||||||
|
KeyNavigation.backtab: usernameInput
|
||||||
|
Keys.onReturnPressed: root.login()
|
||||||
|
Keys.onEnterPressed: root.login()
|
||||||
|
|
||||||
|
Text {
|
||||||
|
anchors.verticalCenter: parent.verticalCenter
|
||||||
|
visible: passwordInput.text.length === 0
|
||||||
|
text: root.loggingIn ? "Logging in..." : "Password"
|
||||||
|
color: Qt.rgba(root.textColor.r, root.textColor.g, root.textColor.b, 0.5)
|
||||||
|
font.family: root.fontFamily
|
||||||
|
font.pixelSize: 16
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
Text {
|
||||||
|
anchors.horizontalCenter: parent.horizontalCenter
|
||||||
|
height: 20
|
||||||
|
text: root.statusMessage
|
||||||
|
color: root.errorColor
|
||||||
|
font.family: root.fontFamily
|
||||||
|
font.pixelSize: 14
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
Row {
|
||||||
|
anchors.left: parent.left
|
||||||
|
anchors.bottom: parent.bottom
|
||||||
|
anchors.margins: 24
|
||||||
|
|
||||||
|
Text {
|
||||||
|
text: "Session: " + root.sessionName(root.sessionIndex)
|
||||||
|
color: root.textColor
|
||||||
|
opacity: sessionArea.containsMouse ? 1 : 0.6
|
||||||
|
font.family: root.fontFamily
|
||||||
|
font.pixelSize: 14
|
||||||
|
|
||||||
|
MouseArea {
|
||||||
|
id: sessionArea
|
||||||
|
anchors.fill: parent
|
||||||
|
hoverEnabled: true
|
||||||
|
cursorShape: Qt.PointingHandCursor
|
||||||
|
onClicked: root.nextSession()
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
Row {
|
||||||
|
anchors.right: parent.right
|
||||||
|
anchors.bottom: parent.bottom
|
||||||
|
anchors.margins: 24
|
||||||
|
spacing: 24
|
||||||
|
|
||||||
|
Repeater {
|
||||||
|
model: [
|
||||||
|
{ label: "Reboot", available: sddm.canReboot, action: "reboot" },
|
||||||
|
{ label: "Shut down", available: sddm.canPowerOff, action: "powerOff" }
|
||||||
|
]
|
||||||
|
|
||||||
|
Text {
|
||||||
|
required property var modelData
|
||||||
|
visible: modelData.available
|
||||||
|
text: modelData.label
|
||||||
|
color: root.textColor
|
||||||
|
opacity: powerArea.containsMouse ? 1 : 0.6
|
||||||
|
font.family: root.fontFamily
|
||||||
|
font.pixelSize: 14
|
||||||
|
|
||||||
|
MouseArea {
|
||||||
|
id: powerArea
|
||||||
|
anchors.fill: parent
|
||||||
|
hoverEnabled: true
|
||||||
|
cursorShape: Qt.PointingHandCursor
|
||||||
|
onClicked: modelData.action === "reboot" ? sddm.reboot() : sddm.powerOff()
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
QtObject {
|
||||||
|
id: clock
|
||||||
|
property date now: new Date()
|
||||||
|
}
|
||||||
|
|
||||||
|
Timer {
|
||||||
|
interval: 1000
|
||||||
|
running: true
|
||||||
|
repeat: true
|
||||||
|
onTriggered: clock.now = new Date()
|
||||||
|
}
|
||||||
|
|
||||||
|
Component.onCompleted: {
|
||||||
|
if (usernameInput.text.length > 0) passwordInput.forceActiveFocus()
|
||||||
|
else usernameInput.forceActiveFocus()
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,10 @@
|
|||||||
|
[SddmGreeterTheme]
|
||||||
|
Name=Blob
|
||||||
|
Description=Blob login screen
|
||||||
|
Type=sddm-theme
|
||||||
|
Version=1.0
|
||||||
|
MainScript=Main.qml
|
||||||
|
ConfigFile=theme.conf
|
||||||
|
QtVersion=6
|
||||||
|
Theme-Id=blob
|
||||||
|
Theme-API=2.0
|
||||||
@@ -0,0 +1,3 @@
|
|||||||
|
[General]
|
||||||
|
type=color
|
||||||
|
color=#1a1b26
|
||||||
@@ -5,7 +5,7 @@ DisplayServer=wayland
|
|||||||
CompositorCommand=start-hyprland -- --config /etc/sddm/hyprland-greeter.lua
|
CompositorCommand=start-hyprland -- --config /etc/sddm/hyprland-greeter.lua
|
||||||
|
|
||||||
[Theme]
|
[Theme]
|
||||||
Current=
|
Current=blob
|
||||||
|
|
||||||
[Autologin]
|
[Autologin]
|
||||||
User=
|
User=
|
||||||
|
|||||||
+4
-3
@@ -126,7 +126,8 @@ with `--check`.
|
|||||||
| File | Why |
|
| File | Why |
|
||||||
| --- | --- |
|
| --- | --- |
|
||||||
| `/usr/local/share/wayland-sessions/blob.desktop` | the session SDDM offers |
|
| `/usr/local/share/wayland-sessions/blob.desktop` | the session SDDM offers |
|
||||||
| `/etc/sddm.conf.d/zz-blob.conf` | Wayland greeter, run on Hyprland, stock theme, remember the last session |
|
| `/etc/sddm.conf.d/zz-blob.conf` | Wayland greeter, run on Hyprland, Blob theme, remember the last session |
|
||||||
|
| `/usr/share/sddm/themes/blob/` | the Blob login screen, from `default/sddm/blob/` and `branding/blob_icon.svg` |
|
||||||
| `/etc/sddm/hyprland-greeter.lua` | the greeter's own tiny Hyprland config |
|
| `/etc/sddm/hyprland-greeter.lua` | the greeter's own tiny Hyprland config |
|
||||||
| `/usr/local/bin/blob-hw-gpu-accelerated` | the renderer check that config runs, where SDDM's user can read it |
|
| `/usr/local/bin/blob-hw-gpu-accelerated` | the renderer check that config runs, where SDDM's user can read it |
|
||||||
| `/etc/pam.d/blob-lock-password` | the PAM stack the lock screen authenticates against |
|
| `/etc/pam.d/blob-lock-password` | the PAM stack the lock screen authenticates against |
|
||||||
@@ -145,8 +146,8 @@ with `--check`.
|
|||||||
The `zz-` prefix is load-bearing. SDDM reads `/etc/sddm.conf.d` in
|
The `zz-` prefix is load-bearing. SDDM reads `/etc/sddm.conf.d` in
|
||||||
alphabetical order and the last file wins, so a leftover `10-wayland.conf`,
|
alphabetical order and the last file wins, so a leftover `10-wayland.conf`,
|
||||||
`10-theme.conf` or `autologin.conf` from another desktop would otherwise
|
`10-theme.conf` or `autologin.conf` from another desktop would otherwise
|
||||||
override Blob's. For the same reason `zz-blob.conf` blanks `Theme` and
|
override Blob's. For the same reason `zz-blob.conf` pins `Theme` to `blob`
|
||||||
`Autologin`: a greeter pointed at an uninstalled theme, or an autologin
|
and blanks `Autologin`: a greeter pointed at an uninstalled theme, or an autologin
|
||||||
pointed at a session entry that no longer exists, leaves SDDM on a black
|
pointed at a session entry that no longer exists, leaves SDDM on a black
|
||||||
screen it never falls back from, and the only way in is a TTY.
|
screen it never falls back from, and the only way in is a TTY.
|
||||||
|
|
||||||
|
|||||||
+16
-2
@@ -9,12 +9,15 @@ greeter_compositor_config=/etc/sddm/hyprland-greeter.lua
|
|||||||
blob_greeter_conf="$greeter_config_dir/zz-blob.conf"
|
blob_greeter_conf="$greeter_config_dir/zz-blob.conf"
|
||||||
blob_autologin_conf="$greeter_config_dir/zzz-blob-autologin.conf"
|
blob_autologin_conf="$greeter_config_dir/zzz-blob-autologin.conf"
|
||||||
greeter_gpu_detector=/usr/local/bin/blob-hw-gpu-accelerated
|
greeter_gpu_detector=/usr/local/bin/blob-hw-gpu-accelerated
|
||||||
|
greeter_theme_dir=/usr/share/sddm/themes/blob
|
||||||
|
greeter_theme_files=(Main.qml metadata.desktop theme.conf)
|
||||||
|
|
||||||
# SDDM's stock Wayland greeter runs on weston, which Blob does not install.
|
# SDDM's stock Wayland greeter runs on weston, which Blob does not install.
|
||||||
# Point it at Hyprland with a greeter-only config instead. That config is Lua:
|
# Point it at Hyprland with a greeter-only config instead. That config is Lua:
|
||||||
# Hyprland dropped the old hyprlang format, and a config it cannot parse leaves
|
# Hyprland dropped the old hyprlang format, and a config it cannot parse leaves
|
||||||
# the greeter with no compositor and the screen black.
|
# the greeter with no compositor and the screen black.
|
||||||
install_login_config() {
|
install_login_config() {
|
||||||
|
install_greeter_theme
|
||||||
install_root_file "$repo_dir/default/sddm/hyprland-greeter.lua" \
|
install_root_file "$repo_dir/default/sddm/hyprland-greeter.lua" \
|
||||||
"$greeter_compositor_config" "sddm/hyprland-greeter.lua"
|
"$greeter_compositor_config" "sddm/hyprland-greeter.lua"
|
||||||
install_root_file "$repo_dir/default/sddm/zz-blob.conf" \
|
install_root_file "$repo_dir/default/sddm/zz-blob.conf" \
|
||||||
@@ -25,6 +28,16 @@ install_login_config() {
|
|||||||
/etc/pam.d/blob-lock-password "pam.d/blob-lock-password"
|
/etc/pam.d/blob-lock-password "pam.d/blob-lock-password"
|
||||||
}
|
}
|
||||||
|
|
||||||
|
install_greeter_theme() {
|
||||||
|
local file
|
||||||
|
for file in "${greeter_theme_files[@]}"; do
|
||||||
|
install_root_file "$repo_dir/default/sddm/blob/$file" \
|
||||||
|
"$greeter_theme_dir/$file" "sddm/themes/blob/$file"
|
||||||
|
done
|
||||||
|
install_root_file "$repo_dir/branding/blob_icon.svg" \
|
||||||
|
"$greeter_theme_dir/logo.svg" "sddm/themes/blob/logo.svg"
|
||||||
|
}
|
||||||
|
|
||||||
install_session_entry() {
|
install_session_entry() {
|
||||||
install_root_file "$repo_dir/session/blob.desktop" \
|
install_root_file "$repo_dir/session/blob.desktop" \
|
||||||
"$session_entry_dir/blob.desktop" "wayland session entry"
|
"$session_entry_dir/blob.desktop" "wayland session entry"
|
||||||
@@ -75,8 +88,9 @@ report_greeter_compositor() {
|
|||||||
say " SDDM cannot draw a greeter without it; it is set in $blob_greeter_conf"
|
say " SDDM cannot draw a greeter without it; it is set in $blob_greeter_conf"
|
||||||
}
|
}
|
||||||
|
|
||||||
# zz-blob.conf blanks Theme and Autologin, so a leftover drop-in cannot point the
|
# zz-blob.conf pins Theme to Blob's own and blanks Autologin, so a leftover
|
||||||
# greeter at a theme that was uninstalled or autolog into a session that no
|
# drop-in cannot point the greeter at a theme that was uninstalled or autolog
|
||||||
|
# into a session that no
|
||||||
# longer exists. Either one leaves SDDM on a black screen it never falls back
|
# longer exists. Either one leaves SDDM on a black screen it never falls back
|
||||||
# from. Report the leftovers anyway: the file is confusing to find later, and the
|
# from. Report the leftovers anyway: the file is confusing to find later, and the
|
||||||
# Omarchy ISO wrote an autologin that no package owns, so it outlives Omarchy.
|
# Omarchy ISO wrote an autologin that no package owns, so it outlives Omarchy.
|
||||||
|
|||||||
@@ -17,6 +17,10 @@ root_files=(
|
|||||||
/etc/sddm.conf.d/10-blob.conf
|
/etc/sddm.conf.d/10-blob.conf
|
||||||
/etc/sddm.conf.d/99-blob-autologin.conf
|
/etc/sddm.conf.d/99-blob-autologin.conf
|
||||||
/etc/sddm/hyprland-greeter.lua
|
/etc/sddm/hyprland-greeter.lua
|
||||||
|
/usr/share/sddm/themes/blob/Main.qml
|
||||||
|
/usr/share/sddm/themes/blob/metadata.desktop
|
||||||
|
/usr/share/sddm/themes/blob/theme.conf
|
||||||
|
/usr/share/sddm/themes/blob/logo.svg
|
||||||
/etc/systemd/system.conf.d/10-blob.conf
|
/etc/systemd/system.conf.d/10-blob.conf
|
||||||
/etc/systemd/system/user@.service.d/10-blob.conf
|
/etc/systemd/system/user@.service.d/10-blob.conf
|
||||||
/etc/systemd/oomd.conf.d/10-blob.conf
|
/etc/systemd/oomd.conf.d/10-blob.conf
|
||||||
|
|||||||
Reference in new issue
Block a user