-
Notifications
You must be signed in to change notification settings - Fork 40
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
21 changed files
with
298 additions
and
258 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,26 +1,37 @@ | ||
// Helpers | ||
export const resource = (file) => `resource:///com/github/Aylur/ags/${file}.js`; | ||
export const require = async (file) => (await import(resource(file))).default; | ||
export const requireCustom = async (path) => (await import(path)).default; | ||
export const service = async (file) => await require(`service/${file}`); | ||
|
||
// Required components | ||
export const App = await require("app"); | ||
export const GLib = await requireCustom("gi://GLib"); | ||
export const Service = await require("service"); | ||
export const Utils = await import(resource("utils")); | ||
export const Variable = await require("variable"); | ||
export const Widget = await require("widget"); | ||
import App from "resource:///com/github/Aylur/ags/app.js"; | ||
import GLib from "gi://GLib"; | ||
import * as Utils from "resource:///com/github/Aylur/ags/utils.js"; | ||
import Service from "resource:///com/github/Aylur/ags/service.js"; | ||
import Variable from "resource:///com/github/Aylur/ags/variable.js"; | ||
import Widget from "resource:///com/github/Aylur/ags/widget.js"; | ||
|
||
// Services | ||
export const Audio = await service("audio"); | ||
export const Battery = await service("battery"); | ||
export const Bluetooth = await service("bluetooth"); | ||
export const Hyprland = await service("hyprland"); | ||
export const Mpris = await service("mpris"); | ||
export const Network = await service("network"); | ||
export const PowerProfiles = await service("powerprofiles"); | ||
export const SystemTray = await service("systemtray"); | ||
import Audio from "resource:///com/github/Aylur/ags/service/audio.js"; | ||
import Battery from "resource:///com/github/Aylur/ags/service/battery.js"; | ||
import Bluetooth from "resource:///com/github/Aylur/ags/service/bluetooth.js"; | ||
import Hyprland from "resource:///com/github/Aylur/ags/service/hyprland.js"; | ||
import Mpris from "resource:///com/github/Aylur/ags/service/mpris.js"; | ||
import Network from "resource:///com/github/Aylur/ags/service/network.js"; | ||
import PowerProfiles from "resource:///com/github/Aylur/ags/service/powerprofiles.js"; | ||
import SystemTray from "resource:///com/github/Aylur/ags/service/systemtray.js"; | ||
|
||
import Icons from "./utils/icons.js"; | ||
|
||
// My definitions | ||
export const Icons = await requireCustom("./utils/icons.js"); | ||
export { | ||
App, | ||
Audio, | ||
Battery, | ||
Bluetooth, | ||
GLib, | ||
Hyprland, | ||
Icons, | ||
Mpris, | ||
Network, | ||
PowerProfiles, | ||
Service, | ||
SystemTray, | ||
Utils, | ||
Variable, | ||
Widget, | ||
}; |
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,5 +1,6 @@ | ||
import { Battery, Widget } from "../../../imports.js"; | ||
|
||
export default Widget.Icon({ className: "battery module" }) | ||
.bind("icon", Battery, "icon-name") | ||
.bind("tooltip-text", Battery, "percent", (p) => `Battery on ${p}%`); | ||
export default () => | ||
Widget.Icon({ className: "battery module" }) | ||
.bind("icon", Battery, "icon-name") | ||
.bind("tooltip-text", Battery, "percent", (p) => `Battery on ${p}%`); |
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,12 +1,13 @@ | ||
import { Utils, Widget } from "../../../imports.js"; | ||
|
||
export default Widget.EventBox({ | ||
child: Widget.Label({ className: "date module" }) | ||
.poll( | ||
1000, | ||
(self) => | ||
Utils.execAsync(["date", "+%a %b %d %H:%M"]).then((r) => | ||
self.label = r | ||
), | ||
), | ||
}); | ||
export default () => | ||
Widget.EventBox({ | ||
child: Widget.Label({ className: "date module" }) | ||
.poll( | ||
1000, | ||
(self) => | ||
Utils.execAsync(["date", "+%a %b %d %H:%M"]).then((r) => | ||
self.label = r | ||
), | ||
), | ||
}); |
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,16 +1,17 @@ | ||
import { Network, Widget } from "../../../imports.js"; | ||
import { getNetIcon, getNetText } from "../../../utils/net.js"; | ||
|
||
export default Widget.Icon({ className: "net module" }) | ||
.bind( | ||
"icon", | ||
Network, | ||
"connectivity", | ||
getNetIcon, | ||
) | ||
.bind( | ||
"tooltip-text", | ||
Network, | ||
"connectivity", | ||
getNetText, | ||
); | ||
export default () => | ||
Widget.Icon({ className: "net module" }) | ||
.bind( | ||
"icon", | ||
Network, | ||
"connectivity", | ||
getNetIcon, | ||
) | ||
.bind( | ||
"tooltip-text", | ||
Network, | ||
"connectivity", | ||
getNetText, | ||
); |
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
Oops, something went wrong.