From 650a8c70fab72b407bf9c7163af1bb11f3ab07d3 Mon Sep 17 00:00:00 2001 From: matt1432 Date: Sun, 14 Jan 2024 20:52:30 -0500 Subject: [PATCH] feat(ags): add updateTypes script --- .../wim/config/ags/ts/media-player/mpris.ts | 1 - .../wim/config/ags/ts/media-player/player.ts | 34 +++---- .../wim/config/ags/ts/notifications/base.ts | 14 +-- .../config/ags/ts/on-screen-keyboard/keys.ts | 4 +- devices/wim/config/ags/ts/powermenu.ts | 1 - flake.lock | 98 ++++++++----------- modules/ags/default.nix | 16 +++ 7 files changed, 80 insertions(+), 88 deletions(-) diff --git a/devices/wim/config/ags/ts/media-player/mpris.ts b/devices/wim/config/ags/ts/media-player/mpris.ts index a3648936..781e23df 100644 --- a/devices/wim/config/ags/ts/media-player/mpris.ts +++ b/devices/wim/config/ags/ts/media-player/mpris.ts @@ -44,7 +44,6 @@ export const CoverArt = ( props: CenterBoxProps, ) => CenterBox({ ...props, - // @ts-expect-error vertical: true, attribute: { diff --git a/devices/wim/config/ags/ts/media-player/player.ts b/devices/wim/config/ags/ts/media-player/player.ts index fbd386e1..abb160aa 100644 --- a/devices/wim/config/ags/ts/media-player/player.ts +++ b/devices/wim/config/ags/ts/media-player/player.ts @@ -38,36 +38,26 @@ const Center = ( children: [ CenterBox({ - // @ts-expect-error vertical: true, - children: [ - Box({ - class_name: 'metadata', - vertical: true, - hpack: 'start', - vpack: 'center', - hexpand: true, + start_widget: Box({ + class_name: 'metadata', + vertical: true, + hpack: 'start', + vpack: 'center', + hexpand: true, - children: [ - mpris.TitleLabel(player), - mpris.ArtistLabel(player), - ], - }), - null, - null, - ], + children: [ + mpris.TitleLabel(player), + mpris.ArtistLabel(player), + ], + }), }), CenterBox({ - // @ts-expect-error vertical: true, - children: [ - null, - mpris.PlayPauseButton(player, colors), - null, - ], + center_widget: mpris.PlayPauseButton(player, colors), }), ], diff --git a/devices/wim/config/ags/ts/notifications/base.ts b/devices/wim/config/ags/ts/notifications/base.ts index e8e095ea..a39a467f 100644 --- a/devices/wim/config/ags/ts/notifications/base.ts +++ b/devices/wim/config/ags/ts/notifications/base.ts @@ -37,8 +37,8 @@ const NotificationIcon = (notif: NotifObj) => { console.log(box); }; - if (notif._appEntry && Applications.query(notif._appEntry).length > 0) { - const app = Applications.query(notif._appEntry)[0]; + if (notif.app_entry && Applications.query(notif.app_entry).length > 0) { + const app = Applications.query(notif.app_entry)[0]; let wmClass = app.app.get_string('StartupWMClass'); @@ -109,13 +109,13 @@ const NotificationIcon = (notif: NotifObj) => { let icon = 'dialog-information-symbolic'; - if (lookUpIcon(notif._appIcon)) { - icon = notif._appIcon; + if (lookUpIcon(notif.app_icon)) { + icon = notif.app_icon; } - if (notif._appEntry && lookUpIcon(notif._appEntry)) { - icon = notif._appEntry; + if (notif.app_entry && lookUpIcon(notif.app_entry)) { + icon = notif.app_entry; } @@ -158,7 +158,7 @@ export const Notification = ({ 'Spotify', ]; - if (BlockedApps.find((app) => app === notif._appName)) { + if (BlockedApps.find((app) => app === notif.app_name)) { notif.close(); return; diff --git a/devices/wim/config/ags/ts/on-screen-keyboard/keys.ts b/devices/wim/config/ags/ts/on-screen-keyboard/keys.ts index f0fe545e..cefce7cb 100644 --- a/devices/wim/config/ags/ts/on-screen-keyboard/keys.ts +++ b/devices/wim/config/ags/ts/on-screen-keyboard/keys.ts @@ -47,11 +47,11 @@ const LCTRL_CODE = 29; // Types import { Variable as Var } from 'types/variable.ts'; type Key = { - keytype: 'normal', + keytype: string, label: string, labelShift?: string, labelAltGr?: string, - shape: 'normal' | 'modkey', + shape: string, keycode: number }; diff --git a/devices/wim/config/ags/ts/powermenu.ts b/devices/wim/config/ags/ts/powermenu.ts index e50a298f..1da14588 100644 --- a/devices/wim/config/ags/ts/powermenu.ts +++ b/devices/wim/config/ags/ts/powermenu.ts @@ -9,7 +9,6 @@ import CursorBox from './misc/cursorbox.ts'; const PowermenuWidget = () => CenterBox({ class_name: 'powermenu', - // @ts-expect-error vertical: false, start_widget: CursorBox({ diff --git a/flake.lock b/flake.lock index cff5fb77..19c8e86a 100644 --- a/flake.lock +++ b/flake.lock @@ -7,11 +7,11 @@ ] }, "locked": { - "lastModified": 1705256758, - "narHash": "sha256-e6cybelQaZAK31zpnFjLciA4bAQvlFFVmh+Ob0H27QE=", + "lastModified": 1705273764, + "narHash": "sha256-qWHrCYk7IZhXhfkOESazhRwpSH85yJvOrOjBfmxE0QI=", "owner": "Aylur", "repo": "ags", - "rev": "d243a45872b36f286044becdfe6223890d504e5d", + "rev": "3fce4efcc25c981c552eb58108d01d64e7033e14", "type": "github" }, "original": { @@ -497,11 +497,11 @@ ] }, "locked": { - "lastModified": 1705169127, - "narHash": "sha256-j9OEtNxOIPWZWjbECVMkI1TO17SzlpHMm0LnVWKOR/g=", + "lastModified": 1705269478, + "narHash": "sha256-j7Rp8Y3ckBHOlIzqe0g2+/BVce9SU/dVtn4Eb0rMuY4=", "owner": "nix-community", "repo": "home-manager", - "rev": "f2942f3385f1b35cc8a1abb03a45e29c9cb4d3c8", + "rev": "846200eb574faa2af808ed02e653c2b8ed51fd71", "type": "github" }, "original": { @@ -542,11 +542,11 @@ "xdph": "xdph" }, "locked": { - "lastModified": 1705253252, - "narHash": "sha256-u3gEnjPq5zJR+/bJXHFw1gH7MB3ovj5bHFe3f7Pb2eo=", + "lastModified": 1705277009, + "narHash": "sha256-foKe6AfJ1HyjXOyaCpCIcsc08Nbyz00u7NV3QbQe0gA=", "owner": "hyprwm", "repo": "Hyprland", - "rev": "b6516bad0281efb55195e8db180aa2dcaf8b98e4", + "rev": "dcd7a92b01a360bbe7afa7299604c4040abb4c62", "type": "github" }, "original": { @@ -582,7 +582,11 @@ }, "hyprlang": { "inputs": { - "nixpkgs": "nixpkgs" + "nixpkgs": [ + "hyprland", + "xdph", + "nixpkgs" + ] }, "locked": { "lastModified": 1704287638, @@ -684,7 +688,7 @@ }, "nh": { "inputs": { - "nixpkgs": "nixpkgs_2" + "nixpkgs": "nixpkgs" }, "locked": { "lastModified": 1705251288, @@ -704,7 +708,7 @@ "inputs": { "flake-parts": "flake-parts_6", "nix-github-actions": "nix-github-actions", - "nixpkgs": "nixpkgs_6", + "nixpkgs": "nixpkgs_5", "treefmt-nix": "treefmt-nix" }, "locked": { @@ -747,14 +751,14 @@ "nix-gaming": { "inputs": { "flake-parts": "flake-parts_5", - "nixpkgs": "nixpkgs_3" + "nixpkgs": "nixpkgs_2" }, "locked": { - "lastModified": 1705242731, - "narHash": "sha256-gfuMbiOPlPpl48jH8hGPY/zfaS3OTjdVN2cn450RTBg=", + "lastModified": 1705281520, + "narHash": "sha256-lCKjL4GBNw74xLTd36OajeHw212S4mhKhRW2cLhCkfA=", "owner": "fufexan", "repo": "nix-gaming", - "rev": "c41c0e5e4fbf942046512760dfa31e88c61d4347", + "rev": "88d3fa859bb4baa2dff23f5546c0843bb51dca6e", "type": "github" }, "original": { @@ -792,11 +796,11 @@ ] }, "locked": { - "lastModified": 1705201750, - "narHash": "sha256-0umjkDiAoXDsIhaFlIIhKFTX/q7sMhfzvhNuY6wFdZo=", + "lastModified": 1705282324, + "narHash": "sha256-LnURMA7yCM5t7et9O2+2YfGQh0FKAfE5GyahNDDzJVM=", "owner": "Mic92", "repo": "nix-index-database", - "rev": "274a40dbf8be212697f3988471a4473987f8a886", + "rev": "49aaeecf41ae0a0944e2c627cb515bcde428a1d1", "type": "github" }, "original": { @@ -807,7 +811,7 @@ }, "nix-melt": { "inputs": { - "nixpkgs": "nixpkgs_4" + "nixpkgs": "nixpkgs_3" }, "locked": { "lastModified": 1704764047, @@ -851,16 +855,16 @@ }, "nixpkgs": { "locked": { - "lastModified": 1702645756, - "narHash": "sha256-qKI6OR3TYJYQB3Q8mAZ+DG4o/BR9ptcv9UnRV2hzljc=", - "owner": "nixos", + "lastModified": 1701263465, + "narHash": "sha256-lNXUIlkfyDyp9Ox21hr+wsEf/IBklLvb6bYcyeXbdRc=", + "owner": "NixOS", "repo": "nixpkgs", - "rev": "40c3c94c241286dd2243ea34d3aef8a488f9e4d0", + "rev": "50aa30a13c4ab5e7ba282da460a3e3d44e9d0eb3", "type": "github" }, "original": { "owner": "NixOS", - "ref": "nixos-unstable", + "ref": "nixos-23.11", "repo": "nixpkgs", "type": "github" } @@ -935,7 +939,7 @@ "flake-compat": "flake-compat_2", "lib-aggregate": "lib-aggregate", "nix-eval-jobs": "nix-eval-jobs", - "nixpkgs": "nixpkgs_7" + "nixpkgs": "nixpkgs_6" }, "locked": { "lastModified": 1705080950, @@ -952,22 +956,6 @@ } }, "nixpkgs_2": { - "locked": { - "lastModified": 1701263465, - "narHash": "sha256-lNXUIlkfyDyp9Ox21hr+wsEf/IBklLvb6bYcyeXbdRc=", - "owner": "NixOS", - "repo": "nixpkgs", - "rev": "50aa30a13c4ab5e7ba282da460a3e3d44e9d0eb3", - "type": "github" - }, - "original": { - "owner": "NixOS", - "ref": "nixos-23.11", - "repo": "nixpkgs", - "type": "github" - } - }, - "nixpkgs_3": { "locked": { "lastModified": 1704842529, "narHash": "sha256-OTeQA+F8d/Evad33JMfuXC89VMetQbsU4qcaePchGr4=", @@ -983,7 +971,7 @@ "type": "github" } }, - "nixpkgs_4": { + "nixpkgs_3": { "locked": { "lastModified": 1688590700, "narHash": "sha256-ZF055rIUP89cVwiLpG5xkJzx00gEuuGFF60Bs/LM3wc=", @@ -999,7 +987,7 @@ "type": "github" } }, - "nixpkgs_5": { + "nixpkgs_4": { "locked": { "lastModified": 1705133751, "narHash": "sha256-rCIsyE80jgiOU78gCWN3A0wE0tR2GI5nH6MlS+HaaSQ=", @@ -1015,7 +1003,7 @@ "type": "github" } }, - "nixpkgs_6": { + "nixpkgs_5": { "locked": { "lastModified": 1703134684, "narHash": "sha256-SQmng1EnBFLzS7WSRyPM9HgmZP2kLJcPAz+Ug/nug6o=", @@ -1031,7 +1019,7 @@ "type": "github" } }, - "nixpkgs_7": { + "nixpkgs_6": { "locked": { "lastModified": 1704722960, "narHash": "sha256-mKGJ3sPsT6//s+Knglai5YflJUF2DGj7Ai6Ynopz0kI=", @@ -1047,7 +1035,7 @@ "type": "github" } }, - "nixpkgs_8": { + "nixpkgs_7": { "locked": { "lastModified": 1689850295, "narHash": "sha256-fUYf6WdQlhd2H+3aR8jST5dhFH1d0eE22aes8fNIfyk=", @@ -1133,11 +1121,11 @@ }, "nur": { "locked": { - "lastModified": 1705263290, - "narHash": "sha256-KdeOMVfM7Ih/HdlUnNCyOl3Zw1q8lTpOOAK0ilM6nrM=", + "lastModified": 1705279394, + "narHash": "sha256-EaNfnCH9eXNrVptaoaqogaxILP1/C+lFFygJl3AxOuY=", "owner": "nix-community", "repo": "NUR", - "rev": "e29cbed55ca5a2cf117662bd9179a85476184ff6", + "rev": "902398e334b8e93403ab3ecb7b25d3c59f054224", "type": "github" }, "original": { @@ -1148,7 +1136,7 @@ }, "nurl": { "inputs": { - "nixpkgs": "nixpkgs_8" + "nixpkgs": "nixpkgs_7" }, "locked": { "lastModified": 1704764151, @@ -1284,7 +1272,7 @@ "nix-index-db": "nix-index-db", "nix-melt": "nix-melt", "nix-on-droid": "nix-on-droid", - "nixpkgs": "nixpkgs_5", + "nixpkgs": "nixpkgs_4", "nixpkgs-wayland": "nixpkgs-wayland", "nms": "nms", "nur": "nur", @@ -1563,11 +1551,11 @@ ] }, "locked": { - "lastModified": 1704400467, - "narHash": "sha256-IsEAKBCorRlN53FwFAMbyGLRsPVu/ZrWEJtCwykPds8=", + "lastModified": 1704659450, + "narHash": "sha256-3lyoUVtUWz1LuxbltAtkJSK2IlVXmKhxCRU2/0PYCms=", "owner": "hyprwm", "repo": "xdg-desktop-portal-hyprland", - "rev": "1c802128f6cc3db29a8ef01552b1a22f894eeefd", + "rev": "6a5de92769d5b7038134044053f90e7458f6a197", "type": "github" }, "original": { diff --git a/modules/ags/default.nix b/modules/ags/default.nix index f947db8c..a904de6c 100644 --- a/modules/ags/default.nix +++ b/modules/ags/default.nix @@ -39,6 +39,22 @@ in { ## gui pavucontrol # TODO: replace with ags widget + + (writeShellApplication { + name = "updateTypes"; + runtimeInputs = [ nodejs_18 typescript git ]; + text = '' + if [[ -d /tmp/ags-types ]]; then + rm -r /tmp/ags-types + fi + rm -r ~/.config/ags/types + + git clone https://github.com/Aylur/ags.git /tmp/ags-types + /tmp/ags-types/example/starter-config/setup.sh + + rm -r /tmp/ags-types + ''; + }) ]) ++ (optionals isTouchscreen (with pkgs; [ lisgd