Skip to content
This repository has been archived by the owner on Sep 6, 2024. It is now read-only.

Commit

Permalink
(wuzetka) add sddm theme & fonts
Browse files Browse the repository at this point in the history
  • Loading branch information
sneexy-boi committed Feb 16, 2024
1 parent b490119 commit ab22975
Show file tree
Hide file tree
Showing 20 changed files with 1,302 additions and 0 deletions.
1 change: 1 addition & 0 deletions config/common/sneexy/fonts.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ fonts:
- JetBrainsMono
- NerdFontsSymbolsOnly
google-fonts:
- Atkinson Hyperlegible
- Lexend
- Noto Sans
- Roboto
Expand Down
4 changes: 4 additions & 0 deletions config/common/sneexy/rpm-ostree.yml
Original file line number Diff line number Diff line change
Expand Up @@ -59,11 +59,15 @@ install:
# libraries
- qt5-qtwayland
- qt6-qtwayland
- qt5-qtsvg
- qt5-qtquickcontrols2
- qt5-qtgraphicaleffects
- gnome-themes-extra
- kdepim
- kdepim-addons
- translate-shell
- lzip
- fontconfig

# themes
- papirus-icon-theme
Expand Down
10 changes: 10 additions & 0 deletions config/files/sneexy/usr/etc/sddm.conf.d/10-wayland.conf
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
# Sets the display server to wayland instead of xorg
[General]
DisplayServer=wayland
# uses kwin_wayland as a compositor for sddm instead of sway,
# drm mode for rendering,
# disables lock-screen as we are not logged in yet,
# disables global shortcuts to make sure user shortcuts are not inherited for security reasons
# and uses the system locale as opposed to the user's locale
[Wayland]
CompositorCommand=kwin_wayland --drm --no-lockscreen --no-global-shortcuts --locale1
2 changes: 2 additions & 0 deletions config/files/sneexy/usr/etc/sddm.conf.d/20-theme.conf
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
[Theme]
Current=corners
38 changes: 38 additions & 0 deletions config/files/sneexy/usr/share/sddm/themes/corners/Main.qml
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
import QtQuick 2.15
import QtQuick.Controls 2.15
import QtQuick.Window 2.15

import "./components"

Rectangle {
id: root

height: Screen.height
width: Screen.width

Image {
anchors { fill: parent }

source: config.BgSource
fillMode: Image.PreserveAspectCrop
clip: true
}

Item {
anchors {
fill: parent
margins: config.Padding
}

DateTimePanel {
anchors {
top: parent.top
right: parent.right
}
}

LoginPanel {
anchors { fill: parent }
}
}
}
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Original file line number Diff line number Diff line change
@@ -0,0 +1,62 @@
import QtQuick 2.15
import QtQuick.Controls 2.15

Column {
spacing: config.DateTimeSpacing

Component.onCompleted: {
timeLabel.updateTime();
dateLabel.updateDate();
}

Text {
id: dateLabel

function updateDate() {
text = new Date().toLocaleDateString(Qt.locale(), config.DateFormat);
}

font {
family: config.FontFamily
pointSize: config.DateSize
bold: config.DateIsBold === "true"
}

anchors { right: parent.right }

opacity: config.DateOpacity
renderType: Text.NativeRendering
color: config.DateColor
}

Text {
id: timeLabel

function updateTime() {
text = new Date().toLocaleTimeString(Qt.locale(), config.TimeFormat);
}

font {
family: config.FontFamily
pointSize: config.TimeSize
bold: config.TimeIsBold === "true"
}

anchors { right: parent.right }

opacity: config.TimeOpacity
renderType: Text.NativeRendering
color: config.TimeColor
}

Timer {
interval: 1000
repeat: true
running: true

onTriggered: {
timeLabel.updateTime();
dateLabel.updateDate();
}
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,169 @@
import QtQuick 2.15
import QtQuick.Controls 2.15
import QtQuick.Window 2.15

Item {
property string user: userPanel.username
property string password: passwordField.text
property int session: sessionPanel.session
property double inputHeight: Screen.height * 0.175 * 0.25 * config.Scale
property double inputWidth: Screen.width * 0.175 * config.Scale

Column {
spacing: 8

anchors {
bottom: parent.bottom
left: parent.left
}

PowerPanel {}
SessionPanel { id: sessionPanel }
}

Column {
spacing: 8
width: inputWidth

anchors {
bottom: parent.bottom
right: parent.right
}

UserPanel { id: userPanel }

PasswordPanel {
id: passwordField

height: inputHeight
width: parent.width
onAccepted: loginButton.clicked();
}

Button {
id: loginButton

height: inputHeight
width: parent.width
enabled: user !== "" && password !== ""
hoverEnabled: true

onClicked: {
sddm.login(user, password, session);
}

states: [
State {
name: "pressed"
when: loginButton.down

PropertyChanges {
target: buttonBackground
color: Qt.darker(config.LoginButtonColor, 1.4)
opacity: 1
}

PropertyChanges {
target: buttonText
opacity: 1
}
},
State {
name: "hovered"
when: loginButton.hovered

PropertyChanges {
target: buttonBackground
color: Qt.darker(config.LoginButtonColor, 1.2)
opacity: 1
}

PropertyChanges {
target: buttonText
opacity: 1
}
},
State {
name: "enabled"
when: loginButton.enabled

PropertyChanges {
target: buttonBackground
opacity: 1
}

PropertyChanges {
target: buttonText
opacity: 1
}
}
]

Rectangle {
id: loginAnim

radius: parent.width / 2
anchors {centerIn: loginButton }
color: "black"
opacity: 1

NumberAnimation {
id: coverScreen

target: loginAnim
properties: "height, width"
from: 0
to: root.width * 2
duration: 1000
easing.type: Easing.InExpo
}
}

contentItem: Text {
id: buttonText

font {
family: config.FontFamily
pointSize: config.FontSize
bold: true
}

text: config.LoginButtonText
horizontalAlignment: Text.AlignHCenter
verticalAlignment: Text.AlignVCenter

opacity: 0.5
renderType: Text.NativeRendering
color: config.LoginButtonTextColor
}

background: Rectangle {
id: buttonBackground

color: config.LoginButtonColor
opacity: 0.5
radius: config.Radius
}

transitions: Transition {
PropertyAnimation {
properties: "color, opacity"
duration: 150
}
}
}
}

Connections {
function onLoginSucceeded() {
coverScreen.start();
}

function onLoginFailed() {
passwordField.text = "";
passwordField.focus = true;
}

target: sddm
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,65 @@
import QtQuick 2.15
import QtQuick.Controls 2.15

TextField {
id: passwordField

focus: true
selectByMouse: true
echoMode: config.HidePassword === "true" ? TextInput.Password : TextInput.Normal
passwordCharacter: ""

font {
family: config.FontFamily
pointSize: config.FontSize
bold: true
}

placeholderText: config.PassPlaceholderText
horizontalAlignment: TextInput.AlignHCenter

color: config.InputTextColor
selectionColor: config.InputTextColor
renderType: Text.NativeRendering

states: [
State {
name: "focused"
when: passwordField.activeFocus

PropertyChanges {
target: passFieldBg
color: Qt.darker(config.InputColor, 1.2)
border.width: config.InputBorderWidth
}
},
State {
name: "hovered"
when: passwordField.hovered

PropertyChanges {
target: passFieldBg
color: Qt.darker(config.InputColor, 1.2)
}
}
]

background: Rectangle {
id: passFieldBg

border {
color: config.InputBorderColor
width: 0
}

color: config.InputColor
radius: config.Radius
}

transitions: Transition {
PropertyAnimation {
properties: "color, border.width"
duration: 150
}
}
}
Loading

0 comments on commit ab22975

Please sign in to comment.