diff --git a/config/awesome/notifications/init.lua b/config/awesome/notifications/init.lua index c3edec7..fdfd17e 100644 --- a/config/awesome/notifications/init.lua +++ b/config/awesome/notifications/init.lua @@ -83,6 +83,7 @@ function notifications.init(theme_name) require("notifications.battery") require("notifications.mpd") require("notifications.league_of_legends") + require("notifications.keyboardlayout") -- Load theme require("notifications.themes." .. theme_name) end diff --git a/config/awesome/notifications/keyboardlayout.lua b/config/awesome/notifications/keyboardlayout.lua new file mode 100644 index 0000000..a3c83cf --- /dev/null +++ b/config/awesome/notifications/keyboardlayout.lua @@ -0,0 +1,13 @@ +local awful = require("awful") +local naughty = require("naughty") +local helpers = require("helpers") +local icons = require("icons") +local notifications = require("notifications") + +local notif +-- We will not actually display this, but only subscribe to its +-- updates in order to send a notification whenerver needed. +local dummy_keyboardlayout_widget = awful.widget.keyboardlayout() +dummy_keyboardlayout_widget:connect_signal("widget::redraw_needed", function () + notif = notifications.notify_dwim({ title = "Keyboard layout", message = dummy_keyboardlayout_widget.widget.text:upper(), icon = icons.keyboard, timeout = 1, app_name = "keyboard" }, notif) +end) diff --git a/config/awesome/notifications/themes/amarena.lua b/config/awesome/notifications/themes/amarena.lua index 5768dfc..ba3abbd 100644 --- a/config/awesome/notifications/themes/amarena.lua +++ b/config/awesome/notifications/themes/amarena.lua @@ -32,6 +32,7 @@ local app_config = { ['youtube'] = { icon = "", title = true }, ['mpd'] = { icon = "", title = true }, ['mpv'] = { icon = "", title = true }, + ['keyboard'] = { icon = "", title = false }, } -- TODO TODO TODO diff --git a/config/awesome/notifications/themes/ephemeral.lua b/config/awesome/notifications/themes/ephemeral.lua index 383c2f0..08166ca 100644 --- a/config/awesome/notifications/themes/ephemeral.lua +++ b/config/awesome/notifications/themes/ephemeral.lua @@ -49,6 +49,7 @@ local app_config = { ['youtube'] = { icon = "", title = true }, ['mpd'] = { icon = "", title = true }, ['mpv'] = { icon = "", title = true }, + ['keyboard'] = { icon = "", title = false }, } -- Template