Skip to content

Commit cde3b01

Browse files
committed
feat: Replace JS launcher service with Rust launcher service
1 parent 3eda9bb commit cde3b01

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

51 files changed

+617
-3145
lines changed

.gitignore

+1
Original file line numberDiff line numberDiff line change
@@ -9,5 +9,6 @@ debian/*
99
!debian/control
1010
!debian/copyright
1111
!debian/rules
12+
!debian/*install
1213
.confirm_shortcut_change
1314
.vscode

Makefile

+2-10
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ compile: $(sources) clean
3838
env PROJECTS="$(PROJECTS)" sh scripts/transpile.sh
3939

4040
# Rebuild, install, reconfigure local settings, restart shell, and listen to journalctl logs
41-
debug: depcheck compile install install-system76-plugins configure enable restart-shell listen
41+
debug: depcheck compile install configure enable restart-shell listen
4242

4343
depcheck:
4444
@echo depcheck
@@ -57,20 +57,12 @@ disable:
5757
listen:
5858
journalctl -o cat -n 0 -f "$$(which gnome-shell)" | grep -v warning
5959

60-
local-install: depcheck compile install install-system76-plugins configure enable restart-shell
60+
local-install: depcheck compile install configure enable restart-shell
6161

6262
install:
6363
rm -rf $(INSTALLBASE)/$(INSTALLNAME)
6464
mkdir -p $(INSTALLBASE)/$(INSTALLNAME) $(PLUGIN_BASE) $(SCRIPTS_BASE)
6565
cp -r _build/* $(INSTALLBASE)/$(INSTALLNAME)/
66-
cp -r src/plugins/* $(PLUGIN_BASE)
67-
cp -r src/scripts/* $(SCRIPTS_BASE)
68-
chmod +x $(PLUGIN_BASE)/**/*.js $(SCRIPTS_BASE)/*
69-
70-
install-system76-plugins:
71-
mkdir -p $(SCRIPTS_BASE)
72-
cp -r src/scripts_system76/* $(SCRIPTS_BASE)
73-
chmod +x $(SCRIPTS_BASE)/*
7466

7567
uninstall:
7668
rm -rf $(INSTALLBASE)/$(INSTALLNAME)

README.md

+8-57
Original file line numberDiff line numberDiff line change
@@ -77,9 +77,9 @@ If you want to uninstall the extension, you may invoke `make uninstall`, and the
7777
7878
### Packaging status
7979

80-
- [Fedora](https://src.fedoraproject.org/rpms/gnome-shell-extension-pop-shell/): `sudo dnf install gnome-shell-extension-pop-shell`
80+
- [Fedora](https://src.fedoraproject.org/rpms/gnome-shell-extension-pop-shell/): `sudo dnf install gnome-shell-extension-pop-shell`
8181
- [Gentoo](https://packages.gentoo.org/packages/gnome-extra/gnome-shell-extension-pop-shell): `emerge gnome-shell-extension-pop-shell`
82-
- [Arch Linux](https://aur.archlinux.org/packages/?O=0&K=gnome-shell-extension-pop-shell) (Using Yay as AUR helper):
82+
- [Arch Linux](https://aur.archlinux.org/packages/?O=0&K=gnome-shell-extension-pop-shell) (Using Yay as AUR helper):
8383
- `yay -S gnome-shell-extension-pop-shell`
8484
- For precompiled binary version: `yay -S gnome-shell-extension-pop-shell-bin`
8585
- For GitHub repository version: `yay -S gnome-shell-extension-pop-shell-git`
@@ -142,29 +142,19 @@ Switching focus to the left will calculate from the center of the east side of t
142142

143143
### Launcher
144144

145-
The launcher is summoned with `Super` + `/`. The search list displays matching windows based on their window name and title, and applications on the system which can be launched. The arrow keys are used to select an application or window from the search list. If it is a window, the selected window will be visually highlighted with an overlay. Pressing `Return` on a window will bring that window to focus, switching to its workspace, and unminimizing it if it was minimized.
146-
147-
#### Launcher Modes
148-
149-
By default, the launcher searches windows and applications. However, you can designate a special launch mode using one of the supported prefixes:
150-
151-
- `:`: Execute a command in `sh`
152-
- `run` | `t:`: Execute a command in `sh` in a terminal
153-
- `=`: Calculator mode, powered by [MathJS](https://mathjs.org/)
154-
- `/` | `~`: Navigate and open directories and files in the file system
155-
- `d:`: Search recent documents
145+
Pop Shell provides an integrated launcher which interfaces directly with our [pop-launcher](https://github.com/pop-os/launcher) service. JSON IPC is used to communicate between the shell and the launcher in an asynchronous fashion. This functionality was separated from the shell due to performance and maintainability issues. The new launcher is written in Rust and fully async. The launcher has extensive features that would be useful for implementing desktop launchers beyond a shell extension.
156146

157147
### Inner and Outer Gaps
158148

159149
Gaps improve the aesthetics of tiled windows and make it easier to grab the edge of a specific window. We've decided to add support for inner and outer gaps, and made these settings configurable in the extension's popup menu.
160150

161151
### Hiding Window Title Bars
162152

163-
Windows with server-side decorations may have their title bars completely hidden, resulting in additional screen real estate for your applications, and a visually cleaner environment. This feature can be toggled in the extension's popup menu. Windows can be moved with the mouse by holding `Super` when clicking and dragging a window to another location. Windows may be closed by pressing GNOME's default `Super` + (`grave` / `~`) shortcut.
153+
Windows with server-side decorations may have their title bars completely hidden, resulting in additional screen real estate for your applications, and a visually cleaner environment. This feature can be toggled in the extension's popup menu. Windows can be moved with the mouse by holding `Super` when clicking and dragging a window to another location, or using the keyboard shortcuts native to pop-shell. Windows may be closed by pressing `Super` + `Q`, and maximized with `Super` + `M`.
164154

165155
---
166156

167-
## Stacking Mode
157+
## Floating Mode
168158

169159
This is the default mode of Pop Shell, which combines traditional stacking window management, with optional tiling window management features.
170160

@@ -178,30 +168,18 @@ An optional feature to improve your tiling experience is the ability to snap win
178168

179169
---
180170

181-
## Auto-Tile Mode
171+
## Tiling Mode
182172

183-
This provides the tiling window manager experience, where windows are automatically tiled across the screen as they are created. This feature is disabled by default but can be enabled through the extension's popup menu in the panel. When enabled, windows that were launched before enabling it will not be associated with any tree. Dragging and dropping them will begin to tile them in a tree.
173+
Disabled by default, this mode manages windows using a tree-based tiling window manager. Similar to i3, each node of the tree represents two branches. A branch may be a window, a fork containing more branches, or a stack that contains many windows. Each branch represents a rectangular area of space on the screen, and can be subdivided by creating more branches inside of a branch. As windows are created, they are assigned to the window or stack that is actively focused, which creates a new fork on a window, or attaches the window to the focused stack. As windows are destroyed, the opposite is performed to compress the tree and rearrange windows to their new dimensions.
184174

185175
### Keyboard Shortcuts
186176

187177
- `Super` + `O`
188178
- Toggles the orientation of a fork's tiling orientation
189179
- `Super` + `G`
190-
- Toggles a window between floating and tiling.
180+
- Toggles a window between floating and tiling.
191181
- See [#customizing the window float list](#customizing-the-floating-window-list)
192182

193-
### Feature Overview
194-
195-
- If no windows are on a display, a newly-opened window will start maximized on the display
196-
- As new windows are opened, they are tiled into the currently focused window
197-
- Windows can be detached and reattached to different areas of the tree by dragging and dropping them
198-
- The default tiling orientation is based on the dimensions of the window being attached to
199-
- The tiling orientation of the fork associated with the focused window can be altered with `Super` + `O`.
200-
- The division of space between branches in a fork can be altered by resizing windows
201-
- Window resizes can be carried out with the mouse
202-
- Tiling mode may also be used to adjust sizes with the keyboard
203-
- Ultra-wide displays are treated as two separate displays by default (**Unimplemented**)
204-
205183
### Customizing the Floating Window List
206184
There is file `$XDG_CONFIG_HOME/pop-shell/config.json` where you can add the following structure:
207185
```
@@ -214,26 +192,6 @@ For example, doing `xprop` on GNOME Settings (or GNOME Control Center), the WM_C
214192

215193
After applying changes in `config.json`, you can reload the tiling if it doesn't work the first time.
216194

217-
## Plugins
218-
219-
### Launcher Plugins
220-
221-
Pop Shell supports extending the functionality of its launcher and comes with some plugins by default. System plugins are stored in `/usr/lib/pop-shell/launcher/`, while user plugins are stored in `$HOME/.local/share/pop-shell/launcher/`. Some plugins are included by default:
222-
223-
- [calc](src/plugins/calc)
224-
- [files](src/plugins/files)
225-
- [pulse](src/plugins/pulse)
226-
- [recent](src/plugins/recent)
227-
- [terminal](src/plugins/terminal)
228-
- [web](src/plugins/web)
229-
- [scripts](src/plugin_scripts.ts)
230-
231-
> Plugin developers, see [the API documentation for the launcher API](src/plugins/README.md).
232-
233-
### Scripts Plugin
234-
235-
This built-in plugin displays scripts in search results. Included with Pop Shell is a set of scripts for log out, reboot, and power off. Scripts are stored in `/usr/lib/pop-shell/scripts/` and `$HOME/.local/share/pop-shell/scripts/`. [See the included scripts as an example of how to create our own](src/scripts/).
236-
237195
## Developers
238196

239197
Due to the risky nature of plain JavaScript, this GNOME Shell extension is written in [TypeScript](https://www.typescriptlang.org/). In addition to supplying static type-checking and self-documenting classes and interfaces, it allows us to write modern JavaScript syntax whilst supporting the generation of code for older targets.
@@ -248,13 +206,6 @@ While working on the shell, you can recompile, reconfigure, reinstall, and resta
248206

249207
[Discussions welcome on Pop Chat](https://chat.pop-os.org/community/channels/dev)
250208

251-
## GNOME JS
252-
GNOME JS is a little different from standard JS, so the included `Makefile` runs `sed` on the transpiled JavaScript to convert the small number of differences between JS and GJS. Notably, GJS only partially supports ES2015, and has its own module system which works differently from what ES2015 expects. The sed scripts will replace `import` and `export` statements with the expected GNOME variants.
253-
254-
```js
255-
const Me = imports.misc.extensionUtils.getCurrentExtension();
256-
```
257-
258209
## License
259210

260211
Licensed under the GNU General Public License, Version 3.0, ([LICENSE](LICENSE) or https://www.gnu.org/licenses/gpl-3.0.en.html)

debian/changelog

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
pop-shell (1.1.0) focal; urgency=medium
22

3-
* Bug fixes & Launcher update w/ plugin support
3+
* Bug fixes & Launcher update w/ plugin support
44

55
-- Michael Aaron Murphy <[email protected]> Fri, 11 Dec 2020 13:27:27 -0700
66

debian/control

+1-5
Original file line numberDiff line numberDiff line change
@@ -7,15 +7,11 @@ Standards-Version: 3.9.8
77
Homepage: https://github.com/pop-os/shell
88
Vcs-Git: https://github.com/pop-os/shell
99

10-
Package: pop-shell-plugin-system76-power
11-
Architecture: all
12-
Depends: pop-shell, system76-power
13-
Description: Launcher integration with system76-power
14-
1510
Package: pop-shell
1611
Architecture: all
1712
Depends:
1813
${misc:Depends},
14+
pop-launcher,
1915
pop-shell-shortcuts,
2016
fd-find
2117
Recommends: pop-shell-plugin-system76-power
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
schemas/org.gnome.shell.extensions.pop-shell.gschema.xml usr/share/glib-2.0/schemas
22
keybindings/*.xml usr/share/gnome-control-center/keybindings
3-
usr/
3+
usr

debian/pop-shell-plugin-system76-power.files

-4
This file was deleted.

debian/rules

+2-11
Original file line numberDiff line numberDiff line change
@@ -5,18 +5,9 @@
55
#export DH_VERBOSE=1
66

77
BASEDIR=debian/pop-shell/usr/share/gnome-shell/extensions/[email protected]
8-
DESTDIR=debian/tmp
98

109
%:
1110
dh $@
1211

13-
override_dh_install:
14-
make install-system76-plugins DESTDIR=$(DESTDIR)
15-
dh_movefiles
16-
dh_install
17-
rm -rf $(BASEDIR)/schemas
18-
19-
override_dh_fixperms:
20-
dh_fixperms
21-
chmod +x debian/pop-shell/usr/lib/pop-shell/launcher/**/*.js
22-
chmod +x debian/pop-shell/usr/lib/pop-shell/scripts/*
12+
override_dh_auto_install:
13+
dh_auto_install --destdir=debian/tmp

scripts/transpile.sh

+2-2
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ glib-compile-schemas schemas &
2121

2222
for proj in ${PROJECTS}; do
2323
mkdir -p _build/${proj}
24-
tsc --p src/${proj} &
24+
tsc --p src/${proj}
2525
done
2626

2727
tsc &
@@ -34,7 +34,7 @@ cp -r metadata.json icons schemas *.css _build &
3434

3535
for src in $(find target -name '*.js'); do
3636
dest=$(echo $src | sed s#target#_build#g)
37-
transpile &
37+
transpile
3838
done
3939

4040
wait

src/app_info.ts

-145
This file was deleted.

0 commit comments

Comments
 (0)