diff options
author | James Booth <boothj5@gmail.com> | 2012-11-21 22:33:07 +0000 |
---|---|---|
committer | James Booth <boothj5@gmail.com> | 2012-11-21 22:33:07 +0000 |
commit | cd4465394b65e824123b69f3a97bd1e8be5a03d0 (patch) | |
tree | 3a2fbda48c8f7f0f59423e17ad98ef378809a646 /src/command.c | |
parent | e8b2b7196ca3f291cf68592f517a31bff18c8f83 (diff) | |
download | profani-tty-cd4465394b65e824123b69f3a97bd1e8be5a03d0.tar.gz |
Added theme files support with /theme command
Diffstat (limited to 'src/command.c')
-rw-r--r-- | src/command.c | 28 |
1 files changed, 28 insertions, 0 deletions
diff --git a/src/command.c b/src/command.c index 715ad0ee..52f7fac9 100644 --- a/src/command.c +++ b/src/command.c @@ -40,6 +40,7 @@ #include "preferences.h" #include "prof_autocomplete.h" #include "profanity.h" +#include "theme.h" #include "tinyurl.h" #include "ui.h" @@ -124,6 +125,7 @@ static gboolean _cmd_xa(gchar **args, struct cmd_help_t help); static gboolean _cmd_info(gchar **args, struct cmd_help_t help); static gboolean _cmd_wins(gchar **args, struct cmd_help_t help); static gboolean _cmd_nick(gchar **args, struct cmd_help_t help); +static gboolean _cmd_theme(gchar **args, struct cmd_help_t help); /* * The commands are broken down into three groups: @@ -191,6 +193,18 @@ static struct cmd_t main_commands[] = "you will need to restart Profanity for config file edits to take effect.", NULL } } }, + { "/theme", + _cmd_theme, parse_args, 1, 1, + { "/theme [theme-name]", "Change colour theme.", + { "/theme [theme-name]", + "--------------", + "Change the colour setting as defined in:", + "", + " ~/.profanity/themes/theme-name", + "", + "Using \"default\" as the theme name will reset to the default colours.", + NULL } } }, + { "/msg", _cmd_msg, parse_args_with_freetext, 2, 2, { "/msg user@host mesg", "Send mesg to user.", @@ -1078,6 +1092,20 @@ _cmd_prefs(gchar **args, struct cmd_help_t help) } static gboolean +_cmd_theme(gchar **args, struct cmd_help_t help) +{ + if (theme_change(args[0])) { + win_load_colours(); + prefs_set_theme(args[0]); + cons_show("Loaded theme: %s", args[0]); + } else { + cons_show("Couldn't find theme: %s", args[0]); + } + + return TRUE; +} + +static gboolean _cmd_who(gchar **args, struct cmd_help_t help) { jabber_conn_status_t conn_status = jabber_get_connection_status(); |