From 9fc6d89ba835710b265cc42c5710936086bde3ab Mon Sep 17 00:00:00 2001 From: Damjan Antevski Date: Wed, 5 Aug 2026 14:11:22 +0200 Subject: [PATCH] fix(theme): fix wallpaper commands --- theme.js | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/theme.js b/theme.js index ed5a5fe..6326269 100644 --- a/theme.js +++ b/theme.js @@ -1127,6 +1127,24 @@ async function execute(cmd) { const argText = args.join(" ").trim(); if (command === "tui") { + if (args.includes("-wp")) { + const urlIdx = args.indexOf("-wp") + 1; + const url = args[urlIdx]; + if (url === "off") { + const wp = document.getElementById("spotui-wallpaper"); + if (wp) wp.remove(); + localStorage.removeItem(WP_URL_KEY); + localStorage.removeItem(WP_OPACITY_KEY); + return; + } + if (url) { + let opacity = "1"; + const oIdx = args.indexOf("-o"); + if (oIdx !== -1 && args[oIdx + 1]) opacity = args[oIdx + 1]; + setWallpaper(url, opacity); + } + return; + } if (args.includes("-l") || args.includes("-a")) { const state = args[args.length - 1]; if (state === "off") {