mirror of
https://github.com/Sn3akyy1/lucid.git
synced 2026-11-18 20:31:37 +03:00
d37cbe3cb4
The greeter drew every size at its shipped pixels and its corners at their shipped radius, while the lock goes through the interface size and corner rounding settings, so at anything but 100% the two looked different. The running shell now hands both over with the colours (theme-dump.qml), the greeter's Theme has the shell's dp(), rad() and pill(), and every size in the greeter goes through them exactly where the lock's does. The chips top right are the lock's: battery, network and bluetooth, with its symbols, labels and colours, read off sysfs since a greeter has no session to ask. qml may only read local files with QML_XHR_ALLOW_FILE_READ, which install-theme.sh adds to the greeter's environment; without it the machine's name stands in, as before. Wi-Fi shows as "Wi-Fi" and bluetooth only as on or off, since sysfs knows neither the network's name nor what is paired. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
64 lines
2.6 KiB
QML
64 lines
2.6 KiB
QML
import QtQuick
|
|
import Quickshell
|
|
import qs
|
|
|
|
// prints the resolved Theme tokens as json, for anything outside the shell
|
|
// that needs Lucid's colours - sddm, which runs before this config exists.
|
|
// the tone maths in Theme.qml is not reproducible from the palette file, so
|
|
// the only honest source is the Theme itself.
|
|
//
|
|
// qs -p ~/.config/quickshell/theme-dump.qml
|
|
ShellRoot {
|
|
// builds Theme now rather than inside the print below: a singleton read for
|
|
// the first time hands back its fallback colours, and the file it is waiting
|
|
// on only lands on the next event loop turn
|
|
Component.onCompleted: Theme.paletteLoaded
|
|
|
|
Timer {
|
|
property int tries: 0
|
|
|
|
running: true
|
|
interval: 250
|
|
repeat: true
|
|
onTriggered: {
|
|
tries += 1;
|
|
// both arrive over a FileView, so the first tick is too early
|
|
if ((!Prefs.loaded || !Theme.paletteLoaded) && tries < 20)
|
|
return ;
|
|
|
|
console.log("LUCIDTOKENS " + JSON.stringify({
|
|
"isLight": Theme.isLight,
|
|
"accent": Theme.accent.toString(),
|
|
"accentHover": Theme.accentHover.toString(),
|
|
"fgAccent": Theme.fgAccent.toString(),
|
|
"accentMuted": Theme.accentMuted.toString(),
|
|
"clockHour": Theme.atTone(Theme.cPrimary, Theme.isLight ? 25 : 92).toString(),
|
|
"accentContainer": Theme.accentContainer.toString(),
|
|
"fgAccentContainer": Theme.fgAccentContainer.toString(),
|
|
"bgOpaque": Theme.bgOpaque.toString(),
|
|
"bgHigh": Theme.bgHigh.toString(),
|
|
"text": Theme.text.toString(),
|
|
"subtext": Theme.subtext.toString(),
|
|
"subtextDim": Theme.subtextDim.toString(),
|
|
"outline": Theme.outline.toString(),
|
|
"outlineStrong": Theme.outlineStrong.toString(),
|
|
"error": Theme.error.toString(),
|
|
"fgError": Theme.fgError.toString(),
|
|
"errorHover": Theme.atTone(Theme.error, Theme.toneOf(Theme.error) + (Theme.isLight ? -6 : 6)).toString(),
|
|
"success": Theme.success.toString(),
|
|
"fgSuccess": Theme.fgSuccess.toString(),
|
|
"warning": Theme.warning.toString(),
|
|
"scrim": Theme.cScrim.toString(),
|
|
"fontFamily": Theme.fontFamily,
|
|
"fontScale": Theme.fontScale,
|
|
"motionScale": Theme.motionScale,
|
|
"uiScale": Theme.uiScale,
|
|
"cornerScale": Theme.cornerScale,
|
|
"clock24h": Prefs.clock24h
|
|
}));
|
|
Qt.exit(0);
|
|
}
|
|
}
|
|
|
|
}
|