🔧 chore: start new cli development, use pnpm's built-in github repo feature for gnim-utils

This commit is contained in:
retrozinndev
2025-10-07 10:04:09 -03:00
parent 1996ab88b8
commit 14a3855df8
12 changed files with 335 additions and 36 deletions
+13 -17
View File
@@ -2,29 +2,29 @@ import { exec, execAsync } from "ags/process";
import { register } from "ags/gobject";
import { AuthPopup } from "../widget/AuthPopup";
import AstalAuth from "gi://AstalAuth";
import Polkit from "gi://Polkit";
import PolkitAgent from "gi://PolkitAgent";
import Polkit from "gi://Polkit?version=1.0";
import PolkitAgent from "gi://PolkitAgent?version=1.0";
import Gio from "gi://Gio?version=2.0";
import GLib from "gi://GLib?version=2.0";
import AstalAuth from "gi://AstalAuth?version=0.1";
@register({ GTypeName: "AuthAgent" })
export class Auth extends PolkitAgent.Listener {
private static instance: Auth;
#subject: Polkit.Subject;
#pam: AstalAuth.Pam;
#handle: any;
#user: Polkit.UnixUser;
#pam: AstalAuth.Pam;
constructor() {
super();
this.#subject = Polkit.UnixSession.new("");
this.#pam = new AstalAuth.Pam();
this.#user = Polkit.UnixUser.new(Number.parseInt(exec("id -u"))) as Polkit.UnixUser;
this.#pam = new AstalAuth.Pam;
this.#handle = this.register(
PolkitAgent.RegisterFlags.RUN_IN_THREAD,
this.#subject,
"/io/github/retrozinndev/colorshell/PolicyKit/AuthAgent",
this.register(
PolkitAgent.RegisterFlags.RUN_IN_THREAD,
Polkit.UnixSession.new(this.#user.get_uid().toString()),
"/io/github/retrozinndev/colorshell/AuthAgent",
null
);
}
@@ -57,12 +57,8 @@ export class Auth extends PolkitAgent.Listener {
}
public static initAgent(): Auth {
if(!this.instance)
this.instance = new Auth();
return this.instance;
initiate_authentication_finish(res: Gio.AsyncResult): boolean {
}
// TODO: support fingerprint/facial auth
+1 -1
View File
@@ -17,7 +17,7 @@ export {
createScopedConnection,
createSecureBinding as secureBinding,
createSecureAccessorBinding as secureBaseBinding,
} from "../utils";
} from "gnim-utils";
export const decoder = new TextDecoder("utf-8"),
+2 -7
View File
@@ -1,11 +1,8 @@
import GObject, { register } from "ags/gobject";
import AstalWp from "gi://AstalWp";
export { Wireplumber };
@register({ GTypeName: "Wireplumber" })
class Wireplumber extends GObject.Object {
private static astalWireplumber: (AstalWp.Wp|null) = AstalWp.get_default();
export class Wireplumber {
private static astalWireplumber: AstalWp.Wp|null = AstalWp.get_default();
private static inst: Wireplumber;
private defaultSink: AstalWp.Endpoint = Wireplumber.astalWireplumber!.get_default_speaker()!;
@@ -15,8 +12,6 @@ class Wireplumber extends GObject.Object {
private maxSourceVolume: number = 100;
constructor() {
super();
if(!Wireplumber.astalWireplumber)
throw new Error("Audio features will not work correctly! Please install wireplumber first", {
cause: "Wireplumber library not found"