Created
August 7, 2015 13:52
-
-
Save blueyed/60137df59980a355402b to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
-- Notifications for property changes (number of masters, master width factor). {{{ | |
-- local prev_tag_vals = {['property::nmaster']={}, ['property::mwfact']={}} | |
local prev_tag_vals, prop_notification_id = {}, nil | |
for s = 1, capi.screen.count() do | |
for sig, name in pairs({['property::nmaster'] = 'nmaster', | |
['property::ncol'] = 'ncol', | |
['property::windowfact'] = 'windowfact', | |
['property::mwfact'] = 'mwfact'}) do | |
awful.tag.attached_connect_signal(s, sig, function(t) | |
if not prev_tag_vals[sig] then | |
prev_tag_vals[sig] = { [t] = '?' } | |
elseif not prev_tag_vals[sig][t] then | |
prev_tag_vals[sig][t] = '?' | |
end | |
local old = prev_tag_vals[sig][t] | |
local val = awful.tag.getproperty(t, name) | |
prop_notification_id = naughty.notify({ | |
text = name .. ' changed: ' .. tostring(old) .. ' => ' .. tostring(val), | |
timeout = 10, | |
replaces_id = prop_notification_id, | |
}).id | |
prev_tag_vals[sig][t] = val | |
end) | |
end | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment