diff --git a/bin/omarchy-menu b/bin/omarchy-menu index 7dac2416..69d042d5 100755 --- a/bin/omarchy-menu +++ b/bin/omarchy-menu @@ -566,14 +566,15 @@ show_about() { } show_system_menu() { - local options=" Lock\n󱄄 Screensaver" + local options="󱄄 Screensaver\n Lock\n󰍃 Logout" [[ -f ~/.local/state/omarchy/toggles/suspend-on ]] && options="$options\n󰒲 Suspend" omarchy-hibernation-available && options="$options\n󰤁 Hibernate" options="$options\n󰜉 Restart\n󰐥 Shutdown" case $(menu "System" "$options") in - *Lock*) omarchy-lock-screen ;; *Screensaver*) omarchy-launch-screensaver force ;; + *Lock*) omarchy-lock-screen ;; + *Logout*) omarchy-system-logout ;; *Suspend*) systemctl suspend ;; *Hibernate*) systemctl hibernate ;; *Restart*) omarchy-cmd-reboot ;; diff --git a/bin/omarchy-system-logout b/bin/omarchy-system-logout new file mode 100755 index 00000000..bf70b861 --- /dev/null +++ b/bin/omarchy-system-logout @@ -0,0 +1,11 @@ +#!/bin/bash + +# Logout command that first closes all application windows (thus giving them a chance to save state), +# then stops the session, returning to the SDDM login screen. + +# Schedule the session stop after closing windows (detached from terminal) +nohup bash -c "sleep 2 && uwsm stop" >/dev/null 2>&1 & + +# Now close all windows +omarchy-hyprland-window-close-all +sleep 1 # Allow apps like Chrome to shutdown correctly diff --git a/default/sddm/omarchy/Main.qml b/default/sddm/omarchy/Main.qml new file mode 100644 index 00000000..a95d6d5d --- /dev/null +++ b/default/sddm/omarchy/Main.qml @@ -0,0 +1,90 @@ +import QtQuick 2.0 +import SddmComponents 2.0 + +Rectangle { + id: root + width: 640 + height: 480 + color: "#000000" + + property string currentUser: userModel.lastUser + + Connections { + target: sddm + function onLoginFailed() { + errorMessage.text = "Login failed" + password.text = "" + password.focus = true + } + function onLoginSucceeded() { + errorMessage.text = "" + } + } + + Column { + anchors.centerIn: parent + spacing: 30 + width: parent.width + + Image { + source: "logo.svg" + width: 500 + height: Math.round(width * sourceSize.height / sourceSize.width) + fillMode: Image.PreserveAspectFit + anchors.horizontalCenter: parent.horizontalCenter + } + + Row { + anchors.horizontalCenter: parent.horizontalCenter + spacing: 10 + + Text { + text: "\uf023" + color: "#ffffff" + font.family: "JetBrainsMono NF" + font.pixelSize: 16 + anchors.verticalCenter: parent.verticalCenter + } + + Rectangle { + width: 250 + height: 32 + color: "#000000" + border.color: "#ffffff" + border.width: 1 + + TextInput { + id: password + anchors.fill: parent + anchors.margins: 6 + verticalAlignment: TextInput.AlignVCenter + echoMode: TextInput.Password + font.family: "JetBrainsMono NF" + font.pixelSize: 14 + font.letterSpacing: 3 + passwordCharacter: "\u2022" + color: "#ffffff" + focus: true + + Keys.onPressed: { + if (event.key === Qt.Key_Return || event.key === Qt.Key_Enter) { + sddm.login(root.currentUser, password.text, sessionModel.lastIndex) + event.accepted = true + } + } + } + } + } + + Text { + id: errorMessage + text: "" + color: "#f7768e" + font.family: "JetBrainsMono NF" + font.pixelSize: 12 + anchors.horizontalCenter: parent.horizontalCenter + } + } + + Component.onCompleted: password.forceActiveFocus() +} diff --git a/default/sddm/omarchy/logo.svg b/default/sddm/omarchy/logo.svg new file mode 100644 index 00000000..0853b047 --- /dev/null +++ b/default/sddm/omarchy/logo.svg @@ -0,0 +1 @@ + diff --git a/default/sddm/omarchy/metadata.desktop b/default/sddm/omarchy/metadata.desktop new file mode 100644 index 00000000..7d07c7e4 --- /dev/null +++ b/default/sddm/omarchy/metadata.desktop @@ -0,0 +1,6 @@ +[SddmGreeterTheme] +Name=Omarchy +Description=Minimal terminal-style login theme matching the Limine bootloader aesthetic +Author=Omarchy +Type=sddm-theme +Version=1.0 diff --git a/default/sddm/omarchy/theme.conf b/default/sddm/omarchy/theme.conf new file mode 100644 index 00000000..e94cbbd3 --- /dev/null +++ b/default/sddm/omarchy/theme.conf @@ -0,0 +1 @@ +[General] diff --git a/install/login/sddm.sh b/install/login/sddm.sh index 1cbd5d7c..295c9a22 100644 --- a/install/login/sddm.sh +++ b/install/login/sddm.sh @@ -1,5 +1,8 @@ sudo mkdir -p /etc/sddm.conf.d +# Install omarchy SDDM theme +sudo cp -r $OMARCHY_PATH/default/sddm/omarchy /usr/share/sddm/themes/omarchy + if [[ ! -f /etc/sddm.conf.d/autologin.conf ]]; then cat <