about summary refs log tree commit diff stats
path: root/src/command.c
diff options
context:
space:
mode:
authorJames Booth <boothj5@gmail.com>2012-12-09 00:21:33 +0000
committerJames Booth <boothj5@gmail.com>2012-12-09 00:21:33 +0000
commit986967ef8909e894cd0c691c74da7f50c4b91b3e (patch)
tree7528c2e6ec50880a721ea7dc923d9de86e2bc069 /src/command.c
parent4c243722c6b17ccafffaaba47d9c4e1a7e00ab56 (diff)
downloadprofani-tty-986967ef8909e894cd0c691c74da7f50c4b91b3e.tar.gz
Added /theme list command
Diffstat (limited to 'src/command.c')
-rw-r--r--src/command.c11
1 files changed, 10 insertions, 1 deletions
diff --git a/src/command.c b/src/command.c
index 2b0d14bc..c81a7618 100644
--- a/src/command.c
+++ b/src/command.c
@@ -1223,10 +1223,19 @@ _cmd_prefs(gchar **args, struct cmd_help_t help)
 static gboolean
 _cmd_theme(gchar **args, struct cmd_help_t help)
 {
-    if (theme_load(args[0])) {
+    // list themes
+    if (strcmp(args[0], "list") == 0) {
+        GSList *themes = theme_list();
+        cons_show_themes(themes);
+        g_slist_free_full(themes, g_free);
+
+    // load a theme
+    } else if (theme_load(args[0])) {
         ui_load_colours();
         prefs_set_theme(args[0]);
         cons_show("Loaded theme: %s", args[0]);
+
+    // theme not found
     } else {
         cons_show("Couldn't find theme: %s", args[0]);
     }