Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support launching app in terminal #718

Open
wants to merge 3 commits into
base: master
Choose a base branch
from

Conversation

jpttrssn
Copy link

@jpttrssn jpttrssn commented Nov 17, 2024

  • Get terminal setting from desktop file
  • Launch app in terminal if set
  • Copy mime_app from cosmic-files to support terminal fallback

This supports pop-os/cosmic-epoch#735

Requires: pop-os/cosmic-term#380

src/desktop.rs Outdated Show resolved Hide resolved
@jpttrssn jpttrssn requested a review from wash2 November 18, 2024 19:14
wash2
wash2 previously approved these changes Nov 18, 2024
src/desktop.rs Outdated
if !arg.starts_with('%') {
cmd.arg(arg);
let mut cmd = if terminal {
let mut cmd = std::process::Command::new("cosmic-term");
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What happens if cosmic-term is not installed?

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good point. I'll try to come up with something. I see that cosmic-files handles this. And I assume the code for command + t also handles this but I haven't found that yet.

- Get terminal setting from desktop file
- Launch app in terminal if set
- Add optional language sorter parameter to MimeAppCache::reload()
- Use mime_app::exec_term_command in desktop::spawn_desktop_exec()
- Add function mime_app::exec_term_to_command() to get exec command using terminal with fallback
  - Use this in MimeApp::command()
  - Use this in desktop::spawn_desktop_exec()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants