• ubuntu/linux系统知识(30)ubuntu系统配置项dconf/gsettings


    一、背景

    在Windows操作系统中有注册表,同样在Linux中也有类似注册表的东西(对应用程序进行配置以及管理),Linux操作系统(Ubuntu已确认,其他系统未确认)中有两种配置存储系统:

    gconf,基于XML的数据库(后端系统),它有一个界面编辑器gconf-editor。主要是在基于gnome2的Linux操作系统中,比较老。
    dconf,基于BLOB的数据库(后端系统),它有一个界面编辑器dconf-editor,比较新。

    在gnome3中,gconf已经完全被dconf所替代。同时还有另外一个工具:

    gsettings,用于编辑设置存储后端的CLI工具,在Linux上它使用dconf,在Windows上它使用注册表,在OS X上它使用本机数据存储。

    二、dconf 安装和使用

    ​ 在桌面系统中,一般通过界面编辑器比较方便于配置编辑,dconf-editor不一定系统有缺省安装,如果没有的话,可以通过命令安装:

    sudo apt install dconf-tools

    sudo apt install dconf-editor

    安装后执行命令:

    dconf-editor

    即可打开界面编辑器,如:

    [外链图片转存失败,源站可能有防盗链机制,建议将图片保存下来直接上传(img-Dwqo3Ibm-1659200977024)(/home/victory/snap/typora/57/.config/Typora/typora-user-images/image-20220731004707666.png)]

    dconf以层级的形式管理配置:

    [外链图片转存失败,源站可能有防盗链机制,建议将图片保存下来直接上传(img-MBXHVIKe-1659200977026)(/home/victory/snap/typora/57/.config/Typora/typora-user-images/image-20220731004942107.png)]

    每项配置都有一些固有属性,例如类型,描述等,这个叫schema。

    [外链图片转存失败,源站可能有防盗链机制,建议将图片保存下来直接上传(img-QQRR7yRz-1659200977027)(/home/victory/snap/typora/57/.config/Typora/typora-user-images/image-20220731005318685.png)]

    三、gsettings 使用

    ​ 输入命令:gsettings -h,可以查看帮助信息,如:

    victory@victory-ThinkPad-T490:~$ gsettings
    Usage:
      gsettings --version
      gsettings [--schemadir SCHEMADIR] COMMAND [ARGS…]
    
    Commands:
      help                      Show this information
      list-schemas              List installed schemas
      list-relocatable-schemas  List relocatable schemas
      list-keys                 List keys in a schema
      list-children             List children of a schema
      list-recursively          List keys and values, recursively
      range                     Queries the range of a key
      describe                  Queries the description of a key
      get                       Get the value of a key
      set                       Set the value of a key
      reset                     Reset the value of a key
      reset-recursively         Reset all values in a given schema
      writable                  Check if a key is writable
      monitor                   Watch for changes
    
    Use “gsettings help COMMAND” to get detailed help.
    
    • 1
    • 2
    • 3
    • 4
    • 5
    • 6
    • 7
    • 8
    • 9
    • 10
    • 11
    • 12
    • 13
    • 14
    • 15
    • 16
    • 17
    • 18
    • 19
    • 20
    • 21
    • 22
  • 相关阅读:
    MMICCI2015- U-Net: Convolutional Networks for Biomedical Image Segmentation
    33.1.3 配置MySQL高可用
    Ceph分布式集群部署
    算法----删掉一个元素以后全为 1 的最长子数组
    TCP协议与UDP协议
    C++11delete与default
    搜索框的测试
    Redis过期策略及内存淘汰机制
    Linux下 man命令的使用 及 中文man手册的安装
    SpringBoot中的Environment
  • 原文地址:https://blog.csdn.net/HandsomeHong/article/details/126080222