Skip to content

Help needed for understanding imports in the widget Examples. #306

Answered by Aylur
ChristopherEverett asked this question in Q&A
Discussion options

You must be logged in to vote

the resource path is pointing to the compiled and installed source of ags
resource:///com/github/Aylur/ags/service/hyprland.js points to src/service/hyprland.ts
the available files are listed in the gresource xml
more on module here https://developer.mozilla.org/en-US/docs/Web/JavaScript/Guide/Modules

the examples haven't been updated yet, but you no longer need to import from these paths, because Widget, Service, Utils, Variable, App are now in the global scope

import Widget from 'resource:///com/github/Aylur/ags/widget.js' // this line can be removed
Widget.Window() 

to import services you can use Service.import, which is shown on each service's wiki page
for example hyprland

import Hyp…

Replies: 1 comment 1 reply

Comment options

You must be logged in to vote
1 reply
@ChristopherEverett
Comment options

Answer selected by ChristopherEverett
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants