Added workspaces, window titles, volume, bluetooth, systray and date/time modules to the panel

This commit is contained in:
Jas Singh
2024-06-09 01:25:57 -07:00
commit 6ff50006f2
33 changed files with 2001 additions and 0 deletions

View File

@@ -0,0 +1,38 @@
import Service from "resource:///com/github/Aylur/ags/service.js";
import App from "resource:///com/github/Aylur/ags/app.js";
import {monitorFile} from "resource:///com/github/Aylur/ags/utils.js";
import Gio from "gi://Gio";
class DirectoryMonitorService extends Service {
static {
Service.register(this, {}, {});
}
constructor() {
super();
this.recursiveDirectoryMonitor(`${App.configDir}/scss`);
}
recursiveDirectoryMonitor(directoryPath) {
monitorFile(directoryPath, (_, eventType) => {
if (eventType === Gio.FileMonitorEvent.CHANGES_DONE_HINT) {
this.emit("changed");
}
}, "directory");
const directory = Gio.File.new_for_path(directoryPath);
const enumerator = directory.enumerate_children("standard::*", Gio.FileQueryInfoFlags.NONE, null);
let fileInfo;
while ((fileInfo = enumerator.next_file(null)) !== null) {
const childPath = directoryPath + "/" + fileInfo.get_name();
if (fileInfo.get_file_type() === Gio.FileType.DIRECTORY) {
this.recursiveDirectoryMonitor(childPath);
}
}
}
}
const service = new DirectoryMonitorService();
export default service;