Add keyboard layout notifications

This commit is contained in:
elenapan 2020-04-07 20:03:37 +03:00
parent 380be9dc1c
commit 1ac7a8c2cc
4 changed files with 16 additions and 0 deletions

View file

@ -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

View file

@ -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)

View file

@ -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

View file

@ -49,6 +49,7 @@ local app_config = {
['youtube'] = { icon = "", title = true },
['mpd'] = { icon = "", title = true },
['mpv'] = { icon = "", title = true },
['keyboard'] = { icon = "", title = false },
}
-- Template