Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 10 additions & 1 deletion desktop/shell/bin/omarchy-keyboard
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
"""Session controller for the theme-matched Wayland keyboard, and its policy.

omarchy-keyboard show|hide|toggle what the person asks for (swipe up, bar button)
omarchy-keyboard quiet the window opening next was not asked for by a tap
omarchy-keyboard listen the policy: reads the compositor's facts on stdin
omarchy-keyboard restart|run (re)start the keyboard process itself

Expand Down Expand Up @@ -187,6 +188,12 @@ class Policy:

def person(self, action):
"""The person opened or closed it (swipe up, bar button)."""
if action == "quiet":
# A launcher opening a window to read, not to type in (About's
# terminal): the tap that started it does not count for the field
# its window brings. A tap in the window still opens the keyboard.
self.touched_until = self.tapped_until = self.asked_until = 0.0
return
self.opened_here = False
self.hide_at = None
if action == "show":
Expand Down Expand Up @@ -274,6 +281,8 @@ def main(mode):
elif mode == "hide":
hide()
tell_policy("hide")
elif mode == "quiet":
tell_policy("quiet")
elif mode == "listen":
listen()
elif mode == "restart":
Expand All @@ -289,7 +298,7 @@ def main(mode):
elif mode == "run":
run()
else:
raise SystemExit("Usage: omarchy-keyboard [show|hide|toggle|listen|restart|run]")
raise SystemExit("Usage: omarchy-keyboard [show|hide|toggle|quiet|listen|restart|run]")


if __name__ == "__main__":
Expand Down
3 changes: 3 additions & 0 deletions desktop/shell/bin/omarchy-launch-about
Original file line number Diff line number Diff line change
Expand Up @@ -3,5 +3,8 @@
# Foot grid is 89x34; keep the real fastfetch readout open at that width.
set -euo pipefail
export LC_ALL=${LC_ALL:-C.UTF-8}
# About is read, not typed in: the tap on its menu entry must not bring up the
# on-screen keyboard over the details as the terminal's text input comes on.
omarchy-keyboard quiet 2>/dev/null || true
exec foot --app-id=org.omarchy.about -W 89x34 -e bash -lc \
'fastfetch --config "$HOME/.config/fastfetch/config.jsonc"; exec bash -i'
11 changes: 11 additions & 0 deletions tests/test_keyboard_policy.py
Original file line number Diff line number Diff line change
Expand Up @@ -101,6 +101,17 @@ def test_a_version_1_field_coming_on_right_after_a_tap_opens_it(self):
self.facts('press', TAP, 'field on 1')
self.assertEqual(self.calls, ['show'])

def test_a_window_opened_to_read_after_a_tap_does_not_open_it(self):
# About: the menu tap starts a terminal whose text input comes on at once.
self.facts('press', TAP)
self.policy.person('quiet')
self.facts('field on 1')
self.assertEqual(self.calls, [])
# A tap in that window still opens it.
self.wait(1)
self.facts('press', TAP)
self.assertEqual(self.calls, ['show'])

def test_a_tap_that_moves_focus_off_a_version_1_field_does_not(self):
self.facts('field on 1', 'press', 'field off', TAP)
self.wait(1)
Expand Down
Loading