-
Notifications
You must be signed in to change notification settings - Fork 36
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
"Command output" widgets #148
Conversation
this would be a cool widget to get implemented. im on xfce now and use their plugin like this a lot. in my wayfire set up i had to move those command outputs to a tmux window instead |
87209c5
to
b008572
Compare
use `Glib::shell_parse_argv` innstead of running with `/bin/bash` simplify `icon_position` handling simplify getting chars from output
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks quite good aside from the one comment about max buffer size.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks great now, thanks :)
A huge thank you for the patch. It looks like "Period" is specified in seconds but it's not mentioned. Please do. |
One more thing: XFCE's generic monitor plugin allows quite rich output formatting options including setting font, font style, font color, icon, etc. Hopefully you could look into that as well: https://docs.xfce.org/panel-plugins/xfce4-genmon-plugin/start That is a ton of work however, so it's really up to you. What would be really nice to see as the barebones is:
In a perfect world it would be great if Wayfire could just use ... XFCE plugins directly. The API is there. XFCE now uses GTK3 which is Wayland compatible. That will allow you to incorporate a ton of applets basically for free. |
Thanks for your suggestions! Implementing XFCE plugins sounds like a cool idea, I'll look into it. About other features you mentioned:
It is able to, use
Current implementation executes the command on click and updates the label on the panel (that's the same command that is launched periodically). Are you suggesting to make it a separate command?
It is able to: it uses Pango Markup and therefore supports colors, font size, styles and etc. |
Yeah, that's my thinking but I just want to avoid confusion. It won't be nice if clicking the applet could either update it or run an external command, e.g. a terminal application with XFCE always runs the second command on click, and refreshing requires right mouse clicking and selecting "Update Now" from a pop-up menu. Without a pop-up menu I've now idea how to set them apart. Maybe using middle mouse click? Anyways, it's all completely up to you. I'm OK if you disregard my request altogether :-) |
hello, trying to implement this. do i add 'command-output' to 'widgets_x =' in wf-shell.ini? and then where to add the command to run? thanks |
Hi. Yes, you add
See full list of available options in the |
Thanks! |
I need help using the command-output plugin. I'm a humanities major and I've tried every way to make it work. I'd like to bring up the weather forecast, but I haven't been successful! I'm editing the wf-shel.ini file and adding the code below: widgets_center = command-output=curl -H "Accept-Language: pt-br" 'wttr.in/Campinas?format=%l:+%C+%t' The command output in the bar should be: But I can't get it to work. I've tried everything. If you can help me with this, I'd appreciate it! |
you need to add 'command-output' to the widget line by itself then add your curl statement and other parameters you need to the 'command_output_ ' variable . Here is an example: |
Thank you very much mrsteve0924! It works now and it looks really cool, just one point to contribute is the line that defines the character size (commands_output_max_chars = 25) which in my case was defined as 2 only, in the end my code looked like this: commands_output_max_chars = 25 Here is the screenshot and thank you very much again! |
Fix #124
TODO:
Glib::spawn_async
instead of sync versionicon_size
option