diff --git a/config/awesome/notifications/battery.lua b/config/awesome/notifications/battery.lua
index 773f7aa..ebe27e6 100644
--- a/config/awesome/notifications/battery.lua
+++ b/config/awesome/notifications/battery.lua
@@ -29,7 +29,7 @@ awesome.connect_signal("evil::battery", function(battery)
end
else
icon = icons.battery_charging
- if battery > 99 and not battery_full_already_notified then
+ if battery > 96 and not battery_full_already_notified then
battery_full_already_notified = true
message = helpers.colorize_text("Full", x.color10)
timeout = 6
diff --git a/config/awesome/notifications/brightness.lua b/config/awesome/notifications/brightness.lua
index bf16b4d..834504f 100644
--- a/config/awesome/notifications/brightness.lua
+++ b/config/awesome/notifications/brightness.lua
@@ -8,7 +8,7 @@ awesome.connect_signal("evil::brightness", function (percentage)
if first_time then
first_time = false
else
- if sidebar.visible or dashboard.visible then
+ if (sidebar and sidebar.visible) or (dashboard and dashboard.visible) then
-- Sidebar and dashboard already show brightness, so
-- destroy notification if it exists
if notif then
diff --git a/config/awesome/notifications/mpd.lua b/config/awesome/notifications/mpd.lua
index 9c1fde0..00a05a7 100644
--- a/config/awesome/notifications/mpd.lua
+++ b/config/awesome/notifications/mpd.lua
@@ -6,11 +6,12 @@ local notif
local first_time = true
local timeout = 2
+local old_artist, old_song
local send_mpd_notif = function (artist, song, paused)
if first_time then
first_time = false
else
- if paused or sidebar.visible then
+ if paused or (sidebar and sidebar.visible) then
-- Sidebar and already shows mpd info, so
-- destroy notification if it exists
-- Also destroy it if music pauses
@@ -18,8 +19,12 @@ local send_mpd_notif = function (artist, song, paused)
notif:destroy()
end
else
- -- Send notification
- notif = notifications.notify_dwim({ title = "Now playing:", message = ""..song.." by "..artist.."", icon = icons.music, timeout = timeout, app_name = "mpd" }, notif)
+ -- Since the evil::mpd signal is also emitted when seeking, only send a notification when the song and artist are different than before.
+ if artist ~= old_artist and song ~=old_song then
+ notif = notifications.notify_dwim({ title = "Now playing:", message = ""..song.." by "..artist.."", icon = icons.music, timeout = timeout, app_name = "mpd" }, notif)
+ old_artist = artist
+ old_song = song
+ end
end
end
end