From 2e8faa765786afbbb96c917e0a9b8e1ea81b78ed Mon Sep 17 00:00:00 2001
From: matt1432 <matt@nelim.org>
Date: Thu, 12 Oct 2023 01:01:38 -0400
Subject: [PATCH] feat(ags): launch apps with hyprctl instead of ags

---
 config/ags/TODO                   |  2 --
 config/ags/js/applauncher/main.js |  5 +++--
 nixos/flake.lock                  | 21 +++++++++------------
 nixos/flake.nix                   |  2 +-
 4 files changed, 13 insertions(+), 17 deletions(-)
 delete mode 100644 config/ags/TODO

diff --git a/config/ags/TODO b/config/ags/TODO
deleted file mode 100644
index 7ed31011..00000000
--- a/config/ags/TODO
+++ /dev/null
@@ -1,2 +0,0 @@
-On fullscreen, make bar disappear (opacity 0)
-Click to reappear
diff --git a/config/ags/js/applauncher/main.js b/config/ags/js/applauncher/main.js
index 798c8966..c121511a 100644
--- a/config/ags/js/applauncher/main.js
+++ b/config/ags/js/applauncher/main.js
@@ -1,4 +1,4 @@
-import { App, Applications, Widget } from '../../imports.js';
+import { App, Applications, Utils, Widget } from '../../imports.js';
 const { Label, Box, Icon, Button, Scrollable, Entry, EventBox } = Widget;
 const { getWindow } = App
 
@@ -21,7 +21,8 @@ const AppItem = (app, window) => {
     className: 'app',
     connections: [['clicked', () => {
       App.closeWindow(window);
-      app.launch();
+      Utils.exec(`hyprctl dispatch exec ${app.executable}`);
+      ++app.frequency;
     }]],
     child: Box({
       children: [
diff --git a/nixos/flake.lock b/nixos/flake.lock
index 9fa43d5a..4134cfa3 100644
--- a/nixos/flake.lock
+++ b/nixos/flake.lock
@@ -7,17 +7,14 @@
         ]
       },
       "locked": {
-        "lastModified": 1696980982,
-        "narHash": "sha256-8hXv02iTueoqWgS5aRi2p+jDgXxqPtp4S2hjYQsPCvw=",
-        "owner": "Aylur",
-        "repo": "ags",
-        "rev": "70b8966b2cd3a834d52a1062b1d2cc6a26e9c5ca",
-        "type": "github"
+        "lastModified": 1697084795,
+        "narHash": "sha256-LtX5RryB60j6vfSiX54rcGdaQVU5oH9JJc65ZtuizmU=",
+        "path": "/home/matt/git/ags",
+        "type": "path"
       },
       "original": {
-        "owner": "Aylur",
-        "repo": "ags",
-        "type": "github"
+        "path": "/home/matt/git/ags",
+        "type": "path"
       }
     },
     "flake-compat": {
@@ -530,11 +527,11 @@
     },
     "nur": {
       "locked": {
-        "lastModified": 1697069045,
-        "narHash": "sha256-80cy1s92pYIhD4FLaSAxLEgVcBo3gcX70GCm0Z7no9U=",
+        "lastModified": 1697083502,
+        "narHash": "sha256-WzXsFXmQJN/noHZPuSw+Yl3KeKOpKbH74iIzqKyiXWg=",
         "owner": "nix-community",
         "repo": "NUR",
-        "rev": "b5f2b4924ed6f505b95c71acd1180475d12396fd",
+        "rev": "6f5c921ddcc818b1e24a117721c58d0d5037e8b6",
         "type": "github"
       },
       "original": {
diff --git a/nixos/flake.nix b/nixos/flake.nix
index ce41449f..37628e93 100644
--- a/nixos/flake.nix
+++ b/nixos/flake.nix
@@ -19,7 +19,7 @@
     };
 
     ags = {
-      url = "github:Aylur/ags";
+      url = "path:/home/matt/git/ags";
       inputs.nixpkgs.follows = "nixpkgs";
     };