return to active tag on restart
This commit is contained in:
parent
509a3c54f0
commit
36b86a40f8
1 changed files with 41 additions and 0 deletions
|
@ -93,3 +93,44 @@ client.connect_signal(
|
||||||
c.border_color = Beautiful.border_normal
|
c.border_color = Beautiful.border_normal
|
||||||
end
|
end
|
||||||
)
|
)
|
||||||
|
|
||||||
|
awesome.connect_signal(
|
||||||
|
'exit',
|
||||||
|
function(reason_restart)
|
||||||
|
if not reason_restart then
|
||||||
|
return
|
||||||
|
end
|
||||||
|
|
||||||
|
local file = io.open('/tmp/awesomewm-last-selected-tags', 'w+')
|
||||||
|
|
||||||
|
for s in screen do
|
||||||
|
file:write(s.selected_tag.index, '\n')
|
||||||
|
end
|
||||||
|
|
||||||
|
file:close()
|
||||||
|
end
|
||||||
|
)
|
||||||
|
|
||||||
|
awesome.connect_signal(
|
||||||
|
'startup',
|
||||||
|
function()
|
||||||
|
local file = io.open('/tmp/awesomewm-last-selected-tags', 'r')
|
||||||
|
if not file then
|
||||||
|
return
|
||||||
|
end
|
||||||
|
|
||||||
|
local selected_tags = {}
|
||||||
|
|
||||||
|
for line in file:lines() do
|
||||||
|
table.insert(selected_tags, tonumber(line))
|
||||||
|
end
|
||||||
|
|
||||||
|
for s in screen do
|
||||||
|
local i = selected_tags[s.index]
|
||||||
|
local t = s.tags[i]
|
||||||
|
t:view_only()
|
||||||
|
end
|
||||||
|
|
||||||
|
file:close()
|
||||||
|
end
|
||||||
|
)
|
||||||
|
|
Loading…
Add table
Reference in a new issue