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

Could you consider submitting the spacer module to ultrabug / py3status? #6

Closed
nwg-piotr opened this issue Oct 11, 2019 · 16 comments
Closed

Comments

@nwg-piotr
Copy link

Hi,

The spacer module works well, but I need to add PRs to my fork manually to keep py3status up and running. Do you think it's possible to merge spacer into the the main repository?

Regards,
Piotr

@lasers
Copy link
Owner

lasers commented Oct 11, 2019

You can specify py3status --include PATH or leave modules in ~/.config/py3status/modules/. I keep pew.py and others in my ~/.config/py3status/modules/.

Then I realized there is py3.py diff. That wouldn't work. Pinging @ultrabug to see what he want to do about this issue.

If this is right, you should be on a different branch and just keep pulling in/rebasing changes instead of adding PRs to your fork manually. I have a personal branch containing ultrabug#1725 and other branches.

(Opinion) spacer.py is more of a hack than a module and I'd like for i3 to come up with a solution that works quite well across multiple monitors / different resolutions.

@nwg-piotr
Copy link
Author

nwg-piotr commented Oct 11, 2019

The latter seems not really convenient way for the user (who I am) to keep software up to date. :) Well, I need to think about it.

@ultrabug
Copy link

Hi

TBH I don't even understand the purpose of the module but since that's not the point of this issue, let me shed a light on this matter here.

  1. you could use self.py3._output_modules even if that's discouraged
  2. you could propose to add a get_outputs method added to py3
    def get_outputs(self):
        """
        Return all modules output.
        """
        return self._output_modules
  1. working with include-path is good for one's own modules imho but can be boring for remote users as expressed by @nwg-piotr . So just like the pew module showcased, @lasers could also now have his own package on PyPi that anybody could rely on easily. This would allow anybody to seamlessly start using your modules here @lasers without the blockers of my approval .

This would allow the main repo to focus on core + basic set of modules as well while freeing anyone to expand py3status on their own (except core modifications ofc)

As a sidenote, if that space module is cool & simple enough, we ofc could add it :)

@nwg-piotr
Copy link
Author

I don't even understand the purpose of the module

The purpose is to be able to left align a part of the output. See the bottom panel:

screenshot_2019-10-12_15-46-01_388701340

This is not exactly what I meant, as it requires the width argument, which I expected to be auto-calculated. However, it works well enough.

if that space module is cool & simple enough, we ofc could add it :)

This would be the simplest solution IMO. Thanks in advance in case you decided to do so.

@ultrabug
Copy link

Oh thanks @nwg-piotr I now understand... I guess I was stupid.

I expected to be auto-calculated

How could we do that? I'd love to

@nwg-piotr
Copy link
Author

I wish I knew. I'm just jealous of the qtile spacer module. This needs a better programmer than myself.

@lasers
Copy link
Owner

lasers commented Oct 12, 2019

I expected to be auto-calculated

I think it may be impossible because of factors like same bars on different monitor / resolutions. Also, I recall the text would be swallowed by number of (or longer custom) workspaces on lower resolutions.

Wild idea: Maybe if i3bar, qtile.bar or other bar could accept multiple status_command (e.g. left, center, right), then we could mix statuses all on the same bar?

Example:

  • status_command_left py3status
  • status_command_center i3block
  • status_command_right bumblebee-status

Can we use qtile.bar on i3wm without qtile? If yes, then I wonder if if this would work... for qtile to make a module that can accept status_command?

Will try discouraged self.py3._output_modules + ~/.config/py3status/modules later.

@lasers
Copy link
Owner

lasers commented Oct 12, 2019

@nwg-piotr wip2 pushed. Try again. Put the module in ~/.config/py3status/modules.

@ultrabug
Copy link

I think it may be impossible because of factors like same bars on different monitor / resolutions.

Hard and cumbersome for sure, impossible never :)

Wild idea: Maybe the easiest way to achieve this is to make the spacer module interactively configurable. My initial idea feels like a "calibration" process:

  • user adds spacer module
  • spacer module starts and if never configured asks for a "left click to setup"
  • then every click adds a "M" letter to the bar until the bar fills and the spacer module (which outputs short_text) displays its short text "now right click on me!" which allows the spacer module to know how many free space there is and stores it on py3 storage

Sounds fun & doable :)

@nwg-piotr
Copy link
Author

nwg-piotr commented Oct 12, 2019

I think it may be impossible

To my needs the current spacer by @lasers works well enough.

wip2 pushed. Try again.

Thanks, I will.

the text would be swallowed by number of (or longer custom) workspaces

My workspace names are up to 30 chars long, as I name them dynamically:

screenshot_2019-10-12_23-12-07_198404615

but in the panel I use spacer, I don't display workspaces. :)

@lasers
Copy link
Owner

lasers commented Oct 12, 2019

wip3 pushed.

@nwg-piotr
Copy link
Author

nwg-piotr commented Oct 13, 2019

wip3 pushed

Haha! Works perfectly! Use of the mouse scroll is funny. :)

@ultrabug
Copy link

smart move @lasers :) PR that for 3.22 maybe?

@lasers
Copy link
Owner

lasers commented Oct 13, 2019

@ultrabug It's still a hack. I would like to keep this unsupported and that there could be edge cases such as losing width when reorganizing... and that users can't add multiple spacer on a single bar.

Since it does mostly what @nwg-piotr want, then swell, he can keep using this as-is... and we could always link it back to here if needed for other users.

For 3.22, maybe we could do:

  • [RFC] Remove Python 2 compatibility ultrabug/py3status#1660 (i imagine you take up reins on this)
  • Consolidate scratchpad_* into a single module (i finished iirc)
  • Consolidate window_title_* into a single module (i stopped wip)
  • Drop nvidia_temp in favor of nvidia_smi.
  • I dunno what else. General minor fixes + cleanups.

  • Drop hardcoded color in favor of \?color=stuff {stuff} (???)
  • Fix bitcoin_price the right way (???) (i finished iirc).
  • Many more, but I already put in efforts long time ago, lol.

@nwg-piotr
Copy link
Author

if needed for other users

I believe that many (or even most) users would benefit from the module, but I understand your position. Thanks for your effort very much.

@ultrabug
Copy link

@lasers ok let's keep it here for now then until we have something better to work with

3.22 ok to move on consolidating things

As for ultrabug#1660 I'm not sure doing it on a "simple mainline" release is a good choice at the moment

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

No branches or pull requests

3 participants