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

CLI switches for opening a specific tab #308

Closed
1 task done
cumber opened this issue Jul 29, 2024 · 4 comments · Fixed by #312
Closed
1 task done

CLI switches for opening a specific tab #308

cumber opened this issue Jul 29, 2024 · 4 comments · Fixed by #312
Labels
enhancement New feature or request

Comments

@cumber
Copy link

cumber commented Jul 29, 2024

Is there an existing issue for this?

  • I have searched the existing issues

Is your feature request related to a problem? Please describe.

I've set up my desktop status bar with a few widgets for monitoring CPU, RAM, etc. They support running a command when I click them, so I've set them to open up Resources to have easy access to more details.

Resources of course opens showing whatever tab it remembers from last time, rather than the tab relevant to the status bar widget I clicked on, and then I have to manually select the tab I was interested in.

It's only a minor point of friction, but it would be wonderful if clicking my CPU usage widget could be made to directly open the Processor tab, etc.

Describe the solution you'd like

I don't expect Resources to integrate with my particular status bar or widgets, but it would be great if I could tell it more context about what I want to look at.

Simply adding a command line switch letting me tell it what tab I want to see would hopefully be a small easy change that would enhance similar use cases.

I'm not sure whether it would be better to have a single flag with an argument taking the name of the tab (e.g. resources --focus=Processor), or several flags for some or all of the specific tabs (or perhaps just the type of tab?).

Given that Resources detects when it's already running and doesn't start another instance, it would also be handy if running with one of these options could change the tab in the existing instance, but even if that isn't as easy a change simply opening on a desired tab if Resources isn't already open would address most of the problem.

Describe alternatives you've considered

Some other sort of mechanism (than CLI arguments) to send signals to the running application telling it to change tabs would also be usable. But for the particular use-case of setting up shortcuts, it seems like it would be the simplest approach (for the user and to implement) to simply embed extra information in the command that starts Resources.

Additional context

No response

@cumber cumber added the enhancement New feature or request label Jul 29, 2024
@nokyan
Copy link
Owner

nokyan commented Jul 29, 2024

Hi, thanks for the issue.

I'm not sure whether it would be better to have a single flag with an argument taking the name of the tab (e.g. resources --focus=Processor), or several flags for some or all of the specific tabs (or perhaps just the type of tab?).

Tabs already have internal IDs for remembering tabs from the last session, I'd just use these for a single flag.

Given that Resources detects when it's already running and doesn't start another instance, it would also be handy if running with one of these options could change the tab in the existing instance, but even if that isn't as easy a change simply opening on a desired tab if Resources isn't already open would address most of the problem.

The "already running" feature is a GTK thing, I didn't do anyhting for that. :)
I'll take a look at it.

@nokyan
Copy link
Owner

nokyan commented Jul 30, 2024

I added commandline arguments (including an argument for directly opening a tab) in the cli-arguments branch, feel free to check it out

@cumber
Copy link
Author

cumber commented Jul 31, 2024

Thanks for adding this so quickly!

I tried to test it out, but the easy way for me to override the source I'm using (from Nix) doesn't work. I think it's because Resources now needs Rust 1.80 to build due to unrelated changes (based on a comment from you here), and Nixpkgs has only just updated to 1.79.

Setting up a proper Rust toolchain (instead of just using Nix's builder) is a bit more than I have time for right now, so I'll have to wait a while and see if I get to that before Nixpkgs updates.

@nokyan
Copy link
Owner

nokyan commented Jul 31, 2024

Thanks for adding this so quickly!

I tried to test it out, but the easy way for me to override the source I'm using (from Nix) doesn't work. I think it's because Resources now needs Rust 1.80 to build due to unrelated changes (based on a comment from you here), and Nixpkgs has only just updated to 1.79.

Setting up a proper Rust toolchain (instead of just using Nix's builder) is a bit more than I have time for right now, so I'll have to wait a while and see if I get to that before Nixpkgs updates.

No worries, we got time. :)
I can't help you with the Nix issue unfortunately, I don't have any experience with Nix.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants