Debian Codegraph @

doc/examples/awesome.lua

raw symbols SCIP
1 -- Support Awesome 3.5 WM
2
3 local posix = require("posix");
4 local os = require("os");
5
6 local awesome = "/usr/bin/awesome-client"
7 if not posix.stat(awesome, "type") == "file" then
8 awesome = nil;
9 end
10
11 -- Check for tiling mode
12 function is_tiling()
13 if awesome then
14 return true;
15 end
16 return false;
17 end
18
19 -- Make window floating
20 -- Parameters: state - true to make window floating, else make window tiled
21 function set_tile_floating( state )
22 if not awesome then
23 return nil;
24 end
25
26 if state then state = "true" else state = "false" end
27
28 local xid = get_window_xid();
29
30 local command = "echo ";
31 command = command .. "'";
32 command = command .. " local naughty = require(\"naughty\");";
33 command = command .. " local awcl = require(\"awful.client\");";
34 command = command .. " local client = require(\"client\");";
35 command = command .. " for k, c in pairs( client.get() ) do";
36 command = command .. " if c.window == " .. xid .. " then";
37 command = command .. " awcl.floating.set(c, " .. state .. ");";
38 command = command .. " end";
39 command = command .. " end";
40 command = command .. "'";
41 command = command .. " | ";
42 command = command .. awesome;
43
44 debug_print("Awesome floating: " .. command);
45 return os.execute( command );
46 end