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 support for custom gtk css. #97

Closed
ahmubashshir opened this issue Sep 18, 2020 · 5 comments
Closed

Add support for custom gtk css. #97

ahmubashshir opened this issue Sep 18, 2020 · 5 comments

Comments

@ahmubashshir
Copy link
Contributor

ahmubashshir commented Sep 18, 2020

It'd be great if we could override the builtin style.css with something like $XDG_CONFIG_HOME/deadd/style.css

@hagen-eriksen
Copy link

Hi there,

I am using this wonderful notification center and so far it has been an incredible experience! It does exactly what I need and I wanted to thank you for this great OSS!

I'm trying to change the CSS of the notification icon but it does not seem to be working.
I followed the instructions on the README:

  • Added some CSS to ~/.config/gtk-3.0/gtk.css:
    .deadd-noti-center.notification.icon { margin: 20px; }
  • Restarted deadd-notification-center but nothing changed (I also tried some more remarkable changes like changing the titles to red)

Could you provide me with some guidance?

@ahmubashshir
Copy link
Contributor Author

Hi there,

I am using this wonderful notification center and so far it has been an incredible experience! It does exactly what I need and I wanted to thank you for this great OSS!

I'm trying to change the CSS of the notification icon but it does not seem to be working.
I followed the instructions on the README:

  • Added some CSS to ~/.config/gtk-3.0/gtk.css:
    .deadd-noti-center.notification.icon { margin: 20px; }
  • Restarted deadd-notification-center but nothing changed (I also tried some more remarkable changes like changing the titles to red)

Could you provide me with some guidance?

I too couldn't... so I'm now directly modifying the css file in code and recompiling it myself.

@MyriaCore
Copy link
Contributor

It'd be great if we could override the builtin style.css with something like $XDG_CONFIG_HOME/deadd/style.css

You should already be able to do this, via ~/.config/gtk-3.0/gtk.css.

.deadd-noti-center.notification.icon { margin: 20px; }

So, I assume you're trying to change the margins for the app icon, correct? The labels for this stuff could be a bit more clear, icon is usually used for the app icon, and image is usually used for the image to the left of the notification.

If you are trying to modify margins for the app icon, it could be a GTK CSS thing. According to these docs, margin seems to be a gtkbox thing, however I think .deadd-noti-center.notification.icon is an image. This doesn't make much sense to me though, since .deadd-noti-center.notification.icon is still the child of a box, so I feel like margin stuff should still apply here. Maybe try with padding instead?

If you're actually trying to modify the image to the left of the notification, then you'll want to do it in your deadd.conf file. The margins are set in the code here:

-- set margins from config
widgetSetMarginTop imgImage
(fromIntegral $ configImgMarginTop config)
widgetSetMarginBottom imgImage
(fromIntegral $ configImgMarginBottom config)
widgetSetMarginStart imgImage
(fromIntegral $ configImgMarginLeft config)
widgetSetMarginEnd imgImage
(fromIntegral $ configImgMarginRight config)

@phuhl
Copy link
Owner

phuhl commented Dec 19, 2020

@MyriaCore

If you're actually trying to modify the image to the left of the notification, then you'll want to do it in your deadd.conf file. The margins are set in the code here:

Do you remember, why it was implemented like that? Was it because changing it in the gtk.css wouldn't take effect? In that case, we could remove these config options now, as the CSS configuration allows for changing these margins as desired.

@phuhl
Copy link
Owner

phuhl commented Dec 19, 2020

Anyways, this issue is closed due to #118

For more information, look here: https://github.com/phuhl/linux_notification_center#css-styling

@phuhl phuhl closed this as completed Dec 19, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants