wallchpaper
Version:
Change wallpaper after an adjustable time
24 lines • 755 B
JavaScript
;
Object.defineProperty(exports, "__esModule", { value: true });
const cron_1 = require("cron");
class App {
constructor(config, system, wallpaperManager) {
this.config = config;
this.system = system;
this.wallpaperManager = wallpaperManager;
this.changeWallpaperJob = new cron_1.CronJob(this.config.getConfig().time, this.changeSystemWallpaper.bind(this));
}
changeSystemWallpaper() {
const wallpaperPath = this.wallpaperManager.next();
this.system.setWallpaper(wallpaperPath);
}
start() {
this.changeWallpaperJob.start();
}
finish() {
this.changeWallpaperJob.stop();
process.exit();
}
}
exports.App = App;
//# sourceMappingURL=app.js.map