Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions debian/compat
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
12
5 changes: 3 additions & 2 deletions debian/control
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
Source: lingmo-core
Section: devel
Priority: optional
Maintainer: LingmoOS <team@lingmo.org>
Maintainer: Lingmo OS Team <team@lingmo.org>

Build-Depends: cmake,
debhelper-compat (= 13),
extra-cmake-modules,
Expand Down Expand Up @@ -64,4 +65,4 @@ Depends: accountsservice,
appmenu-gtk3-module,
${misc:Depends},
${shlibs:Depends}
Description: LingmoOS System Components
Description: Lingmo OS System Components
128 changes: 128 additions & 0 deletions polkit-agent/Button.qml
Original file line number Diff line number Diff line change
@@ -0,0 +1,128 @@
import QtQuick 2.12
import QtQuick.Templates 2.12 as T
import QtGraphicalEffects 1.0
import LingmoUI 1.0 as LingmoUI
import QtQuick.Controls.impl 2.12

T.Button {
id: control
implicitWidth: Math.max(background.implicitWidth, contentItem.implicitWidth + LingmoUI.Units.largeSpacing)
implicitHeight: background.implicitHeight
hoverEnabled: true

icon.width: LingmoUI.Units.iconSizes.small
icon.height: LingmoUI.Units.iconSizes.small

icon.color: control.enabled ? (control.highlighted ? control.LingmoUI.Theme.highlightColor : control.LingmoUI.Theme.textColor) : control.LingmoUI.Theme.disabledTextColor
spacing: LingmoUI.Units.smallSpacing

// property color hoveredColor: LingmoUI.Theme.darkMode ? Qt.lighter(LingmoUI.Theme.alternateBackgroundColor, 1.2)
// : Qt.darker(LingmoUI.Theme.alternateBackgroundColor, 1.1)

// property color pressedColor: LingmoUI.Theme.darkMode ? Qt.lighter(LingmoUI.Theme.alternateBackgroundColor, 1.1)
// : Qt.darker(LingmoUI.Theme.alternateBackgroundColor, 1.2)

property color hoveredColor: Qt.tint(LingmoUI.Theme.textColor, Qt.rgba(LingmoUI.Theme.backgroundColor.r,
LingmoUI.Theme.backgroundColor.g,
LingmoUI.Theme.backgroundColor.b, 0.9))
property color pressedColor: Qt.tint(LingmoUI.Theme.textColor, Qt.rgba(LingmoUI.Theme.backgroundColor.r,
LingmoUI.Theme.backgroundColor.g,
LingmoUI.Theme.backgroundColor.b, 0.8))


// property color borderColor: Qt.rgba(LingmoUI.Theme.highlightColor.r,
// LingmoUI.Theme.highlightColor.g,
// LingmoUI.Theme.highlightColor.b, 0.5)

// property color flatHoveredColor: Qt.rgba(LingmoUI.Theme.highlightColor.r,
// LingmoUI.Theme.highlightColor.g,
// LingmoUI.Theme.highlightColor.b, 0.2)
// property color flatPressedColor: Qt.rgba(LingmoUI.Theme.highlightColor.r,
// LingmoUI.Theme.highlightColor.g,
// LingmoUI.Theme.highlightColor.b, 0.25)

property color flatHoveredColor: Qt.lighter(LingmoUI.Theme.highlightColor, 1.1)
property color flatPressedColor: Qt.darker(LingmoUI.Theme.highlightColor, 1.1)

contentItem: IconLabel {
text: control.text
font: control.font
icon: control.icon
color: !control.enabled ? control.LingmoUI.Theme.disabledTextColor : control.flat ? LingmoUI.Theme.highlightedTextColor : LingmoUI.Theme.textColor
spacing: control.spacing
mirrored: control.mirrored
display: control.display
alignment: Qt.AlignCenter
}

background: Item {
implicitWidth: (LingmoUI.Units.iconSizes.medium * 3) + LingmoUI.Units.largeSpacing
implicitHeight: LingmoUI.Units.iconSizes.medium + LingmoUI.Units.smallSpacing

Rectangle {
id: _flatBackground
anchors.fill: parent
radius: LingmoUI.Theme.mediumRadius
border.width: 1
border.color: control.enabled ? control.activeFocus ? LingmoUI.Theme.highlightColor : "transparent"
: "transparent"
visible: control.flat


color: {
if (!control.enabled)
return LingmoUI.Theme.alternateBackgroundColor

if (control.pressed)
return control.flatPressedColor

if (control.hovered)
return control.flatHoveredColor

return Qt.rgba(LingmoUI.Theme.highlightColor.r,
LingmoUI.Theme.highlightColor.g,
LingmoUI.Theme.highlightColor.b, 0.1)
}

gradient: Gradient {
orientation: Gradient.Vertical
GradientStop { position: 0.0; color: Qt.rgba(_flatBackground.color.r,
_flatBackground.color.g,
_flatBackground.color.b, 0.85) }
GradientStop { position: 1.0; color: Qt.rgba(_flatBackground.color.r,
_flatBackground.color.g,
_flatBackground.color.b, 1) }
}

// Behavior on color {
// ColorAnimation {
// duration: 200
// easing.type: Easing.Linear
// }
// }
}

Rectangle {
id: _background
anchors.fill: parent
radius: LingmoUI.Theme.hugeRadius
border.width: 1
visible: !control.flat
border.color: control.enabled ? control.activeFocus ? LingmoUI.Theme.highlightColor : "transparent"
: "transparent"

color: {
if (!control.enabled)
return LingmoUI.Theme.alternateBackgroundColor

if (control.pressed)
return control.pressedColor

if (control.hovered)
return control.hoveredColor

return LingmoUI.Theme.alternateBackgroundColor
}
}
}
}
91 changes: 91 additions & 0 deletions polkit-agent/TextField.qml
Original file line number Diff line number Diff line change
@@ -0,0 +1,91 @@
import QtQuick 2.6
import QtQuick.Window 2.1
import QtQuick.Controls 2.3 as Controls
import QtQuick.Templates 2.3 as T
import LingmoUI 1.0 as LingmoUI

T.TextField {
id: control

implicitWidth: Math.max(200,
placeholderText ? placeholder.implicitWidth + leftPadding + rightPadding : 0)
|| contentWidth + leftPadding + rightPadding + LingmoUI.Units.extendBorderWidth
implicitHeight: Math.max(contentHeight + topPadding + bottomPadding,
background ? background.implicitHeight : 0,
placeholder.implicitHeight + topPadding + bottomPadding + LingmoUI.Units.extendBorderWidth)

// padding: 6
leftPadding: LingmoUI.Units.smallSpacing + LingmoUI.Units.extendBorderWidth
rightPadding: LingmoUI.Units.smallSpacing + LingmoUI.Units.extendBorderWidth

//Text.NativeRendering is broken on non integer pixel ratios
// renderType: Window.devicePixelRatio % 1 !== 0 ? Text.QtRendering : Text.NativeRendering
renderType: LingmoUI.Theme.renderType

color: control.enabled ? LingmoUI.Theme.textColor : LingmoUI.Theme.disabledTextColor
selectionColor: LingmoUI.Theme.highlightColor
selectedTextColor: LingmoUI.Theme.highlightedTextColor
selectByMouse: true

horizontalAlignment: Text.AlignLeft
verticalAlignment: TextInput.AlignVCenter

opacity: control.enabled ? 1.0 : 0.5

// cursorDelegate: CursorDelegate { }

Controls.Label {
id: placeholder
x: control.leftPadding
y: control.topPadding
width: control.width - (control.leftPadding + control.rightPadding)
height: control.height - (control.topPadding + control.bottomPadding)

text: control.placeholderText
font: control.font
color: LingmoUI.Theme.textColor
opacity: 0.4
horizontalAlignment: Text.AlignLeft
verticalAlignment: control.verticalAlignment
visible: !control.length && !control.preeditText && (!control.activeFocus || control.horizontalAlignment !== Qt.AlignHCenter)
elide: Text.ElideRight
wrapMode: Text.NoWrap
}

background: Rectangle {
implicitWidth: (LingmoUI.Units.iconSizes.medium * 3) + LingmoUI.Units.smallSpacing + LingmoUI.Units.extendBorderWidth
implicitHeight: LingmoUI.Units.iconSizes.medium + LingmoUI.Units.smallSpacing + LingmoUI.Units.extendBorderWidth
// color: control.activeFocus ? Qt.lighter(LingmoUI.Theme.backgroundColor, 1.4) : LingmoUI.Theme.backgroundColor
color: LingmoUI.Theme.alternateBackgroundColor
radius: LingmoUI.Theme.smallRadius

border.width: 1
border.color: control.activeFocus ? LingmoUI.Theme.highlightColor : LingmoUI.Theme.alternateBackgroundColor

// Rectangle {
// id: _border
// anchors.fill: parent
// color: "transparent"
// border.color: control.activeFocus ? Qt.rgba(LingmoUI.Theme.highlightColor.r,
// LingmoUI.Theme.highlightColor.g,
// LingmoUI.Theme.highlightColor.b, 0.2) : "transparent"
// border.width: LingmoUI.Units.extendBorderWidth
// radius: LingmoUI.Theme.smallRadius + LingmoUI.Units.extendBorderWidth

// Behavior on border.color {
// ColorAnimation {
// duration: 50
// }
// }
// }

// Rectangle {
// anchors.fill: parent
// anchors.margins: LingmoUI.Units.extendBorderWidth
// radius: LingmoUI.Theme.smallRadius
// color: LingmoUI.Theme.backgroundColor
// border.color: control.activeFocus ? LingmoUI.Theme.highlightColor : Qt.tint(LingmoUI.Theme.textColor, Qt.rgba(LingmoUI.Theme.backgroundColor.r, LingmoUI.Theme.backgroundColor.g, LingmoUI.Theme.backgroundColor.b, 0.7))
// border.width: 1
// }
}
}
2 changes: 1 addition & 1 deletion polkit-agent/dialog.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -79,4 +79,4 @@ void Dialog::show()
void Dialog::authenticationFailure()
{
emit failure();
}
}
1 change: 1 addition & 0 deletions polkit-agent/main.qml
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import QtQuick 2.12
import QtQuick.Controls 2.5
import QtQuick.Layouts 1.3
import "./"
import LingmoUI.Compatible 3.0 as LingmoUI

Item {
Expand Down
2 changes: 2 additions & 0 deletions polkit-agent/qml.qrc
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
<RCC>
<qresource prefix="/">
<file>main.qml</file>
<file>Button.qml</file>
<file>TextField.qml</file>
<file>svg/emblem-warning.svg</file>
</qresource>
</RCC>
2 changes: 1 addition & 1 deletion session/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -41,4 +41,4 @@ target_link_libraries(${TARGET}
)

install(TARGETS ${TARGET} DESTINATION ${CMAKE_INSTALL_BINDIR})
install(FILES lingmo-xsession.desktop DESTINATION ${CMAKE_INSTALL_DATAROOTDIR}/xsessions/)
# install(FILES lingmo-xsession.desktop DESTINATION ${CMAKE_INSTALL_DATAROOTDIR}/xsessions/)
36 changes: 33 additions & 3 deletions session/processmanager.cpp
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright (C) 2023-2024 Lingmo OS Team.
* Copyright (C) 2023-2025 Lingmo OS Team.
*/

#include "processmanager.h"
Expand All @@ -17,6 +17,8 @@

#include <QDBusInterface>
#include <QDBusPendingCall>
#include <QDBusPendingCallWatcher>
#include <QDBusPendingReply>

#include <QtGui/private/qtx11extras_p.h>
#include <KWindowSystem>
Expand Down Expand Up @@ -50,6 +52,7 @@ void ProcessManager::start()
{
startWindowManager();
startDaemonProcess();
checkAndDeactivateScreenSaver();
}

void ProcessManager::logout()
Expand Down Expand Up @@ -97,15 +100,23 @@ void ProcessManager::startDesktopProcess()

QList<QPair<QString, QStringList>> list;
// Desktop components
list << qMakePair(QString("kwin_x11"), QStringList("--replace"));
list << qMakePair(QString("lingmo-notificationd"), QStringList());
list << qMakePair(QString("lingmo-desktop"), QStringList());
list << qMakePair(QString("lingmo-filemanager"), QStringList("--runtime"));
list << qMakePair(QString("lingmo-statusbar"), QStringList());
list << qMakePair(QString("lingmo-dock"), QStringList());
list << qMakePair(QString("lingmo-filemanager"), QStringList("--desktop"));
list << qMakePair(QString("lingmo-launcher"), QStringList());
list << qMakePair(QString("lingmo-powerman"), QStringList());
list << qMakePair(QString("lingmo-clipboard"), QStringList());
list << qMakePair(QString("lingmo-wallpaper-color-pick"), QStringList());

if (QFile(QDir::homePath() + "/.islin_install_lock").exists() &&
!QFile("/run/live/medium/live/filesystem.squashfs").exists()) {
list << qMakePair(QString("/usr/bin/lingmo-welcome"), QStringList());
// list << qMakePair(QString("config-installer"), QStringList());
}

m_desktopAutoStartD = std::make_shared<LINGMO_SESSION::Daemon>(list);

// Auto start
Expand All @@ -119,7 +130,7 @@ void ProcessManager::startDaemonProcess()
list << qMakePair(QString("lingmo-xembedsniproxy"), QStringList());
list << qMakePair(QString("lingmo-gmenuproxy"), QStringList());
list << qMakePair(QString("lingmo-permission-surveillance"),QStringList());
// list << qMakePair(QString("lingmo-clipboard"), QStringList());
list << qMakePair(QString("lingmo-clipboard"), QStringList());
list << qMakePair(QString("lingmo-chotkeys"), QStringList());

m_daemonAutoStartD = std::make_shared<LINGMO_SESSION::Daemon>(list);
Expand Down Expand Up @@ -196,3 +207,22 @@ bool ProcessManager::nativeEventFilter(const QByteArray &eventType, void *messag

return false;
}

void ProcessManager::checkAndDeactivateScreenSaver()
{
QDBusInterface interface("org.freedesktop.ScreenSaver", "/ScreenSaver", "org.freedesktop.ScreenSaver", QDBusConnection::sessionBus());
if (interface.isValid()) {
QDBusPendingCall call = interface.asyncCall("GetActive");
QDBusPendingCallWatcher *watcher = new QDBusPendingCallWatcher(call, this);
connect(watcher, &QDBusPendingCallWatcher::finished, this, [this, watcher]() {
QDBusPendingReply<bool> reply = *watcher;
if (reply.isValid() && reply.value()) {
QDBusInterface setActiveInterface("org.freedesktop.ScreenSaver", "/ScreenSaver", "org.freedesktop.ScreenSaver", QDBusConnection::sessionBus());
setActiveInterface.call("SetActive", false);
}
watcher->deleteLater();
});
} else {
qWarning() << "Cannot find org.freedesktop.ScreenSaver interface.";
}
}
1 change: 1 addition & 0 deletions session/processmanager.h
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,7 @@ class ProcessManager : public QObject, public QAbstractNativeEventFilter
void startWindowManager();
void startDesktopProcess();
void startDaemonProcess();
void checkAndDeactivateScreenSaver();

/**
* @brief Start the user defined autostart process.
Expand Down
Loading