Compare commits
10
Commits
0a503bc27c
...
v0.5.0
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
d3345906b9 | ||
|
|
08d42e1f8a | ||
|
|
45aa6c9005 | ||
|
|
1763b03287 | ||
|
|
72ff6ad42a | ||
|
|
2a45740020 | ||
|
|
ae25f33fc8
|
||
|
|
02267ec9a6
|
||
|
|
4b8d74a7e5
|
||
|
|
1fa3c84a56
|
@@ -0,0 +1,5 @@
|
|||||||
|
CompileFlags:
|
||||||
|
Remove:
|
||||||
|
# GCC-only flags from the system's default spec that clang/clangd cannot
|
||||||
|
# parse. They appear in compile_commands.json but are not set by the project.
|
||||||
|
- -mno-direct-extern-access
|
||||||
@@ -38,7 +38,6 @@ body:
|
|||||||
attributes:
|
attributes:
|
||||||
label: OS
|
label: OS
|
||||||
options:
|
options:
|
||||||
- NixOS
|
|
||||||
- Arch
|
- Arch
|
||||||
- Debian / Ubuntu
|
- Debian / Ubuntu
|
||||||
- Fedora
|
- Fedora
|
||||||
|
|||||||
@@ -30,6 +30,7 @@ body:
|
|||||||
- Refactor / style
|
- Refactor / style
|
||||||
- CI / build / tooling
|
- CI / build / tooling
|
||||||
- Documentation
|
- Documentation
|
||||||
|
- Other (Describe in description box with header "Issue type")
|
||||||
validations:
|
validations:
|
||||||
required: true
|
required: true
|
||||||
|
|
||||||
|
|||||||
+11
-2
@@ -61,10 +61,12 @@ set(CMAKE_INSTALL_MESSAGE NEVER)
|
|||||||
|
|
||||||
add_compile_options(
|
add_compile_options(
|
||||||
-Wall -Wextra -Wpedantic -Wshadow -Wconversion
|
-Wall -Wextra -Wpedantic -Wshadow -Wconversion
|
||||||
-Wold-style-cast -Wnull-dereference -Wdouble-promotion
|
-Wnull-dereference -Wdouble-promotion
|
||||||
-Wformat=2 -Wfloat-equal -Woverloaded-virtual
|
-Wformat=2 -Wfloat-equal
|
||||||
-Wsign-conversion -Wredundant-decls -Wswitch
|
-Wsign-conversion -Wredundant-decls -Wswitch
|
||||||
-Wunreachable-code
|
-Wunreachable-code
|
||||||
|
$<$<COMPILE_LANGUAGE:CXX>:-Wold-style-cast>
|
||||||
|
$<$<COMPILE_LANGUAGE:CXX>:-Woverloaded-virtual>
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|
||||||
@@ -188,4 +190,11 @@ if("m3shapes" IN_LIST ENABLE_MODULES)
|
|||||||
if(TARGET m3shapesplugin)
|
if(TARGET m3shapesplugin)
|
||||||
set_target_properties(m3shapesplugin PROPERTIES INSTALL_RPATH "$ORIGIN")
|
set_target_properties(m3shapesplugin PROPERTIES INSTALL_RPATH "$ORIGIN")
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
|
# Silence warnings that come from m3shapes files we do not manage.
|
||||||
|
foreach(m3shapes_target m3shapes_core m3shapes_morph m3shapes_shapes m3shapes m3shapesplugin)
|
||||||
|
if(TARGET ${m3shapes_target})
|
||||||
|
target_compile_options(${m3shapes_target} PRIVATE -Wno-shadow -Wno-float-equal)
|
||||||
|
endif()
|
||||||
|
endforeach()
|
||||||
endif()
|
endif()
|
||||||
|
|||||||
@@ -50,9 +50,9 @@ class BlobRect : public BlobShape {
|
|||||||
|
|
||||||
[[nodiscard]] qreal damping() const { return m_damping; }
|
[[nodiscard]] qreal damping() const { return m_damping; }
|
||||||
|
|
||||||
void setDamping(qreal d) {
|
void setDamping(qreal value) {
|
||||||
if (!qFuzzyCompare(m_damping, d)) {
|
if (!qFuzzyCompare(m_damping, value)) {
|
||||||
m_damping = d;
|
m_damping = value;
|
||||||
emit dampingChanged();
|
emit dampingChanged();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -110,7 +110,6 @@ class BlobRect : public BlobShape {
|
|||||||
void checkAtRest(float speed);
|
void checkAtRest(float speed);
|
||||||
void beginRetire();
|
void beginRetire();
|
||||||
|
|
||||||
// Physics state
|
|
||||||
QPointF m_prevScenePos;
|
QPointF m_prevScenePos;
|
||||||
QElapsedTimer m_elapsed;
|
QElapsedTimer m_elapsed;
|
||||||
bool m_physicsActive = false;
|
bool m_physicsActive = false;
|
||||||
@@ -122,13 +121,10 @@ class BlobRect : public BlobShape {
|
|||||||
float m_retire01 = 0.0f;
|
float m_retire01 = 0.0f;
|
||||||
float m_retire11 = 1.0f;
|
float m_retire11 = 1.0f;
|
||||||
|
|
||||||
// Symmetric 2x2 deformation matrix components (3 independent: m00, m01,
|
|
||||||
// m11) Rest state is identity: m00=1, m01=0, m11=1
|
|
||||||
float m_dm00 = 1.0f;
|
float m_dm00 = 1.0f;
|
||||||
float m_dm01 = 0.0f;
|
float m_dm01 = 0.0f;
|
||||||
float m_dm11 = 1.0f;
|
float m_dm11 = 1.0f;
|
||||||
|
|
||||||
// Spring velocities for each component
|
|
||||||
float m_dmVel00 = 0.0f;
|
float m_dmVel00 = 0.0f;
|
||||||
float m_dmVel01 = 0.0f;
|
float m_dmVel01 = 0.0f;
|
||||||
float m_dmVel11 = 0.0f;
|
float m_dmVel11 = 0.0f;
|
||||||
|
|||||||
@@ -168,10 +168,6 @@ void BlobShape::updatePolish() {
|
|||||||
|
|
||||||
if (other->width() <= 0 || other->height() <= 0) continue;
|
if (other->width() <= 0 || other->height() <= 0) continue;
|
||||||
|
|
||||||
// Excluded shapes stay in the rect data. Exclusion only gates the smooth
|
|
||||||
// blend (via excludeMask below); ownership must still see every shape,
|
|
||||||
// otherwise two nodes can both believe they own a pixel and the pixel is
|
|
||||||
// blended twice.
|
|
||||||
const QPointF otherScene = other->mapToScene(QPointF(0, 0));
|
const QPointF otherScene = other->mapToScene(QPointF(0, 0));
|
||||||
|
|
||||||
bool include = false;
|
bool include = false;
|
||||||
@@ -196,7 +192,7 @@ void BlobShape::updatePolish() {
|
|||||||
|
|
||||||
const QMatrix4x4& dm = other->m_deformMatrix;
|
const QMatrix4x4& dm = other->m_deformMatrix;
|
||||||
const float a = dm(0, 0), b = dm(1, 0);
|
const float a = dm(0, 0), b = dm(1, 0);
|
||||||
const float c = dm(0, 1), d = dm(1, 1);
|
const float c = dm(0, 1), e = dm(1, 1);
|
||||||
|
|
||||||
BlobRectData r;
|
BlobRectData r;
|
||||||
r.cx = static_cast<float>(otherScene.x() + other->width() / 2.0);
|
r.cx = static_cast<float>(otherScene.x() + other->width() / 2.0);
|
||||||
@@ -207,19 +203,19 @@ void BlobShape::updatePolish() {
|
|||||||
r.offsetX = dm(0, 3);
|
r.offsetX = dm(0, 3);
|
||||||
r.offsetY = dm(1, 3);
|
r.offsetY = dm(1, 3);
|
||||||
|
|
||||||
const float det = a * d - c * b;
|
const float det = a * e - c * b;
|
||||||
const float invDet = std::abs(det) > 1e-6f ? 1.0f / det : 1.0f;
|
const float invDet = std::abs(det) > 1e-6f ? 1.0f / det : 1.0f;
|
||||||
r.invDeform[0] = d * invDet;
|
r.invDeform[0] = e * invDet;
|
||||||
r.invDeform[1] = -b * invDet;
|
r.invDeform[1] = -b * invDet;
|
||||||
r.invDeform[2] = -c * invDet;
|
r.invDeform[2] = -c * invDet;
|
||||||
r.invDeform[3] = a * invDet;
|
r.invDeform[3] = a * invDet;
|
||||||
|
|
||||||
const float halfTr = 0.5f * (a + d);
|
const float halfTr = 0.5f * (a + e);
|
||||||
const float halfDiff = 0.5f * (a - d);
|
const float halfDiff = 0.5f * (a - e);
|
||||||
r.minEig = halfTr - std::sqrt(halfDiff * halfDiff + c * c);
|
r.minEig = halfTr - std::sqrt(halfDiff * halfDiff + c * c);
|
||||||
|
|
||||||
r.screenHalfX = std::abs(a) * r.hw + std::abs(c) * r.hh;
|
r.screenHalfX = std::abs(a) * r.hw + std::abs(c) * r.hh;
|
||||||
r.screenHalfY = std::abs(b) * r.hw + std::abs(d) * r.hh;
|
r.screenHalfY = std::abs(b) * r.hw + std::abs(e) * r.hh;
|
||||||
|
|
||||||
m_cachedRects.append(r);
|
m_cachedRects.append(r);
|
||||||
rectShapes.append(other);
|
rectShapes.append(other);
|
||||||
|
|||||||
@@ -187,7 +187,7 @@ void CarouselView::setModel(const QVariantList& m) {
|
|||||||
|
|
||||||
emit modelChanged();
|
emit modelChanged();
|
||||||
|
|
||||||
const int newCount = m_model.size();
|
const int newCount = static_cast<int>(m_model.size());
|
||||||
|
|
||||||
if (newCount == 0) {
|
if (newCount == 0) {
|
||||||
m_currentRealIndex = -1;
|
m_currentRealIndex = -1;
|
||||||
@@ -647,7 +647,7 @@ qreal CarouselView::sampleSize(qreal childLoc) const {
|
|||||||
}
|
}
|
||||||
|
|
||||||
int CarouselView::realIndexOf(int virtualIndex) const {
|
int CarouselView::realIndexOf(int virtualIndex) const {
|
||||||
const int count = m_model.size();
|
const int count = static_cast<int>(m_model.size());
|
||||||
|
|
||||||
if (count == 0) return -1;
|
if (count == 0) return -1;
|
||||||
|
|
||||||
@@ -668,7 +668,7 @@ qreal CarouselView::snapTargetX(qreal x) const {
|
|||||||
}
|
}
|
||||||
|
|
||||||
void CarouselView::wrapContentIfNeeded() {
|
void CarouselView::wrapContentIfNeeded() {
|
||||||
const int count = m_model.size();
|
const int count = static_cast<int>(m_model.size());
|
||||||
|
|
||||||
if (count == 0) return;
|
if (count == 0) return;
|
||||||
|
|
||||||
@@ -707,7 +707,7 @@ void CarouselView::wrapContentIfNeeded() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
void CarouselView::updateCurrentIndexFromContentX(bool emitPreview) {
|
void CarouselView::updateCurrentIndexFromContentX(bool emitPreview) {
|
||||||
const int count = m_model.size();
|
const int count = static_cast<int>(m_model.size());
|
||||||
|
|
||||||
if (count == 0) return;
|
if (count == 0) return;
|
||||||
|
|
||||||
@@ -856,8 +856,8 @@ void CarouselView::positionSlot(const Slot& slot) const {
|
|||||||
return rightIndex == n ? m_arrangement.outerSpacing : m_itemSpacing;
|
return rightIndex == n ? m_arrangement.outerSpacing : m_itemSpacing;
|
||||||
};
|
};
|
||||||
|
|
||||||
const auto leftGap = [this, n](int leftIndex) {
|
const auto leftGap = [this, n](int gapIndex) {
|
||||||
return leftIndex == -n ? m_arrangement.outerSpacing : m_itemSpacing;
|
return gapIndex == -n ? m_arrangement.outerSpacing : m_itemSpacing;
|
||||||
};
|
};
|
||||||
|
|
||||||
qreal center = 0;
|
qreal center = 0;
|
||||||
@@ -974,7 +974,7 @@ void CarouselView::releaseAllItems() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
void CarouselView::relayout() {
|
void CarouselView::relayout() {
|
||||||
const int count = m_model.size();
|
const int count = static_cast<int>(m_model.size());
|
||||||
|
|
||||||
if (count == 0 || width() <= 0 || m_focalWidth <= 0) {
|
if (count == 0 || width() <= 0 || m_focalWidth <= 0) {
|
||||||
for (Slot& s : m_slots) {
|
for (Slot& s : m_slots) {
|
||||||
@@ -1038,7 +1038,7 @@ void CarouselView::relayout() {
|
|||||||
m_slots.append(Slot{});
|
m_slots.append(Slot{});
|
||||||
slotUsedThisPass.append(false);
|
slotUsedThisPass.append(false);
|
||||||
|
|
||||||
freeSlot = m_slots.size() - 1;
|
freeSlot = static_cast<int>(m_slots.size()) - 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
updateSlotContent(m_slots[freeSlot], v);
|
updateSlotContent(m_slots[freeSlot], v);
|
||||||
@@ -1092,7 +1092,7 @@ void CarouselView::snapToNearest() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
void CarouselView::goToIndex(int realIndex) {
|
void CarouselView::goToIndex(int realIndex) {
|
||||||
const int count = m_model.size();
|
const int count = static_cast<int>(m_model.size());
|
||||||
|
|
||||||
if (count == 0) return;
|
if (count == 0) return;
|
||||||
|
|
||||||
@@ -1126,7 +1126,7 @@ void CarouselView::decrementCurrentIndex() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
void CarouselView::centerInstantlyOnReal(int realIndex) {
|
void CarouselView::centerInstantlyOnReal(int realIndex) {
|
||||||
const int count = m_model.size();
|
const int count = static_cast<int>(m_model.size());
|
||||||
|
|
||||||
if (count == 0) return;
|
if (count == 0) return;
|
||||||
|
|
||||||
@@ -1220,7 +1220,7 @@ qreal CarouselView::sampledVelocity() const {
|
|||||||
const VelocitySample& oldest = m_velocitySamples.first();
|
const VelocitySample& oldest = m_velocitySamples.first();
|
||||||
const VelocitySample& newest = m_velocitySamples.last();
|
const VelocitySample& newest = m_velocitySamples.last();
|
||||||
|
|
||||||
const qreal dt = newest.t - oldest.t;
|
const qreal dt = static_cast<qreal>(newest.t - oldest.t);
|
||||||
|
|
||||||
if (dt < 8) return 0;
|
if (dt < 8) return 0;
|
||||||
|
|
||||||
|
|||||||
@@ -252,8 +252,6 @@ int ChatListView::count() const {
|
|||||||
}
|
}
|
||||||
|
|
||||||
bool ChatListView::event(QEvent* e) {
|
bool ChatListView::event(QEvent* e) {
|
||||||
// qDebug() << "ChatListView::event() runs";
|
|
||||||
|
|
||||||
return QQuickItem::event(e);
|
return QQuickItem::event(e);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -366,7 +364,6 @@ void ChatListView::updatePolish() {
|
|||||||
m_animateY = false;
|
m_animateY = false;
|
||||||
const int layoutSize = static_cast<int>(m_layout.size());
|
const int layoutSize = static_cast<int>(m_layout.size());
|
||||||
const qint64 now = m_clock.elapsed();
|
const qint64 now = m_clock.elapsed();
|
||||||
bool wrote = false;
|
|
||||||
for (auto& entry : m_delegates) {
|
for (auto& entry : m_delegates) {
|
||||||
if (!entry.item || entry.pendingRemoval || entry.pendingInsert)
|
if (!entry.item || entry.pendingRemoval || entry.pendingInsert)
|
||||||
continue;
|
continue;
|
||||||
@@ -397,7 +394,6 @@ void ChatListView::updatePolish() {
|
|||||||
entry.item->setY(target);
|
entry.item->setY(target);
|
||||||
entry.hasPropY = false;
|
entry.hasPropY = false;
|
||||||
}
|
}
|
||||||
wrote = true;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
applyAnchor();
|
applyAnchor();
|
||||||
|
|||||||
@@ -50,8 +50,6 @@ void SparklineContent::setLine2(internal::CircularBuffer* buffer) {
|
|||||||
|
|
||||||
void SparklineContent::connectBuffer(internal::CircularBuffer* buffer) {
|
void SparklineContent::connectBuffer(internal::CircularBuffer* buffer) {
|
||||||
if (!buffer) return;
|
if (!buffer) return;
|
||||||
// New data, or the buffer's own smoothingRadius changed (it re-emits
|
|
||||||
// valuesChanged in that case too) -> geometry is stale.
|
|
||||||
connect(
|
connect(
|
||||||
buffer,
|
buffer,
|
||||||
&internal::CircularBuffer::valuesChanged,
|
&internal::CircularBuffer::valuesChanged,
|
||||||
@@ -67,7 +65,7 @@ void SparklineContent::connectBuffer(internal::CircularBuffer* buffer) {
|
|||||||
void SparklineContent::setLine1Color(const QColor& color) {
|
void SparklineContent::setLine1Color(const QColor& color) {
|
||||||
if (m_line1Color == color) return;
|
if (m_line1Color == color) return;
|
||||||
m_line1Color = color;
|
m_line1Color = color;
|
||||||
update(); // visual-only, no geometry rebuild needed
|
update();
|
||||||
}
|
}
|
||||||
|
|
||||||
void SparklineContent::setLine2Color(const QColor& color) {
|
void SparklineContent::setLine2Color(const QColor& color) {
|
||||||
@@ -173,7 +171,7 @@ SparklineContent::LineGeometry SparklineContent::buildGeometry(
|
|||||||
if (m_curveSmoothing && points.size() > 2) {
|
if (m_curveSmoothing && points.size() > 2) {
|
||||||
const qreal tension = 1.0;
|
const qreal tension = 1.0;
|
||||||
const qreal k = tension / 6.0;
|
const qreal k = tension / 6.0;
|
||||||
const int n = points.size();
|
const int n = static_cast<int>(points.size());
|
||||||
|
|
||||||
for (int i = 0; i < n - 1; ++i) {
|
for (int i = 0; i < n - 1; ++i) {
|
||||||
const QPointF& p0 = points[qMax(i - 1, 0)];
|
const QPointF& p0 = points[qMax(i - 1, 0)];
|
||||||
|
|||||||
@@ -84,7 +84,6 @@ SparklineSceneItem::LineSample SparklineSceneItem::buildSample(
|
|||||||
points.reserve(len);
|
points.reserve(len);
|
||||||
|
|
||||||
for (int i = 0; i < len; ++i) {
|
for (int i = 0; i < len; ++i) {
|
||||||
// Already smoothed once, incrementally, by the buffer itself.
|
|
||||||
const qreal value =
|
const qreal value =
|
||||||
qBound<qreal>(0.0, buffer->smoothedAt(i), m_maxValue);
|
qBound<qreal>(0.0, buffer->smoothedAt(i), m_maxValue);
|
||||||
|
|
||||||
@@ -99,7 +98,7 @@ SparklineSceneItem::LineSample SparklineSceneItem::buildSample(
|
|||||||
if (m_curveSmoothing && points.size() > 2) {
|
if (m_curveSmoothing && points.size() > 2) {
|
||||||
const qreal tension = 1.0;
|
const qreal tension = 1.0;
|
||||||
const qreal k = tension / 6.0;
|
const qreal k = tension / 6.0;
|
||||||
const int n = points.size();
|
const int n = static_cast<int>(points.size());
|
||||||
for (int i = 0; i < n - 1; ++i) {
|
for (int i = 0; i < n - 1; ++i) {
|
||||||
const QPointF& p0 = points[qMax(i - 1, 0)];
|
const QPointF& p0 = points[qMax(i - 1, 0)];
|
||||||
const QPointF& p1 = points[i];
|
const QPointF& p1 = points[i];
|
||||||
@@ -125,9 +124,6 @@ SparklineSceneItem::LineSample SparklineSceneItem::buildSample(
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// Flatten the curve to a polyline once, here, on data change only.
|
|
||||||
// This is CPU math only -- no QPainter draw calls, no image, no
|
|
||||||
// texture upload happen as a result of this.
|
|
||||||
const auto subpaths = path.toSubpathPolygons();
|
const auto subpaths = path.toSubpathPolygons();
|
||||||
if (subpaths.isEmpty()) return sample;
|
if (subpaths.isEmpty()) return sample;
|
||||||
|
|
||||||
@@ -139,7 +135,7 @@ SparklineSceneItem::LineSample SparklineSceneItem::buildSample(
|
|||||||
|
|
||||||
void SparklineSceneItem::writeFillGeometry(
|
void SparklineSceneItem::writeFillGeometry(
|
||||||
QSGGeometryNode* node, const LineSample& sample) {
|
QSGGeometryNode* node, const LineSample& sample) {
|
||||||
const int n = sample.polyline.size();
|
const int n = static_cast<int>(sample.polyline.size());
|
||||||
auto* geometry = node->geometry();
|
auto* geometry = node->geometry();
|
||||||
geometry->allocate(n * 2);
|
geometry->allocate(n * 2);
|
||||||
geometry->setDrawingMode(QSGGeometry::DrawTriangleStrip);
|
geometry->setDrawingMode(QSGGeometry::DrawTriangleStrip);
|
||||||
@@ -147,8 +143,10 @@ void SparklineSceneItem::writeFillGeometry(
|
|||||||
auto* vertices = geometry->vertexDataAsPoint2D();
|
auto* vertices = geometry->vertexDataAsPoint2D();
|
||||||
for (int i = 0; i < n; ++i) {
|
for (int i = 0; i < n; ++i) {
|
||||||
const QPointF& p = sample.polyline[i];
|
const QPointF& p = sample.polyline[i];
|
||||||
vertices[i * 2].set(p.x(), p.y());
|
vertices[i * 2].set(
|
||||||
vertices[i * 2 + 1].set(p.x(), sample.fillBottom);
|
static_cast<float>(p.x()), static_cast<float>(p.y()));
|
||||||
|
vertices[i * 2 + 1].set(
|
||||||
|
static_cast<float>(p.x()), static_cast<float>(sample.fillBottom));
|
||||||
}
|
}
|
||||||
|
|
||||||
node->markDirty(QSGNode::DirtyGeometry);
|
node->markDirty(QSGNode::DirtyGeometry);
|
||||||
@@ -156,7 +154,7 @@ void SparklineSceneItem::writeFillGeometry(
|
|||||||
|
|
||||||
void SparklineSceneItem::writeStrokeGeometry(
|
void SparklineSceneItem::writeStrokeGeometry(
|
||||||
QSGGeometryNode* node, const LineSample& sample, qreal lineWidth) {
|
QSGGeometryNode* node, const LineSample& sample, qreal lineWidth) {
|
||||||
const int n = sample.polyline.size();
|
const int n = static_cast<int>(sample.polyline.size());
|
||||||
auto* geometry = node->geometry();
|
auto* geometry = node->geometry();
|
||||||
geometry->allocate(n * 2);
|
geometry->allocate(n * 2);
|
||||||
geometry->setDrawingMode(QSGGeometry::DrawTriangleStrip);
|
geometry->setDrawingMode(QSGGeometry::DrawTriangleStrip);
|
||||||
@@ -179,8 +177,12 @@ void SparklineSceneItem::writeStrokeGeometry(
|
|||||||
|
|
||||||
const QPointF& p = sample.polyline[i];
|
const QPointF& p = sample.polyline[i];
|
||||||
const QPointF offset = normal * half;
|
const QPointF offset = normal * half;
|
||||||
vertices[i * 2].set(p.x() + offset.x(), p.y() + offset.y());
|
vertices[i * 2].set(
|
||||||
vertices[i * 2 + 1].set(p.x() - offset.x(), p.y() - offset.y());
|
static_cast<float>(p.x() + offset.x()),
|
||||||
|
static_cast<float>(p.y() + offset.y()));
|
||||||
|
vertices[i * 2 + 1].set(
|
||||||
|
static_cast<float>(p.x() - offset.x()),
|
||||||
|
static_cast<float>(p.y() - offset.y()));
|
||||||
}
|
}
|
||||||
|
|
||||||
node->markDirty(QSGNode::DirtyGeometry);
|
node->markDirty(QSGNode::DirtyGeometry);
|
||||||
@@ -243,7 +245,7 @@ QSGNode* SparklineSceneItem::updatePaintNode(
|
|||||||
}
|
}
|
||||||
|
|
||||||
QMatrix4x4 matrix;
|
QMatrix4x4 matrix;
|
||||||
matrix.translate(-stepX() * m_slideProgress, 0);
|
matrix.translate(static_cast<float>(-stepX() * m_slideProgress), 0.0f);
|
||||||
transformNode->setMatrix(matrix);
|
transformNode->setMatrix(matrix);
|
||||||
|
|
||||||
const bool needsGeometryWrite = samplesRebuilt || justCreated;
|
const bool needsGeometryWrite = samplesRebuilt || justCreated;
|
||||||
|
|||||||
@@ -85,7 +85,7 @@ class WavyLine : public QCanvasPainterItem {
|
|||||||
[[nodiscard]] qreal value() const;
|
[[nodiscard]] qreal value() const;
|
||||||
void setValue(qreal value);
|
void setValue(qreal value);
|
||||||
|
|
||||||
signals:
|
signals:
|
||||||
void lineWidthChanged();
|
void lineWidthChanged();
|
||||||
void amplitudeMultiplierChanged();
|
void amplitudeMultiplierChanged();
|
||||||
void frequencyChanged();
|
void frequencyChanged();
|
||||||
|
|||||||
@@ -37,12 +37,10 @@ static std::filesystem::path g_runtimeDir{"/tmp"};
|
|||||||
static std::filesystem::path g_cacheBase{"/tmp/.cache"};
|
static std::filesystem::path g_cacheBase{"/tmp/.cache"};
|
||||||
|
|
||||||
static void initEnvPaths() {
|
static void initEnvPaths() {
|
||||||
if (const char* env = getenv("XDG_RUNTIME_DIR"))
|
if (const char* env = getenv("XDG_RUNTIME_DIR")) g_runtimeDir = env;
|
||||||
g_runtimeDir = env;
|
|
||||||
|
|
||||||
if (const char* env = getenv("XDG_CACHE_HOME")) {
|
if (const char* env = getenv("XDG_CACHE_HOME")) {
|
||||||
if (*env)
|
if (*env) g_cacheBase = env;
|
||||||
g_cacheBase = env;
|
|
||||||
} else if (const char* home = getenv("HOME")) {
|
} else if (const char* home = getenv("HOME")) {
|
||||||
g_cacheBase = std::filesystem::path(home) / ".cache";
|
g_cacheBase = std::filesystem::path(home) / ".cache";
|
||||||
}
|
}
|
||||||
@@ -50,8 +48,7 @@ static void initEnvPaths() {
|
|||||||
|
|
||||||
static std::ofstream& debugLog() {
|
static std::ofstream& debugLog() {
|
||||||
static std::ofstream log(
|
static std::ofstream log(
|
||||||
g_runtimeDir / "zshell-nightlight-debug.log",
|
g_runtimeDir / "zshell-nightlight-debug.log", std::ios::app);
|
||||||
std::ios::app);
|
|
||||||
return log;
|
return log;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -173,15 +170,14 @@ static bool hkSaveBufferForMirror(CHyprOpenGLImpl* thisptr, const CBox& box) {
|
|||||||
|
|
||||||
static void installShader() {
|
static void installShader() {
|
||||||
auto* gl = g_pHyprOpenGL.get();
|
auto* gl = g_pHyprOpenGL.get();
|
||||||
if (!gl)
|
if (!gl) return;
|
||||||
return;
|
|
||||||
|
|
||||||
ensureShaderFile(shaderPath(), defaultShaderSource());
|
ensureShaderFile(shaderPath(), defaultShaderSource());
|
||||||
gl->applyScreenShader(shaderPath().string());
|
gl->applyScreenShader(shaderPath().string());
|
||||||
|
|
||||||
auto* shader = gl->m_finalScreenShader.get();
|
auto* shader = gl->m_finalScreenShader.get();
|
||||||
if (shader && shader->program() >= 1 &&
|
if (shader && shader->program() >= 1 &&
|
||||||
shader->getUniformLocation(SHADER_TINT) != -1) {
|
shader->getUniformLocation(SHADER_TINT) != -1) {
|
||||||
g_uniformMode = true;
|
g_uniformMode = true;
|
||||||
} else {
|
} else {
|
||||||
g_uniformMode = false;
|
g_uniformMode = false;
|
||||||
@@ -196,8 +192,7 @@ static void installShader() {
|
|||||||
static void setUniformGain(const std::array<float, 3>& gain) {
|
static void setUniformGain(const std::array<float, 3>& gain) {
|
||||||
auto* gl = g_pHyprOpenGL.get();
|
auto* gl = g_pHyprOpenGL.get();
|
||||||
auto* shader = gl ? gl->m_finalScreenShader.get() : nullptr;
|
auto* shader = gl ? gl->m_finalScreenShader.get() : nullptr;
|
||||||
if (!gl || !shader)
|
if (!gl || !shader) return;
|
||||||
return;
|
|
||||||
|
|
||||||
gl->useShader(gl->m_finalScreenShader);
|
gl->useShader(gl->m_finalScreenShader);
|
||||||
shader->setUniformFloat3(SHADER_TINT, gain[0], gain[1], gain[2]);
|
shader->setUniformFloat3(SHADER_TINT, gain[0], gain[1], gain[2]);
|
||||||
@@ -214,8 +209,7 @@ static void hkBegin(
|
|||||||
|
|
||||||
if (fb) {
|
if (fb) {
|
||||||
auto* renderer = g_pHyprRenderer.get();
|
auto* renderer = g_pHyprRenderer.get();
|
||||||
if (renderer)
|
if (renderer) renderer->m_renderData.blockScreenShader = true;
|
||||||
renderer->m_renderData.blockScreenShader = true;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!g_active) return;
|
if (!g_active) return;
|
||||||
@@ -223,17 +217,15 @@ static void hkBegin(
|
|||||||
auto* gl = g_pHyprOpenGL.get();
|
auto* gl = g_pHyprOpenGL.get();
|
||||||
if (!gl) return;
|
if (!gl) return;
|
||||||
|
|
||||||
if (gl->m_finalScreenShader.get() &&
|
if (gl->m_finalScreenShader.get() && gl->m_finalScreenShader->program() < 1)
|
||||||
gl->m_finalScreenShader->program() < 1)
|
|
||||||
installShader();
|
installShader();
|
||||||
if (!gl->m_finalScreenShader.get() ||
|
if (!gl->m_finalScreenShader.get() ||
|
||||||
gl->m_finalScreenShader->program() < 1)
|
gl->m_finalScreenShader->program() < 1)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
if (g_transition.active) {
|
if (g_transition.active) {
|
||||||
auto* monPtr = mon.get();
|
auto* monPtr = mon.get();
|
||||||
if (!monPtr)
|
if (!monPtr) return;
|
||||||
return;
|
|
||||||
const float elapsed =
|
const float elapsed =
|
||||||
std::chrono::duration<float>(
|
std::chrono::duration<float>(
|
||||||
std::chrono::steady_clock::now() - g_transition.start)
|
std::chrono::steady_clock::now() - g_transition.start)
|
||||||
@@ -255,9 +247,9 @@ static void hkBegin(
|
|||||||
ensureShaderFile(
|
ensureShaderFile(
|
||||||
bakedShaderPath(g_currentGain),
|
bakedShaderPath(g_currentGain),
|
||||||
bakedShaderSource(g_currentGain));
|
bakedShaderSource(g_currentGain));
|
||||||
gl->applyScreenShader(bakedShaderPath(g_currentGain).string());
|
gl->applyScreenShader(bakedShaderPath(g_currentGain).string());
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
if (t >= 1.f) {
|
if (t >= 1.f) {
|
||||||
g_transition.active = false;
|
g_transition.active = false;
|
||||||
|
|||||||
@@ -182,10 +182,10 @@ static QString buildHlConfigCall(const QString& key, const QVariant& value) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
static QColor colorFromInt(quint32 value) {
|
static QColor colorFromInt(quint32 value) {
|
||||||
const int a = (value >> 24) & 0xFF;
|
const int a = static_cast<int>(value >> 24) & 0xFF;
|
||||||
const int r = (value >> 16) & 0xFF;
|
const int r = static_cast<int>(value >> 16) & 0xFF;
|
||||||
const int g = (value >> 8) & 0xFF;
|
const int g = static_cast<int>(value >> 8) & 0xFF;
|
||||||
const int b = value & 0xFF;
|
const int b = static_cast<int>(value) & 0xFF;
|
||||||
|
|
||||||
return QColor(r, g, b, a);
|
return QColor(r, g, b, a);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -72,7 +72,7 @@ static QCanvasPath buildStrokePath(
|
|||||||
void StrokeCanvasItem::undoLastGroup() {
|
void StrokeCanvasItem::undoLastGroup() {
|
||||||
if (m_strokes.isEmpty()) return;
|
if (m_strokes.isEmpty()) return;
|
||||||
const int lastGroup = m_strokes.last().groupId;
|
const int lastGroup = m_strokes.last().groupId;
|
||||||
for (int i = m_strokes.size() - 1;
|
for (int i = static_cast<int>(m_strokes.size()) - 1;
|
||||||
i >= 0 && m_strokes[i].groupId == lastGroup;
|
i >= 0 && m_strokes[i].groupId == lastGroup;
|
||||||
--i)
|
--i)
|
||||||
m_strokes.remove(i);
|
m_strokes.remove(i);
|
||||||
|
|||||||
@@ -154,7 +154,7 @@ void StrokeCanvasRenderer::synchronizeData(QCanvasPainterItem* item) {
|
|||||||
for (const auto& stroke : canvas->m_strokes)
|
for (const auto& stroke : canvas->m_strokes)
|
||||||
canvasGroupIds.insert(stroke.groupId);
|
canvasGroupIds.insert(stroke.groupId);
|
||||||
|
|
||||||
for (int i = m_strokes.size() - 1; i >= 0; --i) {
|
for (int i = static_cast<int>(m_strokes.size()) - 1; i >= 0; --i) {
|
||||||
if (!canvasGroupIds.contains(m_strokes[i].groupId)) {
|
if (!canvasGroupIds.contains(m_strokes[i].groupId)) {
|
||||||
if (m_strokes[i].groupId >= 0)
|
if (m_strokes[i].groupId >= 0)
|
||||||
m_pendingGroupRemovals.append(m_strokes[i].groupId);
|
m_pendingGroupRemovals.append(m_strokes[i].groupId);
|
||||||
|
|||||||
@@ -119,7 +119,7 @@ void FileReadTool::execute(
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
const QString head = content.left(limit);
|
const QString head = content.left(limit);
|
||||||
const int nextOffset = offset + head.toUtf8().size();
|
const int nextOffset = offset + static_cast<int>(head.toUtf8().size());
|
||||||
const QString output =
|
const QString output =
|
||||||
head +
|
head +
|
||||||
QStringLiteral(
|
QStringLiteral(
|
||||||
|
|||||||
@@ -1,4 +1,5 @@
|
|||||||
add_library(zshell-pch INTERFACE)
|
add_library(zshell-pch INTERFACE)
|
||||||
|
target_compile_options(zshell-pch INTERFACE $<$<COMPILE_LANGUAGE:CXX>:-Wno-null-dereference>)
|
||||||
target_precompile_headers(zshell-pch INTERFACE
|
target_precompile_headers(zshell-pch INTERFACE
|
||||||
<qobject.h>
|
<qobject.h>
|
||||||
<qqmlintegration.h>
|
<qqmlintegration.h>
|
||||||
|
|||||||
@@ -84,89 +84,11 @@ Defaults from `CMakeLists.txt`:
|
|||||||
- shell config install dir: `etc/xdg/quickshell/zshell`
|
- shell config install dir: `etc/xdg/quickshell/zshell`
|
||||||
- greeter install dir: `etc/xdg/quickshell/zshell-greeter`
|
- greeter install dir: `etc/xdg/quickshell/zshell-greeter`
|
||||||
|
|
||||||
### Nix Flake
|
### Nix
|
||||||
|
|
||||||
_Note that Nix is not actively developed at this point. Things may be broken. Feel free to suggest fixes in a PR_
|
Nix support has been removed. Reason being that none of us actively develop for Nix. Having a `flake.nix` in the project will give the wrong idea.
|
||||||
|
|
||||||
The flake exposes:
|
Contributions for Nix support are welcome, the caveat being that reviews of these contributions can be of lower quality.
|
||||||
|
|
||||||
- `packages.<system>.zshell`
|
|
||||||
- `packages.<system>.zshell-cli`
|
|
||||||
|
|
||||||
Add it as an input in your system flake:
|
|
||||||
|
|
||||||
```nix
|
|
||||||
{
|
|
||||||
inputs = {
|
|
||||||
nixpkgs.url = "github:nixos/nixpkgs/nixos-unstable";
|
|
||||||
z-bar-qt = {
|
|
||||||
url = git+https://git.zach-dev.cc/zach/z-bar-qt.git
|
|
||||||
inputs.nixpkgs.follows = "nixpkgs";
|
|
||||||
};
|
|
||||||
};
|
|
||||||
}
|
|
||||||
```
|
|
||||||
|
|
||||||
Full `flake.nix` example (`nixosConfigurations`):
|
|
||||||
|
|
||||||
```nix
|
|
||||||
{
|
|
||||||
inputs = {
|
|
||||||
nixpkgs.url = "github:nixos/nixpkgs/nixos-unstable";
|
|
||||||
z-bar-qt = {
|
|
||||||
url = git+https://git.zach-dev.cc/zach/z-bar-qt.git
|
|
||||||
inputs.nixpkgs.follows = "nixpkgs";
|
|
||||||
};
|
|
||||||
};
|
|
||||||
|
|
||||||
outputs = inputs@{ nixpkgs, ... }:
|
|
||||||
let
|
|
||||||
system = "x86_64-linux";
|
|
||||||
in {
|
|
||||||
nixosConfigurations.my-host = nixpkgs.lib.nixosSystem {
|
|
||||||
inherit system;
|
|
||||||
specialArgs = { inherit inputs; };
|
|
||||||
modules = [
|
|
||||||
({ ... }: {
|
|
||||||
environment.systemPackages = [
|
|
||||||
inputs.z-bar-qt.packages.${system}.zshell
|
|
||||||
inputs.z-bar-qt.packages.${system}.zshell-cli
|
|
||||||
];
|
|
||||||
})
|
|
||||||
./configuration.nix
|
|
||||||
];
|
|
||||||
};
|
|
||||||
};
|
|
||||||
}
|
|
||||||
```
|
|
||||||
|
|
||||||
Then install shell + CLI from the flake packages:
|
|
||||||
|
|
||||||
```nix
|
|
||||||
{ pkgs, inputs, ... }:
|
|
||||||
let
|
|
||||||
system = pkgs.stdenv.hostPlatform.system;
|
|
||||||
in {
|
|
||||||
environment.systemPackages = [
|
|
||||||
inputs.z-bar-qt.packages.${system}.zshell
|
|
||||||
inputs.z-bar-qt.packages.${system}.zshell-cli
|
|
||||||
];
|
|
||||||
}
|
|
||||||
```
|
|
||||||
|
|
||||||
If you use Home Manager, the same packages can be added to `home.packages`.
|
|
||||||
|
|
||||||
Run shell via wrapper binary:
|
|
||||||
|
|
||||||
```bash
|
|
||||||
zshell
|
|
||||||
```
|
|
||||||
|
|
||||||
CLI entrypoint:
|
|
||||||
|
|
||||||
```bash
|
|
||||||
zshell-cli
|
|
||||||
```
|
|
||||||
|
|
||||||
## Running
|
## Running
|
||||||
|
|
||||||
|
|||||||
Generated
-48
@@ -1,48 +0,0 @@
|
|||||||
{
|
|
||||||
"nodes": {
|
|
||||||
"nixpkgs": {
|
|
||||||
"locked": {
|
|
||||||
"lastModified": 1771369470,
|
|
||||||
"narHash": "sha256-0NBlEBKkN3lufyvFegY4TYv5mCNHbi5OmBDrzihbBMQ=",
|
|
||||||
"owner": "nixos",
|
|
||||||
"repo": "nixpkgs",
|
|
||||||
"rev": "0182a361324364ae3f436a63005877674cf45efb",
|
|
||||||
"type": "github"
|
|
||||||
},
|
|
||||||
"original": {
|
|
||||||
"owner": "nixos",
|
|
||||||
"ref": "nixos-unstable",
|
|
||||||
"repo": "nixpkgs",
|
|
||||||
"type": "github"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"quickshell": {
|
|
||||||
"inputs": {
|
|
||||||
"nixpkgs": [
|
|
||||||
"nixpkgs"
|
|
||||||
]
|
|
||||||
},
|
|
||||||
"locked": {
|
|
||||||
"lastModified": 1770693276,
|
|
||||||
"narHash": "sha256-ngXnN5YXu+f45+QGYNN/VEBMQmcBCYGRCqwaK8cxY1s=",
|
|
||||||
"ref": "refs/heads/master",
|
|
||||||
"rev": "dacfa9de829ac7cb173825f593236bf2c21f637e",
|
|
||||||
"revCount": 735,
|
|
||||||
"type": "git",
|
|
||||||
"url": "https://git.outfoxxed.me/outfoxxed/quickshell"
|
|
||||||
},
|
|
||||||
"original": {
|
|
||||||
"type": "git",
|
|
||||||
"url": "https://git.outfoxxed.me/outfoxxed/quickshell"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"root": {
|
|
||||||
"inputs": {
|
|
||||||
"nixpkgs": "nixpkgs",
|
|
||||||
"quickshell": "quickshell"
|
|
||||||
}
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"root": "root",
|
|
||||||
"version": 7
|
|
||||||
}
|
|
||||||
@@ -1,71 +0,0 @@
|
|||||||
{
|
|
||||||
description = "Flake for zshell";
|
|
||||||
inputs = {
|
|
||||||
nixpkgs.url = "github:nixos/nixpkgs/nixos-unstable";
|
|
||||||
|
|
||||||
quickshell = {
|
|
||||||
url = "git+https://git.outfoxxed.me/outfoxxed/quickshell";
|
|
||||||
inputs.nixpkgs.follows = "nixpkgs";
|
|
||||||
};
|
|
||||||
};
|
|
||||||
|
|
||||||
outputs = {
|
|
||||||
self,
|
|
||||||
nixpkgs,
|
|
||||||
...
|
|
||||||
} @ inputs: let
|
|
||||||
forAllSystems = fn: nixpkgs.lib.genAttrs nixpkgs.lib.platforms.linux (system: fn nixpkgs.legacyPackages.${system});
|
|
||||||
in {
|
|
||||||
formatter = forAllSystems (pkgs: pkgs.nixfmt);
|
|
||||||
|
|
||||||
packages = forAllSystems (
|
|
||||||
pkgs: let
|
|
||||||
pythonEnv = pkgs.python3.withPackages (ps: [
|
|
||||||
ps.pillow
|
|
||||||
ps.materialyoucolor
|
|
||||||
]);
|
|
||||||
in rec {
|
|
||||||
zshell-cli = pkgs.callPackage ./nix/zshell-cli.nix {};
|
|
||||||
|
|
||||||
zshell = pkgs.callPackage ./nix {
|
|
||||||
rev = self.rev or self.dirtyRev;
|
|
||||||
stdenv = pkgs.clangStdenv;
|
|
||||||
|
|
||||||
quickshell = inputs.quickshell.packages.${pkgs.stdenv.hostPlatform.system}.default.override {
|
|
||||||
withX11 = false;
|
|
||||||
withI3 = false;
|
|
||||||
};
|
|
||||||
|
|
||||||
app2unit = pkgs.callPackage ./nix/app2unit.nix {};
|
|
||||||
|
|
||||||
inherit pythonEnv zshell-cli;
|
|
||||||
};
|
|
||||||
|
|
||||||
default = zshell;
|
|
||||||
}
|
|
||||||
);
|
|
||||||
|
|
||||||
devShells = forAllSystems (pkgs: {
|
|
||||||
default = let
|
|
||||||
system = pkgs.stdenv.hostPlatform.system;
|
|
||||||
shellPkg = self.packages.${system}.zshell;
|
|
||||||
cliPkg = self.packages.${system}.zshell-cli;
|
|
||||||
in
|
|
||||||
pkgs.mkShell.override {stdenv = shellPkg.stdenv;} {
|
|
||||||
inputsFrom = [
|
|
||||||
shellPkg
|
|
||||||
shellPkg.plugin
|
|
||||||
];
|
|
||||||
|
|
||||||
packages = with pkgs; [
|
|
||||||
shellPkg
|
|
||||||
cliPkg
|
|
||||||
|
|
||||||
material-symbols
|
|
||||||
rubik
|
|
||||||
nerd-fonts.caskaydia-cove
|
|
||||||
];
|
|
||||||
};
|
|
||||||
});
|
|
||||||
};
|
|
||||||
}
|
|
||||||
@@ -1,16 +0,0 @@
|
|||||||
{
|
|
||||||
pkgs,
|
|
||||||
fetchFromGitHub,
|
|
||||||
...
|
|
||||||
}:
|
|
||||||
pkgs.app2unit.overrideAttrs (
|
|
||||||
final: prev: rec {
|
|
||||||
version = "1.0.3";
|
|
||||||
src = fetchFromGitHub {
|
|
||||||
owner = "Vladimir-csp";
|
|
||||||
repo = "app2unit";
|
|
||||||
tag = "v${version}";
|
|
||||||
hash = "sha256-7eEVjgs+8k+/NLteSBKgn4gPaPLHC+3Uzlmz6XB0930=";
|
|
||||||
};
|
|
||||||
}
|
|
||||||
)
|
|
||||||
-146
@@ -1,146 +0,0 @@
|
|||||||
{
|
|
||||||
fftw,
|
|
||||||
libcava,
|
|
||||||
rev,
|
|
||||||
lib,
|
|
||||||
stdenv,
|
|
||||||
makeWrapper,
|
|
||||||
makeFontsConf,
|
|
||||||
app2unit,
|
|
||||||
networkmanager,
|
|
||||||
swappy,
|
|
||||||
wl-clipboard,
|
|
||||||
libqalculate,
|
|
||||||
bash,
|
|
||||||
hyprland,
|
|
||||||
material-symbols,
|
|
||||||
rubik,
|
|
||||||
nerd-fonts,
|
|
||||||
qt6,
|
|
||||||
quickshell,
|
|
||||||
aubio,
|
|
||||||
pipewire,
|
|
||||||
cmake,
|
|
||||||
ninja,
|
|
||||||
pkg-config,
|
|
||||||
pythonEnv,
|
|
||||||
zshell-cli,
|
|
||||||
ddcutil,
|
|
||||||
brightnessctl,
|
|
||||||
}:
|
|
||||||
let
|
|
||||||
version = "1.0.0";
|
|
||||||
|
|
||||||
runtimeDeps = [
|
|
||||||
pythonEnv
|
|
||||||
app2unit
|
|
||||||
networkmanager
|
|
||||||
swappy
|
|
||||||
wl-clipboard
|
|
||||||
libqalculate
|
|
||||||
bash
|
|
||||||
hyprland
|
|
||||||
zshell-cli
|
|
||||||
ddcutil
|
|
||||||
brightnessctl
|
|
||||||
];
|
|
||||||
|
|
||||||
fontconfig = makeFontsConf {
|
|
||||||
fontDirectories = [
|
|
||||||
material-symbols
|
|
||||||
rubik
|
|
||||||
nerd-fonts.caskaydia-cove
|
|
||||||
];
|
|
||||||
};
|
|
||||||
|
|
||||||
cmakeBuildType = "RelWithDebInfo";
|
|
||||||
|
|
||||||
cmakeVersionFlags = [
|
|
||||||
(lib.cmakeFeature "VERSION" version)
|
|
||||||
(lib.cmakeFeature "GIT_REVISION" rev)
|
|
||||||
(lib.cmakeFeature "DISTRIBUTOR" "nix-flake")
|
|
||||||
];
|
|
||||||
|
|
||||||
plugin = stdenv.mkDerivation {
|
|
||||||
inherit cmakeBuildType;
|
|
||||||
name = "zshell-qml-plugin";
|
|
||||||
src = lib.fileset.toSource {
|
|
||||||
root = ./..;
|
|
||||||
fileset = lib.fileset.union ./../CMakeLists.txt ./../Plugins;
|
|
||||||
};
|
|
||||||
|
|
||||||
nativeBuildInputs = [
|
|
||||||
cmake
|
|
||||||
ninja
|
|
||||||
pkg-config
|
|
||||||
];
|
|
||||||
buildInputs = [
|
|
||||||
pythonEnv
|
|
||||||
qt6.qtbase
|
|
||||||
qt6.qtdeclarative
|
|
||||||
libqalculate
|
|
||||||
pipewire
|
|
||||||
aubio
|
|
||||||
libcava
|
|
||||||
fftw
|
|
||||||
];
|
|
||||||
|
|
||||||
dontWrapQtApps = true;
|
|
||||||
cmakeFlags = [
|
|
||||||
(lib.cmakeFeature "ENABLE_MODULES" "plugin")
|
|
||||||
(lib.cmakeFeature "INSTALL_QMLDIR" qt6.qtbase.qtQmlPrefix)
|
|
||||||
]
|
|
||||||
++ cmakeVersionFlags;
|
|
||||||
};
|
|
||||||
in
|
|
||||||
stdenv.mkDerivation {
|
|
||||||
inherit version cmakeBuildType;
|
|
||||||
pname = "zshell";
|
|
||||||
src = ./..;
|
|
||||||
|
|
||||||
nativeBuildInputs = [
|
|
||||||
cmake
|
|
||||||
ninja
|
|
||||||
makeWrapper
|
|
||||||
qt6.wrapQtAppsHook
|
|
||||||
];
|
|
||||||
buildInputs = [
|
|
||||||
quickshell
|
|
||||||
plugin
|
|
||||||
qt6.qtbase
|
|
||||||
qt6.qtwayland
|
|
||||||
];
|
|
||||||
propagatedBuildInputs = runtimeDeps;
|
|
||||||
|
|
||||||
cmakeFlags = [
|
|
||||||
(lib.cmakeFeature "ENABLE_MODULES" "shell")
|
|
||||||
(lib.cmakeFeature "INSTALL_QSCONFDIR" "${placeholder "out"}/share/ZShell")
|
|
||||||
]
|
|
||||||
++ cmakeVersionFlags;
|
|
||||||
|
|
||||||
prePatch = ''
|
|
||||||
substituteInPlace shell.qml \
|
|
||||||
--replace-fail 'ShellRoot {' 'ShellRoot { settings.watchFiles: false'
|
|
||||||
'';
|
|
||||||
|
|
||||||
postInstall = ''
|
|
||||||
makeWrapper ${quickshell}/bin/qs $out/bin/zshell \
|
|
||||||
--prefix PATH : "${lib.makeBinPath runtimeDeps}" \
|
|
||||||
--set FONTCONFIG_FILE "${fontconfig}" \
|
|
||||||
--add-flags "-p $out/share/ZShell"
|
|
||||||
|
|
||||||
echo "$out"
|
|
||||||
mkdir -p $out/lib
|
|
||||||
'';
|
|
||||||
|
|
||||||
passthru = {
|
|
||||||
inherit plugin;
|
|
||||||
};
|
|
||||||
|
|
||||||
meta = {
|
|
||||||
description = "A very segsy desktop shell";
|
|
||||||
homepage = "https://github.com/Zacharias-Brohn/z-bar-qt";
|
|
||||||
license = lib.licenses.gpl3Only;
|
|
||||||
mainProgram = "zshell";
|
|
||||||
};
|
|
||||||
}
|
|
||||||
@@ -1,28 +0,0 @@
|
|||||||
{
|
|
||||||
python3,
|
|
||||||
installShellFiles,
|
|
||||||
}:
|
|
||||||
python3.pkgs.buildPythonApplication {
|
|
||||||
pname = "zshell-cli";
|
|
||||||
version = "0.1.0";
|
|
||||||
src = ../cli;
|
|
||||||
pyproject = true;
|
|
||||||
|
|
||||||
build-system = with python3.pkgs; [
|
|
||||||
hatch-vcs
|
|
||||||
hatchling
|
|
||||||
];
|
|
||||||
|
|
||||||
dependencies = with python3.pkgs; [
|
|
||||||
materialyoucolor
|
|
||||||
pillow
|
|
||||||
jinja2
|
|
||||||
typer
|
|
||||||
];
|
|
||||||
|
|
||||||
pythonImportsCheck = ["zshell"];
|
|
||||||
|
|
||||||
nativeBuildInputs = [installShellFiles];
|
|
||||||
|
|
||||||
SETUPTOOLS_SCM_PRETEND_VERSION = 1;
|
|
||||||
}
|
|
||||||
Reference in New Issue
Block a user