forked from Shinonome/dots-hyprland
ags: update wallpaper (disable)
This commit is contained in:
@@ -10,9 +10,9 @@ export default (monitor) => Widget.Window({
|
|||||||
layer: 'background',
|
layer: 'background',
|
||||||
exclusivity: 'ignore',
|
exclusivity: 'ignore',
|
||||||
visible: true,
|
visible: true,
|
||||||
// child: WallpaperImage(monitor),
|
|
||||||
child: Widget.Overlay({
|
child: Widget.Overlay({
|
||||||
child: WallpaperImage(monitor),
|
child: WallpaperImage(monitor),
|
||||||
|
// child: Widget.Box({}),
|
||||||
overlays: [
|
overlays: [
|
||||||
TimeAndLaunchesWidget(),
|
TimeAndLaunchesWidget(),
|
||||||
SystemWidget(),
|
SystemWidget(),
|
||||||
|
|||||||
@@ -9,6 +9,8 @@ import Hyprland from 'resource:///com/github/Aylur/ags/service/hyprland.js';
|
|||||||
import Wallpaper from '../../services/wallpaper.js';
|
import Wallpaper from '../../services/wallpaper.js';
|
||||||
import { setupCursorHover } from '../../lib/cursorhover.js';
|
import { setupCursorHover } from '../../lib/cursorhover.js';
|
||||||
|
|
||||||
|
const DISABLE_AGS_WALLPAPER = true;
|
||||||
|
|
||||||
const SWITCHWALL_SCRIPT_PATH = `${App.configDir}/scripts/color_generation/switchwall.sh`;
|
const SWITCHWALL_SCRIPT_PATH = `${App.configDir}/scripts/color_generation/switchwall.sh`;
|
||||||
const WALLPAPER_ZOOM_SCALE = 1.25; // For scrolling when we switch workspace
|
const WALLPAPER_ZOOM_SCALE = 1.25; // For scrolling when we switch workspace
|
||||||
const MAX_WORKSPACES = 10;
|
const MAX_WORKSPACES = 10;
|
||||||
@@ -20,6 +22,7 @@ function clamp(x, min, max) {
|
|||||||
return Math.min(Math.max(x, min), max);
|
return Math.min(Math.max(x, min), max);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
export default (monitor = 0) => {
|
export default (monitor = 0) => {
|
||||||
const wallpaperImage = Widget.DrawingArea({
|
const wallpaperImage = Widget.DrawingArea({
|
||||||
attribute: {
|
attribute: {
|
||||||
@@ -56,6 +59,7 @@ export default (monitor = 0) => {
|
|||||||
cr.paint();
|
cr.paint();
|
||||||
})
|
})
|
||||||
.hook(Wallpaper, (self) => {
|
.hook(Wallpaper, (self) => {
|
||||||
|
if (DISABLE_AGS_WALLPAPER) return;
|
||||||
const wallPath = Wallpaper.get(monitor);
|
const wallPath = Wallpaper.get(monitor);
|
||||||
if (!wallPath || wallPath === "") return;
|
if (!wallPath || wallPath === "") return;
|
||||||
self.attribute.pixbuf = GdkPixbuf.Pixbuf.new_from_file(wallPath);
|
self.attribute.pixbuf = GdkPixbuf.Pixbuf.new_from_file(wallPath);
|
||||||
@@ -92,7 +96,7 @@ export default (monitor = 0) => {
|
|||||||
className: 'btn-primary',
|
className: 'btn-primary',
|
||||||
label: `Select one`,
|
label: `Select one`,
|
||||||
setup: setupCursorHover,
|
setup: setupCursorHover,
|
||||||
onClicked: (self) => Utils.execAsync([SWITCHWALL_SCRIPT_PATH]),
|
onClicked: (self) => Utils.execAsync([SWITCHWALL_SCRIPT_PATH]).catch(print),
|
||||||
}),
|
}),
|
||||||
]
|
]
|
||||||
});
|
});
|
||||||
@@ -100,11 +104,16 @@ export default (monitor = 0) => {
|
|||||||
transition: 'crossfade',
|
transition: 'crossfade',
|
||||||
transitionDuration: 180,
|
transitionDuration: 180,
|
||||||
children: {
|
children: {
|
||||||
|
'disabled': Box({}),
|
||||||
'image': wallpaperImage,
|
'image': wallpaperImage,
|
||||||
'prompt': wallpaperPrompt,
|
'prompt': wallpaperPrompt,
|
||||||
},
|
},
|
||||||
setup: (self) => self
|
setup: (self) => self
|
||||||
.hook(Wallpaper, (self) => {
|
.hook(Wallpaper, (self) => {
|
||||||
|
if(DISABLE_AGS_WALLPAPER) {
|
||||||
|
self.shown = 'disabled';
|
||||||
|
return;
|
||||||
|
}
|
||||||
const wallPath = Wallpaper.get(monitor);
|
const wallPath = Wallpaper.get(monitor);
|
||||||
self.shown = ((wallPath && wallPath != "") ? 'image' : 'prompt');
|
self.shown = ((wallPath && wallPath != "") ? 'image' : 'prompt');
|
||||||
}, 'updated')
|
}, 'updated')
|
||||||
|
|||||||
Reference in New Issue
Block a user