updates
This commit is contained in:
1 parent
12174f264d
commit
9f8030c1bc
3 files changed
+37
-4
No files matched your search
@@ -112,6 +112,28 @@ const Wallpaper = (image: string, name: string) => Widget.Button({
|
||||
})
|
||||
});
|
||||
|
||||
function CacheThumbnails() {
|
||||
Utils.execAsync(`mkdir -p ${GLib.get_home_dir()}/.cache/thumbnails/wallpaper`)
|
||||
.catch(print)
|
||||
const link_directory = `${App.configDir}/wallpaper`;
|
||||
const original_directory = `${GLib.get_home_dir()}/wallpaper`;
|
||||
const extensions = [".jpg", ".jpeg", ".png"];
|
||||
const fileList = listFilesByExtensions(link_directory, extensions);
|
||||
fileList.forEach((value, index) => {
|
||||
const path = `${original_directory}/${value}`
|
||||
const cache_file = `${GLib.get_home_dir()}/.cache/thumbnails/wallpaper/${value}`;
|
||||
Utils.idle(() => {
|
||||
Utils.readFileAsync(cache_file)
|
||||
.catch(() => {
|
||||
Utils.execAsync(`magick ${path} -resize x32 -gravity Center -extent 1:1 ${cache_file}`)
|
||||
.catch(print)
|
||||
})
|
||||
})
|
||||
})
|
||||
}
|
||||
|
||||
CacheThumbnails()
|
||||
|
||||
const WallpaperList = () => {
|
||||
Utils.execAsync(`mkdir -p ${GLib.get_home_dir()}/.cache/thumbnails/wallpaper`)
|
||||
.then();
|
||||
@@ -140,9 +162,7 @@ const WallpaperList = () => {
|
||||
]
|
||||
});
|
||||
|
||||
Utils.interval(30000, () => {
|
||||
box.attribute.update(box);
|
||||
}, box);
|
||||
box.attribute.update(box)
|
||||
|
||||
return box;
|
||||
};
|
||||
|
||||
@@ -138,6 +138,18 @@
|
||||
border-color: @outlineVariant;
|
||||
}
|
||||
|
||||
.settings entry, .settings combobox {
|
||||
min-width: 30px;
|
||||
min-height: 32px;
|
||||
border-radius: 4px;
|
||||
background-color: @surfaceContainerHighest;
|
||||
}
|
||||
|
||||
.settings entry label, .settings combobox label {
|
||||
color: @onSurface;
|
||||
font-weight: normal;
|
||||
}
|
||||
|
||||
/* Wifi */
|
||||
|
||||
.settings .wifi_list .row image {
|
||||
|
||||
@@ -17,7 +17,8 @@ export const icons = {
|
||||
};
|
||||
|
||||
|
||||
const wallpaper_cache_file = `${GLib.get_home_dir()}/.cache/current_wallpaper`
|
||||
export const wallpaper_cache_file = `${GLib.get_home_dir()}/.cache/current_wallpaper`
|
||||
|
||||
Utils.readFileAsync(wallpaper_cache_file)
|
||||
.then(out => { current_wallpaper.setValue(out.trim()); })
|
||||
.catch(err => {
|
||||
|
||||
Reference in new issue
Block a user