Skip to content
Open
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
1 change: 1 addition & 0 deletions desktop/install-tree
Original file line number Diff line number Diff line change
Expand Up @@ -135,6 +135,7 @@ while read -r source name mode; do
done <<EOF
$shell/applications/org.omarchy.settings.desktop usr/share/applications/org.omarchy.settings.desktop 644
$shell/applications/org.omarchy.settings.svg usr/share/icons/hicolor/scalable/apps/org.omarchy.settings.svg 644
$shell/applications/org.omarchy.terminal.desktop usr/share/applications/org.omarchy.terminal.desktop 644
$config/first-theme usr/libexec/arch-ipad-first-theme 755
$config/scale-output usr/libexec/arch-ipad-scale-output 755
$config/auto-brightness usr/libexec/arch-ipad-auto-brightness 755
Expand Down
12 changes: 12 additions & 0 deletions desktop/shell/applications/org.omarchy.terminal.desktop
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
[Desktop Entry]
# The menu's floating terminals (omarchy-launch-floating-terminal-with-presentation:
# foot --app-id=org.omarchy.terminal): an entry of that id names their windows
# in the overview and the dock, which otherwise show the bare app id. Hidden
# from the launcher; the Terminal there is foot's own entry.
Type=Application
Name=Terminal
Exec=foot
Icon=foot
Terminal=false
NoDisplay=true
StartupWMClass=org.omarchy.terminal
44 changes: 44 additions & 0 deletions tests/test_floating_terminal_name.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
"""The menu's floating terminals are named in the overview and the dock (#287)."""
import configparser
from pathlib import Path
import re
import shutil
import unittest

from package_tree import mode, tree

PROJECT = Path(__file__).resolve().parents[1]
ENTRY = PROJECT / 'desktop/shell/applications/org.omarchy.terminal.desktop'
LAUNCHER = PROJECT / 'desktop/shell/bin/omarchy-launch-floating-terminal-with-presentation'


def entry():
parser = configparser.ConfigParser(interpolation=None, comment_prefixes=('#',))
parser.optionxform = str
parser.read_string(ENTRY.read_text())
return parser['Desktop Entry']


class FloatingTerminalName(unittest.TestCase):
def test_the_entry_has_the_windows_app_id(self):
# labwc's overview and the dock look a window's name up by the desktop
# entry whose id is its app id, and show the bare id without one.
app_id = re.search(r'--app-id=(\S+)', LAUNCHER.read_text()).group(1)
self.assertEqual(ENTRY.name, app_id + '.desktop')
self.assertEqual(entry()['StartupWMClass'], app_id)

def test_it_names_and_draws_them_as_the_terminal_without_a_launcher_tile(self):
self.assertEqual(entry()['Name'], 'Terminal')
self.assertEqual(entry()['Icon'], 'foot')
self.assertEqual(entry()['NoDisplay'], 'true')
self.assertEqual(entry()['Exec'], 'foot')

@unittest.skipUnless(shutil.which('bash') and shutil.which('jq'), 'bash and jq run desktop/install-tree')
def test_the_package_installs_it(self):
installed = tree() / 'usr/share/applications/org.omarchy.terminal.desktop'
self.assertEqual(installed.read_text(), ENTRY.read_text())
self.assertEqual(mode(installed), 0o644)


if __name__ == '__main__':
unittest.main()