mirror of
https://github.com/elenapan/dotfiles.git
synced 2026-01-25 17:47:14 +08:00
Add keyboard layout notifications
This commit is contained in:
parent
380be9dc1c
commit
1ac7a8c2cc
4 changed files with 16 additions and 0 deletions
|
|
@ -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
|
||||
|
|
|
|||
13
config/awesome/notifications/keyboardlayout.lua
Normal file
13
config/awesome/notifications/keyboardlayout.lua
Normal 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)
|
||||
|
|
@ -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
|
||||
|
|
|
|||
|
|
@ -49,6 +49,7 @@ local app_config = {
|
|||
['youtube'] = { icon = "", title = true },
|
||||
['mpd'] = { icon = "", title = true },
|
||||
['mpv'] = { icon = "", title = true },
|
||||
['keyboard'] = { icon = "", title = false },
|
||||
}
|
||||
|
||||
-- Template
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue