diff options
| author | caley <195605706+cqley@users.noreply.github.com> | 2026-07-13 19:02:48 +0200 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2026-07-13 19:02:48 +0200 |
| commit | ed4c622f0d5daef1078344f2c1ad8f8e666cfb1b (patch) | |
| tree | 2b0e54bd4c71ac48fe69d1da76b0f518778e5612 | |
| parent | d5dc037e10d9d5348dc447c60dc955f733de0571 (diff) | |
Add rcd functionality and update master items
| -rw-r--r-- | nixos/mdls/qksh.nix | 52 |
1 files changed, 51 insertions, 1 deletions
diff --git a/nixos/mdls/qksh.nix b/nixos/mdls/qksh.nix index 35c068b..3c4ea8d 100644 --- a/nixos/mdls/qksh.nix +++ b/nixos/mdls/qksh.nix @@ -124,6 +124,7 @@ property var masterRootItems: [ { label: "cfg", sub: "cfg" }, { label: "sts", sub: "sts" }, + { label: "rcd", sub: "rcd" }, { label: "wp", sub: "wallpapers" }, { label: "pw", sub: "pw" } ] @@ -159,6 +160,8 @@ property var masterBarLookItems: [{ label: "float", barLook: "float" }, { label: "fill", barLook: "fill" }] property var masterWpItems: [] property string masterWpBuf: "" + property var masterRcdOutItems: [] + property string masterRcdOutBuf: "" property var masterPwItems: [ { label: "lock", cmd: ["hyprlock"] }, { label: "logout", cmd: ["hyprctl", "dispatch", "hl.dsp.exit()"] }, @@ -166,8 +169,14 @@ { label: "shutdown", cmd: ["systemctl", "poweroff"] } ] + function rcdItems() { + return recProc.running + ? [{ label: "stop", rcdStop: true }] + : [{ label: "start", sub: "rcdOutput" }] + } + function masterItemsForLevel(l) { - let lookup = { cfg: masterCfgItems, sts: masterStsItems, animations: masterAnimationsItems, bar: masterBarItems, barPosition: masterBarPositionItems, barLayout: masterBarLayoutItems, barMode: masterBarModeItems, barLook: masterBarLookItems, wallpapers: masterWpItems, pw: masterPwItems } + let lookup = { cfg: masterCfgItems, sts: masterStsItems, animations: masterAnimationsItems, bar: masterBarItems, barPosition: masterBarPositionItems, barLayout: masterBarLayoutItems, barMode: masterBarModeItems, barLook: masterBarLookItems, wallpapers: masterWpItems, pw: masterPwItems, rcd: rcdItems(), rcdOutput: masterRcdOutItems } return lookup[l] ?? masterRootItems } @@ -184,6 +193,10 @@ masterWpItems = []; masterWpBuf = "" masterCurrent = []; masterFiltered = [] wpLsProc.running = true + } else if (l === "rcdOutput") { + masterRcdOutItems = []; masterRcdOutBuf = "" + masterCurrent = []; masterFiltered = [] + rcdMonProc.running = true } else { masterCurrent = masterItemsForLevel(l) masterFiltered = masterCurrent @@ -232,6 +245,19 @@ mProc.running = true masterClose(); return } + if (item.rcdOut !== undefined) { + recProc.command = ["bash", "-c", "mkdir -p \"$HOME/videos\" && exec ${pkgs.gpu-screen-recorder}/bin/gpu-screen-recorder -w " + item.rcdOut + " -f 60 -q ultra -k hevc -fm cfr -a default_output -o \"$HOME/videos/meow_$(date +%Y%m%d_%H%M%S).mp4\""] + recProc.running = true + mProc3.command = ["${pkgs.libnotify}/bin/notify-send", "-t", "2000", "meow", "started on " + item.rcdOut] + mProc3.running = true + masterClose(); return + } + if (item.rcdStop !== undefined) { + recProc.signal(2) + mProc3.command = ["${pkgs.libnotify}/bin/notify-send", "-t", "2000", "meow", "saved"] + mProc3.running = true + masterClose(); return + } if (item.barPos !== undefined) { barSettings.position = item.barPos; masterClose(); return } if (item.barLyt !== undefined) { barSettings.layout = item.barLyt; masterClose(); return } if (item.barLook !== undefined) { barSettings.look = item.barLook; masterClose(); return } @@ -310,6 +336,30 @@ Process { id: mProc2; running: false } Process { id: mProc3; running: false } + Process { id: recProc; running: false } + + Process { + id: rcdMonProc + command: ["bash", "-c", "${pkgs.hyprland}/bin/hyprctl -j monitors | ${pkgs.jq}/bin/jq -r '.[].name'"] + running: false + stdout: SplitParser { + splitMarker: "" + onRead: data => { root.masterRcdOutBuf += data } + } + onRunningChanged: { + if (!running && root.masterRcdOutBuf !== "") { + let lines = root.masterRcdOutBuf.trim().split("\n").filter(l => l.length > 0) + lines.push("portal") + root.masterRcdOutItems = lines.map(l => ({ label: l, rcdOut: l })) + root.masterRcdOutBuf = "" + if (root.activeMode === "master" && root.masterLevel === "rcdOutput") { + root.masterCurrent = root.masterRcdOutItems + root.masterFiltered = root.masterRcdOutItems + } + } + } + } + Process { id: wpLsProc command: ["bash", "-c", "ls $HOME/.wallpapers/"] |
