···11-{ config, pkgs, ... }:
22-let
33- dunstConfig = pkgs.writeText "dunst-config" ''
44- [global]
55- font = Iosevka Term 11
66-77- # Allow a small subset of html markup:
88- # <b>bold</b>
99- # <i>italic</i>
1010- # <s>strikethrough</s>
1111- # <u>underline</u>
1212- #
1313- # For a complete reference see
1414- # <http://developer.gnome.org/pango/stable/PangoMarkupFormat.html>.
1515- # If markup is not allowed, those tags will be stripped out of the
1616- # message.
1717- markup = yes
1818- plain_text = no
1919-2020- # The format of the message. Possible variables are:
2121- # %a appname
2222- # %s summary
2323- # %b body
2424- # %i iconname (including its path)
2525- # %I iconname (without its path)
2626- # %p progress value if set ([ 0%] to [100%]) or nothing
2727- # Markup is allowed
2828- format = "%a\n<b>%s</b>\n%b"
2929-3030- # Sort messages by urgency.
3131- sort = yes
3232-3333- # Show how many messages are currently hidden (because of geometry).
3434- indicate_hidden = yes
3535-3636- # Alignment of message text.
3737- # Possible values are "left", "center" and "right".
3838- alignment = center
3939-4040- # The frequency with wich text that is longer than the notification
4141- # window allows bounces back and forth.
4242- # This option conflicts with "word_wrap".
4343- # Set to 0 to disable.
4444- bounce_freq = 0
4545-4646- # Show age of message if message is older than show_age_threshold
4747- # seconds.
4848- # Set to -1 to disable.
4949- show_age_threshold = 1
5050-5151- # Split notifications into multiple lines if they don't fit into
5252- # geometry.
5353- word_wrap = yes
5454-5555- # Ignore newlines '\n' in notifications.
5656- ignore_newline = no
5757-5858- # Hide duplicate's count and stack them
5959- stack_duplicates = yes
6060- hide_duplicates_count = no
6161-6262-6363- # The geometry of the window:
6464- # [{width}]x{height}[+/-{x}+/-{y}]
6565- # The geometry of the message window.
6666- # The height is measured in number of notifications everything else
6767- # in pixels. If the width is omitted but the height is given
6868- # ("-geometry x2"), the message window expands over the whole screen
6969- # (dmenu-like). If width is 0, the window expands to the longest
7070- # message displayed. A positive x is measured from the left, a
7171- # negative from the right side of the screen. Y is measured from
7272- # the top and down respectevly.
7373- # The width can be negative. In this case the actual width is the
7474- # screen width minus the width defined in within the geometry option.
7575- geometry = "500x10-0+0"
7676-7777- # Shrink window if it's smaller than the width. Will be ignored if
7878- # width is 0.
7979- shrink = no
8080-8181- # The transparency of the window. Range: [0; 100].
8282- # This option will only work if a compositing windowmanager is
8383- # present (e.g. xcompmgr, compiz, etc.).
8484- # transparency = 5
8585-8686- # Don't remove messages, if the user is idle (no mouse or keyboard input)
8787- # for longer than idle_threshold seconds.
8888- # Set to 0 to disable.
8989- idle_threshold = 0
9090-9191- # Which monitor should the notifications be displayed on.
9292- monitor = keyboard
9393-9494- # Display notification on focused monitor. Possible modes are:
9595- # mouse: follow mouse pointer
9696- # keyboard: follow window with keyboard focus
9797- # none: don't follow anything
9898- #
9999- # "keyboard" needs a windowmanager that exports the
100100- # _NET_ACTIVE_WINDOW property.
101101- # This should be the case for almost all modern windowmanagers.
102102- #
103103- # If this option is set to mouse or keyboard, the monitor option
104104- # will be ignored.
105105- follow = none
106106-107107- # Should a notification popped up from history be sticky or timeout
108108- # as if it would normally do.
109109- sticky_history = yes
110110-111111- # Maximum amount of notifications kept in history
112112- history_length = 15
113113-114114- # Display indicators for URLs (U) and actions (A).
115115- show_indicators = no
116116-117117- # The height of a single line. If the height is smaller than the
118118- # font height, it will get raised to the font height.
119119- # This adds empty space above and under the text.
120120- line_height = 3
121121-122122- # Draw a line of "separatpr_height" pixel height between two
123123- # notifications.
124124- # Set to 0 to disable.
125125- separator_height = 1
126126-127127- # Padding between text and separator.
128128- padding = 1
129129-130130- # Horizontal padding.
131131- horizontal_padding = 1
132132-133133- # Define a color for the separator.
134134- # possible values are:
135135- # * auto: dunst tries to find a color fitting to the background;
136136- # * foreground: use the same color as the foreground;
137137- # * frame: use the same color as the frame;
138138- # * anything else will be interpreted as a X color.
139139- separator_color = frame
140140-141141- # Print a notification on startup.
142142- # This is mainly for error detection, since dbus (re-)starts dunst
143143- # automatically after a crash.
144144- startup_notification = true
145145-146146- # dmenu path.
147147- dmenu = ${pkgs.dmenu}/bin/dmenu -p dunst:
148148-149149- # Browser for opening urls in context menu.
150150- browser = /usr/bin/firefox -new-tab
151151-152152- # Align icons left/right/off
153153- icon_position = off
154154- max_icon_size = 80
155155-156156- # Paths to default icons.
157157- icon_folders = /usr/share/icons/Paper/16x16/mimetypes/:/usr/share/icons/Paper/48x48/status/:/usr/share/icons/Paper/16x16/devices/:/usr/share/icons/Paper/48x48/notifications/:/usr/share/icons/Paper/48x48/emblems/
158158-159159- frame_width = 2
160160- frame_color = "#8EC07C"
161161-162162- [shortcuts]
163163-164164- # Shortcuts are specified as [modifier+][modifier+]...key
165165- # Available modifiers are "ctrl", "mod1" (the alt-key), "mod2",
166166- # "mod3" and "mod4" (windows-key).
167167- # Xev might be helpful to find names for keys.
168168-169169- # Close notification.
170170- close = ctrl+space
171171-172172- # Close all notifications.
173173- close_all = ctrl+shift+space
174174-175175- # Redisplay last message(s).
176176- # On the US keyboard layout "grave" is normally above TAB and left
177177- # of "1".
178178- history = ctrl+grave
179179-180180- # Context menu.
181181- context = mod4+u
182182-183183- [urgency_low]
184184- # IMPORTANT: colors have to be defined in quotation marks.
185185- # Otherwise the "#" and following would be interpreted as a comment.
186186- frame_color = "#3B7C87"
187187- foreground = "#3B7C87"
188188- background = "#191311"
189189- #background = "#2B313C"
190190- timeout = 1
191191-192192- [urgency_normal]
193193- frame_color = "#5B8234"
194194- foreground = "#5B8234"
195195- background = "#191311"
196196- #background = "#2B313C"
197197- timeout = 1
198198-199199- [urgency_critical]
200200- frame_color = "#B7472A"
201201- foreground = "#B7472A"
202202- background = "#191311"
203203- #background = "#2B313C"
204204- timeout = 1
205205-206206-207207- # Every section that isn't one of the above is interpreted as a rules to
208208- # override settings for certain messages.
209209- # Messages can be matched by "appname", "summary", "body", "icon", "category",
210210- # "msg_urgency" and you can override the "timeout", "urgency", "foreground",
211211- # "background", "new_icon" and "format".
212212- # Shell-like globbing will get expanded.
213213- #
214214- # SCRIPTING
215215- # You can specify a script that gets run when the rule matches by
216216- # setting the "script" option.
217217- # The script will be called as follows:
218218- # script appname summary body icon urgency
219219- # where urgency can be "LOW", "NORMAL" or "CRITICAL".
220220- #
221221- # NOTE: if you don't want a notification to be displayed, set the format
222222- # to "".
223223- # NOTE: It might be helpful to run dunst -print in a terminal in order
224224- # to find fitting options for rules.
225225-226226- #[espeak]
227227- # summary = "*"
228228- # script = dunst_espeak.sh
229229-230230- #[script-test]
231231- # summary = "*script*"
232232- # script = dunst_test.sh
233233-234234- #[ignore]
235235- # # This notification will not be displayed
236236- # summary = "foobar"
237237- # format = ""
238238-239239- #[signed_on]
240240- # appname = Pidgin
241241- # summary = "*signed on*"
242242- # urgency = low
243243- #
244244- #[signed_off]
245245- # appname = Pidgin
246246- # summary = *signed off*
247247- # urgency = low
248248- #
249249- #[says]
250250- # appname = Pidgin
251251- # summary = *says*
252252- # urgency = critical
253253- #
254254- #[twitter]
255255- # appname = Pidgin
256256- # summary = *twitter.com*
257257- # urgency = normal
258258- #
259259- # vim: ft=cfg
260260- '';
261261-in
262262-{
263263- systemd.user.services.dunst = {
264264- wantedBy = [ "graphical-session.target" ];
265265- requires = [ "xmonad.service" ];
266266- environment = {
267267- DISPLAY = ":${toString config.services.xserver.display}";
268268- };
269269- serviceConfig = {
270270- SyslogIdentifier = "dunst";
271271- ExecStart = "${pkgs.dunst}/bin/dunst -conf ${dunstConfig}";
272272- Restart = "always";
273273- RestartSec = "15s";
274274- StartLimitBurst = 0;
275275- };
276276- };
277277-}