From 6b861dba8c768d014a89080ceaf2251f0594cc78 Mon Sep 17 00:00:00 2001 From: ozz1ee <140255886+ozz1ee-dev@users.noreply.github.com> Date: Sat, 5 Dec 2026 15:29:35 +0000 Subject: [PATCH] desktop: point xdg-terminal-exec at foot Desktop entries with Terminal=true (and the menu actions that already call xdg-terminal-exec) did nothing on the tablet: no default terminal was named, and the helper itself was not installed (see the packages companion change). /etc/xdg/xdg-terminals.list now names foot.desktop. Fixes #161. --- CHANGELOG.md | 6 +++++ system/overlay/etc/xdg/xdg-terminals.list | 3 +++ tests/test_xdg_terminals.py | 27 +++++++++++++++++++++++ 3 files changed, 36 insertions(+) create mode 100644 system/overlay/etc/xdg/xdg-terminals.list create mode 100644 tests/test_xdg_terminals.py diff --git a/CHANGELOG.md b/CHANGELOG.md index b6f4332e..1eaed8a3 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -14,6 +14,12 @@ release is checked here and released on by hand. ## Unreleased +### Desktop + +- Apps that run in a terminal, and the menu's Install or Remove Package + entries, open in foot. They did nothing before: xdg-terminal-exec was + called but not installed, and no default terminal was named. + ## [0.4.10] - 2026-12-05 Built on orchard 0.3.24. diff --git a/system/overlay/etc/xdg/xdg-terminals.list b/system/overlay/etc/xdg/xdg-terminals.list new file mode 100644 index 00000000..c4df3d7e --- /dev/null +++ b/system/overlay/etc/xdg/xdg-terminals.list @@ -0,0 +1,3 @@ +# The tablet's terminal is foot. Desktop entries with Terminal=true, and +# menu actions that call xdg-terminal-exec, use this list. +foot.desktop diff --git a/tests/test_xdg_terminals.py b/tests/test_xdg_terminals.py new file mode 100644 index 00000000..5e7b4b41 --- /dev/null +++ b/tests/test_xdg_terminals.py @@ -0,0 +1,27 @@ +"""xdg-terminal-exec is pointed at foot, so Terminal=true entries have a terminal.""" +from pathlib import Path +import unittest + +PROJECT = Path(__file__).resolve().parents[1] +LIST = PROJECT / 'system/overlay/etc/xdg/xdg-terminals.list' + + +class XdgTerminals(unittest.TestCase): + def test_the_system_list_names_foot(self): + text = LIST.read_text() + names = [line.strip() for line in text.splitlines() + if line.strip() and not line.lstrip().startswith('#')] + self.assertEqual(names, ['foot.desktop']) + + def test_the_package_installs_the_list(self): + import sys + sys.path.insert(0, str(PROJECT)) + from package_tree import system_files + files = system_files() + self.assertIn('etc/xdg/xdg-terminals.list', files) + self.assertEqual(files['etc/xdg/xdg-terminals.list'][0], LIST.read_bytes()) + self.assertEqual(files['etc/xdg/xdg-terminals.list'][1], 0o644) + + +if __name__ == '__main__': + unittest.main()