Add Logout to system menu and style the SDDM login screen
This commit is contained in:
+3
-2
@@ -566,14 +566,15 @@ show_about() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
show_system_menu() {
|
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"
|
[[ -f ~/.local/state/omarchy/toggles/suspend-on ]] && options="$options\n Suspend"
|
||||||
omarchy-hibernation-available && options="$options\n Hibernate"
|
omarchy-hibernation-available && options="$options\n Hibernate"
|
||||||
options="$options\n Restart\n Shutdown"
|
options="$options\n Restart\n Shutdown"
|
||||||
|
|
||||||
case $(menu "System" "$options") in
|
case $(menu "System" "$options") in
|
||||||
*Lock*) omarchy-lock-screen ;;
|
|
||||||
*Screensaver*) omarchy-launch-screensaver force ;;
|
*Screensaver*) omarchy-launch-screensaver force ;;
|
||||||
|
*Lock*) omarchy-lock-screen ;;
|
||||||
|
*Logout*) omarchy-system-logout ;;
|
||||||
*Suspend*) systemctl suspend ;;
|
*Suspend*) systemctl suspend ;;
|
||||||
*Hibernate*) systemctl hibernate ;;
|
*Hibernate*) systemctl hibernate ;;
|
||||||
*Restart*) omarchy-cmd-reboot ;;
|
*Restart*) omarchy-cmd-reboot ;;
|
||||||
|
|||||||
Executable
+11
@@ -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
|
||||||
@@ -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()
|
||||||
|
}
|
||||||
@@ -0,0 +1 @@
|
|||||||
|
<svg fill="none" height="285" viewBox="0 0 1215 285" width="1215" xmlns="http://www.w3.org/2000/svg"><g fill="#9ece6a"><path clip-rule="evenodd" d="m720 120h-15v15h-14.998v14.999l-60.002.001v15.002l90-.002v.002h.002l-.002 89.998h-15v15h-13v15h-17v-89.998h-45v90l-45-.002v-89.998h-14.998v-30h14.998v-15.002h-14.998v-30.001h14.998v-75h15v-14.997h15v-15.002h105.002zm-90-.001h45v-74.997h-45z" fill-rule="evenodd"/><path clip-rule="evenodd" d="m105 30.002h15v14.997h15v180.001h-15v15h-15v15.002h-75v-15.002h-15v-15h-15v-180.001h15v-14.997h15v-15.002h75zm-60 194.998h45v-179.998h-45z" fill-rule="evenodd"/><path d="m300 15h60v15h15v14.999h15v180.001h-15v15h-15v15h-15l-.004-209.998h-44.994v-.002h-.002v210.002h-45v-210h-44.998v179.997h-.002v30.003h-15v-15.002h-15v-15h-14.998v-180.001h14.998v-14.999h15v-15h60v-15h45z"/><path clip-rule="evenodd" d="m555 225h-15v15h-15v15h-15v-105.001l-44.998.001v105.002h-45.002v-105.002h-15v-30.001h15v-75h15.002v-14.997h15v-15.002h105zm-89.998-105.001h44.998v-74.997h-44.998z" fill-rule="evenodd"/><path d="m885 75h-15v15h-15v15h-15v-59.998h-45v179.998h45v-59.998h15v14.997h15v15.001h15v30h-15v15h-15v15.002l-105-.002v-210.001h14.998v-14.997h15.002v-15.002h105z"/><path d="m960 119.999h45v-104.999h15v15h15v14.999h15v75.001h15v15h-15v90h-15v15h-15v15h-15v-105h-45v105.002l-45-.002v-105h-30v-15h15v-15.001h15v-75h15v-14.997h15v-15.002h15z"/><path d="m1125 119.999h45v-104.999h15v15h15v15h15v180h-15v15h-15v15.002l-75-.002v-15h-15v-15h-15v-45.001h15v-14.997-.002h30v60h45v-75h-90v-105.001h15v-14.997h15v-15.002h15z"/></g></svg>
|
||||||
|
After Width: | Height: | Size: 1.5 KiB |
@@ -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
|
||||||
@@ -0,0 +1 @@
|
|||||||
|
[General]
|
||||||
@@ -1,5 +1,8 @@
|
|||||||
sudo mkdir -p /etc/sddm.conf.d
|
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
|
if [[ ! -f /etc/sddm.conf.d/autologin.conf ]]; then
|
||||||
cat <<EOF | sudo tee /etc/sddm.conf.d/autologin.conf
|
cat <<EOF | sudo tee /etc/sddm.conf.d/autologin.conf
|
||||||
[Autologin]
|
[Autologin]
|
||||||
@@ -7,7 +10,7 @@ User=$USER
|
|||||||
Session=hyprland-uwsm
|
Session=hyprland-uwsm
|
||||||
|
|
||||||
[Theme]
|
[Theme]
|
||||||
Current=breeze
|
Current=omarchy
|
||||||
EOF
|
EOF
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
|||||||
@@ -0,0 +1,7 @@
|
|||||||
|
echo "Add Logout option to system menu"
|
||||||
|
|
||||||
|
sudo cp -r $OMARCHY_PATH/default/sddm/omarchy /usr/share/sddm/themes/omarchy
|
||||||
|
|
||||||
|
if [[ -f /etc/sddm.conf.d/autologin.conf ]]; then
|
||||||
|
sudo sed -i 's/^Current=.*/Current=omarchy/' /etc/sddm.conf.d/autologin.conf
|
||||||
|
fi
|
||||||
Reference in New Issue
Block a user