backlight: use brightnessctl instead of removed light binary
nixpkgs 26.05 dropped the 'light' package. Switch BacklightService to brightnessctl and bundle it in the wrapper PATH. Bump flake nixpkgs to nixos-26.05.
This commit is contained in:
parent
628ae67b7d
commit
0d0a3fd718
4 changed files with 9 additions and 7 deletions
8
flake.lock
generated
8
flake.lock
generated
|
|
@ -17,16 +17,16 @@
|
||||||
},
|
},
|
||||||
"nixpkgs": {
|
"nixpkgs": {
|
||||||
"locked": {
|
"locked": {
|
||||||
"lastModified": 1776169885,
|
"lastModified": 1780902259,
|
||||||
"narHash": "sha256-l/iNYDZ4bGOAFQY2q8y5OAfBBtrDAaPuRQqWaFHVRXM=",
|
"narHash": "sha256-q8yYEC5f1mFlQO9RGna4LTc9QrcvWunX6FYp83munkQ=",
|
||||||
"owner": "NixOS",
|
"owner": "NixOS",
|
||||||
"repo": "nixpkgs",
|
"repo": "nixpkgs",
|
||||||
"rev": "4bd9165a9165d7b5e33ae57f3eecbcb28fb231c9",
|
"rev": "bd0ff2d3eac24699c3664d5966b9ef36f388e2ca",
|
||||||
"type": "github"
|
"type": "github"
|
||||||
},
|
},
|
||||||
"original": {
|
"original": {
|
||||||
"owner": "NixOS",
|
"owner": "NixOS",
|
||||||
"ref": "nixos-unstable",
|
"ref": "nixos-26.05",
|
||||||
"repo": "nixpkgs",
|
"repo": "nixpkgs",
|
||||||
"type": "github"
|
"type": "github"
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -2,7 +2,7 @@
|
||||||
description = "nova-shell - minimal Quickshell bar for niri";
|
description = "nova-shell - minimal Quickshell bar for niri";
|
||||||
|
|
||||||
inputs = {
|
inputs = {
|
||||||
nixpkgs.url = "github:NixOS/nixpkgs/nixos-unstable";
|
nixpkgs.url = "github:NixOS/nixpkgs/nixos-26.05";
|
||||||
|
|
||||||
quickshell = {
|
quickshell = {
|
||||||
url = "git+https://git.outfoxxed.me/outfoxxed/quickshell";
|
url = "git+https://git.outfoxxed.me/outfoxxed/quickshell";
|
||||||
|
|
|
||||||
|
|
@ -8,6 +8,7 @@
|
||||||
nova-shaders,
|
nova-shaders,
|
||||||
nova-plugin,
|
nova-plugin,
|
||||||
glib,
|
glib,
|
||||||
|
brightnessctl,
|
||||||
}:
|
}:
|
||||||
let
|
let
|
||||||
shellSrc = lib.cleanSourceWith {
|
shellSrc = lib.cleanSourceWith {
|
||||||
|
|
@ -53,6 +54,7 @@ symlinkJoin {
|
||||||
lib.makeBinPath [
|
lib.makeBinPath [
|
||||||
nova-stats
|
nova-stats
|
||||||
glib
|
glib
|
||||||
|
brightnessctl
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
'';
|
'';
|
||||||
|
|
|
||||||
|
|
@ -14,12 +14,12 @@ QtObject {
|
||||||
|
|
||||||
function adjust(delta) {
|
function adjust(delta) {
|
||||||
const step = NS.ModulesService.backlightStep || 5;
|
const step = NS.ModulesService.backlightStep || 5;
|
||||||
_adjProc.cmd = delta > 0 ? "light -A " + step : "light -U " + step;
|
_adjProc.cmd = delta > 0 ? "brightnessctl set " + step + "%+" : "brightnessctl set " + step + "%-";
|
||||||
_adjProc.running = true;
|
_adjProc.running = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
function setPercent(pct) {
|
function setPercent(pct) {
|
||||||
_adjProc.cmd = "light -S " + Math.round(Math.max(0, Math.min(100, pct)));
|
_adjProc.cmd = "brightnessctl set " + Math.round(Math.max(0, Math.min(100, pct))) + "%";
|
||||||
_adjProc.running = true;
|
_adjProc.running = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
Reference in a new issue