Xfce Wiki

Sub domains
 

Creating a Notification theme

Overview

Note: If you want to create a notification theme you will - due to backward-compatibility breakage - have to take into account which version of Gtk+3 the users of your theme will most likely use or have installed.

Generally speaking, if you want to create a theme for Xfce4-notifyd you have to override the styles of the currently in-use Gtk theme as completely as you can to ensure the user-experience will be consistent with all base themes.

So, for example, if the user uses Adwaita (the built-in Gtk+3 default theme) you will have to define everything this theme has in the specific widget styles (see the list of items to match below) to ensure your style will take complete precedence.

Example: Adwaita defines the osd class shall have a black background and a white foreground color and you only set background-color: #ecde00 (which is yellow) the notification messages will likely be unreadable.

Examples

For examples of some themes, check https://git.xfce.org/apps/xfce4-notifyd/tree/themes

Here you will find several .css files that you can use as a starting point for creating your own themes.

Note: The gtk-3.0 folder is for Gtk3.18 and before.

Installing your theme

In order for Xfce4-notifyd to find your theme and show it in the Preferences Dialog, you have to save it as gtk.css in either /usr/share/themes/$yourtheme/xfce-notify-4.0 (for global installation) or ~/.themes/$yourtheme/xfce-notify-4.0 (for local, single-user installation).

The Notification Window and its Widgets

Gtk 3.20

Overall window style

#XfceNotifyWindow .osd

Window with mouse-focus

#XfceNotifyWindow .osd:hover

Summary

#XfceNotifyWindow.osd label#summary

Body

#XfceNotifyWindow.osd label#body

Button

#XfceNotifyWindow.osd button

Progressbar

#XfceNotifyWindow.osd progressbar

#XfceNotifyWindow.osd progressbar progress

#XfceNotifyWindow.osd progressbar trough

Gtk 3.18 and before

Overall window style

#XfceNotifyWindow

Window with mouse-focus

#XfceNotifyWindow:hover

Summary

#XfceNotifyWindow GtkLabel#summary

Body

#XfceNotifyWindow GtkLabel#body

Button

#XfceNotifyWindow GtkButton

Progressbar

#XfceNotifyWindow GtkProgressbar

#XfceNotifyWindow GtkProgressbar.progressbar

#XfceNotifyWindow GtkProgressbar.trough