awesomerc/configuration/prompt_commands.lua

51 lines
1.1 KiB
Lua
Raw Normal View History

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