tvbox volume controls + hermes vm + removing deprecation warnings
This commit is contained in:
1 parent
68b2f88282
commit
b014fa5cea
13 files changed
+127
-21
No files matched your search
@@ -5,5 +5,7 @@ require("conf/cec")
|
||||
-- =========================
|
||||
hl.on("hyprland.start", function()
|
||||
hl.exec_cmd("setpriv --ambient-caps -all -- hypridle")
|
||||
hl.exec_cmd("wpctl set-volume @DEFAULT_AUDIO_SINK@ 100%")
|
||||
hl.exec_cmd("wpctl set-mute @DEFAULT_AUDIO_SINK@ 0")
|
||||
Cec.wake_and_switch()
|
||||
end)
|
||||
@@ -18,9 +18,50 @@ local function wake_and_switch(target)
|
||||
cec_send("as", target)
|
||||
end
|
||||
|
||||
---Send a CEC "User Control Pressed" + "Released" key press to a device.
|
||||
---cec-client's built-in volup/voldown/mute shortcuts hardcode the CEC
|
||||
---"Audio System" address (5), which is a no-op when there's no amp/soundbar
|
||||
---on the bus — so volume keys go through raw tx frames addressed at the
|
||||
---TV instead, the same address `wake_and_switch` already proves works.
|
||||
---@param target integer CEC logical address (0 = TV)
|
||||
---@param ui_cmd string UI command hex byte, e.g. "41" Volume Up, "42" Volume Down, "43" Mute
|
||||
local function cec_key(target, ui_cmd)
|
||||
local src = 1
|
||||
local press = string.format("tx %x%x:44:%s", src, target, ui_cmd)
|
||||
local release = string.format("tx %x%x:45", src, target)
|
||||
hl.exec_cmd(
|
||||
string.format(
|
||||
"bash -c \"printf '%%s\\n%%s\\n' '%s' '%s' | cec-client -s -d 1 -o SkygBox -t p\"",
|
||||
press,
|
||||
release
|
||||
)
|
||||
)
|
||||
end
|
||||
|
||||
---@param target integer? defaults to 0 (TV)
|
||||
local function volume_up(target)
|
||||
cec_key(target or 0, "41")
|
||||
end
|
||||
|
||||
---@param target integer? defaults to 0 (TV)
|
||||
local function volume_down(target)
|
||||
cec_key(target or 0, "42")
|
||||
end
|
||||
|
||||
---@param target integer? defaults to 0 (TV)
|
||||
local function mute(target)
|
||||
cec_key(target or 0, "43")
|
||||
end
|
||||
|
||||
---@class Cec
|
||||
---@field send fun(cmd: string, target: integer)
|
||||
---@field wake_and_switch fun(target: integer?)
|
||||
---@field volume_up fun(target: integer?)
|
||||
---@field volume_down fun(target: integer?)
|
||||
---@field mute fun(target: integer?)
|
||||
Cec = Cec or {}
|
||||
Cec.send = cec_send
|
||||
Cec.wake_and_switch = wake_and_switch
|
||||
Cec.volume_up = volume_up
|
||||
Cec.volume_down = volume_down
|
||||
Cec.mute = mute
|
||||
@@ -64,8 +64,26 @@ hl.bind("XF86AudioStop", hl.dsp.exec_cmd("playerctl stop"))
|
||||
hl.bind("XF86ChannelUp", hl.dsp.focus({ direction = "right" }))
|
||||
hl.bind("XF86ChannelDown", hl.dsp.focus({ direction = "left" }))
|
||||
hl.bind("XF86HomePage", hl.dsp.exec_cmd("skygqts carousel ~/.config/hypr/skygqts-carousel.json"))
|
||||
hl.bind("XF86AudioRaiseVolume", hl.dsp.exec_cmd("noctalia msg volume-up"), { locked = true })
|
||||
hl.bind("XF86AudioLowerVolume", hl.dsp.exec_cmd("noctalia msg volume-down"), { locked = true })
|
||||
---- volume keys just remote-control the TV over CEC; the machine's own
|
||||
---- volume is pinned at 100%/unmuted (see force_max_volume) so all real
|
||||
---- volume control happens on the TV, not in software.
|
||||
local function force_max_volume()
|
||||
hl.exec_cmd("wpctl set-volume @DEFAULT_AUDIO_SINK@ 100%")
|
||||
hl.exec_cmd("wpctl set-mute @DEFAULT_AUDIO_SINK@ 0")
|
||||
end
|
||||
|
||||
hl.bind("XF86AudioRaiseVolume", function()
|
||||
force_max_volume()
|
||||
Cec.volume_up()
|
||||
end, { locked = true })
|
||||
hl.bind("XF86AudioLowerVolume", function()
|
||||
force_max_volume()
|
||||
Cec.volume_down()
|
||||
end, { locked = true })
|
||||
hl.bind("XF86AudioMute", function()
|
||||
force_max_volume()
|
||||
Cec.mute()
|
||||
end, { locked = true })
|
||||
|
||||
---- middle
|
||||
-- hl.bind("F5", hl.dsp.exec_cmd("")) -- LIVE TV
|
||||
|
||||
Generated
+43
-5
@@ -191,6 +191,27 @@
|
||||
"type": "github"
|
||||
}
|
||||
},
|
||||
"dank-greeter": {
|
||||
"inputs": {
|
||||
"dank-qml-common": "dank-qml-common",
|
||||
"nixpkgs": [
|
||||
"nixpkgs-unstable"
|
||||
]
|
||||
},
|
||||
"locked": {
|
||||
"lastModified": 1789053332,
|
||||
"narHash": "sha256-Z6tV5jX8Ah6RHIHeSnV6kEwJJZ6Ore+FR8F+vr9xjxY=",
|
||||
"owner": "AvengeMedia",
|
||||
"repo": "dank-greeter",
|
||||
"rev": "0175be5c2084e2c5027324403a329e04040cd0bc",
|
||||
"type": "github"
|
||||
},
|
||||
"original": {
|
||||
"owner": "AvengeMedia",
|
||||
"repo": "dank-greeter",
|
||||
"type": "github"
|
||||
}
|
||||
},
|
||||
"dank-qml-common": {
|
||||
"flake": false,
|
||||
"locked": {
|
||||
@@ -207,6 +228,22 @@
|
||||
"type": "github"
|
||||
}
|
||||
},
|
||||
"dank-qml-common_2": {
|
||||
"flake": false,
|
||||
"locked": {
|
||||
"lastModified": 1788376015,
|
||||
"narHash": "sha256-/tT8rTznLADndTwLBzdgzzgfJH1ZhYQibYo5v/F8U+U=",
|
||||
"owner": "AvengeMedia",
|
||||
"repo": "dank-qml-common",
|
||||
"rev": "26396ce432d6c71c3f5367438f96f4a8d667e160",
|
||||
"type": "github"
|
||||
},
|
||||
"original": {
|
||||
"owner": "AvengeMedia",
|
||||
"repo": "dank-qml-common",
|
||||
"type": "github"
|
||||
}
|
||||
},
|
||||
"darwin": {
|
||||
"inputs": {
|
||||
"nixpkgs": [
|
||||
@@ -367,7 +404,7 @@
|
||||
},
|
||||
"dms": {
|
||||
"inputs": {
|
||||
"dank-qml-common": "dank-qml-common",
|
||||
"dank-qml-common": "dank-qml-common_2",
|
||||
"flake-compat": "flake-compat_2",
|
||||
"nixpkgs": [
|
||||
"nixpkgs-unstable"
|
||||
@@ -794,11 +831,11 @@
|
||||
"nixpkgs": "nixpkgs_7"
|
||||
},
|
||||
"locked": {
|
||||
"lastModified": 1789495170,
|
||||
"narHash": "sha256-i3sHwKzO8xSztTDwBDalK8K/m71iyo9IbxSoUp+6++c=",
|
||||
"lastModified": 1789499413,
|
||||
"narHash": "sha256-RyMbCILS77BUTZqT1/ST3cVUsflfnp/7rm6S25MG4jA=",
|
||||
"ref": "refs/heads/main",
|
||||
"rev": "de2649f6e0d0695ec359bc3d27f124f160bc432b",
|
||||
"revCount": 3,
|
||||
"rev": "41ea93a28fc3b2a80231330c5f6d57f5f988af6b",
|
||||
"revCount": 7,
|
||||
"type": "git",
|
||||
"url": "ssh://gitea@minipc1.lab.internal:22/ari/hermenix.git"
|
||||
},
|
||||
@@ -2026,6 +2063,7 @@
|
||||
"inputs": {
|
||||
"agenix": "agenix",
|
||||
"claude-desktop": "claude-desktop",
|
||||
"dank-greeter": "dank-greeter",
|
||||
"determinate": "determinate",
|
||||
"disko": "disko",
|
||||
"dms": "dms",
|
||||
|
||||
@@ -28,6 +28,11 @@
|
||||
url = "github:AvengeMedia/DankMaterialShell/stable";
|
||||
inputs.nixpkgs.follows = "nixpkgs-unstable";
|
||||
};
|
||||
# DankShell greeter (moved out of the dms repo)
|
||||
dank-greeter = {
|
||||
url = "github:AvengeMedia/dank-greeter";
|
||||
inputs.nixpkgs.follows = "nixpkgs-unstable";
|
||||
};
|
||||
# Noctalia
|
||||
noctalia = {
|
||||
url = "github:noctalia-dev/noctalia-shell";
|
||||
@@ -93,6 +98,7 @@
|
||||
, hyprlauncher
|
||||
, hyprland
|
||||
, dms
|
||||
, dank-greeter
|
||||
, noctalia
|
||||
, git-hooks
|
||||
, nix-index-database
|
||||
@@ -132,6 +138,7 @@
|
||||
hyprland
|
||||
nixpkgs-unstable
|
||||
dms
|
||||
dank-greeter
|
||||
noctalia
|
||||
nix-index-database
|
||||
hermes-agent
|
||||
|
||||
+1
-1
@@ -88,7 +88,7 @@ in
|
||||
services.tailscale.enable = true;
|
||||
services.tailscale.extraDaemonFlags = [ "--statedir=/var/lib/tailscale" ];
|
||||
# Desktop Env - DankGreeter
|
||||
services.displayManager.dms-greeter = {
|
||||
programs.dms-greeter = {
|
||||
enable = true;
|
||||
compositor.name = "niri";
|
||||
configHome = "/home/${user.name}";
|
||||
|
||||
+1
-1
@@ -124,7 +124,7 @@ in
|
||||
# Tailscale
|
||||
services.tailscale.enable = true;
|
||||
# Desktop Env - DankGreeter
|
||||
services.displayManager.dms-greeter = {
|
||||
programs.dms-greeter = {
|
||||
enable = true;
|
||||
compositor.name = "hyprland";
|
||||
configHome = "/home/ari";
|
||||
|
||||
+1
-1
@@ -43,7 +43,7 @@
|
||||
boot.tmp.useTmpfs = true;
|
||||
|
||||
# Greeter
|
||||
services.displayManager.dms-greeter = {
|
||||
programs.dms-greeter = {
|
||||
enable = true;
|
||||
compositor.name = "hyprland";
|
||||
configHome = "/home/${config.skyg.user.name}";
|
||||
|
||||
+2
-2
@@ -41,7 +41,7 @@
|
||||
# nested seccomp doesn't work through the translation layer. Skip the test
|
||||
# suite for this build only — Determinate Nix itself stays enabled.
|
||||
nix.package = lib.mkForce (
|
||||
determinate.inputs.nix.packages.${pkgs.stdenv.system}.default.overrideAttrs (old: {
|
||||
determinate.inputs.nix.packages.${pkgs.stdenv.hostPlatform.system}.default.overrideAttrs (old: {
|
||||
doCheck = false;
|
||||
})
|
||||
);
|
||||
@@ -57,7 +57,7 @@
|
||||
# SD image has no swap partition; use compressed RAM swap instead.
|
||||
zramSwap.enable = true;
|
||||
|
||||
services.displayManager.dms-greeter = {
|
||||
programs.dms-greeter = {
|
||||
enable = true;
|
||||
compositor.name = "hyprland";
|
||||
configHome = "/home/${config.skyg.user.name}";
|
||||
|
||||
+2
-2
@@ -26,7 +26,7 @@
|
||||
# nested seccomp doesn't work through the translation layer. Skip the test
|
||||
# suite for this build only — Determinate Nix itself stays enabled.
|
||||
nix.package = lib.mkForce (
|
||||
determinate.inputs.nix.packages.${pkgs.stdenv.system}.default.overrideAttrs (old: {
|
||||
determinate.inputs.nix.packages.${pkgs.stdenv.hostPlatform.system}.default.overrideAttrs (old: {
|
||||
doCheck = false;
|
||||
})
|
||||
);
|
||||
@@ -40,7 +40,7 @@
|
||||
boot.kernelParams = [ "console=ttyS0,115200n8" "console=tty0" ];
|
||||
|
||||
zramSwap.enable = true;
|
||||
services.displayManager.dms-greeter = {
|
||||
programs.dms-greeter = {
|
||||
enable = true;
|
||||
compositor.name = "hyprland";
|
||||
configHome = "/home/${config.skyg.user.name}";
|
||||
|
||||
@@ -30,14 +30,14 @@
|
||||
# Buzz Desktop AppImage wrapper, see pkgs/buzz-desktop.
|
||||
buzz-desktop = final.callPackage ../../pkgs/buzz-desktop { };
|
||||
# Claude Desktop (Linux), see pkgs/claude-desktop.
|
||||
claude-desktop = claude-desktop.packages.${final.system}.default;
|
||||
claude-desktop = claude-desktop.packages.${final.stdenv.hostPlatform.system}.default;
|
||||
# herdr (herdrdev/herdr) — see flake.nix input.
|
||||
herdr = herdr.packages.${final.system}.default;
|
||||
herdr = herdr.packages.${final.stdenv.hostPlatform.system}.default;
|
||||
# flox (flox/flox) — see flake.nix input.
|
||||
flox_dev = flox.packages.${final.system}.default;
|
||||
skygqts = skygqts.packages.${final.system}.default;
|
||||
flox_dev = flox.packages.${final.stdenv.hostPlatform.system}.default;
|
||||
skygqts = skygqts.packages.${final.stdenv.hostPlatform.system}.default;
|
||||
# hermenix CLI (setup/migrate/remote) — see flake.nix input.
|
||||
hermenix = hermenix.packages.${final.system}.hermenix;
|
||||
hermenix = hermenix.packages.${final.stdenv.hostPlatform.system}.hermenix;
|
||||
})
|
||||
(final: prev: {
|
||||
pythonPackagesExtensions = prev.pythonPackagesExtensions ++ [
|
||||
|
||||
+1
-1
@@ -46,7 +46,7 @@ let
|
||||
nix-flatpak.nixosModules.nix-flatpak
|
||||
agenix.nixosModules.default
|
||||
specialArgs.dms.nixosModules.dank-material-shell
|
||||
specialArgs.dms.nixosModules.greeter
|
||||
specialArgs.dank-greeter.nixosModules.default
|
||||
specialArgs.nix-index-database.nixosModules.nix-index
|
||||
specialArgs.hermes-agent.nixosModules.default
|
||||
specialArgs.tether.nixosModules.default
|
||||
|
||||
@@ -92,7 +92,7 @@ clock box (`hl-pi1`) does not.
|
||||
## Conventions
|
||||
|
||||
- Don't set `tiler.enable` directly — enable a compositor and let it flip the shared switch.
|
||||
- Greeter is DMS-managed (`programs.dank-material-shell`); never hand-roll `services.greetd`.
|
||||
- Greeter is managed by the `dank-greeter` module (`programs.dms-greeter`); never hand-roll `services.greetd`.
|
||||
- Keyring provides the SSH agent here — keep `programs.ssh.startAgent` off.
|
||||
|
||||
## Touchscreen Gestures (niri only)
|
||||
|
||||
Reference in new issue
Block a user