blob: e2b2bb18092c3a361f50674efa58310ba080c4f0 (
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
|
namespace AstalSway {
public class Workspace : Node {
public string representation { get; private set; }
public bool focused { get; private set; }
public bool visible { get; private set; }
public int num { get; private set; }
public string output { get; private set; }
public Workspace() {
node_type = NodeType.WORKSPACE;
}
internal override void sync(Json.Object obj) {
var rep = obj.get_member("representation");
if (rep != null) {
representation = rep.get_string();
} else {
representation = "";
}
base.sync(obj);
}
internal void sync_workspace(Json.Object obj) {
focused = obj.get_boolean_member("focused");
visible = obj.get_boolean_member("visible");
num = (int)obj.get_int_member("num");
output = obj.get_string_member("output");
}
public override void focus() {
Sway.get_default().run_command(@"workspace $name");
}
}
}
|