From f089d834c6bb907ed5db0e52b42632fdc8fb75b1 Mon Sep 17 00:00:00 2001 From: end-4 <97237370+end-4@users.noreply.github.com> Date: Mon, 19 Feb 2024 20:20:40 +0700 Subject: [PATCH] very very small refractor --- .config/ags/services/wallpaper.js | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/.config/ags/services/wallpaper.js b/.config/ags/services/wallpaper.js index 9b501c8ee..38cab9cba 100644 --- a/.config/ags/services/wallpaper.js +++ b/.config/ags/services/wallpaper.js @@ -3,6 +3,8 @@ import Service from 'resource:///com/github/Aylur/ags/service.js'; import * as Utils from 'resource:///com/github/Aylur/ags/utils.js'; const { exec, execAsync } = Utils; +const WALLPAPER_CONFIG_PATH = `${GLib.get_user_cache_dir()}/ags/user/wallpaper.json`; + const clamp = (num, min, max) => Math.min(Math.max(num, min), max); function fileExists(filePath) { let file = Gio.File.new_for_path(filePath); @@ -53,7 +55,7 @@ class WallpaperService extends Service { // How many screens? this._monitorCount = Gdk.Display.get_default()?.get_n_monitors() || 1; // Read config - this._wallPath = `${GLib.get_user_cache_dir()}/ags/user/wallpaper.json`; + this._wallPath = WALLPAPER_CONFIG_PATH; try { const fileContents = Utils.readFile(this._wallPath); this._wallJson = JSON.parse(fileContents);