legacy-dotfiles/config/awesome/functions.lua

40 lines
747 B
Lua
Raw Normal View History

2010-12-05 12:25:01 +01:00
-- Functions
function switch_tag (i)
local screen = mouse.screen
if tags[screen][i] then
awful.tag.viewonly(tags[screen][i])
end
end
function toggle_tag (i)
local screen = mouse.screen
if tags[screen][i] then
awful.tag.viewtoggle(tags[screen][i])
end
end
function move_to_tag (i)
if client.focus and tags[client.focus.screen][i] then
awful.client.movetotag(tags[client.focus.screen][i])
end
end
function toggle_client_tag (i)
if client.focus and tags[client.focus.screen][i] then
awful.client.toggletag(tags[client.focus.screen][i])
end
end
function fexists (n)
local f = io.open(n)
if f == nil then
return false
end
io.close(f)
return true
end
module("functions")