i3-workspace-names-daemon icon indicating copy to clipboard operation
i3-workspace-names-daemon copied to clipboard

Dynamic Titles, Pango Markup, Ignore Unknown

Open bastidest opened this issue 4 years ago • 11 comments

First of all, thank you for this great script, I use it as a daily driver and it is essential to me. These are some customizations I made for myself. Maybe you find some of the useful and consider integrating them. A lot of changes for one PR, I am sorry in advance (i used the 'black' code formatter, so the diff is not necessarily that large).

I mainly made these changes for differentiating multiple instances of the same applications (like an IDE). The idea is to show the "project name" or an equivalent besides the app icon. I hope the description in the README gives you an idea what it is supposed to do.

I don't know if you agree with changing the flag --no-unknown-name instead of --no-match-not-show-name, which is very confusing to me. But I can revert it again if you don't agree.

As pango markup is supported natively, users should have the possibility to use arbitrary icons on their system. (See README).

Also I added some tests to verify everything is working as before. You can run them with python -m unittest discover ..

This is just a suggestion, feel free to deny it. I understand that those are not minor changes. Thank you for your work

bastidest avatar Apr 25 '20 18:04 bastidest

Hi, thanks a lot for this - it looks really good. I've got very limited bandwidth right now - @CastixGitHub is this something you would be able to review in depth? If so I'll defer to your judgement and cut a new release after.

I'm fine with the linter and if we could wire up the tests to Github CI that would be great. The only thing I object to is changing/removing an existing flag since it might trip some people up. Perhaps we could make the help text clearer?

cboddy avatar May 17 '20 07:05 cboddy

@cboddy Thank you for taking the time to look over this.

Yes, changing the existing flag is probably a bad idea. I'll try to extend the documentation to make it more understandable instead. Also I will try to enable the GitHub Actions CI.

bastidest avatar May 17 '20 15:05 bastidest

@cboddy @CastixGitHub I made the suggested changes

  • Add GitHub Actions / Workflow CI with pytest
  • Revert the flag name to the original name

As arbitrary icons can be specified now, shall we also close issue #10 with this?

bastidest avatar May 18 '20 18:05 bastidest

hi there, I didn't check github notifications for a while... so I just made a PR to @bastidest https://github.com/bastidest/i3-workspace-names-daemon/pull/2 with some other small modifications based on his fork :+1: I agree that #10 can be closed too

I'm thinking that another improvement could be to have some sort of list of regex for window title, so you can have a different icon for each window of you browser (if you match your browser with window_class, then you can set the best icon based on window_title) This PR can be merged anyway, it looks really good. Breaking changes such as --no-match-not-show-name are well accepted by me until a first stable release, and Development Status :: 3 - Alpha classifier can be added to make it a little bit more clear

CastixGitHub avatar Jun 11 '20 21:06 CastixGitHub

Great, I merged your PR!

So shall we change --no-match-not-show-name to --no-unknown-name? What do you prefer?

bastidest avatar Jun 12 '20 07:06 bastidest

Looks very merge-able to me. I would move the --no-match-not-show-name to another issue, if needed.

Anything missing?

bastidest avatar Jul 05 '20 12:07 bastidest

Thanks @bastidest for your patience :)

I will finish checking this over tonight. One thing so far - my system (ubuntu 18.04 LTS) doesn't have the pango font AFAICT. Could you add a section for installing it to the README?

cboddy avatar Jul 10 '20 13:07 cboddy

To my knowledge, pango is not a font itself, but a font rendering system. It is responsible for interpreting the HTML-like Tags and replacing them with the rendered icon/text. As i3status supports pango, I believe it has libpango as a dependency, so pango should work out of the box.

The pango-view utility probably is not installed on your system, you can get it by installing pango1.0-tools. I will add that as a note to the readme.

bastidest avatar Jul 10 '20 13:07 bastidest

yes, the readme shows a pango rendered icon (emacs icon) and links to two fonts that provide that icon with the same code. the readme also shows an example of a blue text, so you can try pango support even without installing any font at all (or you could use fontawesome getting the icon code directely from fa_icons.py)

CastixGitHub avatar Jul 10 '20 15:07 CastixGitHub

I added the hint regarding the pango tools in the README (and only had two typos on the way :1st_place_medal: ). Let me know if you need any help getting it working.

bastidest avatar Jul 10 '20 18:07 bastidest

Any updates? :smile:

bastidest avatar Nov 09 '20 19:11 bastidest