feat: upgrade to gnome 49
This commit is contained in:
@@ -8,26 +8,23 @@ all: dist/extension.js
|
|||||||
node_modules: package.json
|
node_modules: package.json
|
||||||
pnpm install
|
pnpm install
|
||||||
|
|
||||||
dist/extension.js dist/prefs.js: node_modules
|
dist/extension.js : node_modules
|
||||||
tsc
|
tsc
|
||||||
|
|
||||||
schemas/gschemas.compiled: schemas/org.gnome.shell.extensions.$(NAME).gschema.xml
|
schemas/gschemas.compiled: schemas/org.gnome.shell.extensions.$(NAME).gschema.xml
|
||||||
glib-compile-schemas schemas
|
glib-compile-schemas schemas
|
||||||
|
|
||||||
#
|
|
||||||
$(NAME).zip: dist/extension.js dist/prefs.js schemas/gschemas.compiled
|
$(NAME).zip: dist/extension.js dist/prefs.js schemas/gschemas.compiled
|
||||||
@cp -r schemas dist/
|
@rm -rf dist/*
|
||||||
@cp metadata.json dist/
|
@cp metadata.json dist/
|
||||||
@cp stylesheet.css dist/
|
@cp stylesheet.css dist/
|
||||||
|
@mkdir dist/schemas
|
||||||
|
@cp schemas/*.compiled dist/schemas/
|
||||||
@(cd dist && zip ../$(NAME).zip -9r .)
|
@(cd dist && zip ../$(NAME).zip -9r .)
|
||||||
|
|
||||||
|
|
||||||
pack: $(NAME).zip
|
pack: $(NAME).zip
|
||||||
|
|
||||||
install: $(NAME).zip
|
install: $(NAME).zip
|
||||||
@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:
|
clean:
|
||||||
@rm -rf dist node_modules $(NAME).zip
|
@rm -rf dist node_modules $(NAME).zip
|
||||||
@@ -35,4 +32,5 @@ clean:
|
|||||||
test:
|
test:
|
||||||
@dbus-run-session -- gnome-shell --nested --wayland
|
@dbus-run-session -- gnome-shell --nested --wayland
|
||||||
|
|
||||||
|
.PHONY: install-and-test
|
||||||
install-and-test: install test
|
install-and-test: install test
|
||||||
|
|||||||
+20
-15
@@ -1,20 +1,21 @@
|
|||||||
import GLib from 'gi://GLib';
|
import GLib from 'gi://GLib';
|
||||||
import Gio from 'gi://Gio';
|
|
||||||
import St from 'gi://St';
|
import St from 'gi://St';
|
||||||
import Meta from 'gi://Meta';
|
import Meta from 'gi://Meta';
|
||||||
import cairo from "cairo";
|
|
||||||
import Shell from 'gi://Shell';
|
|
||||||
import * as Main from 'resource:///org/gnome/shell/ui/main.js';
|
|
||||||
import {Extension, ExtensionMetadata} from 'resource:///org/gnome/shell/extensions/extension.js';
|
import {Extension, ExtensionMetadata} from 'resource:///org/gnome/shell/extensions/extension.js';
|
||||||
import Color, {HSLColor} from "./color.js";
|
import {HSLColor} from "./color.js";
|
||||||
import RGBColor from "./color.js";
|
import RGBColor from "./color.js";
|
||||||
|
// import Gio from 'gi://Gio';
|
||||||
|
// import cairo from "cairo";
|
||||||
|
// import Shell from 'gi://Shell';
|
||||||
|
// import * as Main from 'resource:///org/gnome/shell/ui/main.js';
|
||||||
|
|
||||||
export default class ActiveBorderExtension extends Extension {
|
export default class PrettyBorders extends Extension {
|
||||||
|
|
||||||
borderActor: St.Widget | null;
|
borderActor: St.Widget | null;
|
||||||
focusWindowSignals: any[];
|
focusWindowSignals: any[];
|
||||||
lastFocusedWindow: Meta.Window | null;
|
lastFocusedWindow: Meta.Window | null;
|
||||||
_focusSignal: number | null;
|
_focusSignal: number | null;
|
||||||
|
_windowCreateId : number | null;
|
||||||
|
|
||||||
// New variables for color.ts cycling
|
// New variables for color.ts cycling
|
||||||
colorTimeoutId: number | null;
|
colorTimeoutId: number | null;
|
||||||
@@ -27,6 +28,7 @@ export default class ActiveBorderExtension extends Extension {
|
|||||||
this.focusWindowSignals = [];
|
this.focusWindowSignals = [];
|
||||||
this.lastFocusedWindow = null;
|
this.lastFocusedWindow = null;
|
||||||
this._focusSignal = null;
|
this._focusSignal = null;
|
||||||
|
this._windowCreateId = null;
|
||||||
|
|
||||||
// Initialize color.ts cycling variables
|
// Initialize color.ts cycling variables
|
||||||
this.colorTimeoutId = null;
|
this.colorTimeoutId = null;
|
||||||
@@ -37,15 +39,17 @@ export default class ActiveBorderExtension extends Extension {
|
|||||||
console.log("STARTING PRETTY BORDERS!")
|
console.log("STARTING PRETTY BORDERS!")
|
||||||
// Connect to the focus window signal to track the active window
|
// Connect to the focus window signal to track the active window
|
||||||
this._focusSignal = global.display.connect('notify::focus-window', () => {
|
this._focusSignal = global.display.connect('notify::focus-window', () => {
|
||||||
console.log("Focus Changed")
|
// console.log("Focus Changed")
|
||||||
this._updateBorder(global.display.focus_window);
|
this._updateBorder(global.display.focus_window);
|
||||||
})
|
})
|
||||||
// Set initial border on the current window, if there is one
|
// Set initial border on the current window, if there is one
|
||||||
this._updateBorder(global.display.focus_window);
|
this._updateBorder(global.display.focus_window);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
_updateBorder(window: Meta.Window) {
|
_updateBorder(window: Meta.Window) {
|
||||||
console.log("UPDATING THE BORDER")
|
// console.log("UPDATING THE BORDER")
|
||||||
// Clear the previous border
|
// Clear the previous border
|
||||||
this._clearBorder();
|
this._clearBorder();
|
||||||
// Set a new border for the currently focused window
|
// Set a new border for the currently focused window
|
||||||
@@ -56,7 +60,7 @@ export default class ActiveBorderExtension extends Extension {
|
|||||||
}
|
}
|
||||||
|
|
||||||
_setBorder(window: Meta.Window) {
|
_setBorder(window: Meta.Window) {
|
||||||
console.log("SETTING THE BORDER")
|
// console.log("SETTING THE BORDER")
|
||||||
if (!window) return;
|
if (!window) return;
|
||||||
|
|
||||||
const rect = window.get_frame_rect();
|
const rect = window.get_frame_rect();
|
||||||
@@ -67,10 +71,10 @@ export default class ActiveBorderExtension extends Extension {
|
|||||||
name: 'active-window-border',
|
name: 'active-window-border',
|
||||||
// style_class: 'active-window-border',
|
// style_class: 'active-window-border',
|
||||||
reactive: false,
|
reactive: false,
|
||||||
x: rect.x - 2, // Adjust for border width
|
x: rect.x - 1, // Adjust for border width
|
||||||
y: rect.y - 2,
|
y: rect.y - 1,
|
||||||
width: rect.width + 4, // Increased to accommodate border
|
width: rect.width + 2, // Increased to accommodate border
|
||||||
height: rect.height + 4,
|
height: rect.height + 2,
|
||||||
// Initial style with default color.ts
|
// Initial style with default color.ts
|
||||||
// style: `border: 4px solid hsl(${this.hue}, 100%, 50%); border-radius: 5px;`,
|
// style: `border: 4px solid hsl(${this.hue}, 100%, 50%); border-radius: 5px;`,
|
||||||
// style: `border: 2px solid rgba(0, 0, 0, 0.5); border-radius: 3px;`
|
// style: `border: 2px solid rgba(0, 0, 0, 0.5); border-radius: 3px;`
|
||||||
@@ -97,11 +101,12 @@ export default class ActiveBorderExtension extends Extension {
|
|||||||
const rect = window.get_frame_rect();
|
const rect = window.get_frame_rect();
|
||||||
if (!rect) return;
|
if (!rect) return;
|
||||||
|
|
||||||
this.borderActor.set_position(rect.x - 2, rect.y - 2);
|
this.borderActor.set_position(rect.x - 1, rect.y - 1);
|
||||||
this.borderActor.set_size(rect.width + 2, rect.height + 2);
|
this.borderActor.set_size(rect.width + 2, rect.height + 2);
|
||||||
}
|
}
|
||||||
|
|
||||||
_clearBorder() {
|
_clearBorder() {
|
||||||
|
// console.log("Clearing Border!")
|
||||||
// Stop the color.ts cycling
|
// Stop the color.ts cycling
|
||||||
this._stopColorCycle();
|
this._stopColorCycle();
|
||||||
|
|
||||||
@@ -135,7 +140,7 @@ export default class ActiveBorderExtension extends Extension {
|
|||||||
|
|
||||||
_getStyleRGBA() {
|
_getStyleRGBA() {
|
||||||
let rgb = RGBColor.fromHSL(this.currentColor)
|
let rgb = RGBColor.fromHSL(this.currentColor)
|
||||||
return `border: 2px solid rgba(${rgb.r}, ${rgb.b}, ${rgb.g}, ${rgb.a}); border-radius: 10px;`
|
return `border: 3px solid rgba(${rgb.r}, ${rgb.b}, ${rgb.g}, ${rgb.a}); border-radius: 10px;`
|
||||||
}
|
}
|
||||||
|
|
||||||
// Stop the color.ts cycling
|
// Stop the color.ts cycling
|
||||||
|
|||||||
@@ -0,0 +1,30 @@
|
|||||||
|
set dotenv-load
|
||||||
|
NAME:="prettyborders"
|
||||||
|
DOMAIN:="lucaso.io"
|
||||||
|
|
||||||
|
packages:
|
||||||
|
pnpm install
|
||||||
|
|
||||||
|
build: packages
|
||||||
|
rm -rf dist/*
|
||||||
|
tsc
|
||||||
|
glib-compile-schemas schemas
|
||||||
|
cp metadata.json dist/
|
||||||
|
cp stylesheet.css dist/
|
||||||
|
mkdir dist/schemas
|
||||||
|
cp schemas/*.compiled dist/schemas/
|
||||||
|
|
||||||
|
|
||||||
|
build-package: build
|
||||||
|
cd dist && zip ../{{NAME}}.zip -9r .
|
||||||
|
|
||||||
|
|
||||||
|
install: build
|
||||||
|
mkdir -p ~/.local/share/gnome-shell/extensions/{{NAME}}@{{DOMAIN}}
|
||||||
|
rm -rf /.local/share/gnome-shell/extensions/{{NAME}}@{{DOMAIN}}/*
|
||||||
|
cp -r dist/* ~/.local/share/gnome-shell/extensions/{{NAME}}@{{DOMAIN}}/
|
||||||
|
|
||||||
|
run:
|
||||||
|
dbus-run-session -- gnome-shell --nested --wayland
|
||||||
|
|
||||||
|
install-and-run: install run
|
||||||
+4
-2
@@ -1,8 +1,10 @@
|
|||||||
{
|
{
|
||||||
"name": "pretty-borders",
|
"name": "pretty-borders",
|
||||||
"description": "Adds pretty borders to the active and inactive windows",
|
"description": "Adds pretty rainbow or static borders to the active and inactive windows",
|
||||||
"uuid": "prettyborders@lucaso.io",
|
"uuid": "prettyborders@lucaso.io",
|
||||||
"shell-version": [
|
"shell-version": [
|
||||||
"47"
|
"47",
|
||||||
|
"48",
|
||||||
|
"49"
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
|
|||||||
+26
-9
@@ -1,12 +1,12 @@
|
|||||||
{
|
{
|
||||||
"name": "prettyborders",
|
"name": "prettyborders",
|
||||||
"version": "0.1.0",
|
"version": "0.2.0",
|
||||||
"description": "A TypeScript GNOME Extension for Pretty Borders",
|
"description": "A TypeScript GNOME Extension for Pretty Borders",
|
||||||
"type": "module",
|
"type": "module",
|
||||||
"private": true,
|
"private": true,
|
||||||
"repository": {
|
"repository": {
|
||||||
"type": "git",
|
"type": "git",
|
||||||
"url": "git+https://github.com/example/my-extension.git"
|
"url": "git+https://gitlab.com/lucasoskorep/prettyborders"
|
||||||
},
|
},
|
||||||
"author": "Lucas Oskorep <lucas.oskorep@gmail.com>",
|
"author": "Lucas Oskorep <lucas.oskorep@gmail.com>",
|
||||||
"license": "LGPL-3.0-or-later",
|
"license": "LGPL-3.0-or-later",
|
||||||
@@ -16,13 +16,30 @@
|
|||||||
"homepage": "https://github.com/example/my-extension#readme",
|
"homepage": "https://github.com/example/my-extension#readme",
|
||||||
"sideEffects": false,
|
"sideEffects": false,
|
||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
"eslint": "^9.14.0",
|
"@girs/gjs": "4.0.0-beta.38",
|
||||||
"eslint-plugin-jsdoc": "^50.4.3",
|
"@girs/gnome-shell": "49.0.1",
|
||||||
"typescript": "^5.6.3",
|
"eslint": "^9.27.0",
|
||||||
"@girs/gjs": "^4.0.0-beta.18",
|
"eslint-plugin-jsdoc": "^50.6.17",
|
||||||
"@girs/gnome-shell": "^47.0.0"
|
"typescript": "^5.8.3"
|
||||||
},
|
},
|
||||||
|
"pnpm": {
|
||||||
"dependencies": {
|
"overrides": {
|
||||||
|
"@girs/cairo-1.0": "1.0.0-4.0.0-beta.38",
|
||||||
|
"@girs/freetype2-2.0": "2.0.0-4.0.0-beta.38",
|
||||||
|
"@girs/gdk-4.0": "4.0.0-4.0.0-beta.38",
|
||||||
|
"@girs/gdkpixbuf-2.0": "2.0.0-4.0.0-beta.38",
|
||||||
|
"@girs/gio-2.0": "2.86.0-4.0.0-beta.38",
|
||||||
|
"@girs/gjs": "4.0.0-beta.38",
|
||||||
|
"@girs/glib-2.0": "2.86.0-4.0.0-beta.38",
|
||||||
|
"@girs/gmodule-2.0": "2.0.0-4.0.0-beta.38",
|
||||||
|
"@girs/gobject-2.0": "2.86.0-4.0.0-beta.38",
|
||||||
|
"@girs/graphene-1.0": "1.0.0-4.0.0-beta.38",
|
||||||
|
"@girs/gsk-4.0": "4.0.0-4.0.0-beta.38",
|
||||||
|
"@girs/gtk-4.0": "4.20.1-4.0.0-beta.38",
|
||||||
|
"@girs/harfbuzz-0.0": "11.5.0-4.0.0-beta.38",
|
||||||
|
"@girs/mtk-17": "17.0.0-4.0.0-beta.38",
|
||||||
|
"@girs/pango-1.0": "1.57.0-4.0.0-beta.38",
|
||||||
|
"@girs/pangocairo-1.0": "1.0.0-4.0.0-beta.38"
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Generated
+599
-640
File diff suppressed because it is too large
Load Diff
@@ -1,6 +1,6 @@
|
|||||||
<?xml version="1.0" encoding="UTF-8"?>
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
<schemalist>
|
<schemalist>
|
||||||
<schema id="org.gnome.shell.extensions.border-customizer" path="/org/gnome/shell/extensions/border-customizer/">
|
<schema id="org.gnome.shell.extensions.prettyborders" path="/org/gnome/shell/extensions/prettyborders/">
|
||||||
<key name="border-color" type="s">
|
<key name="border-color" type="s">
|
||||||
<default>'#FFFFFF'</default>
|
<default>'#FFFFFF'</default>
|
||||||
<summary>Border Color</summary>
|
<summary>Border Color</summary>
|
||||||
|
|||||||
Reference in New Issue
Block a user