Awesome: Default notification icon size in naughty notify

Created on 18 Nov 2018  Â·  8Comments  Â·  Source: awesomeWM/awesome

Output of awesome --version:

awesome v4.2 (Human after all)
• Compiled against Lua 5.3.5 (running with Lua 5.3)
• D-Bus support: ✔
• execinfo support: ✔
• xcb-randr version: 1.6
• LGI version: 0.9.2

The notification icon size does not have any limitations. Some programs (older qbittorrent versions, firefox addon) gives the the icon for notification as big as whole screen, which causes the whole desktop covered up by the notification.

I'm not sure, if the Awesome should handle the "too big" icons, or the program that is providing should be responsible about the icon size, but I think the some sort of limitation for icon would be nice.

How to reproduce the issue:

Get a icon, something as this big.
Use it as icon in notification for startup in rc.lua file:
naughty.notify({ preset = naughty.config.presets.critical, title = "Huge icon notification!", icon = "/tmp/xsdre.jpg"})
Restart the desktop manager.

Actual result:

20181119002643

Expected result:

Not so big notification:

20181119003725

discussion

Most helpful comment

There is beautiful.notification_icon_size in the Git master version, which allows you to set the icon size.

All 8 comments

There is beautiful.notification_icon_size in the Git master version, which allows you to set the icon size.

...do we need some default values for this parameter other than nil? (But I am not quite sure how to do that; touch every theme we ship with awesome?)

In my opinion, this shouldn't be configurable in theme. It's not some kind of option, that impacts the design. It's more like "safety" feature.

On the second thought, maybe someone would like really small icons in notification and configuring in theme.lua would seem to be reasonable.

Well, the value can come from one of three places: Arguments to naughty.notify, a notification preset and the theme. If we have a default value in one of the two places, any value in a theme will be ignored (unless the user also gets rid of the default value). Thus, I think the theme is the only place where we can add a default value.

(Plus, that also makes it easier to find this setting exists)

I think the theme is the only place where we can add a default value.

Definitely agree on that.

Well, then I think a default value in every theme would be the most reasonable solution:

  • Prevent from "huge icon" notification covering up the desktop
  • Keeps the flexibility to change the setting for the users who cares
  • >Makes it easier to find this setting exists

What should we use? (64x64)*(DPI_factor) or 128x128?

Personally, I think (64x64)*(DPI_factor) would fit better the environment and default style.
It's also approximately the same size as in other window manager.

This can now be defined using some signals handler with the new API. Users who use the new API are free to implement this in their theme or rc.lua or any other way they can think of.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

batmanm0b1E picture batmanm0b1E  Â·  6Comments

SethBarberee picture SethBarberee  Â·  3Comments

doronbehar picture doronbehar  Â·  5Comments

robn picture robn  Â·  4Comments

bew picture bew  Â·  5Comments