mirror of
https://github.com/Sn3akyy1/lucid.git
synced 2026-11-19 21:27:56 +03:00
08744d0688
Desktop icons, bar islands and a full bar, live wallpapers and four picker styles, files over Bluetooth with a pairing agent, a Startup page, fingerprint unlock on the lock and login screens, five new widgets, metric or imperial units, the Steam open/close loop fixed, and the right graphics drivers for Steam. Fifteen pull requests from Ciro Rivera and one from SKetU-l. The full notes are in CHANGELOG.md. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
32 lines
730 B
QML
32 lines
730 B
QML
import QtQuick
|
|
import Quickshell
|
|
pragma Singleton
|
|
|
|
// how the shell reads out temperatures and speeds, from Prefs.units
|
|
Singleton {
|
|
id: root
|
|
|
|
readonly property bool imperial: Prefs.units === "imperial"
|
|
|
|
// c in celsius; f is the source's own fahrenheit if it has one, else c is converted
|
|
function temp(c, f) {
|
|
if (!root.imperial)
|
|
return Math.round(c);
|
|
|
|
return f !== undefined ? f : Math.round(c * 9 / 5 + 32);
|
|
}
|
|
|
|
function deg(c, f) {
|
|
return root.temp(c, f) + "°";
|
|
}
|
|
|
|
function degUnit(c) {
|
|
return root.temp(c) + (root.imperial ? " °F" : " °C");
|
|
}
|
|
|
|
function wind(kmh, mph) {
|
|
return root.imperial ? mph + " mph" : kmh + " km/h";
|
|
}
|
|
|
|
}
|