51 lines
1.1 KiB
Lua
51 lines
1.1 KiB
Lua
local atag = require "awful.tag"
|
|
local layout_suit = require "awful.layout.suit"
|
|
|
|
local commands = {}
|
|
|
|
commands["o"] = {
|
|
callback = function(parameters)
|
|
local tag_name = parameters[1] or "New-Tag"
|
|
|
|
atag.add(tag_name, {
|
|
layout = layout_suit.tile,
|
|
}):view_only()
|
|
end,
|
|
}
|
|
|
|
commands["O"] = {
|
|
callback = function(parameters)
|
|
local aspawn = require "awful.spawn"
|
|
|
|
local application = parameters[1]
|
|
local tag_name = parameters[2] or application
|
|
|
|
local t = atag.add(tag_name, {
|
|
layout = layout_suit.tile,
|
|
volatile = true,
|
|
})
|
|
t:view_only()
|
|
aspawn(application, { tag = t })
|
|
end,
|
|
}
|
|
|
|
commands["q"] = {
|
|
callback = function()
|
|
local ascreen = require "awful.screen"
|
|
|
|
local tags = ascreen.focused().selected_tags
|
|
|
|
for _, tag in ipairs(tags) do
|
|
tag.volatile = true
|
|
|
|
for _, client in ipairs(tag:clients()) do
|
|
client:kill()
|
|
end
|
|
|
|
tag:delete()
|
|
end
|
|
end,
|
|
}
|
|
|
|
return commands
|