diff --git a/cmake/ConkyBuildOptions.cmake b/cmake/ConkyBuildOptions.cmake index 9de30072..d5afaebe 100644 --- a/cmake/ConkyBuildOptions.cmake +++ b/cmake/ConkyBuildOptions.cmake @@ -58,6 +58,7 @@ set(SYSTEM_CONFIG_FILE "/etc/conky/conky.conf" CACHE STRING "Default system-wide # use FORCE below to make sure this changes when CMAKE_INSTALL_PREFIX is modified set(PACKAGE_LIBRARY_DIR "${CMAKE_INSTALL_PREFIX}/lib/conky" CACHE STRING "Package library path (where Lua bindings are installed" FORCE) set(DEFAULTNETDEV "eth0" CACHE STRING "Default networkdevice") +set(XDG_CONFIG_FILE "$HOME/.config/conky/conky.conf" CACHE STRING "Configfile of the user (XDG)") set(CONFIG_FILE "$HOME/.conkyrc" CACHE STRING "Configfile of the user") set(MAX_USER_TEXT_DEFAULT "16384" CACHE STRING "Default maximum size of config TEXT buffer, i.e. below TEXT line.") set(DEFAULT_TEXT_BUFFER_SIZE "256" CACHE STRING "Default size used for temporary, static text buffers") diff --git a/cmake/config.h.in b/cmake/config.h.in index c9516457..b6c78dab 100644 --- a/cmake/config.h.in +++ b/cmake/config.h.in @@ -14,6 +14,7 @@ #define SYSTEM_CONFIG_FILE "@SYSTEM_CONFIG_FILE@" #define PACKAGE_LIBDIR "@PACKAGE_LIBRARY_DIR@" #define DEFAULTNETDEV "@DEFAULTNETDEV@" +#define XDG_CONFIG_FILE "@XDG_CONFIG_FILE@" #define CONFIG_FILE "@CONFIG_FILE@" #define LOCALE_DIR "@LOCALE_DIR@" #define MAX_USER_TEXT_DEFAULT @MAX_USER_TEXT_DEFAULT@ diff --git a/doc/command_options.xml b/doc/command_options.xml index ad1b0e43..974fe614 100644 --- a/doc/command_options.xml +++ b/doc/command_options.xml @@ -56,7 +56,7 @@ - Config file to load instead of $HOME/.conkyrc + Config file to load instead of $HOME/.config/conky/conky.conf diff --git a/doc/config_settings.xsl b/doc/config_settings.xsl index c310cfad..a2732e36 100644 --- a/doc/config_settings.xsl +++ b/doc/config_settings.xsl @@ -7,7 +7,7 @@ - ~/.conkyrc settings + ~/.config/conky/conky.conf settings diff --git a/doc/conky-howto.xml b/doc/conky-howto.xml index f322f5a4..34520dd9 100644 --- a/doc/conky-howto.xml +++ b/doc/conky-howto.xml @@ -94,11 +94,12 @@ Once you have an idea of how Conky looks, you can now move on to configuring it!

-By default, Conky will look for a configuration file in the users home directory located at ~/.conkyrc This file contains all the configuration options, and the static text, colors and other variables which control what data is shown to the user. Conky also provides a great sample configuration, located at /usr/share/doc/conky-version/Conkyrc.sample.gz Make sure to replace "version" with the specific version of Conky you have installed. +By default, Conky will look for a configuration file in the users home directory located at ~/.config/conky/conky.conf This file contains all the configuration options, and the static text, colors and other variables which control what data is shown to the user. Conky also provides a great sample configuration, located at /usr/share/doc/conky-version/Conkyrc.sample.gz Make sure to replace "version" with the specific version of Conky you have installed.

-$ zcat /usr/share/conky-1.6.0/conkyrc.sample.gz >> ~/.conkyrc
+$ mkdir -p ~/.config/conky
+$ zcat /usr/share/conky-1.6.0/conkyrc.sample.gz >> ~/.config/conky/conky.conf
 
diff --git a/doc/docs.xml b/doc/docs.xml index a88d9f65..2ddc3a96 100644 --- a/doc/docs.xml +++ b/doc/docs.xml @@ -144,7 +144,7 @@ the more you try to make Conky do, the more resources it is going to consume. - An easy way to force Conky to reload your ~/.conkyrc: + An easy way to force Conky to reload your ~/.config/conky/conky.conf: "killall -SIGUSR1 conky". Saves you the trouble of having to kill and then restart. You can now also do the same with SIGHUP. @@ -159,12 +159,12 @@ Configuration Settings - Default configuration file location is $HOME/.conkyrc or + Default configuration file location is $HOME/.config/conky/conky.conf or ${sysconfdir}/conky/conky.conf. On most systems, sysconfdir is /etc, and you can find the sample config file there (/etc/conky/conky.conf). - You might want to copy it to $HOME/.conkyrc and then + You might want to copy it to $HOME/.config/conky/conky.conf and then start modifying it. Other configs can be found at http://conky.sf.net/ @@ -241,11 +241,11 @@ conky - + Do not start Conky, but have it output - the builtin default config file to ~/.conkyrc for - later customising. + the builtin default config file to + ~/.config/conky/conky.conf for later customising.
@@ -263,7 +263,7 @@ - ~/.conkyrc + ~/.config/conky/rc Default personal configuration file. diff --git a/src/conky.cc b/src/conky.cc index 151ede1d..b48fd7c0 100644 --- a/src/conky.cc +++ b/src/conky.cc @@ -2826,6 +2826,13 @@ void set_current_config() { /* load current_config, CONFIG_FILE or SYSTEM_CONFIG_FILE */ struct stat s; + if (current_config.empty()) { + /* Try to use personal config file first */ + std::string buf = to_real_path(XDG_CONFIG_FILE); + if (stat(buf.c_str(), &s) == 0) + current_config = buf; + } + if (current_config.empty()) { /* Try to use personal config file first */ std::string buf = to_real_path(CONFIG_FILE);