-
Notifications
You must be signed in to change notification settings - Fork 176
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
We want to replace gjs' custom (and now legacy) imports system with standard EcmaScript modules: JS developers are already familiar with them, they have better tooling support and using standard features over non-standard ones is generally the right thing to do. Our D-Bus services are separate from the main process, and thus can be ported separately (except for the few imports that are shared with the main process' code base). Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/2786>
- Loading branch information
Showing
13 changed files
with
70 additions
and
70 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,9 @@ | ||
imports.package.start({ | ||
import {programInvocationName, programArgs} from 'system'; | ||
|
||
imports.package.init({ | ||
name: '@PACKAGE_NAME@', | ||
prefix: '@prefix@', | ||
libdir: '@libdir@', | ||
}); | ||
const {main} = await import(`${imports.package.moduledir}/main.js`); | ||
await main([programInvocationName, ...programArgs]); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,3 @@ | ||
[D-BUS Service] | ||
Name=@service@ | ||
Exec=@gjs@ @pkgdatadir@/@service@ | ||
Exec=@gjs@ -m @pkgdatadir@/@service@ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,11 +1,10 @@ | ||
/* exported main */ | ||
import {DBusService} from './dbusService.js'; | ||
import {NotificationDaemon} from './notificationDaemon.js'; | ||
|
||
const { DBusService } = imports.dbusService; | ||
const { NotificationDaemon } = imports.notificationDaemon; | ||
|
||
function main() { | ||
/** @returns {void} */ | ||
export async function main() { | ||
const service = new DBusService( | ||
'org.gnome.Shell.Notifications', | ||
new NotificationDaemon()); | ||
service.run(); | ||
await service.runAsync(); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,14 +1,13 @@ | ||
/* exported main */ | ||
import {DBusService} from './dbusService.js'; | ||
import {ScreencastService} from './screencastService.js'; | ||
|
||
const {DBusService} = imports.dbusService; | ||
|
||
function main() { | ||
const {ScreencastService} = imports.screencastService; | ||
/** @returns {void} */ | ||
export async function main() { | ||
if (!ScreencastService.canScreencast()) | ||
return; | ||
|
||
const service = new DBusService( | ||
'org.gnome.Shell.Screencast', | ||
new ScreencastService()); | ||
service.run(); | ||
await service.runAsync(); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,11 +1,10 @@ | ||
/* exported main */ | ||
import {DBusService} from './dbusService.js'; | ||
import {ScreenSaverService} from './screenSaverService.js'; | ||
|
||
const { DBusService } = imports.dbusService; | ||
const { ScreenSaverService } = imports.screenSaverService; | ||
|
||
function main() { | ||
/** @returns {void} */ | ||
export async function main() { | ||
const service = new DBusService( | ||
'org.gnome.ScreenSaver', | ||
new ScreenSaverService()); | ||
service.run(); | ||
await service.runAsync(); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters