almost there

This commit is contained in:
Henry Hiles 2025-08-10 17:29:19 -04:00
commit 4259725632
No known key found for this signature in database
4 changed files with 31 additions and 9 deletions

1
.envrc Normal file
View file

@ -0,0 +1 @@
use flake

3
.gitignore vendored
View file

@ -1 +1,2 @@
.direnv/
.direnv/
node_modules/

View file

@ -1,14 +1,29 @@
import { Extension } from "resource:///org/gnome/shell/extensions/extension.js"
import * as Main from "resource:///org/gnome/shell/ui/main.js"
import * as MessageTray from "resource:///org/gnome/shell/ui/messageTray.js"
import Gio from "gi://Gio"
export default class MyExtension extends Extension {
export default class AutoRotate extends Extension {
_listenerId?: number
enable() {
Main.notify(
"Simple Notification",
"A notification with a title and body"
this._listenerId = global.display.connect(
"in-fullscreen-changed",
() => {
const monitors = global.display.get_n_monitors()
const isFullscreen =
[...new Array(monitors)].findIndex((_, index) =>
global.display.get_monitor_in_fullscreen(index)
) != -1
const { Meta } = imports.gi;
const monitorManager = Meta.MonitorManager.;
if (isFullscreen) {
} else {
}
}
)
}
disable() {}
disable() {
if (this._listenerId != null)
global.display.disconnect(this._listenerId)
}
}

View file

@ -20,6 +20,10 @@
in {
_module.args.pkgs = import inputs.nixpkgs {inherit system;};
devShells.default = pkgs.mkShell {
buildInputs = with pkgs; [nodejs];
};
packages.default = pkgs.buildNpmPackage (finalAttrs: {
pname = name;
version = "1.0.0";
@ -46,7 +50,7 @@
};
});
apps.install = {
apps.default = {
type = "app";
program = let
file = "/tmp/${uuid}.zip";
@ -54,6 +58,7 @@
pkgs.writeShellScriptBin "build" ''
env -C ${self'.packages.default}/${extDir} ${lib.getExe pkgs.zip} ${file} -FS9r .
gnome-extensions install --force ${file}
dbus-run-session -- gnome-shell --nested --wayland
'';
};
};