2021-11-29 18:53:23 +01:00
|
|
|
local atag = require "awful.tag"
|
|
|
|
local layout_suit = require "awful.layout.suit"
|
2021-07-04 17:24:00 +02:00
|
|
|
|
|
|
|
local commands = {}
|
|
|
|
|
2021-11-29 18:53:23 +01:00
|
|
|
commands["o"] = {
|
|
|
|
callback = function(parameters)
|
|
|
|
local tag_name = parameters[1] or "New-Tag"
|
2021-07-04 17:24:00 +02:00
|
|
|
|
|
|
|
atag.add(tag_name, {
|
2021-11-29 18:53:23 +01:00
|
|
|
layout = layout_suit.tile,
|
2021-07-04 17:24:00 +02:00
|
|
|
}):view_only()
|
2021-11-29 18:53:23 +01:00
|
|
|
end,
|
2021-07-04 17:24:00 +02:00
|
|
|
}
|
|
|
|
|
2021-11-29 18:53:23 +01:00
|
|
|
commands["O"] = {
|
|
|
|
callback = function(parameters)
|
|
|
|
local aspawn = require "awful.spawn"
|
2021-07-04 17:24:00 +02:00
|
|
|
|
|
|
|
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 })
|
2021-11-29 18:53:23 +01:00
|
|
|
end,
|
2021-07-04 17:24:00 +02:00
|
|
|
}
|
|
|
|
|
2021-11-29 18:53:23 +01:00
|
|
|
commands["q"] = {
|
|
|
|
callback = function()
|
|
|
|
local ascreen = require "awful.screen"
|
2021-07-04 17:24:00 +02:00
|
|
|
|
|
|
|
local tags = ascreen.focused().selected_tags
|
|
|
|
|
2021-11-29 18:53:23 +01:00
|
|
|
for _, tag in ipairs(tags) do
|
2021-07-04 17:24:00 +02:00
|
|
|
tag.volatile = true
|
|
|
|
|
2021-11-29 18:53:23 +01:00
|
|
|
for _, client in ipairs(tag:clients()) do
|
2021-07-04 17:24:00 +02:00
|
|
|
client:kill()
|
|
|
|
end
|
|
|
|
|
|
|
|
tag:delete()
|
|
|
|
end
|
2021-11-29 18:53:23 +01:00
|
|
|
end,
|
2021-07-04 17:24:00 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
return commands
|