almost there
This commit is contained in:
parent
442b0f567d
commit
4259725632
4 changed files with 31 additions and 9 deletions
1
.envrc
Normal file
1
.envrc
Normal file
|
@ -0,0 +1 @@
|
||||||
|
use flake
|
3
.gitignore
vendored
3
.gitignore
vendored
|
@ -1 +1,2 @@
|
||||||
.direnv/
|
.direnv/
|
||||||
|
node_modules/
|
29
extension.ts
29
extension.ts
|
@ -1,14 +1,29 @@
|
||||||
import { Extension } from "resource:///org/gnome/shell/extensions/extension.js"
|
import { Extension } from "resource:///org/gnome/shell/extensions/extension.js"
|
||||||
import * as Main from "resource:///org/gnome/shell/ui/main.js"
|
import Gio from "gi://Gio"
|
||||||
import * as MessageTray from "resource:///org/gnome/shell/ui/messageTray.js"
|
|
||||||
|
|
||||||
export default class MyExtension extends Extension {
|
export default class AutoRotate extends Extension {
|
||||||
|
_listenerId?: number
|
||||||
enable() {
|
enable() {
|
||||||
Main.notify(
|
this._listenerId = global.display.connect(
|
||||||
"Simple Notification",
|
"in-fullscreen-changed",
|
||||||
"A notification with a title and body"
|
() => {
|
||||||
|
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)
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -20,6 +20,10 @@
|
||||||
in {
|
in {
|
||||||
_module.args.pkgs = import inputs.nixpkgs {inherit system;};
|
_module.args.pkgs = import inputs.nixpkgs {inherit system;};
|
||||||
|
|
||||||
|
devShells.default = pkgs.mkShell {
|
||||||
|
buildInputs = with pkgs; [nodejs];
|
||||||
|
};
|
||||||
|
|
||||||
packages.default = pkgs.buildNpmPackage (finalAttrs: {
|
packages.default = pkgs.buildNpmPackage (finalAttrs: {
|
||||||
pname = name;
|
pname = name;
|
||||||
version = "1.0.0";
|
version = "1.0.0";
|
||||||
|
@ -46,7 +50,7 @@
|
||||||
};
|
};
|
||||||
});
|
});
|
||||||
|
|
||||||
apps.install = {
|
apps.default = {
|
||||||
type = "app";
|
type = "app";
|
||||||
program = let
|
program = let
|
||||||
file = "/tmp/${uuid}.zip";
|
file = "/tmp/${uuid}.zip";
|
||||||
|
@ -54,6 +58,7 @@
|
||||||
pkgs.writeShellScriptBin "build" ''
|
pkgs.writeShellScriptBin "build" ''
|
||||||
env -C ${self'.packages.default}/${extDir} ${lib.getExe pkgs.zip} ${file} -FS9r .
|
env -C ${self'.packages.default}/${extDir} ${lib.getExe pkgs.zip} ${file} -FS9r .
|
||||||
gnome-extensions install --force ${file}
|
gnome-extensions install --force ${file}
|
||||||
|
dbus-run-session -- gnome-shell --nested --wayland
|
||||||
'';
|
'';
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue