irssi-import / bugs.irssi.org

bugs.irssi.org archive
https://github.com/irssi/irssi/issues
0 stars 0 forks source link

Should Irssi use ~/.config/irssi? #731

Closed irssibot closed 14 years ago

irssibot commented 14 years ago

Most software now uses that... I think it's cleaner.

irssibot commented 14 years ago

0002-Use-.config-irssi-instead-of-.irssi.patch

From ba492cc06425ec7445b45cec32a4a304d5c82512 Mon Sep 17 00:00:00 2001
From: Ismael Luceno <ismael.luceno@gmail.com>
Date: Sat, 9 Jan 2010 22:48:55 -0200
Subject: [PATCH] Use ~/.config/irssi instead of ~/.irssi

---
 docs/faq.html                       |    8 ++++----
 docs/help/in/load.in                |    2 +-
 docs/irssi.1                        |   18 +++++++++---------
 docs/manual.txt                     |    4 ++--
 docs/perl.txt                       |    2 +-
 docs/proxy.txt                      |    4 ++--
 docs/startup-HOWTO-rus.html         |    2 +-
 docs/startup-HOWTO.html             |    2 +-
 scripts/buf.pl                      |    2 +-
 scripts/quitmsg.pl                  |    4 ++--
 src/common.h                        |    8 ++++----
 src/core/core.c                     |    6 +++---
 src/core/settings.c                 |    2 +-
 src/fe-common/core/fe-common-core.c |    2 +-
 src/fe-common/core/themes.c         |    2 +-
 src/fe-text/irssi.c                 |    2 +-
 src/perl/perl-core.c                |    4 ++--
 17 files changed, 37 insertions(+), 37 deletions(-)

diff --git a/docs/faq.html b/docs/faq.html
index e2de979..3db69b0 100644
--- a/docs/faq.html
+++ b/docs/faq.html
@@ -122,15 +122,15 @@ don't have much interest in coding it,

 <h3>Q: How do I run scripts automatically at startup?</h3>

-<p>A: Put them into <code>~/.irssi/scripts/autorun/</code> directory. Or
-better would be if you placed them in <code>~/.irssi/scripts/</code> and
+<p>A: Put them into <code>~/.config/irssi/scripts/autorun/</code> directory. Or
+better would be if you placed them in <code>~/.config/irssi/scripts/</code> and
 created symlinks to autorun directory (eg. <code>cd
-~/.irssi/scripts/autorun/ ; ln -s ../script.pl .</code>)</p>
+~/.config/irssi/scripts/autorun/ ; ln -s ../script.pl .</code>)</p>

 <h3>Q: How do I execute commands automatically at startup?</h3>

-<p>A: Put them into <code>~/.irssi/startup</code> file, each command on its
+<p>A: Put them into <code>~/.config/irssi/startup</code> file, each command on its
 own line. The preceding slash (/) is not necessary.</p>

diff --git a/docs/help/in/load.in b/docs/help/in/load.in
index 76f4d01..01a82f0 100644
--- a/docs/help/in/load.in
+++ b/docs/help/in/load.in
@@ -4,7 +4,7 @@
 Load a plugin. If full path isn't given, irssi searches the plugin from
 directories:

- ~/.irssi/modules/
+ ~/.config/irssi/modules/
  <install dir, /usr/local or /usr maybe>/lib/irssi/modules/

 See plugins page of http://www.irssi.org/ to see if there's any plugins
diff --git a/docs/irssi.1 b/docs/irssi.1
index 62c2844..86724fc 100644
--- a/docs/irssi.1
+++ b/docs/irssi.1
@@ -16,13 +16,13 @@ is easily extensible through scripts and modules.
 .BI "\-\-config="FILE
 use 
 .I FILE
-instead of ~/.irssi/config.
+instead of ~/.config/irssi/config.
 .TP
 .BI "\-\-home="PATH
 .I PATH 
 specifies the home directory of Irssi.
 Default is 
-.BR ~/.irssi
+.BR ~/.config/irssi
 .TP
 .BI "\-c, \-\-connect="SERVER
 connects to 
@@ -71,16 +71,16 @@ at the files contained by /usr/share/doc/irssi*
 .I /etc/irssi.conf
 Global configuration file
 .TP
-.I ~/.irssi/config
+.I ~/.config/irssi/config
 Personal configuration file
 .TP
-.I ~/.irssi/config.autosave
+.I ~/.config/irssi/config.autosave
 Automatic save of the personal config file when it was changed externally
 .TP
-.I ~/.irssi/default.theme
+.I ~/.config/irssi/default.theme
 Default irssi theme
 .TP
-.I ~/.irssi/away.log
+.I ~/.config/irssi/away.log
 Logged messages in away status
 .TP
 .I /usr/share/irssi/help/
@@ -92,14 +92,14 @@ Global scripts directory
 .I /usr/share/irssi/themes/
 Global themes directory
 .TP
-.I ~/.irssi/scripts/
+.I ~/.config/irssi/scripts/
 Default scripts directory
 .TP
-.I ~/.irssi/scripts/autorun/
+.I ~/.config/irssi/scripts/autorun/
 Directory containing links to scripts that should be loaded
 automatically on startup
 .TP
-.I ~/.irssi/startup
+.I ~/.config/irssi/startup
 File containing a list of commands to execute on startup
 .SH AUTHORS/CREDITS
 .B Irssi
diff --git a/docs/manual.txt b/docs/manual.txt
index 43d7755..8f6a4bd 100644
--- a/docs/manual.txt
+++ b/docs/manual.txt
@@ -261,7 +261,7 @@

  4.1 Configuration files

-   The configuration is saved to ~/.irssi/config file. You can edit
+   The configuration is saved to ~/.config/irssi/config file. You can edit
    it with text editor if you want, you can also add comments to it
    and they stay there even if /SAVE is used. Comments are the lines
    starting with # character. Any errors in config file are displayed
@@ -973,7 +973,7 @@ If <color> is a
    yourself unaway, Irssi will display all the messages in the awaylog.

    /SET awaylog_level <level> - Default is MSGS HILIGHT
-   /SET awaylog_file <filename> - Default is ~/.irssi/away.log
+   /SET awaylog_file <filename> - Default is ~/.config/irssi/away.log

    You can disable this feature by setting awaylog_level to NONE.

diff --git a/docs/perl.txt b/docs/perl.txt
index 732b73a..a497fe1 100644
--- a/docs/perl.txt
+++ b/docs/perl.txt
@@ -13,7 +13,7 @@ Scripts are run with /SCRIPT LOAD command, or the default /RUN alias.
 "/SCRIPT" shows list of running script, and /SCRIPT UNLOAD can unload
 scripts.

-Scripts should be placed to ~/.irssi/scripts/ or
+Scripts should be placed to ~/.config/irssi/scripts/ or
 /usr/local/lib/irssi/scripts/ (or depending on where irssi was
 installed) directories. After that /RUN script_name should work, you
 don't need to add the .pl suffix.
diff --git a/docs/proxy.txt b/docs/proxy.txt
index 41875aa..c918ffd 100644
--- a/docs/proxy.txt
+++ b/docs/proxy.txt
@@ -5,8 +5,8 @@ irssi with --with-proxy and do make install, or manually:

   cd src/irc/proxy
   make
-  mkdir ~/.irssi/modules
-  cp .libs/libproxy.so ~/.irssi/modules/
+  mkdir ~/.config/irssi/modules
+  cp .libs/libproxy.so ~/.config/irssi/modules/

 In irssi, say:

diff --git a/docs/startup-HOWTO-rus.html b/docs/startup-HOWTO-rus.html
index 595d1df..18220c6 100644
--- a/docs/startup-HOWTO-rus.html
+++ b/docs/startup-HOWTO-rus.html
@@ -458,7 +458,7 @@ END</code>.</p>

 <pre>
 /SET awaylog_level MSGS HILIGHT     - ÷ÙÂÉÒÁÅÔ ËÁËÏÅ ÓÏÏÂÝÅÎÉÑ ÎÁÄÏ ÚÁÐÉÓÙ×ÁÔØ × ÌÏÇ
-/SET awaylog_file ~/.irssi/away.log - ÷ÙÂÉÒÁÅÔ ÆÁÊÌ ÄÌÑ ÌÏÇÁ
+/SET awaylog_file ~/.config/irssi/away.log - ÷ÙÂÉÒÁÅÔ ÆÁÊÌ ÄÌÑ ÌÏÇÁ
 </pre>

 <p>ðÒÏÓÔÅÊÛÉÊ ÓÐÏÓÏ ×ÅÄÅÎÉÑ ÌÏÇÏ× ÐÒÉ ÐÏÍÏÝÉ Irssi - ×ËÌÀÞÅÎÉÅ Á×ÔÏÌÏÇÁ. 
diff --git a/docs/startup-HOWTO.html b/docs/startup-HOWTO.html
index 736f25e..92a2671 100644
--- a/docs/startup-HOWTO.html
+++ b/docs/startup-HOWTO.html
@@ -527,7 +527,7 @@ You can configure it with:</p>

 <pre>
 /SET awaylog_level MSGS HILIGHT     - Specifies what messages to log
-/SET awaylog_file ~/.irssi/away.log - Specifies the file to use
+/SET awaylog_file ~/.config/irssi/away.log - Specifies the file to use
 </pre>

 <p>Easiest way to start logging with Irssi is to use autologging. With it
diff --git a/scripts/buf.pl b/scripts/buf.pl
index 43b4b3d..08c36fd 100644
--- a/scripts/buf.pl
+++ b/scripts/buf.pl
@@ -118,5 +118,5 @@ signal_add       'event 366'       => 'suppress';
 signal_add       'event join'      => 'suppress';

 unless (-f sprintf('%s/scripts/autorun/buf.pl', get_irssi_dir)) {
-    Irssi::print('PUT THIS SCRIPT IN ~/.irssi/scripts/autorun/ BEFORE /UPGRADING!!');
+    Irssi::print('PUT THIS SCRIPT IN ~/.config/irssi/scripts/autorun/ BEFORE /UPGRADING!!');
 }
diff --git a/scripts/quitmsg.pl b/scripts/quitmsg.pl
index 41bddaa..c0b9562 100644
--- a/scripts/quitmsg.pl
+++ b/scripts/quitmsg.pl
@@ -1,5 +1,5 @@
 # If quit message isn't given, quit with a random message
-# read from ~/.irssi/irssi.quit
+# read from ~/.config/irssi/irssi.quit

 use Irssi;
 use Irssi::Irc;
@@ -15,7 +15,7 @@ $VERSION = "1.00";
     changed    => 'Sun Mar 10 23:18 EET 2002'
 );

-my $quitfile = glob "~/.irssi/irssi.quit";
+my $quitfile = glob "~/.config/irssi/irssi.quit";

 sub cmd_quit {
    my ($data, $server, $channel) = @_;
diff --git a/src/common.h b/src/common.h
index bb24696..8a960b0 100644
--- a/src/common.h
+++ b/src/common.h
@@ -1,10 +1,10 @@
 #ifndef __COMMON_H
 #define __COMMON_H

-#define IRSSI_DIR_FULL "%s/.irssi" /* %s == g_get_home_dir() */
+#define IRSSI_DIR_FULL "%s/.config/irssi" /* %s == g_get_home_dir() */

 #define IRSSI_GLOBAL_CONFIG "irssi.conf" /* config file name in /etc/ */
-#define IRSSI_HOME_CONFIG "config" /* config file name in ~/.irssi/ */
+#define IRSSI_HOME_CONFIG "config" /* config file name in ~/.config/irssi/ */

 #define DEFAULT_SERVER_ADD_PORT 6667

@@ -77,9 +77,9 @@ int g_input_add(GIOChannel *source, int condition,
 int g_input_add_full(GIOChannel *source, int priority, int condition,
             GInputFunction function, void *data);

-/* return full path for ~/.irssi */
+/* return full path for ~/.config/irssi */
 const char *get_irssi_dir(void);
-/* return full path for ~/.irssi/config */
+/* return full path for ~/.config/irssi/config */
 const char *get_irssi_config(void);

 /* max. size for %d */
diff --git a/src/core/core.c b/src/core/core.c
index b9debbb..4a5ea5c 100644
--- a/src/core/core.c
+++ b/src/core/core.c
@@ -70,7 +70,7 @@ const char *get_irssi_dir(void)
         return irssi_dir;
 }

-/* return full path for ~/.irssi/config */
+/* return full path for ~/.config/irssi/config */
 const char *get_irssi_config(void)
 {
         return irssi_config_file;
@@ -167,8 +167,8 @@ static char *fix_path(const char *str)
 void core_register_options(void)
 {
    static GOptionEntry options[] = {
-       { "config", 0, 0, G_OPTION_ARG_STRING, &irssi_config_file, "Configuration file location (~/.irssi/config)", "PATH" },
-       { "home", 0, 0, G_OPTION_ARG_STRING, &irssi_dir, "Irssi home dir location (~/.irssi)", "PATH" },
+       { "config", 0, 0, G_OPTION_ARG_STRING, &irssi_config_file, "Configuration file location (~/.config/irssi/config)", "PATH" },
+       { "home", 0, 0, G_OPTION_ARG_STRING, &irssi_dir, "Irssi home dir location (~/.config/irssi)", "PATH" },
        { NULL }
    };

diff --git a/src/core/settings.c b/src/core/settings.c
index bfcead3..a9e23ab 100644
--- a/src/core/settings.c
+++ b/src/core/settings.c
@@ -681,7 +681,7 @@ static void init_configfile(void)
    char *str;

    if (stat(get_irssi_dir(), &statbuf) != 0) {
-       /* ~/.irssi not found, create it. */
+       /* ~/.config/irssi not found, create it. */
        if (mkpath(get_irssi_dir(), 0700) != 0) {
            g_error("Couldn't create %s directory", get_irssi_dir());
        }
diff --git a/src/fe-common/core/fe-common-core.c b/src/fe-common/core/fe-common-core.c
index 2b88b94..288ca32 100644
--- a/src/fe-common/core/fe-common-core.c
+++ b/src/fe-common/core/fe-common-core.c
@@ -393,7 +393,7 @@ static void autorun_startup(void)
    GString *buf;
    gsize tpos;

-   /* open ~/.irssi/startup and run all commands in it */
+   /* open ~/.config/irssi/startup and run all commands in it */
    path = g_strdup_printf("%s/startup", get_irssi_dir());
    handle = g_io_channel_new_file(path, "r", NULL);
    g_free(path);
diff --git a/src/fe-common/core/themes.c b/src/fe-common/core/themes.c
index 7c50c28..b0955d9 100644
--- a/src/fe-common/core/themes.c
+++ b/src/fe-common/core/themes.c
@@ -1160,7 +1160,7 @@ static void theme_save(THEME_REC *theme, int save_all)
         data.save_all = save_all;
    g_hash_table_foreach(theme->modules, (GHFunc) module_save, &data);

-        /* always save the theme to ~/.irssi/ */
+        /* always save the theme to ~/.config/irssi/ */
    path = g_strdup_printf("%s/%s", get_irssi_dir(),
                   g_basename(theme->path));
    ok = config_write(config, path, 0660) == 0;
diff --git a/src/fe-text/irssi.c b/src/fe-text/irssi.c
index 2f2f37d..860c359 100644
--- a/src/fe-text/irssi.c
+++ b/src/fe-text/irssi.c
@@ -249,7 +249,7 @@ static void check_files(void)
    struct stat statbuf;

    if (stat(get_irssi_dir(), &statbuf) != 0) {
-       /* ~/.irssi doesn't exist, first time running irssi */
+       /* ~/.config/irssi doesn't exist, first time running irssi */
        display_firsttimer = TRUE;
    }
 }
diff --git a/src/perl/perl-core.c b/src/perl/perl-core.c
index 08d0738..14662c2 100644
--- a/src/perl/perl-core.c
+++ b/src/perl/perl-core.c
@@ -360,7 +360,7 @@ char *perl_script_get_path(const char *name)
    file = IS_PERL_SCRIPT(name) ? g_strdup(name) :
        g_strdup_printf("%s.pl", name);

-   /* check from ~/.irssi/scripts/ */
+   /* check from ~/.config/irssi/scripts/ */
    path = g_strdup_printf("%s/scripts/%s", get_irssi_dir(), file);
    if (stat(path, &statbuf) != 0) {
        /* check from SCRIPTDIR */
@@ -394,7 +394,7 @@ static void perl_scripts_autorun(void)
    struct stat statbuf;
    char *path, *fname;

-        /* run *.pl scripts from ~/.irssi/scripts/autorun/ */
+        /* run *.pl scripts from ~/.config/irssi/scripts/autorun/ */
    path = g_strdup_printf("%s/scripts/autorun", get_irssi_dir());
    dirp = opendir(path);
    if (dirp == NULL) {
-- 
1.6.5.7
irssibot commented 14 years ago

Thanks, but no thanks.

For this kind of changes, it might be better to ask us before spending much time writing the patch :)