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鈥檒l occasionally send you account related emails.

Already on GitHub? Sign in to your account

add on_click setting for cpu block #813

Merged
merged 1 commit into from
Aug 24, 2020
Merged

Conversation

Dieterbe
Copy link
Contributor

@Dieterbe Dieterbe commented Aug 23, 2020

I wanted this so I can easily open a terminal with top running when my cpu usage is high.

Note: this is my first time working with rust. I pretty much just copy pasted code from other blocks.
Took me quite a while to figure out i needed to switch from textwidget to buttonwidget, to make the "name" identifier be emitted for the cpu block, such that click events can have the corresponding name and we can link it back to the cpu block.
some basic instructions for new developers could be helpful for people like me, but otherwise great project 馃憤

I wanted this so I can easily open a terminal with top running when
my cpu usage is high.
@Dieterbe
Copy link
Contributor Author

PS: I use this to launch top in a termite window.

on_click = "termite -t top -e '/usr/bin/top -o +%CPU'"

works great

@ammgws
Copy link
Collaborator

ammgws commented Aug 24, 2020

Thanks!

I think eventually things like on_click should be made as general options that can be applied to any block by default.

@ammgws ammgws merged commit 18db269 into greshake:master Aug 24, 2020
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

2 participants