Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Dunst: set per-app notification icons #2005

Open
wants to merge 12 commits into
base: main
Choose a base branch
from

Conversation

zeerayne
Copy link
Contributor

Pull Request

Description

This PR adds ability to set per-application icons for dunst notification messages to better distinct one from another.

Please not that I have increased min_icon_size to 128, because dafualt hyprdots.svg image have size 300x300 in svg code, but themed icons don't, and without this change amended notifications looks smaller.

Type of change

Please put an x in the boxes that apply:

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • Documentation update (non-breaking change; modified files are limited to the documentations)
  • Technical debt (a code change that does not fix a bug or add a feature but makes something clearer for devs)
  • Other (provide details below)

Checklist

Please put an x in the boxes that apply:

  • I have read the CONTRIBUTING document.
  • My code follows the code style of this project.
  • My commit message follows the commit guidelines.
  • My change requires a change to the documentation.
  • I have updated the documentation accordingly.
  • I have added a changelog entry.
  • I have added necessary comments/documentation to my code.
  • I have added tests to cover my changes.
  • I have tested my code locally and it works as expected.
  • All new and existing tests passed.

Screenshots

Before

image

After

image

@kRHYME7
Copy link
Collaborator

kRHYME7 commented Nov 16, 2024

Please confirm if this is ready to merge

@zeerayne
Copy link
Contributor Author

I have tested it by myself and looks like it works as expected.

Only one case is not resolved - if current icon theme have no icon for the app - I can't figure out how to fallback to hyprdots icon.
Tried to set default_icon and icon on general/urgency/specefic sections - all do not work.
Maybe it is not possible at all.

@kRHYME7
Copy link
Collaborator

kRHYME7 commented Nov 17, 2024

Is this because of the recursive flag? Or this problem already exist ??

I'm currently doing a fork ATM and merged this PR cause this looks promising.

@zeerayne
Copy link
Contributor Author

Actually it is not a problem - it is how dunst behaves. It does not provide any fallback if icon not found - and notification will be shown without icon. This relates to some unpopular apps icon for can exist in current icon theme, but when switching to other theme with other icons - it can be absent there.

@kRHYME7
Copy link
Collaborator

kRHYME7 commented Nov 17, 2024

We can solve this by adding an icon pack that might have all the icons or just simply add an array of icon names here. Dunst did not emphasize the max icons, so maybe we can fit an array of icon packs? lol

 # You can also set multiple icon themes, with the leftmost one being used first. 
  icon_theme = "Tela-circle-dracula"

Dunno if it gives an error but will try to add 50+ icon packs in this

so what we can do is use something like this

icon_theme = "$iconTheme ${allTheme@}"

allTheme can be an array of All themes available

If dunst is written correctly it should stop parsing the array if it finds the correct icons. maybe🤔

@zeerayne
Copy link
Contributor Author

If dunst is written correctly it should stop parsing the array if it finds the correct icons

Yes, it stops, it can be checked in logs if started with debug logs:

dunst -verbosity debug

p.s. will try to do amendments to icon_theme logic today

@zeerayne
Copy link
Contributor Author

@kRHYME7 Please review the changes. Now icon theme from current HyDE theme is set as first element in icon_theme= config line and icon themes from other HyDE themes are appended from second to last without any sorting.

This is looking like that:

icon_theme = "Tela-circle-pink,BeautyLine,Tela-circle-purple,Gruvbox-Plus-Dark,Tela-circle-yellow,Tela-circle-grey,Tela-circle-dracula,Tela-circle-grey,Tela-circle-green,Tela-circle-blue,Tela-circle-black,Nordzy"

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

Successfully merging this pull request may close these issues.

2 participants