应用程序的用户配置文件夹放在~/.config文件夹的原则在Linux界里是大势吗?

93 views
Skip to first unread message

tyrant acg

unread,
Apr 27, 2013, 1:13:45 AM4/27/13
to sh...@googlegroups.com
我注意到有不少应用程序支持在~/.config文件夹里读取配置,并且按应用程序名称进行文件夹各自的归档,例如i3的配置放在~/.config/i3/文件夹,fcixt配置放在~/.config/fcitx文件夹等等。我挺喜欢这设定的,因为起到了对用户专用配置文件的集中作用,也好用Git进行全面备份。

不过我还不清楚Linux界是否认可这为国际惯例,毕竟有些应用程序的配置文件还是放在别的地方,例如git的用户配置文件是~/.gitconfig,而并非是在~/.config的专用文件夹。

Tualatrix Chou

unread,
Apr 27, 2013, 1:23:30 AM4/27/13
to sh...@googlegroups.com
这是XDG的标准规范,主要是给桌面软件来参考实现用的,是Linux图形桌面的推荐标准。


比如如果你用C实现一个应用程序,GLib有这样的一个函数 g_get_user_config_dir () :https://developer.gnome.org/glib/2.34/glib-Miscellaneous-Utility-Functions.html#g-get-user-config-dir  用它会直接返回~/.config (如果默认配置是这个的话)。

命令行程序一般不按这个标准来的。


2013/4/27 tyrant acg <acgt...@gmail.com>
我注意到有不少应用程序支持在~/.config文件夹里读取配置,并且按应用程序名称进行文件夹各自的归档,例如i3的配置放在~/.config/i3/文件夹,fcixt配置放在~/.config/fcitx文件夹等等。我挺喜欢这设定的,因为起到了对用户专用配置文件的集中作用,也好用Git进行全面备份。

不过我还不清楚Linux界是否认可这为国际惯例,毕竟有些应用程序的配置文件还是放在别的地方,例如git的用户配置文件是~/.gitconfig,而并非是在~/.config的专用文件夹。

--
-- You received this message because you are subscribed to the Google Groups Shanghai Linux User Group group. To post to this group, send email to sh...@googlegroups.com. To unsubscribe from this group, send email to shlug+un...@googlegroups.com. For more options, visit this group at https://groups.google.com/d/forum/shlug?hl=zh-CN
---
您收到此邮件是因为您订阅了 Google 网上论坛的“Shanghai Linux User Group”论坛。
要退订此论坛并停止接收此论坛的电子邮件,请发送电子邮件到 shlug+un...@googlegroups.com
要查看更多选项,请访问 https://groups.google.com/groups/opt_out。
 
 



--
Tualatrix Chou
http://imtx.me

tyrant acg

unread,
Apr 27, 2013, 1:26:29 AM4/27/13
to sh...@googlegroups.com
原来如此,那么命令行程序也有类似的标准规范吗?


2013/4/27 Tualatrix Chou <tual...@gmail.com>
您收到此邮件是因为您订阅了 Google 网上论坛“Shanghai Linux User Group”中的主题。
要退订此主题,请访问 https://groups.google.com/d/topic/shlug/YYGA2iOZT6c/unsubscribe?hl=zh-CN。
要退订此论坛及其所有主题,请发送电子邮件到 shlug+un...@googlegroups.com
要查看更多选项,请访问 https://groups.google.com/groups/opt_out。
 
 



--
Best wishes,

Tualatrix Chou

unread,
Apr 27, 2013, 1:50:34 AM4/27/13
to sh...@googlegroups.com
命令行程序就是那个潜规则吧,配置文件要以「.」开头放在Home下。

tyrant acg

unread,
Apr 27, 2013, 1:54:49 AM4/27/13
to sh...@googlegroups.com
还真有点棘手啊,看来要花时间研究怎么用Git备份,此外第一次得到主席热心的解答,很开心。

On 4/27/13, Tualatrix Chou <tual...@gmail.com> wrote:
> 命令行程序就是那个潜规则吧,配置文件要以「.」开头放在Home下。

Tualatrix Chou

unread,
Apr 27, 2013, 2:35:11 AM4/27/13
to sh...@googlegroups.com
呃…潜了这么久水好不容易看到一个我可以回答的,哈哈 :)


2013/4/27 tyrant acg <acgt...@gmail.com>
您收到此邮件是因为您订阅了 Google 网上论坛的“Shanghai Linux User Group”论坛。
要退订此论坛并停止接收此论坛的电子邮件,请发送电子邮件到 shlug+un...@googlegroups.com
要查看更多选项,请访问 https://groups.google.com/groups/opt_out





--
Tualatrix Chou
http://imtx.me

Xidorn Quan

unread,
Apr 27, 2013, 2:56:50 AM4/27/13
to sh...@googlegroups.com
我现在是把配置文件都统一放到一个文件夹里面,然后用符号链链到 home 里


2013/4/27 tyrant acg <acgt...@gmail.com>
您收到此邮件是因为您订阅了 Google 网上论坛的“Shanghai Linux User Group”论坛。
要退订此论坛并停止接收此论坛的电子邮件,请发送电子邮件到 shlug+un...@googlegroups.com
要查看更多选项,请访问 https://groups.google.com/groups/opt_out





--
Xidorn Quan
GnuPG fingerprint: 6F1E DF9A D250 7505 63E2  345E 7570 8D3F 7C9A 1209

Easior Lars

unread,
Apr 27, 2013, 6:24:01 AM4/27/13
to sh...@googlegroups.com
我想知道潜规则有没有不叫明确的文字表述或解释?
 


From: Tualatrix Chou <tual...@gmail.com>
To: "sh...@googlegroups.com" <sh...@googlegroups.com>
Sent: Saturday, April 27, 2013 1:50 PM
Subject: Re: [shlug] 应用程序的用户配置文件夹放在~/.config文件夹的原则在Linux界里是大势吗?

命令行程序就是那个潜规则吧,配置文件要以「.」开头放在Home下。

Zhenbo Li

unread,
Apr 27, 2013, 9:24:07 AM4/27/13
to sh...@googlegroups.com

在 2013年4月27日下午2:56,Xidorn Quan <quanx...@gmail.com>写道:
我现在是把配置文件都统一放到一个文件夹里面,然后用符号链链到 home 里

我觉得这个方法很不错。
还有就是,有必要用git来管理吗?我觉得随便注册个网盘就可以了吧


--
Have a nice day!
Zhenbo Li

Yummy Chen

unread,
Mar 4, 2020, 10:11:07 PM3/4/20
to Shanghai Linux User Group
请问一下这个怎样实现呢?

在 2013年4月27日星期六 UTC+8下午2:56:50,Xidorn Quan写道:
我现在是把配置文件都统一放到一个文件夹里面,然后用符号链链到 home 里


2013/4/27 tyrant acg <acgt...@gmail.com>
还真有点棘手啊,看来要花时间研究怎么用Git备份,此外第一次得到主席热心的解答,很开心。

On 4/27/13, Tualatrix Chou <tual...@gmail.com> wrote:
> 命令行程序就是那个潜规则吧,配置文件要以「.」开头放在Home下。
>
> --
> -- You received this message because you are subscribed to the Google Groups
> Shanghai Linux User Group group. To post to this group, send email to
> sh...@googlegroups.com. To unsubscribe from this group, send email to
> sh...@googlegroups.com. For more options, visit this group at
> https://groups.google.com/d/forum/shlug?hl=zh-CN
> ---
> 您收到此邮件是因为您订阅了 Google 网上论坛“Shanghai Linux User Group”中的主题。
> 要退订此主题,请访问
> https://groups.google.com/d/topic/shlug/YYGA2iOZT6c/unsubscribe?hl=zh-CN
> 要退订此论坛及其所有主题,请发送电子邮件到 sh...@googlegroups.com

> 要查看更多选项,请访问 https://groups.google.com/groups/opt_out
>
>
>


--
Best wishes,

--
-- You received this message because you are subscribed to the Google Groups Shanghai Linux User Group group. To post to this group, send email to sh...@googlegroups.com. To unsubscribe from this group, send email to sh...@googlegroups.com. For more options, visit this group at https://groups.google.com/d/forum/shlug?hl=zh-CN

---
您收到此邮件是因为您订阅了 Google 网上论坛的“Shanghai Linux User Group”论坛。
要退订此论坛并停止接收此论坛的电子邮件,请发送电子邮件到 sh...@googlegroups.com
要查看更多选项,请访问 https://groups.google.com/groups/opt_out


Chenjun Shen

unread,
Mar 5, 2020, 11:00:45 AM3/5/20
to sh...@googlegroups.com
Linux下软链接?

-- You received this message because you are subscribed to the Google Groups Shanghai Linux User Group group. To post to this group, send email to sh...@googlegroups.com. To unsubscribe from this group, send email to shlug+un...@googlegroups.com. For more options, visit this group at https://groups.google.com/d/forum/shlug?hl=zh-CN
---
您收到此邮件是因为您订阅了Google网上论坛上的“Shanghai Linux User Group”群组。
要退订此群组并停止接收此群组的电子邮件,请发送电子邮件到shlug+un...@googlegroups.com
要在网络上查看此讨论,请访问https://groups.google.com/d/msgid/shlug/61990a20-63e1-42d2-9664-1ffc63661a99%40googlegroups.com

Plain_Text

unread,
Mar 5, 2020, 6:17:21 PM3/5/20
to Shanghai Linux User Group


2020-02-29(Saturday) 21:55:06 -0800, Yummy Chen <chen...@gmail.com>:


> 请问一下这个怎样实现呢?
>
> 在 2013年4月27日星期六 UTC+8下午2:56:50,Xidorn Quan写道:
> >
> > 我现在是把配置文件都统一放到一个文件夹里面,然后用符号链链到 home 里





推荐您看一下这篇:

Using GNU Stow to manage your dotfiles
http://brandon.invergo.net/news/2012-05-26-using-gnu-stow-to-manage-your-dotfiles.html

这是一个非常不错的思路。






Reply all
Reply to author
Forward
0 new messages