almost there
This commit is contained in:
parent
442b0f567d
commit
4259725632
4 changed files with 31 additions and 9 deletions
29
extension.ts
29
extension.ts
|
@ -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)
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue