码农知识堂 - 1000bd
  •   Python
  •   PHP
  •   JS/TS
  •   JAVA
  •   C/C++
  •   C#
  •   GO
  •   Kotlin
  •   Swift
  • GSettings/gsettings/dconf/dconf-editor介绍及使用


    本文主要介绍gnome相关工具使用。环境是SUSE Linux Enterprise 15 SP4, gnome版本号: Gnome Shell 41.4
    参考文档: https://wiki.gnome.org/HowDoI/GSettings
    https://segmentfault.com/a/1190000019968756
    https://help.gnome.org/admin/system-admin-guide/stable/index.html.en

    1. GSettings

    GSettings is a high-level API for application settings, front end for dconf.
    配置文件:
    GSettings 的配置文件是 xml 格式的,文件需以 .gschema.xml 结尾,文件名通常与 id 相同。配置文件安装在 /usr/share/glib-2.0/schemas/ 目录下,手动添加进去的文件需要执行 sudo glib-complie-schemas /usr/share/glib-2.0/schemas 让其生效。

    2. gsettings command

    The gsettings command-line tool is used to view and change user settings.
    通俗来讲,dconf/user是GNOME的注册表,gsettings是一个查询、读取、设置注册表键值的命令行工具。gnome 桌面环境的外观配置数据是使用 gsettings 来存储,所以可以通过 gsettings 来设置和读取。gsettings 相比设置界面(如dconf-editor)就是可以设置到更多的选项,设置的值更加精确。
    gsettings命令的参数如下,比较常用的是 gsettings list-recursively | grep xx 用于查找包含关键字xx的key和value。gsettings set/get 用于设置、读取指定key的值。:
    在这里插入图片描述

    例如,查找和home相关的键值:在这里插入图片描述
    获取桌面图标主题,字体名称:
    在这里插入图片描述

    3. dconf 文件 (namely, ~/.config/config/user)

    dconf is a key-based configuration system which manages user settings. It is the back end for GSettings used in Red Hat Enterprise Linux 7. dconf manages a range of different settings, including GDM, application, and proxy settings.
    dconf 使用 gvdb(GVariant Database file) 格式的二进制文件存储数据,它是一个简单的数据库,以路径映射的方式存储 key ,检索高效。默认的文件路径为: ~/.config/dconf/user
    dconf/user文件存储着GNOME的配置,包括通过gsettings对当前用户的设置,以及gnome extension的设置等, 是个二进制文件,不能打开查看。

    4. dconf command

    The dconf command-line utility is used for reading and writing individual values or entire directories from and to a dconf database.
    比如,读取桌面背景图:可以使用dconf read 命令,设置桌面背景图,可以使用dconf set命令。
    在这里插入图片描述

    5. dconf-editor

    gconf-editor is the graphic editor for dconf key-based configuration system.
    如果系统中没有gconf-editor tool,需要通过yast安装。安装完成之后用命令打开,gconf-editor是以目录的形式展示。
    在这里插入图片描述

    6. how to read the ~/.config/dconf/user file

    cd
    cp ~/.config/dconf/user ~/.config/dconf/test
    printf %s\n “user-db:test” > db_profile
    DCONF_PROFILE=~/db_profile dconf dump / > old_settings

  • 相关阅读:
    提升运营效率:仓储可视化的实时监控与优化
    SpringCloud学习笔记 - 服务熔断、服务降级 - Hystrix断路器
    DAC测试实验——FPGA学习笔记7
    java毕业生设计大学生网络创业就业管理系统计算机源码+系统+mysql+调试部署+lw
    第1章丨IRIS Globals 简介
    【Flutter】初识Flutter项目之使用Android Studio创建第一个Flutter项目(详细步骤)
    【网络通信】websocket如何断线重连
    Windows连接Samba服务时报“找不到网络名”
    docker freeswitch mysql驱动相关
    Redis(12)Bitmap
  • 原文地址:https://blog.csdn.net/tongyi04/article/details/127672241
  • 最新文章
  • 攻防演习之三天拿下官网站群
    数据安全治理学习——前期安全规划和安全管理体系建设
    企业安全 | 企业内一次钓鱼演练准备过程
    内网渗透测试 | Kerberos协议及其部分攻击手法
    0day的产生 | 不懂代码的"代码审计"
    安装scrcpy-client模块av模块异常,环境问题解决方案
    leetcode hot100【LeetCode 279. 完全平方数】java实现
    OpenWrt下安装Mosquitto
    AnatoMask论文汇总
    【AI日记】24.11.01 LangChain、openai api和github copilot
  • 热门文章
  • 十款代码表白小特效 一个比一个浪漫 赶紧收藏起来吧!!!
    奉劝各位学弟学妹们,该打造你的技术影响力了!
    五年了,我在 CSDN 的两个一百万。
    Java俄罗斯方块,老程序员花了一个周末,连接中学年代!
    面试官都震惊,你这网络基础可以啊!
    你真的会用百度吗?我不信 — 那些不为人知的搜索引擎语法
    心情不好的时候,用 Python 画棵樱花树送给自己吧
    通宵一晚做出来的一款类似CS的第一人称射击游戏Demo!原来做游戏也不是很难,连憨憨学妹都学会了!
    13 万字 C 语言从入门到精通保姆级教程2021 年版
    10行代码集2000张美女图,Python爬虫120例,再上征途
Copyright © 2022 侵权请联系2656653265@qq.com    京ICP备2022015340号-1
正则表达式工具 cron表达式工具 密码生成工具

京公网安备 11010502049817号