remove wallust, fix enabled switch for schedule dark mode
This commit is contained in:
@@ -174,7 +174,6 @@ Singleton {
|
|||||||
wallpaperPath: general.wallpaperPath,
|
wallpaperPath: general.wallpaperPath,
|
||||||
desktopIcons: general.desktopIcons,
|
desktopIcons: general.desktopIcons,
|
||||||
color: {
|
color: {
|
||||||
wallust: general.color.wallust,
|
|
||||||
mode: general.color.mode,
|
mode: general.color.mode,
|
||||||
smart: general.color.smart,
|
smart: general.color.smart,
|
||||||
scheduleDark: general.color.scheduleDark,
|
scheduleDark: general.color.scheduleDark,
|
||||||
|
|||||||
@@ -26,7 +26,6 @@ JsonObject {
|
|||||||
property int scheduleDarkStart: 0
|
property int scheduleDarkStart: 0
|
||||||
property bool schemeGeneration: true
|
property bool schemeGeneration: true
|
||||||
property bool smart: false
|
property bool smart: false
|
||||||
property bool wallust: false
|
|
||||||
}
|
}
|
||||||
component Idle: JsonObject {
|
component Idle: JsonObject {
|
||||||
property list<var> timeouts: [
|
property list<var> timeouts: [
|
||||||
|
|||||||
@@ -175,7 +175,6 @@ Singleton {
|
|||||||
username: general.username,
|
username: general.username,
|
||||||
desktopIcons: general.desktopIcons,
|
desktopIcons: general.desktopIcons,
|
||||||
color: {
|
color: {
|
||||||
wallust: general.color.wallust,
|
|
||||||
mode: general.color.mode,
|
mode: general.color.mode,
|
||||||
smart: general.color.smart,
|
smart: general.color.smart,
|
||||||
schemeGeneration: general.color.schemeGeneration,
|
schemeGeneration: general.color.schemeGeneration,
|
||||||
|
|||||||
@@ -26,7 +26,6 @@ JsonObject {
|
|||||||
property int scheduleDarkStart: 0
|
property int scheduleDarkStart: 0
|
||||||
property bool schemeGeneration: true
|
property bool schemeGeneration: true
|
||||||
property bool smart: false
|
property bool smart: false
|
||||||
property bool wallust: false
|
|
||||||
}
|
}
|
||||||
component Idle: JsonObject {
|
component Idle: JsonObject {
|
||||||
property list<var> timeouts: [
|
property list<var> timeouts: [
|
||||||
|
|||||||
@@ -12,6 +12,7 @@ Singleton {
|
|||||||
|
|
||||||
readonly property int darkEnd: Config.general.color.scheduleDarkEnd
|
readonly property int darkEnd: Config.general.color.scheduleDarkEnd
|
||||||
readonly property int darkStart: Config.general.color.scheduleDarkStart
|
readonly property int darkStart: Config.general.color.scheduleDarkStart
|
||||||
|
readonly property bool enabled: Config.general.color.scheduleDark
|
||||||
|
|
||||||
function applyDarkMode() {
|
function applyDarkMode() {
|
||||||
if (Config.general.color.schemeGeneration) {
|
if (Config.general.color.schemeGeneration) {
|
||||||
@@ -27,9 +28,6 @@ Singleton {
|
|||||||
Quickshell.execDetached(["sh", "-c", `sed -i 's/color_scheme_path=\\(.*\\)Light.colors/color_scheme_path=\\1Dark.colors/' ${Paths.home}/.config/qt6ct/qt6ct.conf`]);
|
Quickshell.execDetached(["sh", "-c", `sed -i 's/color_scheme_path=\\(.*\\)Light.colors/color_scheme_path=\\1Dark.colors/' ${Paths.home}/.config/qt6ct/qt6ct.conf`]);
|
||||||
|
|
||||||
Quickshell.execDetached(["sed", "-i", "'s/\\(vim.cmd.colorscheme \\).*/\\1\"tokyodark\"/'", "~/.config/nvim/lua/config/load-colorscheme.lua"]);
|
Quickshell.execDetached(["sed", "-i", "'s/\\(vim.cmd.colorscheme \\).*/\\1\"tokyodark\"/'", "~/.config/nvim/lua/config/load-colorscheme.lua"]);
|
||||||
|
|
||||||
if (Config.general.color.wallust)
|
|
||||||
Wallust.generateColors(WallpaperPath.currentWallpaperPath);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
function applyLightMode() {
|
function applyLightMode() {
|
||||||
@@ -47,9 +45,6 @@ Singleton {
|
|||||||
|
|
||||||
if (Config.general.color.neovimColors)
|
if (Config.general.color.neovimColors)
|
||||||
Quickshell.execDetached(["sed", "-i", "'s/\\(vim.cmd.colorscheme \\).*/\\1\"onelight\"/'", "~/.config/nvim/lua/config/load-colorscheme.lua"]);
|
Quickshell.execDetached(["sed", "-i", "'s/\\(vim.cmd.colorscheme \\).*/\\1\"onelight\"/'", "~/.config/nvim/lua/config/load-colorscheme.lua"]);
|
||||||
|
|
||||||
if (Config.general.color.wallust)
|
|
||||||
Wallust.generateColors(WallpaperPath.currentWallpaperPath);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
function checkStartup() {
|
function checkStartup() {
|
||||||
@@ -71,15 +66,15 @@ Singleton {
|
|||||||
running: true
|
running: true
|
||||||
|
|
||||||
onTriggered: {
|
onTriggered: {
|
||||||
if (darkStart === darkEnd)
|
if (!root.enabled)
|
||||||
return;
|
return;
|
||||||
var now = new Date();
|
var now = new Date();
|
||||||
if (now.getHours() >= darkStart || now.getHours() < darkEnd) {
|
if (now.getHours() >= root.darkStart || now.getHours() < root.darkEnd) {
|
||||||
if (DynamicColors.light)
|
if (DynamicColors.light)
|
||||||
applyDarkMode();
|
root.applyDarkMode();
|
||||||
} else {
|
} else {
|
||||||
if (!DynamicColors.light)
|
if (!DynamicColors.light)
|
||||||
applyLightMode();
|
root.applyLightMode();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,26 +0,0 @@
|
|||||||
pragma Singleton
|
|
||||||
|
|
||||||
import Quickshell
|
|
||||||
import Quickshell.Io
|
|
||||||
import QtQuick
|
|
||||||
import qs.Config
|
|
||||||
|
|
||||||
Singleton {
|
|
||||||
id: root
|
|
||||||
|
|
||||||
property var args
|
|
||||||
readonly property string mode: Config.general.color.mode
|
|
||||||
readonly property string threshold: mode === "dark" ? "--threshold=9" : "--dynamic-threshold"
|
|
||||||
|
|
||||||
function generateColors(wallpaperPath) {
|
|
||||||
root.args = wallpaperPath;
|
|
||||||
wallustProc.running = true;
|
|
||||||
}
|
|
||||||
|
|
||||||
Process {
|
|
||||||
id: wallustProc
|
|
||||||
|
|
||||||
command: ["wallust", "run", root.args, `--palette=${root.mode}`, "--ignore-sequence=cursor", `${root.threshold}`]
|
|
||||||
running: false
|
|
||||||
}
|
|
||||||
}
|
|
||||||
Reference in New Issue
Block a user