11 Commits

Author SHA1 Message Date
AramJonghu d799e61c79 clang-tidy fixes incoming 2026-06-05 18:02:27 +02:00
zach 9cefdf509c cmake build hotfix 2026-06-05 12:31:37 +02:00
zach 27924aca37 disable incompatible-type for qmllint in clock 2026-06-04 23:22:28 +02:00
zach b4716d25c0 nodiscard 2026-06-04 22:57:45 +02:00
zach d8f047dbc9 nodiscard 2026-06-04 22:38:17 +02:00
zach 91b50b312d open launcher with gesture from bottom border 2026-06-04 19:01:02 +02:00
zach 3e933a8b78 remove logging 2026-06-04 18:56:42 +02:00
zach e127928126 Merge pull request 'Rewrite the manager responsible for handling automatic hyprsunset temperature activation as a qml plugin' (#117) from hyprsunset-manager-rewrite into main
Reviewed-on: #117
2026-06-04 15:05:45 +02:00
zach 94f2cf076c fix applying end() on init
Lint & Format (JS/TS) / lint-format (pull_request) Successful in 12s
Python / lint-format (pull_request) Successful in 23s
Python / test (pull_request) Successful in 49s
Lint & Format (Rust) / lint-format (pull_request) Successful in 1m3s
2026-06-04 15:05:18 +02:00
zach 9168b6e893 Merge branch 'main' into hyprsunset-manager-rewrite
Lint & Format (JS/TS) / lint-format (pull_request) Successful in 12s
Python / lint-format (pull_request) Successful in 24s
Python / test (pull_request) Successful in 42s
Lint & Format (Rust) / lint-format (pull_request) Successful in 1m3s
2026-06-04 14:56:53 +02:00
zach a477fb2e22 fix namespaces and logging names 2026-06-04 14:56:20 +02:00
33 changed files with 382 additions and 373 deletions
+1 -2
View File
@@ -24,8 +24,7 @@ CheckOptions:
readability-identifier-naming.StaticConstantCase: UPPER_CASE
readability-identifier-naming.StaticConstantPrefix: k
readability-identifier-naming.VariableCase: camelBack
WarningsAsErrors: "*"
HeaderFilterRegex: ".*"
HeaderFilterRegex: ""
FormatStyle: file
...
+6 -3
View File
@@ -69,14 +69,17 @@ Item {
root.singleGestureTriggered = false;
}
onCentroidChanged: {
if (root.singleGestureTriggered)
return;
const x = centroid.position.x;
const y = centroid.position.y;
const dragX = x - centroid.pressPosition.x;
const dragY = y - centroid.pressPosition.y;
if (centroid.pressPosition.y >= root.screen.height - Config.barConfig.border && dragY < -200)
root.visibilities.launcher = true;
if (root.singleGestureTriggered)
return;
if (centroid.pressPosition.y < root.bar.implicitHeight) {
if (dragY > 20) {
root.visibilities.settings = true;
+1 -1
View File
@@ -23,7 +23,7 @@ CustomRect {
anchors.centerIn: parent
color: root.visibilities.dashboard ? DynamicColors.palette.m3onPrimary : DynamicColors.palette.m3onSurface
font: Appearance.font.family.mono
font: Appearance.font.family.mono // qmllint disable incompatible-type
text: Time.dateStr
Behavior on color {
-2
View File
@@ -28,8 +28,6 @@ Item {
spacing: 1
Component.onCompleted: console.log(Battery.isLaptop)
CustomRect {
id: track
+4 -4
View File
@@ -18,13 +18,13 @@ public:
explicit BlobGroup(QObject* parent = nullptr);
~BlobGroup() override;
qreal smoothing() const {
[[nodiscard]] qreal smoothing() const {
return m_smoothing;
}
void setSmoothing(qreal s);
QColor color() const {
[[nodiscard]] QColor color() const {
return m_color;
}
@@ -36,11 +36,11 @@ void removeShape(BlobShape* shape);
void setInvertedRect(BlobInvertedRect* rect);
void clearInvertedRect(BlobInvertedRect* rect);
const QList<BlobShape*>& shapes() const {
[[nodiscard]] const QList<BlobShape*>& shapes() const {
return m_shapes;
}
BlobInvertedRect* invertedRect() const {
[[nodiscard]] BlobInvertedRect* invertedRect() const {
return m_invertedRect;
}
+5 -5
View File
@@ -16,25 +16,25 @@ public:
explicit BlobInvertedRect(QQuickItem* parent = nullptr);
~BlobInvertedRect() override;
qreal borderLeft() const {
[[nodiscard]] qreal borderLeft() const {
return m_borderLeft;
}
void setBorderLeft(qreal v);
qreal borderRight() const {
[[nodiscard]] qreal borderRight() const {
return m_borderRight;
}
void setBorderRight(qreal v);
qreal borderTop() const {
[[nodiscard]] qreal borderTop() const {
return m_borderTop;
}
void setBorderTop(qreal v);
qreal borderBottom() const {
[[nodiscard]] qreal borderBottom() const {
return m_borderBottom;
}
@@ -47,7 +47,7 @@ void borderTopChanged();
void borderBottomChanged();
protected:
bool isInvertedRect() const override {
[[nodiscard]] bool isInvertedRect() const override {
return true;
}
+2 -2
View File
@@ -21,8 +21,8 @@ struct BlobRectData {
class BlobMaterial : public QSGMaterial {
public:
QSGMaterialType* type() const override;
QSGMaterialShader* createShader(QSGRendererInterface::RenderMode) const override;
[[nodiscard]] QSGMaterialType* type() const override;
[[nodiscard]] QSGMaterialShader* createShader(QSGRendererInterface::RenderMode) const override;
int compare(const QSGMaterial* other) const override;
float m_paddedX = 0;
+7 -7
View File
@@ -24,7 +24,7 @@ public:
explicit BlobRect(QQuickItem* parent = nullptr);
~BlobRect() override;
qreal stiffness() const {
[[nodiscard]] qreal stiffness() const {
return m_stiffness;
}
@@ -35,7 +35,7 @@ void setStiffness(qreal s) {
}
}
qreal damping() const {
[[nodiscard]] qreal damping() const {
return m_damping;
}
@@ -46,7 +46,7 @@ void setDamping(qreal d) {
}
}
qreal deformScale() const {
[[nodiscard]] qreal deformScale() const {
return m_deformScale;
}
@@ -62,25 +62,25 @@ QQmlListProperty<BlobRect> exclude();
bool isExcluded(const BlobShape* other) const override;
void cornerRadii(float out[4]) const override;
qreal topLeftRadius() const {
[[nodiscard]] qreal topLeftRadius() const {
return m_topLeftRadius;
}
void setTopLeftRadius(qreal r);
qreal topRightRadius() const {
[[nodiscard]] qreal topRightRadius() const {
return m_topRightRadius;
}
void setTopRightRadius(qreal r);
qreal bottomLeftRadius() const {
[[nodiscard]] qreal bottomLeftRadius() const {
return m_bottomLeftRadius;
}
void setBottomLeftRadius(qreal r);
qreal bottomRightRadius() const {
[[nodiscard]] qreal bottomRightRadius() const {
return m_bottomRightRadius;
}
+6 -7
View File
@@ -21,23 +21,23 @@ public:
explicit BlobShape(QQuickItem* parent = nullptr);
~BlobShape() override = default;
BlobGroup* group() const {
[[nodiscard]] BlobGroup* group() const {
return m_group;
}
void setGroup(BlobGroup* g);
qreal radius() const {
[[nodiscard]] qreal radius() const {
return m_radius;
}
void setRadius(qreal r);
QMatrix4x4 deformMatrix() const {
[[nodiscard]] QMatrix4x4 deformMatrix() const {
return m_centeredDeformMatrix;
}
QMatrix4x4 rawDeformMatrix() const {
[[nodiscard]] QMatrix4x4 rawDeformMatrix() const {
return m_deformMatrix;
}
@@ -53,7 +53,7 @@ void geometryChange(const QRectF& newGeometry, const QRectF& oldGeometry) overri
void updatePolish() override;
QSGNode* updatePaintNode(QSGNode* oldNode, UpdatePaintNodeData*) override;
virtual bool isInvertedRect() const {
[[nodiscard]] virtual bool isInvertedRect() const {
return false;
}
@@ -72,10 +72,9 @@ void updateCenteredDeformMatrix();
BlobGroup* m_group = nullptr;
qreal m_radius = 0;
QMatrix4x4 m_deformMatrix; // identity by default
QMatrix4x4 m_deformMatrix;
QMatrix4x4 m_centeredDeformMatrix;
// Cached data from updatePolish
float m_cachedPaddedX = 0;
float m_cachedPaddedY = 0;
float m_cachedPaddedW = 0;
+1 -1
View File
@@ -58,4 +58,4 @@ qreal m_sweepAngle = 1.5 * M_PI;
qreal m_lineWidth = 10.0;
};
} // namespace ZShell::internal
} // namespace ZShell::Internal
@@ -19,7 +19,8 @@ class CachingImageManager : public QObject {
public:
explicit CachingImageManager(QObject* parent = nullptr)
: QObject(parent)
, m_item(nullptr) {}
, m_item(nullptr) {
}
[[nodiscard]] QQuickItem* item() const;
void setItem(QQuickItem* item);
+2 -2
View File
@@ -2,7 +2,7 @@
#include <algorithm>
namespace caelestia::internal {
namespace ZShell::internal {
CircularBuffer::CircularBuffer(QObject* parent)
: QObject(parent) {
@@ -92,4 +92,4 @@ qreal CircularBuffer::at(int index) const {
return m_data[actualIndex];
}
} // namespace caelestia::internal
} // namespace ZShell::internal
+2 -2
View File
@@ -4,7 +4,7 @@
#include <qqmlintegration.h>
#include <qvector.h>
namespace caelestia::internal {
namespace ZShell::internal {
class CircularBuffer : public QObject {
Q_OBJECT
@@ -41,4 +41,4 @@ int m_count = 0;
int m_capacity = 0;
};
} // namespace caelestia::internal
} // namespace ZShell::internal
@@ -1,5 +1,6 @@
#pragma once
#include <cstdint>
#include <qeasingcurve.h>
#include <qobject.h>
#include <qqmlintegration.h>
+1 -1
View File
@@ -6,7 +6,7 @@
#include <QtDBus/qdbusreply.h>
#include <qloggingcategory.h>
Q_LOGGING_CATEGORY(lcLidWatcher, "caelestia.internal.logindmanager", QtInfoMsg)
Q_LOGGING_CATEGORY(lcLidWatcher, "ZShell.internal.logindmanager", QtInfoMsg)
namespace ZShell::internal {
+2 -2
View File
@@ -4,7 +4,7 @@
#include <qpainterpath.h>
#include <qpen.h>
namespace caelestia::internal {
namespace ZShell::internal {
SparklineItem::SparklineItem(QQuickItem* parent)
: QQuickPaintedItem(parent) {
@@ -212,4 +212,4 @@ void SparklineItem::setLineWidth(qreal width) {
update();
}
} // namespace caelestia::internal
} // namespace ZShell::internal
+2 -2
View File
@@ -7,7 +7,7 @@
#include "circularbuffer.hpp"
namespace caelestia::internal {
namespace ZShell::internal {
class SparklineItem : public QQuickPaintedItem {
Q_OBJECT
@@ -87,4 +87,4 @@ int m_historyLength = 30;
qreal m_lineWidth = 2.0;
};
} // namespace caelestia::internal
} // namespace ZShell::internal
+4 -3
View File
@@ -1,5 +1,6 @@
#pragma once
#include <cstdint>
#include <qabstractitemmodel.h>
#include <qdir.h>
#include <qfilesystemwatcher.h>
@@ -85,9 +86,9 @@ public:
explicit FileSystemModel(QObject* parent = nullptr);
int rowCount(const QModelIndex& parent = QModelIndex()) const override;
QVariant data(const QModelIndex& index, int role = Qt::DisplayRole) const override;
QHash<int, QByteArray> roleNames() const override;
[[nodiscard]] int rowCount(const QModelIndex& parent = QModelIndex()) const override;
[[nodiscard]] QVariant data(const QModelIndex& index, int role = Qt::DisplayRole) const override;
[[nodiscard]] QHash<int, QByteArray> roleNames() const override;
[[nodiscard]] QString path() const;
void setPath(const QString& path);
+1 -1
View File
@@ -59,7 +59,7 @@ quint32 readChunk(double* out, quint32 count = 0);
private:
explicit AudioCollector(QObject* parent = nullptr);
~AudioCollector();
~AudioCollector() override;
std::jthread m_thread;
std::vector<float> m_buffer1;
+2 -3
View File
@@ -11,11 +11,10 @@ Q_OBJECT
public:
explicit AudioProcessor(QObject* parent = nullptr);
~AudioProcessor();
~AudioProcessor() override;
void init();
public slots:
void start();
void stop();
@@ -31,7 +30,7 @@ Q_OBJECT
public:
explicit AudioProvider(QObject* parent = nullptr);
~AudioProvider();
~AudioProvider() override;
protected:
AudioProcessor* m_processor;
+1 -1
View File
@@ -11,7 +11,7 @@ Q_OBJECT
public:
explicit BeatProcessor(QObject* parent = nullptr);
~BeatProcessor();
~BeatProcessor() override;
signals:
void beat(smpl_t bpm);
+1 -1
View File
@@ -11,7 +11,7 @@ Q_OBJECT
public:
explicit CavaProcessor(QObject* parent = nullptr);
~CavaProcessor();
~CavaProcessor() override;
void setBars(int bars);
+5 -4
View File
@@ -4,6 +4,7 @@
#include <QList>
#include <QString>
#include <QQmlEngine>
#include <cstdint>
namespace ZShell::services {
@@ -30,9 +31,9 @@ enum DesktopRoles {
explicit DesktopModel(QObject *parent = nullptr);
int rowCount(const QModelIndex &parent = QModelIndex()) const override;
QVariant data(const QModelIndex &index, int role = Qt::DisplayRole) const override;
QHash<int, QByteArray> roleNames() const override;
[[nodiscard]] int rowCount(const QModelIndex &parent = QModelIndex()) const override;
[[nodiscard]] QVariant data(const QModelIndex &index, int role = Qt::DisplayRole) const override;
[[nodiscard]] QHash<int, QByteArray> roleNames() const override;
Q_INVOKABLE void loadDirectory(const QString &path);
Q_INVOKABLE void moveIcon(int index, int newX, int newY);
@@ -43,4 +44,4 @@ QList<DesktopItem> m_items;
void saveCurrentLayout();
};
} // namespace ZShell::services
} // namespace ZShell::Services
@@ -18,7 +18,7 @@ Q_INVOKABLE void saveLayout(const QVariantMap& layout);
Q_INVOKABLE QVariantMap getLayout();
private:
QString getConfigFilePath() const;
[[nodiscard]] QString getConfigFilePath() const;
};
} // namespace ZShell::services
@@ -104,10 +104,12 @@ void HyprsunsetManager::toggle() {
}
void HyprsunsetManager::start() {
if (m_enabled)
if (m_enabled && m_initialized)
return;
m_initialized = true;
m_enabled = true;
emit enabledChanged();
m_process.setProgram("hyprctl");
@@ -116,10 +118,12 @@ void HyprsunsetManager::start() {
}
void HyprsunsetManager::end() {
if (!m_enabled)
if (!m_enabled && m_initialized)
return;
m_initialized = true;
m_enabled = false;
emit enabledChanged();
m_process.setProgram("hyprctl");
+10 -8
View File
@@ -22,12 +22,13 @@ Q_PROPERTY(bool manualToggle READ manualToggle WRITE setManualToggle NOTIFY manu
public:
explicit HyprsunsetManager(QObject* parent = nullptr);
int startTime() const;
int endTime() const;
bool enabled() const;
int temp() const;
bool activeAuto() const;
bool manualToggle() const;
[[nodiscard]] int startTime() const;
[[nodiscard]] int endTime() const;
[[nodiscard]] bool enabled() const;
[[nodiscard]] int temp() const;
[[nodiscard]] bool activeAuto() const;
[[nodiscard]] bool manualToggle() const;
Q_INVOKABLE void toggle();
Q_INVOKABLE void apply();
@@ -48,10 +49,11 @@ void manualToggleChanged();
private:
int m_startTime;
int m_endTime;
bool m_enabled;
bool m_enabled = false;
bool m_manualToggle = false;
bool m_activeAuto;
bool m_startAllowed;
bool m_startAllowed = false;
bool m_initialized = false;
QTimer m_startCooldown;
int m_temp;
QProcess m_process;
+1 -1
View File
@@ -13,7 +13,7 @@ QML_SINGLETON
public:
explicit Qalculator(QObject* parent = nullptr);
Q_INVOKABLE QString eval(const QString& expr, bool printExpr = true) const;
Q_INVOKABLE [[nodiscard]] QString eval(const QString& expr, bool printExpr = true) const;
};
} // namespace ZShell
+2 -1
View File
@@ -1,5 +1,6 @@
#pragma once
#include <cstdint>
#include <qobject.h>
#include <qqmlintegration.h>
#include <qqmllist.h>
@@ -20,7 +21,7 @@ Q_PROPERTY(int timeout READ timeout CONSTANT)
Q_PROPERTY(Type type READ type CONSTANT)
public:
enum class Type {
enum class Type: std::uint8_t {
Info = 0,
Success,
Warning,
+3 -3
View File
@@ -29,9 +29,9 @@ Q_INVOKABLE void cacheImage(const QUrl& source, const QString& cacheDir, QJSValu
Q_INVOKABLE void cacheImage(const QUrl& source, const QString& cacheDir, QJSValue onSaved, QJSValue onFailed);
// clang-format on
Q_INVOKABLE bool copyFile(const QUrl& source, const QUrl& target, bool overwrite = true) const;
Q_INVOKABLE bool deleteFile(const QUrl& path) const;
Q_INVOKABLE QString toLocalFile(const QUrl& url) const;
Q_INVOKABLE [[nodiscard]] bool copyFile(const QUrl& source, const QUrl& target, bool overwrite = true) const;
Q_INVOKABLE [[nodiscard]] bool deleteFile(const QUrl& path) const;
Q_INVOKABLE [[nodiscard]] QString toLocalFile(const QUrl& url) const;
private:
bool loadSourceImage(const QUrl& source, QImage& image) const;