Make every control tell the truth
The audit's first tier, in one change: every case found where the interface
asserted something the system did not do.
Twenty-one compositor-owned preferences -- the whole Mouse & Touchpad page,
plus window layout, snapping, dim-inactive and the magnifier -- had the live
half (hyprctl eval) and not the config-time half, so they quietly reverted on
every hyprctl reload. All 70 hypr-backed keys now have a prefs.get() in the
Lua, and hypr-prefs-contract pins both the presence and that the Lua fallback
equals the schema default, which is how the touchpad page misreported natural
scrolling on first boot.
The idle generator fell back from unwritten battery keys to the AC values
while the Power page displayed the schema defaults: a fresh laptop showed
"suspend at 20 minutes" and generated no suspend listener, then discharged to
zero in a bag. Unwritten keys now use the defaults the page shows
(idle-defaults-contract pins generator to schema; idle-config-contract
re-pinned to the new rule with the tradeoff recorded), and change-settings
enables managed idle on any machine with a battery -- without starting
hypridle in whatever session the installer runs under.
The per-app lock-screen notification switches wrote fields nothing read:
hyprlock cannot render notifications. Removed, with the rule model shrunk to
{enabled}, stale stored fields dropped at normalization, and the contract now
forbidding the page from growing lock-screen switches it cannot honor.
The battery warning thresholds were searchable, documented as "Found on
Power & Lock", and rendered nowhere -- and crossing the low threshold changed
only a glyph's color. Both sliders now exist where search was already sending
people, and low battery publishes a real notification at important priority.
Three handoffs opened GNOME panels that are inert in a Hyprland session. The
keyboard handoff is gone (that panel writes gsettings nothing here reads, and
the working controls sat on the same page); Connectivity gains a Wi-Fi row
that opens GNOME's actual Wi-Fi panel -- hidden SSIDs and 802.1X finally have
a road -- beside the network row that legitimately drives NetworkManager; the
universal-access handoff is gone, its few working toggles being controls this
app already owns. And the accessibility page now gives the true reason sticky
keys are missing: each Wayland compositor implements its own and Hyprland
does not yet -- not "an X11 feature with no Wayland equivalent," which sent
people to the wrong conclusion about the platform.
Claude-Session: https://claude.ai/code/session_01Epx9ZC1gwm81K3jm9x9CKh
This commit is contained in:
@@ -1446,7 +1446,8 @@ Singleton {
|
||||
},
|
||||
|
||||
// ── Per-application notification rules ──────────────────────────────
|
||||
// { "<appId>": { enabled, showOnLockScreen, showContentOnLockScreen } }
|
||||
// { "<appId>": { enabled } } -- lock-screen fields from older rules are
|
||||
// dropped at normalization; hyprlock cannot render notifications.
|
||||
//
|
||||
// Absent means "no rule", which is not the same as a rule that allows
|
||||
// everything: a new application must be able to notify without needing
|
||||
|
||||
@@ -62,32 +62,26 @@ SettingsPage {
|
||||
SliderRow { setting: "dimStrength"; divider: false }
|
||||
}
|
||||
|
||||
// What this session genuinely cannot do, said plainly.
|
||||
//
|
||||
// Sticky keys, slow keys, bounce keys and mouse keys are AccessX, which is
|
||||
// an X11 SERVER feature. XKB under Wayland has no accessx option group at
|
||||
// all, and Hyprland does not implement one. The compositor will accept
|
||||
// "accessx:enable" as a keyboard option and store it, and nothing will ever
|
||||
// act on it -- so there is no switch here, and pointing at GNOME's panel
|
||||
// would be no better, since the daemon that applies those keys is not
|
||||
// running either.
|
||||
// What this session genuinely cannot do, said plainly -- and for the
|
||||
// right reason. On Wayland there is no protocol for sticky, slow or
|
||||
// bounce keys: each compositor implements its own (mutter does, which is
|
||||
// how GNOME has them on Wayland), and Hyprland does not yet. An earlier
|
||||
// version blamed "X11 feature with no Wayland equivalent", which sent
|
||||
// anyone who needs sticky keys to the wrong conclusion about the whole
|
||||
// platform. There is also deliberately no handoff to GNOME's
|
||||
// universal-access panel: its toggles are applied by GNOME Shell, and
|
||||
// the few that work through plain gsettings (cursor size, text scale,
|
||||
// high contrast) are owned by the controls above on this very page.
|
||||
SettingsCard {
|
||||
title: "Keyboard accessibility"
|
||||
subtitle: "Sticky, slow and bounce keys are an X11 feature with no Wayland equivalent, so they are unavailable in this session. Offering them here would store a preference that nothing acts on."
|
||||
subtitle: "Sticky, slow and bounce keys are implemented by each Wayland compositor for itself; Hyprland does not implement them yet, so they are unavailable in this session. Offering switches here would store preferences nothing acts on."
|
||||
|
||||
ActionRow {
|
||||
label: "Screen reader"
|
||||
detail: "Orca reads the screen aloud and works over the accessibility bus, which does run here"
|
||||
action: "Start Orca"
|
||||
onTriggered: SystemSettings.openApplication("orca")
|
||||
}
|
||||
|
||||
ActionRow {
|
||||
label: "GNOME accessibility settings"
|
||||
detail: "For the parts GNOME's own stack still owns"
|
||||
action: "Open"
|
||||
divider: false
|
||||
onTriggered: SystemSettings.openGnomePanel("universal-access")
|
||||
onTriggered: SystemSettings.openApplication("orca")
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -185,11 +185,24 @@ SettingsPage {
|
||||
|
||||
SettingsCard {
|
||||
title: "Owned by Fedora"
|
||||
subtitle: "VPNs and per-connection routing are still configured by GNOME's panel, which is installed and searchable. Printers and online accounts have their own pages here."
|
||||
// These two panels drive NetworkManager over D-Bus, which is why they
|
||||
// work in this session when most GNOME panels do not. They are split
|
||||
// because GNOME splits them: "network" is wired, VPN and proxies, and
|
||||
// does not contain Wi-Fi -- the one panel used to point everyone
|
||||
// there, so the road to a hidden SSID or eduroam ended on a page
|
||||
// without Wi-Fi on it.
|
||||
subtitle: "Wired, VPN and Wi-Fi connection editing stay with GNOME's panels, which drive the same NetworkManager this page reads. Printers and online accounts have their own pages here."
|
||||
|
||||
ActionRow {
|
||||
label: "Wi-Fi networks"
|
||||
detail: "Hidden networks, enterprise (802.1X) logins, and per-network settings"
|
||||
action: "Open"
|
||||
onTriggered: SystemSettings.openGnomePanel("wifi")
|
||||
}
|
||||
|
||||
ActionRow {
|
||||
label: "Network connections"
|
||||
detail: "VPN, proxies, and per-connection settings"
|
||||
detail: "VPN, proxies, and wired connection settings"
|
||||
action: "Open"
|
||||
divider: false
|
||||
onTriggered: SystemSettings.openGnomePanel("network")
|
||||
|
||||
@@ -7,7 +7,6 @@ SettingsPage {
|
||||
|
||||
// Only one application is expanded at a time; the point is a card you
|
||||
// can read, not twenty open at once.
|
||||
property string expandedApp: ""
|
||||
|
||||
// Which focus mode is open for editing. One at a time, like the app rules.
|
||||
property string expandedMode: ""
|
||||
@@ -117,87 +116,21 @@ SettingsPage {
|
||||
|
||||
readonly property var app: appEntry.modelData
|
||||
readonly property var rule: Notifs.appRule(appEntry.app.id)
|
||||
readonly property bool open: root.expandedApp === String(appEntry.app.id)
|
||||
|
||||
// What the two lock-screen switches add up to, so the common
|
||||
// case -- reading rather than changing -- needs no interaction.
|
||||
// Every app repeated both switch labels verbatim before this,
|
||||
// which made twenty apps sixty rows of identical sentences.
|
||||
readonly property string summary: {
|
||||
if (!appEntry.rule.enabled)
|
||||
return "Notifications off";
|
||||
if (!appEntry.rule.showOnLockScreen)
|
||||
return "On · hidden on the lock screen";
|
||||
return appEntry.rule.showContentOnLockScreen
|
||||
? "On · lock screen shows content"
|
||||
: "On · lock screen shows the sender only";
|
||||
}
|
||||
|
||||
width: parent.width
|
||||
|
||||
SettingRow {
|
||||
width: parent.width
|
||||
label: appEntry.app.name
|
||||
// The identifier is only worth the space while the app is
|
||||
// open, which is the only time it disambiguates anything.
|
||||
detail: appEntry.open ? String(appEntry.app.id) : appEntry.summary
|
||||
activatable: true
|
||||
divider: !appEntry.open
|
||||
controlWidth: 92
|
||||
onActivated: root.expandedApp = appEntry.open ? "" : String(appEntry.app.id)
|
||||
|
||||
Row {
|
||||
anchors.right: parent.right
|
||||
anchors.verticalCenter: parent.verticalCenter
|
||||
spacing: 11
|
||||
|
||||
SettingsToggle {
|
||||
anchors.verticalCenter: parent.verticalCenter
|
||||
checked: appEntry.rule.enabled
|
||||
onToggled: value => Notifs.setAppRule(appEntry.app.id, { enabled: value })
|
||||
}
|
||||
|
||||
Text {
|
||||
anchors.verticalCenter: parent.verticalCenter
|
||||
text: appEntry.open ? "\u25B4" : "\u25BE"
|
||||
color: Theme.fgMuted
|
||||
font.family: Theme.fontFamily
|
||||
font.pixelSize: Theme.fontSizeSmall
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
SettingRow {
|
||||
width: parent.width
|
||||
visible: appEntry.open
|
||||
label: "Show on lock screen"
|
||||
detail: "Allow this app's notifications on the lock screen"
|
||||
detail: appEntry.rule.enabled ? String(appEntry.app.id) : "Notifications off"
|
||||
divider: true
|
||||
controlWidth: 48
|
||||
|
||||
SettingsToggle {
|
||||
anchors.right: parent.right
|
||||
anchors.verticalCenter: parent.verticalCenter
|
||||
checked: appEntry.rule.showOnLockScreen
|
||||
onToggled: value => Notifs.setAppRule(appEntry.app.id, { showOnLockScreen: value })
|
||||
}
|
||||
}
|
||||
|
||||
SettingRow {
|
||||
width: parent.width
|
||||
visible: appEntry.open
|
||||
label: "Show content on lock screen"
|
||||
detail: "Show message details when this app is visible there"
|
||||
divider: false
|
||||
controlWidth: 48
|
||||
// Meaningless unless the app reaches the lock screen at all.
|
||||
opacity: appEntry.rule.showOnLockScreen ? 1 : 0.45
|
||||
|
||||
SettingsToggle {
|
||||
anchors.right: parent.right
|
||||
anchors.verticalCenter: parent.verticalCenter
|
||||
enabled: appEntry.rule.showOnLockScreen
|
||||
checked: appEntry.rule.showContentOnLockScreen
|
||||
onToggled: value => Notifs.setAppRule(appEntry.app.id, { showContentOnLockScreen: value })
|
||||
checked: appEntry.rule.enabled
|
||||
onToggled: value => Notifs.setAppRule(appEntry.app.id, { enabled: value })
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -46,6 +46,15 @@ SettingsPage {
|
||||
return "Plugged in, not charging";
|
||||
return "On battery";
|
||||
}
|
||||
}
|
||||
|
||||
// The two points at which the desktop starts telling you. These were
|
||||
// in the schema and reachable from settings search long before any
|
||||
// page rendered them -- search delivered people to this card and the
|
||||
// controls were not here.
|
||||
SliderRow { setting: "batteryLowPercent" }
|
||||
SliderRow {
|
||||
setting: "batteryCriticalPercent"
|
||||
divider: Battery.chargeLimitSupported
|
||||
}
|
||||
|
||||
|
||||
@@ -111,17 +111,12 @@ SettingsPage {
|
||||
ToggleRow { setting: "numlockByDefault"; divider: false }
|
||||
}
|
||||
|
||||
SettingsCard {
|
||||
title: "Hardware input"
|
||||
|
||||
ActionRow {
|
||||
label: "Mouse, touchpad, and keyboard devices"
|
||||
detail: "Device-specific settings stay with Fedora's hardware-backed panels"
|
||||
action: "Open keyboard"
|
||||
divider: false
|
||||
onTriggered: SystemSettings.openGnomePanel("keyboard")
|
||||
}
|
||||
}
|
||||
// Deliberately no handoff to GNOME's keyboard panel here. That panel
|
||||
// writes org.gnome.desktop input-source and shortcut gsettings, which
|
||||
// nothing in a Hyprland session reads -- so the button looked like the
|
||||
// escape hatch for layouts and did nothing, while the controls that DO
|
||||
// work sat further up this same page. A handoff to an inert panel is a
|
||||
// dead end wearing a button.
|
||||
|
||||
// One card per group, built from what the compositor actually has bound.
|
||||
//
|
||||
|
||||
@@ -71,16 +71,24 @@ load() {
|
||||
suffix="Battery"
|
||||
fi
|
||||
|
||||
# The battery variants fall back to their AC counterparts rather than to a
|
||||
# constant, so a machine whose battery keys were never written still gets
|
||||
# coherent behavior instead of the schema's shipped shorter timings
|
||||
# overriding a deliberately long AC setting.
|
||||
blank_min="$(clamp_int "$(read_setting "screenBlankMinutes$suffix" \
|
||||
"$(read_setting screenBlankMinutes 5)")" 0 120 5)"
|
||||
lock_min="$(clamp_int "$(read_setting "lockMinutes$suffix" \
|
||||
"$(read_setting lockMinutes 10)")" 0 240 10)"
|
||||
suspend_min="$(clamp_int "$(read_setting "suspendMinutes$suffix" \
|
||||
"$(read_setting suspendMinutes 0)")" 0 480 0)"
|
||||
# An unwritten key falls back to ITS OWN schema default, never to the
|
||||
# other power source's value. The battery keys once fell back to their AC
|
||||
# counterparts, which sounded protective and produced a lie instead: the
|
||||
# Power page shows the schema default (suspend at 20) for an unwritten
|
||||
# battery key, while this generator quietly used the AC value (never), so
|
||||
# a fresh laptop displayed one behavior and shipped another -- and
|
||||
# discharged to zero in a bag. Whatever the sliders show is what must be
|
||||
# generated; these fallbacks are pinned to the schema by
|
||||
# tests/hypr/idle-defaults-contract.
|
||||
if [[ "$suffix" == "Battery" ]]; then
|
||||
blank_min="$(clamp_int "$(read_setting screenBlankMinutesBattery 2)" 0 120 2)"
|
||||
lock_min="$(clamp_int "$(read_setting lockMinutesBattery 5)" 0 240 5)"
|
||||
suspend_min="$(clamp_int "$(read_setting suspendMinutesBattery 20)" 0 480 20)"
|
||||
else
|
||||
blank_min="$(clamp_int "$(read_setting screenBlankMinutes 5)" 0 120 5)"
|
||||
lock_min="$(clamp_int "$(read_setting lockMinutes 10)" 0 240 10)"
|
||||
suspend_min="$(clamp_int "$(read_setting suspendMinutes 0)" 0 480 0)"
|
||||
fi
|
||||
lock_on_sleep="$(read_setting lockOnSleep true)"
|
||||
[[ "$lock_on_sleep" == "true" || "$lock_on_sleep" == "false" ]] || lock_on_sleep=true
|
||||
}
|
||||
@@ -162,7 +170,15 @@ case "${1:-apply}" in
|
||||
install)
|
||||
generate
|
||||
install_dropin
|
||||
systemctl --user restart hypridle.service
|
||||
# Restart only a daemon that is already running. `restart` on an
|
||||
# inactive unit STARTS it, and this verb now also runs from
|
||||
# change-settings during ./install -- possibly inside a GNOME
|
||||
# session, where starting hypridle would fight GNOME's own idle
|
||||
# handling. A session that has not started hypridle yet picks the
|
||||
# drop-in up at its next launch.
|
||||
if systemctl --user is-active -q hypridle.service; then
|
||||
systemctl --user restart hypridle.service
|
||||
fi
|
||||
;;
|
||||
remove)
|
||||
rm -f "$dropin"
|
||||
|
||||
@@ -120,6 +120,29 @@ Singleton {
|
||||
}
|
||||
}
|
||||
|
||||
// The "Warn at" threshold from the Power page. A quiet mention, not an
|
||||
// interruption: Do Not Disturb may still silence it, and the bar glyph
|
||||
// turns with it. For a long time this threshold changed only the glyph's
|
||||
// color, which nobody watching their work ever saw -- the first actual
|
||||
// message arrived at the critical level.
|
||||
Connections {
|
||||
target: Battery
|
||||
function onLowChanged(): void {
|
||||
if (!root.powerInitialized || !Battery.low || Battery.critical)
|
||||
return;
|
||||
StatusEvents.publish({
|
||||
key: "battery-low",
|
||||
glyph: "\u{F007A}",
|
||||
title: "Battery low",
|
||||
detail: Math.round(Battery.percent) + "% remaining",
|
||||
tone: "warning",
|
||||
priority: StatusEvents.importantPriority,
|
||||
actionId: "open-settings",
|
||||
actionData: "power"
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
// Running out is not ambient. Published at a priority Do Not Disturb does
|
||||
// not silence, because the one notification you must not miss is the one
|
||||
// saying the machine is about to stop.
|
||||
|
||||
@@ -113,11 +113,9 @@ Singleton {
|
||||
|
||||
function normalizedAppRule(rule: var): var {
|
||||
const source = rule && typeof rule === "object" && !Array.isArray(rule) ? rule : {};
|
||||
return {
|
||||
enabled: source.enabled !== false,
|
||||
showOnLockScreen: source.showOnLockScreen !== false,
|
||||
showContentOnLockScreen: source.showContentOnLockScreen !== false
|
||||
};
|
||||
// Only `enabled` -- see the lock-screen note below for why the rule
|
||||
// model carries nothing else, and drops old fields on the way through.
|
||||
return { enabled: source.enabled !== false };
|
||||
}
|
||||
|
||||
function appRule(appId: string): var {
|
||||
@@ -133,9 +131,7 @@ Singleton {
|
||||
for (const knownAppId of Object.keys(root.appRules))
|
||||
next[knownAppId] = root.appRule(knownAppId);
|
||||
next[appId] = {
|
||||
enabled: patch.enabled === undefined ? current.enabled : patch.enabled === true,
|
||||
showOnLockScreen: patch.showOnLockScreen === undefined ? current.showOnLockScreen : patch.showOnLockScreen === true,
|
||||
showContentOnLockScreen: patch.showContentOnLockScreen === undefined ? current.showContentOnLockScreen : patch.showContentOnLockScreen === true
|
||||
enabled: patch.enabled === undefined ? current.enabled : patch.enabled === true
|
||||
};
|
||||
|
||||
if (root.appRulesSchemaAvailable && DesktopPreferences.set("notificationAppRules", next))
|
||||
@@ -158,17 +154,14 @@ Singleton {
|
||||
return appId;
|
||||
}
|
||||
|
||||
// These policy getters deliberately accept Notification objects, so a lock
|
||||
// screen can use the same source of truth without duplicating app matching.
|
||||
function shouldShowOnLockScreen(notification: var): bool {
|
||||
const rule = root.appRule(root.notificationAppId(notification));
|
||||
return rule.enabled && rule.showOnLockScreen;
|
||||
}
|
||||
|
||||
function shouldShowContentOnLockScreen(notification: var): bool {
|
||||
const rule = root.appRule(root.notificationAppId(notification));
|
||||
return rule.enabled && rule.showOnLockScreen && rule.showContentOnLockScreen;
|
||||
}
|
||||
// There are deliberately no lock-screen policy getters here, and no
|
||||
// lock-screen switches on the Notifications page. The lock screen is
|
||||
// hyprlock, which cannot render notifications, so two per-app privacy
|
||||
// toggles shipped for a while that controlled nothing -- on the page a
|
||||
// person checks precisely when they care. Stored rules may still carry
|
||||
// showOnLockScreen fields from that era; nothing reads them. If a lock
|
||||
// screen that can render notifications ever exists, the rule store and
|
||||
// appRule() are the right place to hang its policy back onto.
|
||||
|
||||
// history grouped by app, in most-recent-app-first order — the shape
|
||||
// NotificationList.qml renders directly.
|
||||
|
||||
Reference in New Issue
Block a user