Added --home and --config command line parameters to irssi to specify

locations for ~/.irssi and ~/.irssi/config


git-svn-id: http://svn.irssi.org/repos/irssi/trunk@1626 dbcabf3a-b0e7-0310-adc4-f8d773084564
This commit is contained in:
Timo Sirainen 2001-07-15 00:39:48 +00:00 committed by cras
commit 79d1d7089a
19 changed files with 129 additions and 276 deletions

View file

@ -32,7 +32,7 @@ static void sig_autorun(void)
int f, ret, recvlen;
/* open ~/.irssi/startup and run all commands in it */
path = g_strdup_printf("%s/.irssi/startup", g_get_home_dir());
path = g_strdup_printf("%s/startup", get_irssi_dir());
f = open(path, O_RDONLY);
g_free(path);
if (f == -1) {

View file

@ -247,13 +247,12 @@ static void cmd_reload(const char *data)
{
char *fname;
fname = *data != '\0' ? g_strdup(data) :
g_strdup_printf("%s/.irssi/config", g_get_home_dir());
fname = *data == '\0' ? NULL : g_strdup(data);
if (settings_reread(fname)) {
printformat(NULL, NULL, MSGLEVEL_CLIENTNOTICE,
TXT_CONFIG_RELOADED, fname);
}
g_free(fname);
g_free_not_null(fname);
}
static void settings_save_fe(const char *fname)

View file

@ -701,7 +701,7 @@ THEME_REC *theme_load(const char *setname)
theme = theme_find(name);
/* check home dir */
fname = g_strdup_printf("%s/.irssi/%s.theme", g_get_home_dir(), name);
fname = g_strdup_printf("%s/%s.theme", get_irssi_dir(), name);
if (stat(fname, &statbuf) != 0) {
/* check global config dir */
g_free(fname);
@ -1005,7 +1005,7 @@ static void theme_save(THEME_REC *theme)
g_hash_table_foreach(theme->modules, (GHFunc) module_save, config);
/* always save the theme to ~/.irssi/ */
path = g_strdup_printf("%s/.irssi/%s", g_get_home_dir(),
path = g_strdup_printf("%s/%s", get_irssi_dir(),
g_basename(theme->path));
ok = config_write(config, path, 0660) == 0;
@ -1135,8 +1135,7 @@ static void themes_read(void)
/* first there's default theme.. */
current_theme = theme_load("default");
if (current_theme == NULL) {
fname = g_strdup_printf("%s/.irssi/default.theme",
g_get_home_dir());
fname = g_strdup_printf("%s/default.theme", get_irssi_dir());
current_theme = theme_create(fname, "default");
current_theme->default_color = 0;
current_theme->default_real_color = 7;