10.2. 通知系统安全分类

您可以在 overlay banner 中设置包含预定义消息的通知。对于需要在登录前读取系统安全分类的部署,这非常有用。

根据您的配置,通知可以在登录屏幕中、登录后、锁定屏幕或稍后没有用户活动显示。当出现通知时,您始终可以忽略通知。

流程

  1. 安装 gnome-shell-extension-heads-up-display 软件包:

    # yum install gnome-shell-extension-heads-up-display
  2. 在以下位置之一创建 99-hud-message 文件:

    • 要在登录屏幕中配置通知,请创建 /etc/dconf/db/gdm.d/99-hud-message
    • 要在用户会话中配置通知,请创建 /etc/dconf/db/local.d/99-hud-message
  3. 在创建的文件中输入以下配置:

    [org/gnome/shell]
    enabled-extensions=['heads-up-display@gnome-shell-extensions.gcampax.github.com']
    
    [org/gnome/shell/extensions/heads-up-display]
    message-heading="Security classification title"
    message-body="Security classification description"
    # The following options control when the notification appears:
    show-when-locked=true
    show-when-unlocking=true
    show-when-unlocked=true

    将以下值替换为描述系统安全分类的文本:

    安全分类标题
    标识安全分类的简短标题。
    安全分类描述
    提供额外详情的较长消息,如引用各种指南。
    警告

    此配置会覆盖那些启用了扩展(如 启用系统安全分类横幅)的类似的配置文件。

    要启用多个扩展,在 enabled-extensions 列表中指定它们。例如:

    enabled-extensions=['heads-up-display@gnome-shell-extensions.gcampax.github.com', 'classification-banner@gnome-shell-extensions.gcampax.github.com']
  4. 更新 dconf 数据库:

    # dconf update
  5. 重启系统。

故障排除

  • 如果没有为现有用户显示通知,请以用户身份登录,并使用 Tweaks 应用程序启用 Heads-up display message 扩展。