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

Add option to not scale some icons #1037

Closed
fwsmit opened this issue Feb 18, 2022 · 11 comments · Fixed by #1069
Closed

Add option to not scale some icons #1037

fwsmit opened this issue Feb 18, 2022 · 11 comments · Fixed by #1069
Labels

Comments

@fwsmit
Copy link
Member

fwsmit commented Feb 18, 2022

With the introduction of the recursive icon lookup, all the icons will get scaled to a certain size, icon_size. For scalable icons this is no problem, since they are scalable without getting blurry. For other icons this is more of a problem. Icons that are sent as raw icons via dbus will never be scalable and icons that are sent via path name might be scalable.

There are a few options to make sure icons don't get scaled badly:

  • Add a max_icon_size option again (as a rule).
  • Add a scale_raw_icons rule which can be set to false to not get blurry icons.
  • More?

ref #992

@ncfavier
Copy link

ncfavier commented Mar 8, 2022

Suggestion: only have two options min_icon_size and max_icon_size, both global and per-rule. For named icons, use min_icon_size to query the icon, then scale between the bounds. For raw icons, just scale between the bounds.

Crucially, allow rules to match on whether the icon is named or raw (and maybe on whether it's an SVG, though I'm not sure why this is useful).

I think this covers all use cases?

@fwsmit
Copy link
Member Author

fwsmit commented Mar 12, 2022

Sounds like a good approach! Thanks for you input. I think I'll explore this direction.

@fwsmit fwsmit added the Feature label Apr 14, 2022
@J-MR-T
Copy link

J-MR-T commented Apr 24, 2022

It would also be possible to add an option in the commandline tools, a hint for notify-send and a native option for dunstify to force a certain icon size. I am currently struggling with the new recursive icon lookup, because icons for volume and brightness notifications need to be way smaller than the cover art for song-change notifications.

Currently I cannot get the song-change notification icons big, without screwing up all other notifications, as icon_size doesn't seem to be responsible for scaling, but is the only option available to set rule based. I think the easiest, most transparent and accessible option would be a hard override on the commandline.

But I am open to being corrected here, as this might go against some paradigms of dunst that I'm unfamiliar with.

fwsmit added a commit to fwsmit/dunst that referenced this issue Apr 25, 2022
The recursive icon lookup used an icon_size rule to scale all icons to
this size, but this was a bit limiting in allowing bigger icons for
things like album art. To fix this, the old behaviour has been
reinstated. The main difference is that icons from a theme (that are
searched by icon name) are of the size `min_icon_size`, instead of being
of whatever size was found first.

ref: dunst-project#1037
@fwsmit
Copy link
Member Author

fwsmit commented Apr 25, 2022

Suggestion: only have two options min_icon_size and max_icon_size, both global and per-rule. For named icons, use min_icon_size to query the icon, then scale between the bounds. For raw icons, just scale between the bounds.

This has been implemented in #1069.

Crucially, allow rules to match on whether the icon is named or raw (and maybe on whether it's an SVG, though I'm not sure why this is useful).

It would be nice I guess, but I don't consider this a priority.

It would also be possible to add an option in the commandline tools, a hint for notify-send and a native option for dunstify to force a certain icon size. I am currently struggling with the new recursive icon lookup, because icons for volume and brightness notifications need to be way smaller than the cover art for song-change notifications.

Currently I cannot get the song-change notification icons big, without screwing up all other notifications, as icon_size doesn't seem to be responsible for scaling, but is the only option available to set rule based. I think the easiest, most transparent and accessible option would be a hard override on the commandline.

But I am open to being corrected here, as this might go against some paradigms of dunst that I'm unfamiliar with.

It would also be possible to add an option in the commandline tools, a hint for notify-send and a native option for dunstify to force a certain icon size. I am currently struggling with the new recursive icon lookup, because icons for volume and brightness notifications need to be way smaller than the cover art for song-change notifications.

Currently I cannot get the song-change notification icons big, without screwing up all other notifications, as icon_size doesn't seem to be responsible for scaling, but is the only option available to set rule based. I think the easiest, most transparent and accessible option would be a hard override on the commandline.

But I am open to being corrected here, as this might go against some paradigms of dunst that I'm unfamiliar with.

I think with the min_icon_size and max_icon_size it should be flexible enough again, so I don't think a hint is neccesary.

@ncfavier
Copy link

I still don't know how to do what I'm after, with the recent changes.

As a reminder, I want to be able to use dunst to display two separate kinds of icons:

  • raw icons: things like album arts or screenshots, which should be "large" (scaled down to 500 pixels tall)
  • named icons: these should be looked up in the icon theme according to a given size (in my case 64 px), and scaled to that size

This is why I need rules to be able to match on whether the icon is raw or not, and set sizes accordingly. Is this hard to implement?

@fwsmit
Copy link
Member Author

fwsmit commented May 13, 2022

Since min_icon_size is used for looking up named icons your use case can be achieved with:
dunstrc:

[global]
min_icon_size=64
max_icon_size=500

@ncfavier
Copy link

But that will scale SVG icons up to 500 pixels!

@fwsmit
Copy link
Member Author

fwsmit commented May 13, 2022

You mean named svg icons? It should scale all named icons to 64 pixels

@ncfavier
Copy link

dunstify -i dialog-information a:

@fwsmit
Copy link
Member Author

fwsmit commented May 13, 2022

Could you try that with the latest dunst-git. I think that issue has been resolved? I cannot reproduce it at least. Otherwise, please open a new bug report describing how to reproduce this issue.

@ncfavier
Copy link

#1075

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants