diff --git a/flake.nix b/flake.nix index aa48a52..98e97dd 100644 --- a/flake.nix +++ b/flake.nix @@ -48,7 +48,7 @@ pname = "hyprman"; version = "${self.shortRev or "dirty"}"; src = cleanSource ./.; - nimbleDepsHash = "sha256-72FYXiYIgEDX2j/bBADGvwX6+kd+7py0RHTz2WeyXO8="; + nimbleDepsHash = "sha256-hZ7aDy8mqfWxZqdCxB+z7OTc38u14fQaEwMqERSYqV0="; }; }); formatter = forAllSystems (pkgs: pkgs.nixfmt-rfc-style); diff --git a/hyprman.nimble b/hyprman.nimble index 36cbcf9..831ade2 100644 --- a/hyprman.nimble +++ b/hyprman.nimble @@ -11,7 +11,6 @@ bin = @["hyprman"] # Dependencies requires "nim >= 2.0.8" -requires "cligen" requires "yaml" requires "jsony" -requires "https://github.com/daylinmorgan/hwylterm#HEAD" +requires "https://github.com/daylinmorgan/hwylterm#b6202f4f" diff --git a/nimble.lock b/nimble.lock index 5a893ac..286e74a 100644 --- a/nimble.lock +++ b/nimble.lock @@ -1,24 +1,14 @@ { "version": 2, "packages": { - "cligen": { - "version": "1.7.6", - "vcsRevision": "54f1da5d63cf7e116625e2392e85ae54c2b70719", - "url": "https://github.com/c-blake/cligen.git", - "downloadMethod": "git", - "dependencies": [], - "checksums": { - "sha1": "853785ddace4ee4f3c6c21bdf7f5e9ff0358eb3f" - } - }, "hwylterm": { "version": "0.1.0", - "vcsRevision": "5c71355b5f319a9c174ea88132c7c67a78d00030", + "vcsRevision": "b6202f4f51edadd041d2b5f2aed1d75abcd4ee51", "url": "https://github.com/daylinmorgan/hwylterm", "downloadMethod": "git", "dependencies": [], "checksums": { - "sha1": "30f8f61787c36b63d484f3d5e149995fad16c63c" + "sha1": "eb38b434419ec70f080f79b7826c3c3989a2c74a" } }, "jsony": { diff --git a/src/hyprman.nim b/src/hyprman.nim index 5370c46..14d45c4 100644 --- a/src/hyprman.nim +++ b/src/hyprman.nim @@ -1,42 +1,52 @@ ## hyprman, the hyprland companion import std/[osproc, strformat] -import hwylterm/cligen, cligen +import hwylterm/hwylcli import ./[ hyprland, lib, mako, ] -hwylCli(clCfg) +hwylCli: + name "hyprman" + subcommands: + --- mako + ... "interact with mako" + flags: + count: + T int + ? "# of notifications" + * 10 + - c + json: + T bool + ? "output as json" + - j + reverse: + T bool + ? "swap notification order" + - r + run: + let history = getHistory(reverse, count) + if json: echo $(%* history) + else: + for n in history.notifications: + echo $bb(n) -proc start() = - ## launch eww - notify("starting eww") - for i in 0..