Skip to content

Commit e4f7813

Browse files
committed
feat: add run and toolbox-run commands for GNOME Shell with auto-detection
1 parent 47f7e5b commit e4f7813

2 files changed

Lines changed: 56 additions & 15 deletions

File tree

README.md

Lines changed: 19 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -35,27 +35,31 @@ just install
3535
## Commands
3636

3737
```
38-
just # list all commands
39-
just build # build everything (deps + CSS + TS + zip)
40-
just install # build + install to GNOME Shell
41-
just quick # rebuild + copy files (skip full install)
42-
just uninstall # disable + remove extension
43-
just logs # show recent extension logs
44-
just clean # remove build artifacts
45-
just distclean # remove artifacts + node_modules
46-
just validate # type-check without emitting
47-
just lint # run eslint
48-
just watch # watch SCSS for changes
38+
just # list all commands
39+
just build # build everything (deps + CSS + TS + zip)
40+
just install # build + install to GNOME Shell
41+
just quick # rebuild + copy files (skip full install)
42+
just uninstall # disable + remove extension
43+
just run # build + install + run GNOME Shell (auto-detects --devkit or --nested)
44+
just toolbox-run # same as run, but inside a toolbox
45+
just create-toolbox # create a Fedora toolbox for testing
46+
just logs # show recent extension logs
47+
just clean # remove build artifacts
48+
just distclean # remove artifacts + node_modules
49+
just validate # type-check without emitting
50+
just lint # run eslint
51+
just watch # watch SCSS for changes
4952
```
5053

5154
## Testing
5255

5356
```bash
54-
# GNOME 49+
55-
dbus-run-session -- gnome-shell --devkit
57+
# Run directly on the host (builds, installs, and launches GNOME Shell)
58+
just run
5659

57-
# GNOME 48 and earlier
58-
dbus-run-session -- gnome-shell --nested --wayland
60+
# Run inside a toolbox (useful when host lacks gnome-shell dev packages)
61+
just create-toolbox # first time only
62+
just toolbox-run
5963
```
6064

6165
## Adding a Module

justfile

Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
uuid := "aurora-shell@luminusos.github.io"
22
ext_dir := env("HOME") / ".local/share/gnome-shell/extensions" / uuid
3+
toolbox_name := "gnome-shell-devel"
4+
toolbox_image := "registry.fedoraproject.org/fedora-toolbox:42"
35

46
# List available commands
57
default:
@@ -71,3 +73,38 @@ distclean: clean
7173
# Clean build + install
7274
all: clean build install
7375
@echo "Complete installation finished."
76+
77+
# Run GNOME Shell with the extension (auto-detects --devkit or --nested)
78+
run: install
79+
#!/usr/bin/env bash
80+
set -e
81+
if gnome-shell --help 2>&1 | grep -q -- --devkit; then
82+
mode=--devkit
83+
elif gnome-shell --help 2>&1 | grep -q -- --nested; then
84+
mode=--nested
85+
else
86+
echo "Error: gnome-shell has neither --devkit nor --nested support" >&2
87+
exit 1
88+
fi
89+
env XDG_CURRENT_DESKTOP=GNOME dbus-run-session gnome-shell "$mode"
90+
91+
# Run GNOME Shell with the extension inside a toolbox (auto-detects --devkit or --nested)
92+
toolbox-run: install
93+
#!/usr/bin/env bash
94+
set -e
95+
if toolbox --container {{ toolbox_name }} run gnome-shell --help 2>&1 | grep -q -- --devkit; then
96+
mode=--devkit
97+
elif toolbox --container {{ toolbox_name }} run gnome-shell --help 2>&1 | grep -q -- --nested; then
98+
mode=--nested
99+
else
100+
echo "Error: gnome-shell has neither --devkit nor --nested support" >&2
101+
exit 1
102+
fi
103+
toolbox --container {{ toolbox_name }} run \
104+
env XDG_CURRENT_DESKTOP=GNOME dbus-run-session gnome-shell "$mode"
105+
106+
# Create development toolbox for testing
107+
create-toolbox:
108+
toolbox create --image {{ toolbox_image }} {{ toolbox_name }}
109+
toolbox run --container {{ toolbox_name }} sudo dnf install -y gnome-shell glib2-devel
110+
@echo "Toolbox '{{ toolbox_name }}' created successfully."

0 commit comments

Comments
 (0)