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

CPU Monitor Click Through #400

Merged
merged 2 commits into from
May 20, 2024
Merged

Conversation

Oliver-Bagin
Copy link

Description

I was seeing spikes in CPU usage in simple bar, I was wondering what was causing the spikes and I found my self naturally clicking on the graph.

This lead me to add clicking on the widget to open a cpu monitor. I know people had different preferences about what should open so I made it configurable. Specifically I added 'top' and 'Activity Monitor' which both ship with macOS. I also added configurability to select which terminal 'top' runs in. I added two terminals "Terminal" and "iTerm2" I think this code has potentially to be useful in other parts of the project, but I cant for the life of me think of any good examples maybe people want to open "Spotify TUI" from simple bar given spotify behaves poorly with yabai?

How Has This Been Tested?

Please describe the tests that you ran to verify your changes. Provide instructions so we can reproduce. Please also list any relevant details for your test configuration.

There are the following possible options that have been tested:

  • [✅] User has no CPU Monitor selected in settings
    • The label is not clickable
  • [✅] User selects activity monitor in settings
    • Activity monitor should open up
  • Top is selected in settings
    • [✅] User has terminal selected in settings
      • Terminal should open with top running
    • [✅] User has iTerm2 selected in settings
      • iTerm2 should open with top running
    • [✅] User selects iTerm2 but iTerm2 is not installed
      • Nothing should happen

Checklist:

  • [ ✅] My code follows the style guidelines of this project
  • [ ✅] I have performed a self-review of my code
  • [✅ ] I have commented my code, particularly in hard-to-understand areas
  • [✅ ] My changes generate no new warnings

Changes to make to the documentation

None

Adding in the ability to click on this widget I wanted
users to be able to use either 'top' or 'activity monitor'.

Because 'top' is run in a terminal I wanted users to
be able to specify their preferred Terminal.

I added two terminal options Terminal and iTerm2.

Hopefully the ability to open a terminal of the users
choosing and run an arbitrary command will be helpful
else where in the project.
@Jean-Tinland
Copy link
Owner

This is really nice! I like the extensible system allowing to choose in which terminal to run any command.

Thank you for your work!

@Jean-Tinland Jean-Tinland merged commit d908bca into Jean-Tinland:master May 20, 2024
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.

None yet

3 participants