diff --git a/src/keybindings/ConfigParser.vala b/src/keybindings/ConfigParser.vala index f2f2b75..3d7d55e 100644 --- a/src/keybindings/ConfigParser.vala +++ b/src/keybindings/ConfigParser.vala @@ -1,5 +1,5 @@ /** - * This class retrieves the i3 config file over IPC and + * This class retrieves the wm config file over IPC and * produces a [Category] -> List data structure * indended to be presented to the user. */ @@ -33,7 +33,7 @@ public class ConfigParser { this.line_prefix = line_prefix; } - public Map > parse () throws PARSE_ERROR, GLib.Error, Ilia.I3_ERROR { + public Map > parse () throws PARSE_ERROR, GLib.Error, Ilia.WM_ERROR { string[] lines = config.split ("\n"); if (lines == null || lines.length == 0) return Map.empty >(); ; diff --git a/src/keybindings/I3Ipc.vala b/src/keybindings/I3Ipc.vala index feedaca..eea455c 100644 --- a/src/keybindings/I3Ipc.vala +++ b/src/keybindings/I3Ipc.vala @@ -6,7 +6,7 @@ using GLib; using Gee; namespace Ilia { - enum I3_COMMAND { + enum WM_COMMAND { RUN_COMMAND, GET_WORKSPACES, SUBSCRIBE, @@ -21,7 +21,7 @@ namespace Ilia { SYNC } - public errordomain I3_ERROR { + public errordomain WM_ERROR { RPC_ERROR } @@ -250,14 +250,14 @@ namespace Ilia { } } - public class I3Client { + public class IPCClient { private Socket socket; private uint8[] magic_number = "i3-ipc".data; private uint8[] terminator = { '\0' }; private int bytes_to_payload = 14; private int buffer_size = 1024 * 128; - public I3Client () throws GLib.Error { + public IPCClient () throws GLib.Error { var socket_path = Environment.get_variable ("I3SOCK"); var socketAddress = new UnixSocketAddress (socket_path); @@ -269,7 +269,7 @@ namespace Ilia { socket.set_blocking (true); } - ~I3Client () { + ~IPCClient () { if (socket != null) { try { socket.close (); @@ -293,7 +293,7 @@ namespace Ilia { return (string) b.data; } - private uint8[] generate_request (I3_COMMAND cmd) { + private uint8[] generate_request (WM_COMMAND cmd) { ByteArray np = new ByteArray (); np.append (magic_number); @@ -305,7 +305,7 @@ namespace Ilia { return message.get_data (); } - private Json.Node ? i3_ipc (I3_COMMAND command) throws GLib.Error { + private Json.Node ? wm_ipc (WM_COMMAND command) throws GLib.Error { ssize_t sent = socket.send (generate_request (command)); debug ("Sent " + sent.to_string () + " bytes to " + WM_NAME + ".\n"); @@ -325,31 +325,31 @@ namespace Ilia { return parser.get_root (); } - public VersionReply getVersion () throws I3_ERROR, GLib.Error { - var response = i3_ipc (I3_COMMAND.GET_VERSION); + public VersionReply getVersion () throws WM_ERROR, GLib.Error { + var response = wm_ipc (WM_COMMAND.GET_VERSION); if (response == null) { - throw new I3_ERROR.RPC_ERROR ("No Response"); + throw new WM_ERROR.RPC_ERROR ("No Response"); } return new VersionReply (response); } - public ConfigReply getConfig () throws I3_ERROR, GLib.Error { - var response = i3_ipc (I3_COMMAND.GET_CONFIG); + public ConfigReply getConfig () throws WM_ERROR, GLib.Error { + var response = wm_ipc (WM_COMMAND.GET_CONFIG); if (response == null) { - throw new I3_ERROR.RPC_ERROR ("No Response"); + throw new WM_ERROR.RPC_ERROR ("No Response"); } return new ConfigReply (response); } - public TreeReply getTree () throws I3_ERROR, GLib.Error { - var response = i3_ipc (I3_COMMAND.GET_TREE); + public TreeReply getTree () throws WM_ERROR, GLib.Error { + var response = wm_ipc (WM_COMMAND.GET_TREE); if (response == null) { - throw new I3_ERROR.RPC_ERROR ("No Response"); + throw new WM_ERROR.RPC_ERROR ("No Response"); } return new TreeReply (response); diff --git a/src/keybindings/KeybindingsPage.vala b/src/keybindings/KeybindingsPage.vala index 8d41782..218fdcc 100644 --- a/src/keybindings/KeybindingsPage.vala +++ b/src/keybindings/KeybindingsPage.vala @@ -60,8 +60,8 @@ namespace Ilia { create_item_view (); - read_i3_config.begin ((obj, res) => { - read_i3_config.end (res); + read_config.begin ((obj, res) => { + read_config.end (res); item_view.columns_autosize (); model.set_sort_column_id (1, SortType.ASCENDING); @@ -161,11 +161,11 @@ namespace Ilia { } } - // Read the active i3 configuration and populate the model with keybindings - private async void read_i3_config () { + // Read the active configuration and populate the model with keybindings + private async void read_config () { try { - var i3_client = new I3Client (); - var config_file = i3_client.getConfig ().config; + var ipc_client = new IPCClient (); + var config_file = ipc_client.getConfig ().config; var parser = new ConfigParser (config_file, ""); Map > kbmodel = parser.parse (); diff --git a/src/windows/WindowPage.vala b/src/windows/WindowPage.vala index 88078b0..0d853e7 100644 --- a/src/windows/WindowPage.vala +++ b/src/windows/WindowPage.vala @@ -161,8 +161,8 @@ namespace Ilia { private void load_windows () { try { - var i3_client = new I3Client (); - var node = i3_client.getTree (); + var ipc_client = new IPCClient (); + var node = ipc_client.getTree (); if (node != null) { icon_theme = Gtk.IconTheme.get_default (); @@ -268,4 +268,4 @@ namespace Ilia { } } } -} \ No newline at end of file +}