Files
Panama/config/dot/quickshell/config/Settings.qml
T

143 lines
11 KiB
QML

pragma Singleton
// ─────────────────────────────────────────────────────────────────────────────
// User-facing knobs. Everything here is something you might reasonably want to
// change without understanding the rest of the shell.
//
// Theme.qml holds *how it looks*; this holds *what it does*.
// ─────────────────────────────────────────────────────────────────────────────
import Quickshell
import QtQuick
Singleton {
id: root
// ── Clock ───────────────────────────────────────────────────────────────
// Carried over from GNOME: 12-hour, weekday + date shown, seconds on.
readonly property bool use24Hour: DesktopPreferences.get("use24Hour")
readonly property bool showSeconds: DesktopPreferences.get("showSeconds")
readonly property bool showWeekday: DesktopPreferences.get("showWeekday")
// ── Bar ─────────────────────────────────────────────────────────────────
// Legibility first: the bar sits on the wallpaper, so it may need a tone,
// a shadow or a scrim the theme cannot know about. `barTextTone` itself is
// read by Theme, which turns it into the barFg family the widgets bind to.
readonly property bool barTextShadow: DesktopPreferences.get("barTextShadow")
readonly property bool barBackdrop: DesktopPreferences.get("barBackdrop")
// Which widgets earn a place. Each is ANDed with the widget's own state
// condition, so turning one on never conjures a pill with nothing in it.
readonly property bool showWeatherWidget: DesktopPreferences.get("showWeatherWidget")
readonly property bool showMediaWidget: DesktopPreferences.get("showMediaWidget")
readonly property bool showClipboardButton: DesktopPreferences.get("showClipboardButton")
readonly property bool showCalendarCountdown: DesktopPreferences.get("showCalendarCountdown")
// ── Control Center ──────────────────────────────────────────────────────
// One bool per section of the quick settings panel that is worth hiding.
readonly property bool ccShowFocus: DesktopPreferences.get("ccShowFocus")
readonly property bool ccShowHome: DesktopPreferences.get("ccShowHome")
readonly property bool ccShowPhone: DesktopPreferences.get("ccShowPhone")
// ── Weather ─────────────────────────────────────────────────────────────
// Coordinates taken from the GNOME night-light setting, which had already
// resolved the location. Uses Open-Meteo, which needs no API key.
readonly property real latitude: DesktopPreferences.get("weatherLatitude")
readonly property real longitude: DesktopPreferences.get("weatherLongitude")
// Open-Meteo returns coordinates but no friendly place name. Keep the
// label deliberately general rather than exposing precise coordinates in
// the UI or guessing at a city from them.
readonly property string weatherLocation: DesktopPreferences.get("weatherLocation")
readonly property string temperatureUnit: DesktopPreferences.get("temperatureUnit")
readonly property int weatherRefreshMinutes: DesktopPreferences.get("weatherRefreshMinutes")
// ── Vitals ──────────────────────────────────────────────────────────────
// The GNOME Vitals extension showed processor usage, memory usage and GPU
// usage, in that order. Same here.
readonly property int vitalsIntervalMs: DesktopPreferences.get("vitalsIntervalMs")
readonly property bool showCpu: DesktopPreferences.get("showCpu")
readonly property bool showMemory: DesktopPreferences.get("showMemory")
readonly property bool showGpu: DesktopPreferences.get("showGpu")
readonly property bool showBattery: DesktopPreferences.get("showBattery")
readonly property bool showBatteryPercent: DesktopPreferences.get("showBatteryPercent")
readonly property bool showAgentUsage: DesktopPreferences.get("showAgentUsage")
// ── Battery ─────────────────────────────────────────────────────────────
readonly property int batteryLowPercent: DesktopPreferences.get("batteryLowPercent")
readonly property int batteryCriticalPercent: DesktopPreferences.get("batteryCriticalPercent")
// amdgpu exposes utilisation here. Verified present on this machine; the
// widget hides itself if the path is missing rather than showing zeros.
readonly property string gpuBusyPath: DesktopPreferences.get("gpuBusyPath")
// ── Night light ─────────────────────────────────────────────────────────
// Matches the (disabled) GNOME schedule: 3500K from 17:00 to 10:00.
readonly property int nightLightTemperature: DesktopPreferences.get("nightLightTemperature")
readonly property real nightLightFrom: DesktopPreferences.get("nightLightFrom")
readonly property real nightLightTo: DesktopPreferences.get("nightLightTo")
readonly property bool nightLightEnabledByDefault: DesktopPreferences.get("nightLightEnabled")
// ── Notifications ───────────────────────────────────────────────────────
readonly property int notificationTimeoutMs: DesktopPreferences.get("notificationTimeoutMs")
readonly property int notificationTimeoutCriticalMs: DesktopPreferences.get("notificationTimeoutCriticalMs") // 0 = never auto-expire
readonly property int notificationHistoryLimit: DesktopPreferences.get("notificationHistoryLimit")
readonly property int maxVisibleToasts: DesktopPreferences.get("maxVisibleToasts")
// The single exception to Do Not Disturb, read by the popup gate in
// services/Notifs.qml. Off means Do Not Disturb is absolute.
readonly property bool criticalBreaksThrough: DesktopPreferences.get("criticalBreaksThrough")
// ── Accessibility ───────────────────────────────────────────────────────
// Reduce motion. Theme.qml turns this into the dur* tokens, so every
// Behavior and NumberAnimation in the shell obeys it without knowing it
// exists. Read through here rather than from the store directly because
// Theme reads it on every animated property in the shell.
readonly property bool animationsEnabled: DesktopPreferences.get("animationsEnabled")
// Read on every notification that would ring the bell, by the per-screen
// VisualBell overlay. Lives here rather than being read from the store
// directly, like every other value the shell consults at speed.
readonly property bool visualAlerts: DesktopPreferences.get("visualAlerts")
// ── Sound ───────────────────────────────────────────────────────────────
// Over-amplification is the clamp ceiling for output volume: off means 1.0,
// on means 1.5. Every slider and the volume keys read the same switch, so
// the ceiling cannot differ depending on where you changed the volume from.
readonly property bool overAmplification: DesktopPreferences.get("overAmplification")
readonly property bool volumeChangeBlip: DesktopPreferences.get("volumeChangeBlip")
// ── Focus ──────────────────────────────────────────────────────────────
// One deliberate default rather than a preset picker: quick settings and
// the keyboard shortcut should start a useful session in one action.
readonly property int focusDurationMinutes: DesktopPreferences.get("focusDurationMinutes")
// ── Dock ────────────────────────────────────────────────────────────────
// Pinned apps, in order, taken from the GNOME dash favorites.
readonly property string dockPosition: DesktopPreferences.get("dockPosition")
readonly property var dockScreens: {
const stored = DesktopPreferences.get("dockScreens");
return Array.isArray(stored) ? stored : [];
}
readonly property var dockPinned: DesktopPreferences.get("dockPinned")
// Dash-to-Dock was set to intellihide against all windows: the dock hides
// when any window would overlap it, and comes back on hover.
readonly property bool dockAutohide: DesktopPreferences.get("dockAutohide")
// 0: reveal the instant the pointer reaches the bottom edge. A reveal delay
// is indistinguishable from lag, because the user has already committed to
// the gesture by the time the strip is hit.
readonly property int dockRevealDelayMs: DesktopPreferences.get("dockRevealDelayMs")
// Hiding keeps a delay, so brushing past the bottom edge or crossing the
// gap between two icons doesn't make the dock flicker.
readonly property int dockHideDelayMs: DesktopPreferences.get("dockHideDelayMs")
// ── Capture ─────────────────────────────────────────────────────────────
readonly property string screenshotDir: DesktopPreferences.get("screenshotDir")
readonly property string recordingDir: DesktopPreferences.get("recordingDir")
// Passed to wf-recorder. Uses VAAPI on the AMD card so recording does not
// cost CPU while gaming.
readonly property string recorderArgs: DesktopPreferences.get("recorderArgs")
readonly property string recorderAudio: DesktopPreferences.get("recorderAudio")
}