Skip to content

Commit 4dcb524

Browse files
committed
Switch to Just, GNOME 48 compat update.
Signed-off-by: Andy Piper <andypiper@users.noreply.github.com>
1 parent 6e13f15 commit 4dcb524

7 files changed

Lines changed: 113 additions & 13 deletions

File tree

CHANGELOG.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
- 1.3
2+
- support GNOME 46 (thanks John Morahan), 48
13
- 1.2
24
- add copy option for artist/album name
35
- modify class names for namespacing to avoid conflicts

Justfile

Lines changed: 68 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,68 @@
1+
NAME := "tibr-ext"
2+
DOMAIN := "andypiper.org"
3+
EXTENSION_ID := NAME + "@" + DOMAIN
4+
5+
# List available commands
6+
default:
7+
@just --list
8+
9+
# Pack the extension using GNOME's tools and include extra sources
10+
pack:
11+
@echo "Packaging extension to {{ EXTENSION_ID }}.shell-extension.zip"
12+
gnome-extensions pack --force \
13+
--extra-source=api.js \
14+
--extra-source=images \
15+
--extra-source=radio.js \
16+
--extra-source=constants.js \
17+
{{ EXTENSION_ID }}
18+
zip -u {{ EXTENSION_ID }}.shell-extension.zip LICENSE README.md CHANGELOG.md
19+
@echo "Extension packaged successfully"
20+
21+
# Install the extension to the user's home directory
22+
install:
23+
@echo "Installing extension to ~/.local/share/gnome-shell/extensions/{{ EXTENSION_ID }}"
24+
@mkdir -p ~/.local/share/gnome-shell/extensions/{{ EXTENSION_ID }}
25+
@rm -rf ~/.local/share/gnome-shell/extensions/{{ EXTENSION_ID }}/*
26+
# Copy extension files from the tibr-ext@andypiper.org directory
27+
@cp -r {{ EXTENSION_ID }}/* ~/.local/share/gnome-shell/extensions/{{ EXTENSION_ID }}/
28+
@echo "Extension installed successfully"
29+
30+
# Start a nested GNOME Shell instance for testing
31+
test:
32+
MUTTER_DEBUG_DUMMY_MODE_SPECS="1600x900@60.0" dbus-run-session -- gnome-shell --nested --wayland
33+
34+
# Install and then immediately test the extension
35+
install-and-test: install
36+
@echo "Extension installed. Starting test environment..."
37+
@just test
38+
39+
# Create a GitHub release
40+
release VERSION message="New release": pack
41+
@echo "Creating GitHub release v{{ VERSION }}..."
42+
gh release create v{{ VERSION }} \
43+
--title "v{{ VERSION }}" \
44+
--notes "{{ message }}" \
45+
{{ EXTENSION_ID }}.shell-extension.zip
46+
@echo "GitHub release created successfully"
47+
48+
# Update the version in metadata.json
49+
update-version VERSION:
50+
@echo "Updating version to {{ VERSION }} in metadata.json"
51+
@sed -i 's/"version-name": "[^"]*"/"version-name": "{{ VERSION }}"/' {{ EXTENSION_ID }}/metadata.json
52+
@echo "Version updated successfully"
53+
54+
# Create a new release with version update
55+
full-release VERSION message="New release":
56+
@just update-version {{ VERSION }}
57+
@just pack
58+
@echo "Creating GitHub release v{{ VERSION }}..."
59+
gh release create v{{ VERSION }} \
60+
--title "v{{ VERSION }}" \
61+
--notes "{{ message }}" \
62+
{{ EXTENSION_ID }}.shell-extension.zip
63+
@echo "Full release process completed successfully"
64+
65+
# Remove build artifacts
66+
clean:
67+
@rm -rf {{ EXTENSION_ID }}.shell-extension.zip
68+
@echo "Build artifacts cleaned"

README.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -50,6 +50,12 @@ The extension is available to install [here](https://extensions.gnome.org/extens
5050
cp -r tibr-ext@andypiper.org ~/.local/share/gnome-shell/extensions/
5151
```
5252

53+
or, if the `just` command runner is installed:
54+
55+
```sh
56+
just install
57+
```
58+
5359
4. Restart GNOME Shell:
5460
- Press `Alt + F2`, type `r`, and press `Enter`.
5561
- (on Wayland, logout and log back in)

build.sh

Lines changed: 0 additions & 4 deletions
This file was deleted.

tibr-ext@andypiper.org/extension.js

Lines changed: 28 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@ import * as PanelMenu from 'resource:///org/gnome/shell/ui/panelMenu.js';
1313
import * as PopupMenu from 'resource:///org/gnome/shell/ui/popupMenu.js';
1414
import * as Slider from 'resource:///org/gnome/shell/ui/slider.js';
1515
import * as Main from 'resource:///org/gnome/shell/ui/main.js';
16+
import * as Config from 'resource:///org/gnome/shell/misc/config.js';
1617

1718
import { INACTIVE_RESET_TIMEOUT } from './constants.js';
1819
import * as Radio from './radio.js';
@@ -29,6 +30,9 @@ const TIBRPlayerPopup = GObject.registerClass(
2930
},
3031
class TIBRPlayerPopup extends PopupMenu.PopupBaseMenuItem {
3132
_init(player) {
33+
34+
const shellVersion = parseFloat(Config.PACKAGE_VERSION);
35+
3236
super._init({
3337
hover: false,
3438
activate: false,
@@ -42,18 +46,27 @@ const TIBRPlayerPopup = GObject.registerClass(
4246
this.player = player;
4347

4448
this.box = new St.BoxLayout({
45-
vertical: true,
49+
...(this.shellVersion >= 48
50+
? { orientation: Clutter.Orientation.VERTICAL }
51+
: { vertical: true }
52+
),
4653
width: 250,
4754
});
4855

4956
// Volume control section
5057
this.volBox = new St.BoxLayout({
51-
vertical: false,
58+
...(this.shellVersion >= 48
59+
? { orientation: Clutter.Orientation.HORIZONTAL }
60+
: { vertical: false }
61+
),
5262
width: 250,
5363
});
5464

5565
this.loadingBox = new St.BoxLayout({
56-
vertical: false,
66+
...(this.shellVersion >= 48
67+
? { orientation: Clutter.Orientation.HORIZONTAL }
68+
: { vertical: false }
69+
),
5770
x_align: Clutter.ActorAlign.CENTER,
5871
style_class: 'tibr-loading-box',
5972
});
@@ -104,7 +117,10 @@ const TIBRPlayerPopup = GObject.registerClass(
104117

105118
// Track metadata container
106119
this.metadataBox = new St.BoxLayout({
107-
vertical: true,
120+
...(this.shellVersion >= 48
121+
? { orientation: Clutter.Orientation.VERTICAL }
122+
: { vertical: true }
123+
),
108124
style_class: 'tibr-metadata-box',
109125
});
110126

@@ -124,7 +140,10 @@ const TIBRPlayerPopup = GObject.registerClass(
124140
});
125141

126142
this.artistInfoBox = new St.BoxLayout({
127-
vertical: false,
143+
...(this.shellVersion >= 48
144+
? { orientation: Clutter.Orientation.VERTICAL }
145+
: { vertical: true }
146+
),
128147
x_align: Clutter.ActorAlign.CENTER,
129148
x_expand: true,
130149
style_class: 'tibr-info-box',
@@ -166,7 +185,10 @@ const TIBRPlayerPopup = GObject.registerClass(
166185
this.artistInfoBox.add_child(this.artistCopyButton);
167186

168187
this.albumInfoBox = new St.BoxLayout({
169-
vertical: false,
188+
...(this.shellVersion >= 48
189+
? { orientation: Clutter.Orientation.VERTICAL }
190+
: { vertical: true }
191+
),
170192
x_align: Clutter.ActorAlign.CENTER,
171193
x_expand: true,
172194
style_class: 'tibr-info-box',

tibr-ext@andypiper.org/metadata.json

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,12 +4,13 @@
44
"uuid": "tibr-ext@andypiper.org",
55
"shell-version": [
66
"46",
7-
"47"
7+
"47",
8+
"48"
89
],
910
"url": "https://github.com/andypiper/theindiebeat-gnome-ext",
1011
"donations": {
1112
"github": "andypiper",
1213
"kofi": "andypiper"
1314
},
14-
"version-name": "1.2"
15+
"version-name": "1.3"
1516
}

tibr-ext@andypiper.org/radio.js

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ import Gst from 'gi://Gst';
55
import GObject from 'gi://GObject';
66
import St from 'gi://St';
77
import Clutter from 'gi://Clutter';
8+
import * as Config from 'resource:///org/gnome/shell/misc/config.js';
89

910
import { AzuraCastAPI } from './api.js';
1011
import {
@@ -19,8 +20,12 @@ export const TIBRControlButtons = GObject.registerClass(
1920
},
2021
class TIBRControlButtons extends St.BoxLayout {
2122
_init(player, pr) {
23+
const shellVersion = parseFloat(Config.PACKAGE_VERSION);
2224
super._init({
23-
vertical: false,
25+
...(this.shellVersion >= 48
26+
? { orientation: Clutter.Orientation.HORIZONTAL }
27+
: { vertical: false }
28+
),
2429
x_align: Clutter.ActorAlign.CENTER,
2530
x_expand: true,
2631
style: 'padding: 12px 0;'

0 commit comments

Comments
 (0)