quickshell and hyprland additions

This commit is contained in:
2026-03-15 13:56:00 +02:00
parent c9c27d1554
commit 1ad06b82a6
509 changed files with 68371 additions and 19 deletions

View File

@@ -0,0 +1,97 @@
import QtQuick
import Quickshell
import Quickshell.Io
import qs.services
import qs.modules.interface.settings
Scope {
id: global
// Track if notification has already been shown
property bool themeNotificationShown: false
// Function to show notification once
function notifyPredefinedTheme() {
if (!themeNotificationShown) {
themeNotificationShown = true
Quickshell.execDetached([
"notify-send",
"Nucleus Shell",
`You are using a predefined theme ${Config.runtime.appearance.colors.scheme}. Color generation/Light Theme is not supported for this theme.`,
"--urgency=normal",
"--expire-time=5000"
])
}
}
// Handle Global IPCs
IpcHandler {
target: "global"
function toggleTheme() {
const currentTheme = Config.runtime.appearance.theme
const newTheme = currentTheme === "light" ? "dark" : "light"
// Predefined themes: validate variant BEFORE changing theme
if (!Config.runtime.appearance.colors.autogenerated) {
const scheme = Config.runtime.appearance.colors.scheme
const file = Theme.map[scheme]?.[newTheme]
if (!file) {
Theme.notifyMissingVariant(scheme, newTheme)
return
}
Config.updateKey("appearance.theme", newTheme)
Quickshell.execDetached([
"bash",
Directories.scriptsPath + "/interface/switchTheme.sh",
file
])
return
}
// Autogenerated themes: safe to toggle freely
Config.updateKey("appearance.theme", newTheme)
genThemeColors.running = true
}
function regenColors() {
if (Config.runtime.appearance.colors.autogenerated) {
genThemeColors.running = true
} else {
notifyPredefinedTheme()
}
}
}
property var genColorsCmd: Config.runtime.appearance.colors.runMatugenUserWide
? [
"bash",
Directories.scriptsPath + "/interface/gencolors.sh",
"--user-wide",
Config.runtime.appearance.background.path,
Config.runtime.appearance.colors.matugenScheme,
Config.runtime.appearance.theme,
Quickshell.shellPath("extras/matugen/config.toml")
]
: [
"bash",
Directories.scriptsPath + "/interface/gencolors.sh",
Config.runtime.appearance.background.path,
Config.runtime.appearance.colors.matugenScheme,
Config.runtime.appearance.theme,
Quickshell.shellPath("extras/matugen/config.toml")
];
// Process to generate colors
Process {
id: genThemeColors
command: genColorsCmd
}
}