Give a laptop its first week: the keys, the lid, the battery's endgame
The audit's fourth tier -- what a Framework owner reaches for in the first week and found missing. The power button stops being an instant, unconfirmed poweroff: a shipped logind drop-in tells the daemon to stand down and the compositor binds the key to the power menu, the way GNOME turns it into a question. Holding it still hard-cuts through firmware. change-settings restarts logind so the change applies without waiting for a boot, and the Power page says what the button does now. The function row fills in: F10 (XF86RFKill) toggles airplane mode through a new panama-osd verb that blocks or unblocks every radio and says which way it went; F9 (XF86Display) opens the Displays page, the honest action until mirroring exists. And the lid becomes a switch bind: closing a docked lid turns the internal panel off so nothing renders inside a closed shell and no workspace strands on an invisible output, and opening it restores the panel with the mode and scale chosen in Settings. panama-lid owns both decisions; undocked machines suspend via logind before any of it matters. The battery gets an endgame. On battery the screen dims to 30% two-thirds of the way to blanking -- GNOME's single largest idle battery saver -- and restores exactly the level it saved. At the urgent threshold the machine suspends after a fifteen-second grace, cancelled by plugging in, because a suspend preserves the session for days and a hard cut at 0% preserves nothing; "Only warn" remains a choice on the Power page. Hibernate joins the power menu, but only where logind answers CanHibernate with yes -- an entry that fails silently is worse than none. And brightness stops being two code paths: the Displays page now embeds the same control the quick-settings panel uses, so the built-in backlight and DDC/CI monitors share one surface that withdraws itself where neither exists. The lid contract narrows to what its principle protects -- a HandleLidSwitch drop-in -- so deliberate policy for other keys can ship. Claude-Session: https://claude.ai/code/session_01Epx9ZC1gwm81K3jm9x9CKh
This commit is contained in:
@@ -34,6 +34,10 @@ local osd = function(action)
|
||||
return "$HOME/.config/quickshell/scripts/panama-osd " .. action
|
||||
end
|
||||
|
||||
local lid = function(action)
|
||||
return "$HOME/.config/quickshell/scripts/panama-lid " .. action
|
||||
end
|
||||
|
||||
local dictate = function(action)
|
||||
return "$HOME/.config/quickshell/scripts/panama-dictate " .. action
|
||||
end
|
||||
@@ -458,6 +462,30 @@ bind("XF86AudioStop", hl.dsp.exec_cmd(osd("media stop")), { locked = true , desc
|
||||
bind("XF86MonBrightnessUp", hl.dsp.exec_cmd(osd("brightness up 5")), { locked = true, repeating = true , description = "Brightness up" })
|
||||
bind("XF86MonBrightnessDown", hl.dsp.exec_cmd(osd("brightness down 5")), { locked = true, repeating = true , description = "Brightness down" })
|
||||
|
||||
-- Airplane mode. The Framework's F10 emits exactly this keysym, and for a
|
||||
-- while it emitted it into silence. panama-osd owns the toggle so the OSD
|
||||
-- can say which way it went.
|
||||
bind("XF86RFKill", hl.dsp.exec_cmd(osd("airplane toggle")), { locked = true, description = "Airplane mode" })
|
||||
|
||||
-- F9 on the same row. GNOME shows a display-switching OSD here; until
|
||||
-- mirroring exists (DESKTOP-PARITY gap), the honest action is the page where
|
||||
-- displays are actually arranged.
|
||||
bind("XF86Display", hl.dsp.exec_cmd("qs ipc call settings page displays"), { description = "Display settings" })
|
||||
|
||||
-- The power button. logind is told to ignore it (config/copy ships the
|
||||
-- drop-in) so a stray press is a question, not an instant poweroff -- the
|
||||
-- menu this opens is the question. Until the next boot after that drop-in
|
||||
-- lands, logind still acts on the key; this bind costs nothing extra then.
|
||||
bind("XF86PowerOff", hl.dsp.exec_cmd("qs ipc call powermenu toggle"), { locked = true, description = "Power menu" })
|
||||
|
||||
-- The lid, as a switch rather than a key. Closing a docked lid turns the
|
||||
-- internal panel off so nothing renders inside a closed shell and no
|
||||
-- workspace strands on an invisible output; opening it turns the panel back
|
||||
-- on. panama-lid owns the decision -- undocked machines suspend via logind
|
||||
-- before this matters, and the guard's inhibitor handles staying awake.
|
||||
bind("switch:on:Lid Switch", hl.dsp.exec_cmd(lid("close")), { locked = true, description = "Lid closed" })
|
||||
bind("switch:off:Lid Switch", hl.dsp.exec_cmd(lid("open")), { locked = true, description = "Lid opened" })
|
||||
|
||||
category("Applications")
|
||||
-- Hardware keys GNOME mapped that have obvious equivalents.
|
||||
bind("XF86Tools", hl.dsp.exec_cmd(settings), { description = "Settings" })
|
||||
|
||||
Reference in New Issue
Block a user