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

Implement a --show-app CLI flag #751

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

Conversation

heliguy4599
Copy link

@heliguy4599 heliguy4599 commented Jan 22, 2025

What this adds:

flatseal --show-app org.app.Name

  • Adds a new --show-app command-line flag, which takes a Flatpak's appID.
  • If the supplied ID matches an installed app, the UI will switch to showing that app.
  • If no match is found, nothing happens.
  • The flag can be invoked at startup of Flatseal, or while Flatseal is running, and will behave the same.

There is no way to show the Global section, however I can add this if it is desired. Also, I can change the behavior of a non-matching provided ID, if you'd like that to behave differently than doing nothing.

The new flag shows up in the default --help output, with a description.

I believe I have followed Flatseal's coding style to the best of my abilities, but I can always refine what I've added!

Why I think this should be added:

I believe it would be handy for Flatseal to be able to be opened to a specific application, to allow it to be called from other apps or scripts. I am the developer of Warehouse, and I would like to be able to launch Flatseal to a specific app via a button in the UI.

Adds ability for the window to focus an app's page for a given appId string. If no match is found, nothing happens
Adds a function to parse and handle command-line arguments and flags. Currently there are no flags to handle yet
Adds a --show-app flag, which takes a string for the appId of a Flatpak. This then runs the window's showAppId function to try and show the matching app
@tchx84
Copy link
Owner

tchx84 commented Feb 1, 2025

hey @heliguy4599 , I will take a look at this ASAP. Thanks.

@heliguy4599
Copy link
Author

heliguy4599 commented Feb 1, 2025

Great to hear! You're welcome, and thank you for this wonderful app itself!

Copy link
Owner

@tchx84 tchx84 left a comment

Choose a reason for hiding this comment

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

Apologies for the big delay.

This looks OK, but wouldn't it better to expose this functionality as a service?

So that, instead of having to call flatseal via CLI (which is an unlikely use case for actual people), one could simply activate Flatseal with the proper appId via DBus (which is what programs should be doing, like your use case).

I am pretty sure there is a GApplication/GAction magic that does all the heavy lifting here.

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.

2 participants