mirror of
https://github.com/weechat/weechat.git
synced 2026-06-27 21:36:37 +02:00
adaa7e8f87
Add exec-theme.{c,h} with the exec plugin contribution to the built-in
"light" theme: 2 entries (exec.color.flag_finished=red,
exec.color.flag_running=green) tuned for a light-background terminal.
Same 2D-array pattern as the other plugin contributions.
Default option values are NOT changed.
71 lines
1.9 KiB
C
71 lines
1.9 KiB
C
/*
|
|
* SPDX-FileCopyrightText: 2026 Sébastien Helleu <flashcode@flashtux.org>
|
|
*
|
|
* SPDX-License-Identifier: GPL-3.0-or-later
|
|
*
|
|
* This file is part of WeeChat, the extensible chat client.
|
|
*
|
|
* WeeChat is free software; you can redistribute it and/or modify
|
|
* it under the terms of the GNU General Public License as published by
|
|
* the Free Software Foundation; either version 3 of the License, or
|
|
* (at your option) any later version.
|
|
*
|
|
* WeeChat is distributed in the hope that it will be useful,
|
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
* GNU General Public License for more details.
|
|
*
|
|
* You should have received a copy of the GNU General Public License
|
|
* along with WeeChat. If not, see <https://www.gnu.org/licenses/>.
|
|
*/
|
|
|
|
/* exec contribution to built-in themes. */
|
|
|
|
#ifdef HAVE_CONFIG_H
|
|
#include "config.h"
|
|
#endif
|
|
|
|
#include <stddef.h>
|
|
|
|
#include "../weechat-plugin.h"
|
|
#include "exec.h"
|
|
#include "exec-theme.h"
|
|
|
|
|
|
const char *exec_theme_light[][2] =
|
|
{
|
|
{ "exec.color.flag_finished", "red" },
|
|
{ "exec.color.flag_running", "green" },
|
|
{ NULL, NULL },
|
|
};
|
|
|
|
void
|
|
exec_theme_register (const char *name, const char *entries[][2])
|
|
{
|
|
struct t_hashtable *overrides;
|
|
int i;
|
|
|
|
if (!name || !entries)
|
|
return;
|
|
|
|
overrides = weechat_hashtable_new (32,
|
|
WEECHAT_HASHTABLE_STRING,
|
|
WEECHAT_HASHTABLE_STRING,
|
|
NULL, NULL);
|
|
if (!overrides)
|
|
return;
|
|
|
|
for (i = 0; entries[i][0]; i++)
|
|
weechat_hashtable_set (overrides, entries[i][0], entries[i][1]);
|
|
|
|
weechat_theme_register (name, overrides);
|
|
|
|
weechat_hashtable_free (overrides);
|
|
}
|
|
|
|
void
|
|
exec_theme_init (void)
|
|
{
|
|
exec_theme_register ("light", exec_theme_light);
|
|
}
|