refractor: clamp, distro; add distro icon next to uptime

This commit is contained in:
end-4
2024-02-20 12:13:16 +07:00
parent 9fbb1e8159
commit 522dd99d84
11 changed files with 294 additions and 195 deletions
@@ -8,6 +8,7 @@ import Hyprland from 'resource:///com/github/Aylur/ags/service/hyprland.js';
import Wallpaper from '../../services/wallpaper.js';
import { setupCursorHover } from '../.widgetutils/cursorhover.js';
import { clamp } from '../.miscutils/mathfuncs.js';
const DISABLE_AGS_WALLPAPER = true;
@@ -18,10 +19,6 @@ const MAX_WORKSPACES = 10;
const WALLPAPER_OFFSCREEN_X = (WALLPAPER_ZOOM_SCALE - 1) * SCREEN_WIDTH;
const WALLPAPER_OFFSCREEN_Y = (WALLPAPER_ZOOM_SCALE - 1) * SCREEN_HEIGHT;
function clamp(x, min, max) {
return Math.min(Math.max(x, min), max);
}
export default (monitor = 0) => {
const wallpaperImage = Widget.DrawingArea({