使用配置文件而不是命令行参数配置 gnome-terminal

发布于 2024-10-26 04:32:49 字数 178 浏览 0 评论 0原文

我在 gnome-terminal 帮助文档中发现了一个非常酷的列表,其中列出了您可以在文件中配置的内容,但绝对没有关于 conf 文件中的变量是什么的文档。我已经用谷歌搜索了很多,但没有找到任何有用的东西。有人可以给我指出一些东西,甚至列出实际的命令吗?或者也许出来坐在我的办公桌前并配对。今天早上我的谷歌搜索失败了。

谢谢

I've found in the gnome-terminal help documentation a really cool list of things you can configure in a file but absolutely no documentation of what the variables in the conf file are. I've googled a bunch for this and haven't found anything useful. Can someone point me to something or even list the actual commands. Or maybe come out and sit here at my desk and pair on it. My google-fu has failed me this morning.

thanks

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(3

巴黎盛开的樱花 2024-11-02 04:32:49

此后,GNOME 终端改变了其存储配置的方式;它现在使用 dconf,至少从 gnome-terminal 3.28.2 开始。

您可以使用以下方式查询 dconf 数据库中可用配置文件的 UUID:

gsettings get org.gnome.Terminal.ProfilesList list

示例输出:

['b1dcc9dd-5262-4d8d-a863-c897e6d979b9']

您可以查看所有每个配置文件的可配置设置(在 dconf 中称为“键”)及其当前值使用:

gsettings list-recursively "org.gnome.Terminal.Legacy.Profile:/org/gnome/terminal/legacy/profiles:/:b1dcc9dd-5262-4d8d-a863-c897e6d979b9/"

示例输出:(

org.gnome.Terminal.Legacy.Profile audible-bell false
org.gnome.Terminal.Legacy.Profile cursor-shape 'block'
org.gnome.Terminal.Legacy.Profile cursor-colors-set true
org.gnome.Terminal.Legacy.Profile scroll-on-keystroke true
org.gnome.Terminal.Legacy.Profile cjk-utf8-ambiguous-width 'narrow'
org.gnome.Terminal.Legacy.Profile default-size-rows 24
org.gnome.Terminal.Legacy.Profile encoding 'UTF-8'
org.gnome.Terminal.Legacy.Profile use-theme-colors false
org.gnome.Terminal.Legacy.Profile custom-command ''
org.gnome.Terminal.Legacy.Profile visible-name 'Unnamed'
org.gnome.Terminal.Legacy.Profile text-blink-mode 'always'

... lots more ...

提示:如果您通过管道进行排序,则可以按字母顺序按字母顺序排序,因此将命令修改为 gsettings list-recursively“org.gnome..... ." | sort -k2)

要设置密钥(例如 audible-bell),请使用:

gsettings set \
    "org.gnome.Terminal.Legacy.Profile:/org/gnome/terminal/legacy/profiles:/:b1dcc9dd-5262-4d8d-a863-c897e6d979b9/" \
    "audible-bell" \
    false

查看 此脚本位于我的 GitHub dotfiles 存储库中作为实际示例。在该脚本中,我创建自己的配置文件(如果尚不存在),将该配置文件设置为默认配置文件,然后配置该配置文件的密钥以及适用于所有配置文件的一些全局密钥。

GNOME Terminal has since changed how it stores its configuration; it now uses dconf, at least as of gnome-terminal 3.28.2.

You can query the dconf database for the UUIDs of available Profiles using:

gsettings get org.gnome.Terminal.ProfilesList list

Example output:

['b1dcc9dd-5262-4d8d-a863-c897e6d979b9']

You can view all per-Profile configurable settings (called "keys" in dconf) and their current values using:

gsettings list-recursively "org.gnome.Terminal.Legacy.Profile:/org/gnome/terminal/legacy/profiles:/:b1dcc9dd-5262-4d8d-a863-c897e6d979b9/"

Example output:

org.gnome.Terminal.Legacy.Profile audible-bell false
org.gnome.Terminal.Legacy.Profile cursor-shape 'block'
org.gnome.Terminal.Legacy.Profile cursor-colors-set true
org.gnome.Terminal.Legacy.Profile scroll-on-keystroke true
org.gnome.Terminal.Legacy.Profile cjk-utf8-ambiguous-width 'narrow'
org.gnome.Terminal.Legacy.Profile default-size-rows 24
org.gnome.Terminal.Legacy.Profile encoding 'UTF-8'
org.gnome.Terminal.Legacy.Profile use-theme-colors false
org.gnome.Terminal.Legacy.Profile custom-command ''
org.gnome.Terminal.Legacy.Profile visible-name 'Unnamed'
org.gnome.Terminal.Legacy.Profile text-blink-mode 'always'

... lots more ...

(tip: you can sort alphabetically by key if you pipe to sort, so modify your command to gsettings list-recursively "org.gnome......" | sort -k2)

To set a key (e.g. audible-bell), use:

gsettings set \
    "org.gnome.Terminal.Legacy.Profile:/org/gnome/terminal/legacy/profiles:/:b1dcc9dd-5262-4d8d-a863-c897e6d979b9/" \
    "audible-bell" \
    false

Check out this script in my GitHub dotfiles repo for a practical example. In that script, I create a Profile of my own (if it does not already exist), set that Profile as the default, then configure the keys for that Profile as well as some global keys that apply to all profiles.

静待花开 2024-11-02 04:32:49

此外,gconf-editor 将 gnome-terminal 的配置存储在 ~/.gconf/apps/gnome-terminal 中

Also, gconf-editor stores it's configurations for gnome-terminal in ~/.gconf/apps/gnome-terminal

夜无邪 2024-11-02 04:32:49

您不只是在谈论使用 gconf-editor (通常来自系统菜单),是吗?

实际上,gconf-editor 需要从我的 Ubuntu 系统上的终端启动,但是 gnome-terminal 下有一堆设置。

You're not just talking about using gconf-editor (from the System menu usually) are you?

Actually, gconf-editor needs to be started from a terminal on my Ubuntu system here, but there are a bunch of settings under gnome-terminal there.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文