#include <ccs.h>
#include <gio/gio.h>
#include <iostream>
#include <string>
extern const CCSInterfaceTable ccsDefaultInterfaceTable;
int main(int argc, char **argv)
{
auto context = ccsContextNew (0, &ccsDefaultInterfaceTable);
if (!context || argc < 2)
return -1;
g_print("Current profile is %s\n", ccsGetProfile(context));
CCSStringList profiles = ccsGetExistingProfiles(context);
g_print("We've %u profiles\n",ccsStringListLength(profiles));
for (unsigned i = 0; i < ccsStringListLength(profiles); ++i)
g_print(" - %s\n",ccsStringListGetItem(profiles, i)->data->value);
ccsSetProfile(context, argv[1]);
ccsReadSettings(context);
ccsWriteSettings(context);
g_settings_sync();
ccsFreeContext(context);
return 0;
}