Compare commits
1
Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
9d8bde1413 |
@@ -18,7 +18,7 @@ jobs:
|
|||||||
uses: actions/checkout@v4
|
uses: actions/checkout@v4
|
||||||
|
|
||||||
- name: Install Docker CLI
|
- name: Install Docker CLI
|
||||||
run: apk add --no-cache docker-cli docker-cli-buildx
|
run: apk add --no-cache docker-cli
|
||||||
|
|
||||||
- name: Login to registry
|
- name: Login to registry
|
||||||
run: echo "${{ secrets.REGISTRY_TOKEN }}" | docker login git.aramjonghu.dev --username aramjonghu --password-stdin
|
run: echo "${{ secrets.REGISTRY_TOKEN }}" | docker login git.aramjonghu.dev --username aramjonghu --password-stdin
|
||||||
|
|||||||
@@ -20,10 +20,28 @@ jobs:
|
|||||||
-exec clang-format -i --style=file {} +
|
-exec clang-format -i --style=file {} +
|
||||||
git diff --exit-code && echo "clang-format: passed"
|
git diff --exit-code && echo "clang-format: passed"
|
||||||
|
|
||||||
build & lint:
|
build:
|
||||||
runs-on: alpine
|
runs-on: alpine
|
||||||
container:
|
container:
|
||||||
image: git.aramjonghu.dev/aramjonghu/zshell-ci:latest
|
image: git.aramjonghu.dev/aramjonghu/zshell-ci:latest
|
||||||
|
|
||||||
|
steps:
|
||||||
|
- name: Checkout
|
||||||
|
uses: actions/checkout@v4
|
||||||
|
with:
|
||||||
|
fetch-depth: 0
|
||||||
|
|
||||||
|
- name: Configure
|
||||||
|
run: cmake -B build -G Ninja -DENABLE_MODULES=plugin -DCMAKE_BUILD_TYPE=Release
|
||||||
|
|
||||||
|
- name: Build
|
||||||
|
run: ninja -C build
|
||||||
|
|
||||||
|
clang-tidy:
|
||||||
|
runs-on: alpine
|
||||||
|
container:
|
||||||
|
image: git.aramjonghu.dev/aramjonghu/zshell-ci:latest
|
||||||
|
|
||||||
steps:
|
steps:
|
||||||
- name: Checkout
|
- name: Checkout
|
||||||
uses: actions/checkout@v4
|
uses: actions/checkout@v4
|
||||||
@@ -40,7 +58,5 @@ jobs:
|
|||||||
run: |
|
run: |
|
||||||
sed -i 's/-mno-direct-extern-access //g' build/compile_commands.json
|
sed -i 's/-mno-direct-extern-access //g' build/compile_commands.json
|
||||||
set -o pipefail
|
set -o pipefail
|
||||||
run-clang-tidy -p build -j "$(nproc)" \
|
run-clang-tidy -p build -j $(nproc) -header-filter="Plugins/.*" 2>&1 | \
|
||||||
-source-filter="^$(pwd)/Plugins/" \
|
grep -v 'Suppressed\|non-user\|non-system\|unknown argument.*mno-direct\|Found compiler error\|warnings generated\.\|^Use -header-filter'
|
||||||
-header-filter=".*Plugins/.*" \
|
|
||||||
-removed-arg=-mno-direct-extern-access
|
|
||||||
|
|||||||
@@ -4,7 +4,7 @@ on:
|
|||||||
pull_request:
|
pull_request:
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
fmt & lint:
|
fmt:
|
||||||
runs-on: alpine
|
runs-on: alpine
|
||||||
container: node:26-alpine
|
container: node:26-alpine
|
||||||
|
|
||||||
@@ -24,6 +24,20 @@ jobs:
|
|||||||
else
|
else
|
||||||
echo "No JS/TS files found"
|
echo "No JS/TS files found"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
lint:
|
||||||
|
runs-on: alpine
|
||||||
|
container: node:26-alpine
|
||||||
|
|
||||||
|
steps:
|
||||||
|
- name: Checkout
|
||||||
|
uses: actions/checkout@v4
|
||||||
|
|
||||||
|
- name: Install tools
|
||||||
|
run: |
|
||||||
|
apk add --no-cache \
|
||||||
|
git
|
||||||
|
|
||||||
- name: ESLint
|
- name: ESLint
|
||||||
run: |
|
run: |
|
||||||
if [ -n "$(find . \( -iname "*.js" -o -iname "*.jsx" -o -iname "*.ts" -o -iname "*.tsx" -o -iname "*.mjs" -o -iname "*.cjs" \) -print -quit)" ]; then
|
if [ -n "$(find . \( -iname "*.js" -o -iname "*.jsx" -o -iname "*.ts" -o -iname "*.tsx" -o -iname "*.mjs" -o -iname "*.cjs" \) -print -quit)" ]; then
|
||||||
|
|||||||
@@ -7,7 +7,7 @@ on:
|
|||||||
pull_request:
|
pull_request:
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
fmt & lint:
|
static:
|
||||||
runs-on: debian
|
runs-on: debian
|
||||||
container: node:26-trixie-slim
|
container: node:26-trixie-slim
|
||||||
|
|
||||||
@@ -33,7 +33,7 @@ jobs:
|
|||||||
. .venv/bin/activate
|
. .venv/bin/activate
|
||||||
ruff check .
|
ruff check .
|
||||||
|
|
||||||
test & nuitka build:
|
verify:
|
||||||
if: always()
|
if: always()
|
||||||
runs-on: debian
|
runs-on: debian
|
||||||
container: node:26-trixie-slim
|
container: node:26-trixie-slim
|
||||||
@@ -64,4 +64,4 @@ jobs:
|
|||||||
- name: Nuitka module check
|
- name: Nuitka module check
|
||||||
run: |
|
run: |
|
||||||
. .venv/bin/activate
|
. .venv/bin/activate
|
||||||
nuitka --module --include-package=zshell cli/src/zshell/
|
nuitka --module --include-package=zshell cli/src/zshell/
|
||||||
+85
-20
@@ -3,9 +3,8 @@ name: Rust
|
|||||||
on:
|
on:
|
||||||
pull_request:
|
pull_request:
|
||||||
|
|
||||||
# jobs can be separated if we integrate tests
|
|
||||||
jobs:
|
jobs:
|
||||||
build, clippy & fmt:
|
build:
|
||||||
runs-on: alpine
|
runs-on: alpine
|
||||||
container: node:26-alpine
|
container: node:26-alpine
|
||||||
env:
|
env:
|
||||||
@@ -35,9 +34,7 @@ jobs:
|
|||||||
apk add --no-cache \
|
apk add --no-cache \
|
||||||
git \
|
git \
|
||||||
cargo \
|
cargo \
|
||||||
rust \
|
rust
|
||||||
rust-clippy \
|
|
||||||
rustfmt
|
|
||||||
|
|
||||||
- name: Cargo check
|
- name: Cargo check
|
||||||
run: |
|
run: |
|
||||||
@@ -53,22 +50,40 @@ jobs:
|
|||||||
else
|
else
|
||||||
echo "No Rust project found"
|
echo "No Rust project found"
|
||||||
fi
|
fi
|
||||||
- name: Clippy
|
|
||||||
|
fmt:
|
||||||
|
runs-on: alpine
|
||||||
|
container: node:26-alpine
|
||||||
|
env:
|
||||||
|
CARGO_HOME: ${{ github.workspace }}/.cargo
|
||||||
|
|
||||||
|
steps:
|
||||||
|
- name: Checkout
|
||||||
|
uses: actions/checkout@v4
|
||||||
|
|
||||||
|
- name: Cache cargo packages
|
||||||
|
uses: actions/cache@v4
|
||||||
|
env:
|
||||||
|
cache-name: cache-cargo-packages
|
||||||
|
with:
|
||||||
|
path: |
|
||||||
|
.cargo/registry
|
||||||
|
.cargo/git
|
||||||
|
target
|
||||||
|
key: rust-fmt-${{ runner.os }}-${{ env.cache-name }}-${{ hashFiles('**/Cargo.lock') }}
|
||||||
|
restore-keys: |
|
||||||
|
rust-${{ runner.os }}-build-${{ env.cache-name }}-
|
||||||
|
rust-${{ runner.os }}-build-
|
||||||
|
rust-
|
||||||
|
|
||||||
|
- name: Install tools
|
||||||
run: |
|
run: |
|
||||||
if [ -n "$(find . -name "Cargo.toml" -print -quit)" ]; then
|
apk add --no-cache \
|
||||||
status=0
|
git \
|
||||||
for manifest in $(find . -name "Cargo.toml"); do
|
cargo \
|
||||||
cargo clippy --manifest-path "$manifest" --all-targets --all-features -- -D warnings && \
|
rust \
|
||||||
echo "$manifest: Clippy passed" || \
|
rustfmt
|
||||||
{ echo "$manifest: Clippy failed"; status=1; }
|
|
||||||
done
|
|
||||||
exit $status
|
|
||||||
elif [ -n "$(find . -name "*.rs" -print -quit)" ]; then
|
|
||||||
echo "Rust files found but no Cargo.toml"
|
|
||||||
exit 1
|
|
||||||
else
|
|
||||||
echo "No Rust project found"
|
|
||||||
fi
|
|
||||||
- name: Format check
|
- name: Format check
|
||||||
run: |
|
run: |
|
||||||
if [ -n "$(find . -name "Cargo.toml" -print -quit)" ]; then
|
if [ -n "$(find . -name "Cargo.toml" -print -quit)" ]; then
|
||||||
@@ -85,3 +100,53 @@ jobs:
|
|||||||
else
|
else
|
||||||
echo "No Rust project found"
|
echo "No Rust project found"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
clippy:
|
||||||
|
runs-on: alpine
|
||||||
|
container: node:26-alpine
|
||||||
|
env:
|
||||||
|
CARGO_HOME: ${{ github.workspace }}/.cargo
|
||||||
|
|
||||||
|
steps:
|
||||||
|
- name: Checkout
|
||||||
|
uses: actions/checkout@v4
|
||||||
|
|
||||||
|
- name: Cache cargo packages
|
||||||
|
uses: actions/cache@v4
|
||||||
|
env:
|
||||||
|
cache-name: cache-cargo-packages
|
||||||
|
with:
|
||||||
|
path: |
|
||||||
|
.cargo/registry
|
||||||
|
.cargo/git
|
||||||
|
target
|
||||||
|
key: rust-clippy-${{ runner.os }}-${{ env.cache-name }}-${{ hashFiles('**/Cargo.lock') }}
|
||||||
|
restore-keys: |
|
||||||
|
rust-${{ runner.os }}-build-${{ env.cache-name }}-
|
||||||
|
rust-${{ runner.os }}-build-
|
||||||
|
rust-
|
||||||
|
|
||||||
|
- name: Install tools
|
||||||
|
run: |
|
||||||
|
apk add --no-cache \
|
||||||
|
git \
|
||||||
|
cargo \
|
||||||
|
rust \
|
||||||
|
rust-clippy
|
||||||
|
|
||||||
|
- name: Clippy
|
||||||
|
run: |
|
||||||
|
if [ -n "$(find . -name "Cargo.toml" -print -quit)" ]; then
|
||||||
|
status=0
|
||||||
|
for manifest in $(find . -name "Cargo.toml"); do
|
||||||
|
cargo clippy --manifest-path "$manifest" --all-targets --all-features -- -D warnings && \
|
||||||
|
echo "$manifest: Clippy passed" || \
|
||||||
|
{ echo "$manifest: Clippy failed"; status=1; }
|
||||||
|
done
|
||||||
|
exit $status
|
||||||
|
elif [ -n "$(find . -name "*.rs" -print -quit)" ]; then
|
||||||
|
echo "Rust files found but no Cargo.toml"
|
||||||
|
exit 1
|
||||||
|
else
|
||||||
|
echo "No Rust project found"
|
||||||
|
fi
|
||||||
|
|||||||
+10
-22
@@ -1,35 +1,23 @@
|
|||||||
|
**/__pycache__/
|
||||||
./result/
|
./result/
|
||||||
.pyre/
|
.pyre/
|
||||||
|
.cache/
|
||||||
|
.venv/
|
||||||
|
.qmlls.ini
|
||||||
|
build/
|
||||||
|
compile_commands.json
|
||||||
|
testpython
|
||||||
pkg/
|
pkg/
|
||||||
*.tar.*
|
*.tar.*
|
||||||
|
uv.lock
|
||||||
|
.qtcreator/
|
||||||
dist/
|
dist/
|
||||||
**/target/
|
**/target/
|
||||||
**/test-plugins/
|
**/test-plugins/
|
||||||
**/Charts/
|
**/Charts/
|
||||||
network-dev/
|
network-dev/
|
||||||
**/zshell.dist/
|
|
||||||
|
|
||||||
# Qml
|
|
||||||
.qtcreator/
|
|
||||||
.qmlls.ini
|
|
||||||
|
|
||||||
# CMake compile artifacts
|
|
||||||
.cache/
|
|
||||||
compile_commands.json
|
|
||||||
build/
|
|
||||||
|
|
||||||
# Python
|
|
||||||
uv.lock
|
|
||||||
testpython
|
|
||||||
.venv/
|
|
||||||
**/__pycache__/
|
|
||||||
|
|
||||||
# Nuitka compile
|
|
||||||
**/zshell.pyi
|
|
||||||
**/zshell.cpython-*
|
|
||||||
**/zshell.build/
|
**/zshell.build/
|
||||||
|
**/zshell.dist/
|
||||||
# Agents stuff
|
|
||||||
.opencode/
|
.opencode/
|
||||||
run-agent.sh
|
run-agent.sh
|
||||||
AGENTS.md
|
AGENTS.md
|
||||||
|
|||||||
@@ -218,7 +218,7 @@ void BlobInvertedRect::outerCornerRadii(float out[4]) const {
|
|||||||
const auto base = std::min(static_cast<float>(m_outerRadius), maxR);
|
const auto base = std::min(static_cast<float>(m_outerRadius), maxR);
|
||||||
out[0] = std::min(
|
out[0] = std::min(
|
||||||
m_outerTopRightRadius >= 0 ? static_cast<float>(m_outerTopRightRadius)
|
m_outerTopRightRadius >= 0 ? static_cast<float>(m_outerTopRightRadius)
|
||||||
: base,
|
: base,
|
||||||
maxR);
|
maxR);
|
||||||
out[1] = std::min(
|
out[1] = std::min(
|
||||||
m_outerBottomRightRadius >= 0
|
m_outerBottomRightRadius >= 0
|
||||||
|
|||||||
@@ -60,15 +60,11 @@ class BlobInvertedRect : public BlobShape {
|
|||||||
void setOuterRadius(qreal v);
|
void setOuterRadius(qreal v);
|
||||||
|
|
||||||
// Per-corner outer radii. -1 falls back to outerRadius (mirrors BlobRect).
|
// Per-corner outer radii. -1 falls back to outerRadius (mirrors BlobRect).
|
||||||
[[nodiscard]] qreal outerTopLeftRadius() const {
|
[[nodiscard]] qreal outerTopLeftRadius() const { return m_outerTopLeftRadius; }
|
||||||
return m_outerTopLeftRadius;
|
|
||||||
}
|
|
||||||
|
|
||||||
void setOuterTopLeftRadius(qreal v);
|
void setOuterTopLeftRadius(qreal v);
|
||||||
|
|
||||||
[[nodiscard]] qreal outerTopRightRadius() const {
|
[[nodiscard]] qreal outerTopRightRadius() const { return m_outerTopRightRadius; }
|
||||||
return m_outerTopRightRadius;
|
|
||||||
}
|
|
||||||
|
|
||||||
void setOuterTopRightRadius(qreal v);
|
void setOuterTopRightRadius(qreal v);
|
||||||
|
|
||||||
|
|||||||
@@ -240,7 +240,8 @@ void BlobShape::updatePolish() {
|
|||||||
m_cachedInvertedRadius = 0;
|
m_cachedInvertedRadius = 0;
|
||||||
memset(m_cachedInvertedOuter, 0, sizeof(m_cachedInvertedOuter));
|
memset(m_cachedInvertedOuter, 0, sizeof(m_cachedInvertedOuter));
|
||||||
memset(m_cachedInvertedInner, 0, sizeof(m_cachedInvertedInner));
|
memset(m_cachedInvertedInner, 0, sizeof(m_cachedInvertedInner));
|
||||||
memset(m_cachedInvertedOuterRadii, 0, sizeof(m_cachedInvertedOuterRadii));
|
memset(
|
||||||
|
m_cachedInvertedOuterRadii, 0, sizeof(m_cachedInvertedOuterRadii));
|
||||||
|
|
||||||
auto* inv = m_group->invertedRect();
|
auto* inv = m_group->invertedRect();
|
||||||
if (inv) {
|
if (inv) {
|
||||||
|
|||||||
@@ -14,9 +14,10 @@
|
|||||||
#include <hyprland/src/plugins/PluginAPI.hpp>
|
#include <hyprland/src/plugins/PluginAPI.hpp>
|
||||||
#include <hyprland/src/render/OpenGL.hpp>
|
#include <hyprland/src/render/OpenGL.hpp>
|
||||||
#include <hyprland/src/render/Renderer.hpp>
|
#include <hyprland/src/render/Renderer.hpp>
|
||||||
|
#include <hyprland/src/render/Context.hpp>
|
||||||
#undef private
|
#undef private
|
||||||
|
|
||||||
#include <hyprland/src/managers/EventManager.hpp>
|
#include <hyprland/src/ipc/s2/S2.hpp>
|
||||||
|
|
||||||
extern "C" {
|
extern "C" {
|
||||||
#include <lua.h>
|
#include <lua.h>
|
||||||
@@ -27,6 +28,7 @@ extern "C" {
|
|||||||
|
|
||||||
using ZShell::services::kelvinToGain;
|
using ZShell::services::kelvinToGain;
|
||||||
|
|
||||||
|
using Render::CRenderContext;
|
||||||
using Render::IFramebuffer;
|
using Render::IFramebuffer;
|
||||||
using Render::GL::CHyprOpenGLImpl;
|
using Render::GL::CHyprOpenGLImpl;
|
||||||
using Render::GL::g_pHyprOpenGL;
|
using Render::GL::g_pHyprOpenGL;
|
||||||
@@ -149,25 +151,14 @@ static bool gainIsNeutral(const std::array<float, 3>& gain) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
static CFunctionHook* g_pBeginHook = nullptr;
|
static CFunctionHook* g_pBeginHook = nullptr;
|
||||||
using origBegin = void (*)(
|
using origBegin = bool (*)(
|
||||||
CHyprOpenGLImpl*,
|
CHyprOpenGLImpl*,
|
||||||
|
CRenderContext&,
|
||||||
PHLMONITOR,
|
PHLMONITOR,
|
||||||
const CRegion&,
|
const CRegion&,
|
||||||
SP<IFramebuffer>,
|
SP<IFramebuffer>,
|
||||||
std::optional<CRegion>);
|
std::optional<CRegion>);
|
||||||
|
|
||||||
static CFunctionHook* g_pSaveMirrorHook = nullptr;
|
|
||||||
using origSaveMirror = bool (*)(CHyprOpenGLImpl*, const CBox&);
|
|
||||||
|
|
||||||
static bool hkSaveBufferForMirror(CHyprOpenGLImpl* thisptr, const CBox& box) {
|
|
||||||
const bool saved = thisptr->m_applyFinalShader;
|
|
||||||
thisptr->m_applyFinalShader = false;
|
|
||||||
const bool result = (*reinterpret_cast<origSaveMirror>(
|
|
||||||
g_pSaveMirrorHook->m_original))(thisptr, box);
|
|
||||||
thisptr->m_applyFinalShader = saved;
|
|
||||||
return result;
|
|
||||||
}
|
|
||||||
|
|
||||||
static void installShader() {
|
static void installShader() {
|
||||||
auto* gl = g_pHyprOpenGL.get();
|
auto* gl = g_pHyprOpenGL.get();
|
||||||
if (!gl) return;
|
if (!gl) return;
|
||||||
@@ -198,34 +189,33 @@ static void setUniformGain(const std::array<float, 3>& gain) {
|
|||||||
shader->setUniformFloat3(SHADER_TINT, gain[0], gain[1], gain[2]);
|
shader->setUniformFloat3(SHADER_TINT, gain[0], gain[1], gain[2]);
|
||||||
}
|
}
|
||||||
|
|
||||||
static void hkBegin(
|
static bool hkBegin(
|
||||||
CHyprOpenGLImpl* thisptr,
|
CHyprOpenGLImpl* thisptr,
|
||||||
|
CRenderContext& ctx,
|
||||||
PHLMONITOR mon,
|
PHLMONITOR mon,
|
||||||
const CRegion& damage,
|
const CRegion& damage,
|
||||||
SP<IFramebuffer> fb,
|
SP<IFramebuffer> fb,
|
||||||
std::optional<CRegion> finalDamage) {
|
std::optional<CRegion> finalDamage) {
|
||||||
(*reinterpret_cast<origBegin>(
|
const bool ok = (*reinterpret_cast<origBegin>(
|
||||||
g_pBeginHook->m_original))(thisptr, mon, damage, fb, finalDamage);
|
g_pBeginHook->m_original))(thisptr, ctx, mon, damage, fb, finalDamage);
|
||||||
|
if (!ok) return false;
|
||||||
|
|
||||||
if (fb) {
|
if (fb) ctx.m_data.blockScreenShader = true;
|
||||||
auto* renderer = g_pHyprRenderer.get();
|
|
||||||
if (renderer) renderer->m_renderData.blockScreenShader = true;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (!g_active) return;
|
if (!g_active) return true;
|
||||||
|
|
||||||
auto* gl = g_pHyprOpenGL.get();
|
auto* gl = g_pHyprOpenGL.get();
|
||||||
if (!gl) return;
|
if (!gl) return true;
|
||||||
|
|
||||||
if (gl->m_finalScreenShader.get() && gl->m_finalScreenShader->program() < 1)
|
if (gl->m_finalScreenShader.get() && 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 true;
|
||||||
|
|
||||||
if (g_transition.active) {
|
if (g_transition.active) {
|
||||||
auto* monPtr = mon.get();
|
auto* monPtr = mon.get();
|
||||||
if (!monPtr) return;
|
if (!monPtr) return true;
|
||||||
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)
|
||||||
@@ -265,6 +255,7 @@ static void hkBegin(
|
|||||||
} else if (g_uniformMode) {
|
} else if (g_uniformMode) {
|
||||||
setUniformGain(g_currentGain);
|
setUniformGain(g_currentGain);
|
||||||
}
|
}
|
||||||
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
static constexpr int KELVIN_MIN = 2000;
|
static constexpr int KELVIN_MIN = 2000;
|
||||||
@@ -333,9 +324,10 @@ static int luaNightlightState(lua_State* L) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
static void postStateEvent(bool enabled, bool animating) {
|
static void postStateEvent(bool enabled, bool animating) {
|
||||||
if (!g_pEventManager) return;
|
auto& sock = IPC::Socket2::sock();
|
||||||
g_pEventManager->postEvent(
|
if (!sock) return;
|
||||||
SHyprIPCEvent{
|
sock->postEvent(
|
||||||
|
IPC::Socket2::SEvent{
|
||||||
.event = "zshell-nightlight",
|
.event = "zshell-nightlight",
|
||||||
.data = std::format(
|
.data = std::format(
|
||||||
"{},{},{},{}",
|
"{},{},{},{}",
|
||||||
@@ -377,31 +369,6 @@ APICALL EXPORT PLUGIN_DESCRIPTION_INFO PLUGIN_INIT(HANDLE handle) {
|
|||||||
throw std::runtime_error("[zshell-nightlight] version mismatch");
|
throw std::runtime_error("[zshell-nightlight] version mismatch");
|
||||||
}
|
}
|
||||||
|
|
||||||
static const auto SAVEMIRROR_METHODS =
|
|
||||||
HyprlandAPI::findFunctionsByName(PHANDLE, "saveBufferForMirror");
|
|
||||||
const SFunctionMatch* saveMirrorTarget = findExactMethod(
|
|
||||||
SAVEMIRROR_METHODS,
|
|
||||||
manglePrefix("CHyprOpenGLImpl", "saveBufferForMirror"));
|
|
||||||
|
|
||||||
if (saveMirrorTarget) {
|
|
||||||
g_pSaveMirrorHook = HyprlandAPI::createFunctionHook(
|
|
||||||
PHANDLE,
|
|
||||||
saveMirrorTarget->address,
|
|
||||||
reinterpret_cast<void*>(&hkSaveBufferForMirror));
|
|
||||||
if (g_pSaveMirrorHook && g_pSaveMirrorHook->hook())
|
|
||||||
dlog(
|
|
||||||
"saveBufferForMirror hook installed: " +
|
|
||||||
saveMirrorTarget->signature);
|
|
||||||
}
|
|
||||||
|
|
||||||
if (!g_pSaveMirrorHook)
|
|
||||||
HyprlandAPI::addNotification(
|
|
||||||
PHANDLE,
|
|
||||||
"[zshell-nightlight] WARNING: couldn't hook saveBufferForMirror — "
|
|
||||||
"captures may still show the nightlight",
|
|
||||||
CHyprColor{1.f, 0.6f, 0.2f, 1.f},
|
|
||||||
8000);
|
|
||||||
|
|
||||||
static const auto METHODS =
|
static const auto METHODS =
|
||||||
HyprlandAPI::findFunctionsByName(PHANDLE, "begin");
|
HyprlandAPI::findFunctionsByName(PHANDLE, "begin");
|
||||||
const SFunctionMatch* target =
|
const SFunctionMatch* target =
|
||||||
|
|||||||
+53
-25
@@ -1,28 +1,56 @@
|
|||||||
FROM archlinux:latest
|
FROM archlinux:latest
|
||||||
|
|
||||||
RUN pacman -Syu --noconfirm \
|
RUN pacman -Syyu --noconfirm
|
||||||
&& pacman -S --needed --noconfirm \
|
|
||||||
base-devel cmake ninja clang lld nodejs tree-sitter \
|
|
||||||
jkqtplotter cmark-gfm git wayland-protocols ffmpeg mpv \
|
|
||||||
qt6-base qt6-declarative qt6-shadertools qt6-5compat \
|
|
||||||
qt6-canvaspainter qt6-wayland qt5-wayland \
|
|
||||||
libqalculate pipewire aubio cava lm_sensors glib2 \
|
|
||||||
&& pacman -Scc --noconfirm
|
|
||||||
|
|
||||||
RUN pacman -Syu --noconfirm \
|
# Build toolchain
|
||||||
&& pacman -S --needed --noconfirm \
|
RUN pacman -S --noconfirm \
|
||||||
sudo meson autoconf-archive python-tqdm \
|
base-devel \
|
||||||
&& useradd -m builder \
|
cmake \
|
||||||
&& printf '%s\n' 'builder ALL=(ALL) NOPASSWD: ALL' > /etc/sudoers.d/builder \
|
ninja \
|
||||||
&& chmod 0440 /etc/sudoers.d/builder \
|
clang \
|
||||||
&& for i in 1 2 3 4 5; do \
|
lld \
|
||||||
rm -rf /tmp/libcava; \
|
nodejs \
|
||||||
if git clone --depth 1 https://aur.archlinux.org/libcava.git /tmp/libcava; then break; fi; \
|
tree-sitter \
|
||||||
sleep 5; \
|
jkqtplotter \
|
||||||
done \
|
cmark-gfm \
|
||||||
&& test -d /tmp/libcava/.git \
|
git
|
||||||
&& chown -R builder:builder /tmp/libcava \
|
|
||||||
&& su builder -c "cd /tmp/libcava && makepkg -si --noconfirm" \
|
# Qt6
|
||||||
&& rm -rf /tmp/libcava /etc/sudoers.d/builder \
|
RUN pacman -S --noconfirm \
|
||||||
&& userdel -r builder \
|
qt6-base \
|
||||||
&& pacman -Scc --noconfirm
|
qt6-declarative \
|
||||||
|
qt6-shadertools \
|
||||||
|
qt6-5compat \
|
||||||
|
qt6-canvaspainter
|
||||||
|
|
||||||
|
# Project-specific dependencies
|
||||||
|
RUN pacman -S --noconfirm \
|
||||||
|
libqalculate \
|
||||||
|
pipewire \
|
||||||
|
aubio \
|
||||||
|
cava \
|
||||||
|
lm_sensors \
|
||||||
|
glib2
|
||||||
|
|
||||||
|
# AUR: libcava (provides development headers for cava)
|
||||||
|
RUN pacman -Syu --noconfirm && \
|
||||||
|
pacman -S --needed --noconfirm \
|
||||||
|
sudo \
|
||||||
|
meson \
|
||||||
|
autoconf-archive \
|
||||||
|
python-tqdm && \
|
||||||
|
useradd -m builder && \
|
||||||
|
echo "builder ALL=(ALL) NOPASSWD: ALL" >> /etc/sudoers
|
||||||
|
|
||||||
|
RUN for i in 1 2 3 4 5; do \
|
||||||
|
rm -rf /tmp/libcava && \
|
||||||
|
git clone --depth 1 https://aur.archlinux.org/libcava.git /tmp/libcava && \
|
||||||
|
break || sleep 5; \
|
||||||
|
done && \
|
||||||
|
test -d /tmp/libcava/.git && \
|
||||||
|
chown -R builder /tmp/libcava
|
||||||
|
|
||||||
|
RUN su builder -c "cd /tmp/libcava && makepkg -si --noconfirm" && \
|
||||||
|
rm -rf /tmp/libcava && \
|
||||||
|
userdel -r builder && \
|
||||||
|
sed -i '/^builder/d' /etc/sudoers
|
||||||
|
|||||||
@@ -1,106 +0,0 @@
|
|||||||
BUILD ?= cmake -B build -G Ninja
|
|
||||||
NONUITKA ?= cmake -S . -B build -G Ninja -DCMAKE_BUILD_TYPE=Release -DENABLE_MODULES="plugin;shell;m3shapes"
|
|
||||||
NINJA ?= ninja -C build
|
|
||||||
COMPILE ?= $(BUILD) && $(NINJA)
|
|
||||||
INSTALL ?= $(BUILD) && $(NINJA) && sudo ninja -C build install
|
|
||||||
|
|
||||||
CPPFMT ?= find . \( -name '*.cpp' -o -name '*.h' -o -name '*.hpp' \) -not -path './build/*' -exec clang-format -i --style=file {} +
|
|
||||||
CPPLINT ?= run-clang-tidy -p build -j "$$(nproc)" -source-filter="^$$(pwd)/Plugins/" -header-filter=".*Plugins/.*" -removed-arg=-mno-direct-extern-access
|
|
||||||
|
|
||||||
NUITKA ?= nuitka --module --include-package=zshell cli/src/zshell/ --output-dir=cli/
|
|
||||||
|
|
||||||
.DEFAULT_GOAL := help
|
|
||||||
|
|
||||||
# string is misaligned to align when run in terminal
|
|
||||||
help:
|
|
||||||
@echo "build cmake builds into build directory"
|
|
||||||
@echo "install cmake builds, compiles and installs into filesystem"
|
|
||||||
@echo "compile cmake builds and compiles C++ code"
|
|
||||||
@echo "cpp-fmt format C++ code with clang-format"
|
|
||||||
@echo "cpp-lint lint check C++ code with clang-tidy"
|
|
||||||
@echo "cpp-compile similar to make compile, but excludes Nuitka from compiling python"
|
|
||||||
@echo "py-fmt format Python code with ruff"
|
|
||||||
@echo "py-lint lint check Python code with ruff"
|
|
||||||
@echo "py-check lsp and typecheck all Python code using Basedpyright"
|
|
||||||
@echo "py-test run all Python tests using Pytest"
|
|
||||||
@echo "py-compile compiles Python code using Nuitka"
|
|
||||||
@echo "rs-compile compiles Rust code"
|
|
||||||
@echo "rs-format formats Rust code with Rustfmt"
|
|
||||||
@echo "rs-lint lint check Rust code with Clippy"
|
|
||||||
@echo "rs-test runs all Rust tests"
|
|
||||||
@echo "qml-fmt format QML code with qmlformat"
|
|
||||||
@echo "check-cpp runs all C++ checks"
|
|
||||||
@echo "check-py runs all Python checks"
|
|
||||||
@echo "check-rs runs all Rust checks"
|
|
||||||
|
|
||||||
build:
|
|
||||||
$(BUILD)
|
|
||||||
|
|
||||||
install:
|
|
||||||
$(INSTALL)
|
|
||||||
|
|
||||||
compile:
|
|
||||||
$(COMPILE)
|
|
||||||
|
|
||||||
# C++
|
|
||||||
cpp-fmt:
|
|
||||||
$(CPPFMT)
|
|
||||||
|
|
||||||
cpp-lint:
|
|
||||||
$(CPPLINT)
|
|
||||||
|
|
||||||
cpp-compile:
|
|
||||||
$(NONUITKA)
|
|
||||||
|
|
||||||
# Python
|
|
||||||
py-fmt:
|
|
||||||
ruff format --check
|
|
||||||
|
|
||||||
py-lint:
|
|
||||||
ruff check ./cli
|
|
||||||
|
|
||||||
py-check:
|
|
||||||
basedpyright
|
|
||||||
|
|
||||||
py-test:
|
|
||||||
python -m pytest ./cli/tests/ -v
|
|
||||||
|
|
||||||
# Want to use gcc, clang or zig C compiler instead? Output directory?
|
|
||||||
py-compile:
|
|
||||||
$(NUITKA)
|
|
||||||
|
|
||||||
# Rust
|
|
||||||
rs-compile:
|
|
||||||
cd ./zshell-img-tools/ && cargo run
|
|
||||||
|
|
||||||
rs-fmt:
|
|
||||||
cd ./zshell-img-tools/ && cargo fmt && echo "formatted!"
|
|
||||||
|
|
||||||
rs-lint:
|
|
||||||
cd ./zshell-img-tools/ && cargo clippy
|
|
||||||
|
|
||||||
rs-test:
|
|
||||||
cd ./zshell-img-tools/ && cargo test
|
|
||||||
|
|
||||||
# Qml
|
|
||||||
qml-fmt:
|
|
||||||
find -name '*.qml' -exec /usr/lib/qt6/bin/qmlformat -i {} +
|
|
||||||
|
|
||||||
# Full checks
|
|
||||||
check-cpp:
|
|
||||||
$(MAKE) cpp-fmt
|
|
||||||
$(MAKE) cpp-lint
|
|
||||||
$(MAKE) compile
|
|
||||||
|
|
||||||
check-rs:
|
|
||||||
$(MAKE) rs-fmt
|
|
||||||
$(MAKE) rs-lint
|
|
||||||
$(MAKE) rs-test
|
|
||||||
$(MAKE) rs-compile
|
|
||||||
|
|
||||||
check-py:
|
|
||||||
$(MAKE) py-fmt
|
|
||||||
$(MAKE) py-lint
|
|
||||||
$(MAKE) py-test
|
|
||||||
$(MAKE) py-check
|
|
||||||
$(MAKE) py-compile
|
|
||||||
Reference in New Issue
Block a user