diff --git a/README.md b/README.md index 243ed20..a85a217 100644 --- a/README.md +++ b/README.md @@ -49,6 +49,9 @@ Optional Dependencies: ## Used for Tracking GPU Usage in your Dashboard (NVidia only) python python-gpustat + +## Only if a pywal hook from wallpaper changes applied through settings is desired +pywal ``` Arch (pacman): diff --git a/options.ts b/options.ts index c5d6f7e..c15d66f 100644 --- a/options.ts +++ b/options.ts @@ -1068,7 +1068,8 @@ const options = mkOptions(OPTIONS, { wallpaper: { enable: opt(true), - image: opt("") + image: opt(""), + pywal: opt(false) }, notifications: { diff --git a/scss/options_trackers.ts b/scss/options_trackers.ts index b83545c..e25ee10 100644 --- a/scss/options_trackers.ts +++ b/scss/options_trackers.ts @@ -1,5 +1,5 @@ import icons from "lib/icons"; -import { Notify, isAnImage } from "lib/utils"; +import { bash, dependencies, Notify, isAnImage } from "lib/utils"; import options from "options"; import Wallpaper from "services/Wallpaper"; @@ -50,6 +50,10 @@ export const initializeTrackers = (resetCssFunc: Function) => { options.resetTheme(); resetCssFunc(); } + if (options.wallpaper.pywal.value && dependencies('wal')) { + const wallpaperPath = options.wallpaper.image.value; + bash(`wal -i ${wallpaperPath}`); + } }) } diff --git a/widget/settings/pages/theme/menus/index.ts b/widget/settings/pages/theme/menus/index.ts index 97ae58c..e1ef474 100644 --- a/widget/settings/pages/theme/menus/index.ts +++ b/widget/settings/pages/theme/menus/index.ts @@ -24,6 +24,7 @@ export const MenuTheme = () => { } }), Option({ opt: options.theme.bar.menus.monochrome, title: 'Use Global Colors', type: 'boolean', disabledBinding: options.theme.matugen }), + Option({ opt: options.wallpaper.pywal, title: 'Generate Pywal Colors', subtitle: 'Whether to also generate pywal colors with chosen wallpaper', type: 'boolean' }), Option({ opt: options.wallpaper.enable, title: 'Apply Wallpapers', subtitle: 'Whether to apply the wallpaper or to only use it for Matugen color generation.', type: 'boolean' }), Option({ opt: options.wallpaper.image, title: 'Wallpaper', subtitle: options.wallpaper.image.bind("value"), type: 'wallpaper' }), Option({ opt: options.theme.bar.menus.background, title: 'Background Color', type: 'color' }),