feat: adding fixed version of this for using typescript
This commit is contained in:
@@ -14,17 +14,19 @@ dist/extension.js dist/prefs.js: node_modules
|
||||
schemas/gschemas.compiled: schemas/org.gnome.shell.extensions.$(NAME).gschema.xml
|
||||
glib-compile-schemas schemas
|
||||
|
||||
#
|
||||
$(NAME).zip: dist/extension.js dist/prefs.js schemas/gschemas.compiled
|
||||
@cp -r schemas dist/
|
||||
#@cp -r schemas dist/
|
||||
@cp metadata.json dist/
|
||||
@cp stylesheet.css dist/
|
||||
@(cd dist && zip ../$(NAME).zip -9r .)
|
||||
|
||||
pack: $(NAME).zip
|
||||
|
||||
install: $(NAME).zip
|
||||
@touch ~/.local/share/gnome-shell/extensions/$(NAME)@$(DOMAIN)
|
||||
@rm -rf ~/.local/share/gnome-shell/extensions/$(NAME)@$(DOMAIN)
|
||||
@mv dist ~/.local/share/gnome-shell/extensions/$(NAME)@$(DOMAIN)
|
||||
@mkdir -p ~/.local/share/gnome-shell/extensions/$(NAME)@$(DOMAIN)
|
||||
@rm -rf /.local/share/gnome-shell/extensions/$(NAME)@$(DOMAIN)/*
|
||||
@cp dist/* ~/.local/share/gnome-shell/extensions/$(NAME)@$(DOMAIN)/
|
||||
|
||||
clean:
|
||||
@rm -rf dist node_modules $(NAME).zip
|
||||
+7
-8
@@ -1,16 +1,14 @@
|
||||
import Meta from '@girs/meta-15';
|
||||
import GLib from 'gi://GLib';
|
||||
import Gio from 'gi://Gio';
|
||||
import St from 'gi://St';
|
||||
|
||||
import {Extension, ExtensionMetadata} from 'resource:///org/gnome/shell/extensions/extension.js';
|
||||
import Meta from 'gi://Meta';
|
||||
import Shell from 'gi://Shell';
|
||||
import * as Main from 'resource:///org/gnome/shell/ui/main.js';
|
||||
import giCairo from "@girs/gjs/cairo";
|
||||
import Content = giCairo.Content;
|
||||
import {LayoutManager} from "@girs/gnome-shell/ui/layout";
|
||||
|
||||
import { Extension, ExtensionMetadata } from 'resource:///org/gnome/shell/extensions/extension.js';
|
||||
|
||||
export default class ActiveBorderExtension extends Extension {
|
||||
|
||||
borderActor: Widget<LayoutManager, Content> | null;
|
||||
borderActor: St.Widget | null;
|
||||
focusWindowSignals: any[];
|
||||
lastFocusedWindow: Meta.Window | null;
|
||||
_focusSignal: number | null;
|
||||
@@ -106,6 +104,7 @@ export default class ActiveBorderExtension extends Extension {
|
||||
}
|
||||
|
||||
disable() {
|
||||
console.log("DISABLED PRETTY BORDERS!")
|
||||
// Disconnect the signal and remove any existing borders
|
||||
if (this._focusSignal) {
|
||||
global.display.disconnect(this._focusSignal);
|
||||
|
||||
Generated
+5
-1
@@ -1,9 +1,13 @@
|
||||
{
|
||||
"name": "prettyborders@lucaso.io",
|
||||
"name": "prettyborders",
|
||||
"version": "0.1.0",
|
||||
"lockfileVersion": 3,
|
||||
"requires": true,
|
||||
"packages": {
|
||||
"": {
|
||||
"name": "prettyborders",
|
||||
"version": "0.1.0",
|
||||
"license": "LGPL-3.0-or-later",
|
||||
"dependencies": {
|
||||
"@girs/gjs": "^4.0.0-beta.18",
|
||||
"@girs/gnome-shell": "^47.0.0"
|
||||
|
||||
@@ -1,4 +1,20 @@
|
||||
{
|
||||
"name": "prettyborders",
|
||||
"version": "0.1.0",
|
||||
"description": "A TypeScript GNOME Extension for Pretty Borders",
|
||||
"type": "module",
|
||||
"private": true,
|
||||
"repository": {
|
||||
"type": "git",
|
||||
"url": "git+https://github.com/example/my-extension.git"
|
||||
},
|
||||
"author": "Lucas Oskorep <lucas.oskorep@gmail.com>",
|
||||
"license": "LGPL-3.0-or-later",
|
||||
"bugs": {
|
||||
"url": "https://github.com/example/my-extension/issues"
|
||||
},
|
||||
"homepage": "https://github.com/example/my-extension#readme",
|
||||
"sideEffects": false,
|
||||
"devDependencies": {
|
||||
"eslint": "^9.14.0",
|
||||
"eslint-plugin-jsdoc": "^50.4.3",
|
||||
|
||||
@@ -1,51 +0,0 @@
|
||||
import Gtk from 'gi://Gtk';
|
||||
import Adw from 'gi://Adw';
|
||||
import Gio from 'gi://Gio';
|
||||
import { ExtensionPreferences, gettext as _ } from 'resource:///org/gnome/Shell/Extensions/js/extensions/prefs.js';
|
||||
|
||||
export default class GnomeRectanglePreferences extends ExtensionPreferences {
|
||||
_settings?: Gio.Settings
|
||||
|
||||
fillPreferencesWindow(window: Adw.PreferencesWindow) {
|
||||
this._settings = this.getSettings();
|
||||
|
||||
const page = new Adw.PreferencesPage({
|
||||
title: _('General'),
|
||||
iconName: 'dialog-information-symbolic',
|
||||
});
|
||||
|
||||
const animationGroup = new Adw.PreferencesGroup({
|
||||
title: _('Animation'),
|
||||
description: _('Configure move/resize animation'),
|
||||
});
|
||||
page.add(animationGroup);
|
||||
|
||||
const animationEnabled = new Adw.SwitchRow({
|
||||
title: _('Enabled'),
|
||||
subtitle: _('Wether to animate windows'),
|
||||
});
|
||||
animationGroup.add(animationEnabled);
|
||||
|
||||
const paddingGroup = new Adw.PreferencesGroup({
|
||||
title: _('Paddings'),
|
||||
description: _('Configure the padding between windows'),
|
||||
});
|
||||
page.add(paddingGroup);
|
||||
|
||||
const paddingInner = new Adw.SpinRow({
|
||||
title: _('Inner'),
|
||||
subtitle: _('Padding between windows'),
|
||||
adjustment: new Gtk.Adjustment({
|
||||
lower: 0,
|
||||
upper: 1000,
|
||||
stepIncrement: 1
|
||||
})
|
||||
});
|
||||
paddingGroup.add(paddingInner);
|
||||
|
||||
window.add(page)
|
||||
|
||||
this._settings!.bind('animate', animationEnabled, 'active', Gio.SettingsBindFlags.DEFAULT);
|
||||
this._settings!.bind('padding-inner', paddingInner, 'value', Gio.SettingsBindFlags.DEFAULT);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,15 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<schemalist>
|
||||
<schema id="org.gnome.shell.extensions.my-extension" path="/org/gnome/shell/extensions/my-extension/">
|
||||
<key name="padding-inner" type="i">
|
||||
<default>8</default>
|
||||
<summary>Inner padding</summary>
|
||||
<description>Padding between windows</description>
|
||||
</key>
|
||||
<key name="animate" type="b">
|
||||
<default>true</default>
|
||||
<summary>Animation</summary>
|
||||
<description>Whether to animate window movement/resizing</description>
|
||||
</key>
|
||||
</schema>
|
||||
</schemalist>
|
||||
+1
-1
@@ -15,6 +15,6 @@
|
||||
],
|
||||
"files": [
|
||||
"extension.ts",
|
||||
"prefs.ts"
|
||||
// "prefs.ts"
|
||||
],
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user