Skip to content

Commit

Permalink
set the client_extras_dir
Browse files Browse the repository at this point in the history
  • Loading branch information
eyelash committed Feb 23, 2018
1 parent fcbb995 commit e09645e
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 2 deletions.
4 changes: 4 additions & 0 deletions config.vapi
@@ -0,0 +1,4 @@
[CCode(cprefix = "", lower_case_cprefix = "", cheader_filename = "config.h")]
namespace Config {
const string PLUGIN_DIR;
}
5 changes: 5 additions & 0 deletions meson.build
Expand Up @@ -24,6 +24,11 @@ dependencies = [
meson.get_compiler('c').find_library('m')
]

config = configuration_data()
config.set_quoted('PLUGIN_DIR', join_paths(get_option('prefix'), get_option('datadir'), 'xi-gtk', 'plugins'))
configure_file(configuration: config, output: 'config.h')
dependencies += meson.get_compiler('vala').find_library('config', dirs: meson.current_source_dir())

sources += import('gnome').compile_resources('resources', 'resources/gresource.xml', source_dir: 'resources')
executable('xi-gtk', sources, dependencies: dependencies, install: true)
configuration = configuration_data()
Expand Down
2 changes: 1 addition & 1 deletion src/Application.vala
Expand Up @@ -63,7 +63,7 @@ class Application: Gtk.Application {
});
string config_dir = GLib.Path.build_filename(GLib.Environment.get_user_config_dir(), "xi-gtk");
GLib.DirUtils.create_with_parents(config_dir, 0777);
core_connection.send_client_started(config_dir);
core_connection.send_client_started(config_dir, Config.PLUGIN_DIR);
unowned string theme = GLib.Environment.get_variable("XI_THEME");
if (theme == null) {
theme = "InspiredGitHub";
Expand Down
3 changes: 2 additions & 1 deletion src/CoreConnection.vala
Expand Up @@ -150,9 +150,10 @@ class CoreConnection {
send_request("edit", params, response_handler);
}

public void send_client_started(string config_dir) {
public void send_client_started(string config_dir, string client_extras_dir) {
var params = new Json.Object();
params.set_string_member("config_dir", config_dir);
params.set_string_member("client_extras_dir", client_extras_dir);
send_notification("client_started", params);
}

Expand Down

0 comments on commit e09645e

Please sign in to comment.