summaryrefslogtreecommitdiffstats
path: root/config/awesome/functions.lua
blob: ee9594d42cb26dc962201760dae3d55a634f3d7c (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
-- 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")