AskOverflow.Dev

AskOverflow.Dev Logo AskOverflow.Dev Logo

AskOverflow.Dev Navigation

  • 主页
  • 系统&网络
  • Ubuntu
  • Unix
  • DBA
  • Computer
  • Coding
  • LangChain

Mobile menu

Close
  • 主页
  • 系统&网络
    • 最新
    • 热门
    • 标签
  • Ubuntu
    • 最新
    • 热门
    • 标签
  • Unix
    • 最新
    • 标签
  • DBA
    • 最新
    • 标签
  • Computer
    • 最新
    • 标签
  • Coding
    • 最新
    • 标签
主页 / unix / 问题 / 491299
Accepted
gearge
gearge
Asked: 2018-12-29 04:46:01 +0800 CST2018-12-29 04:46:01 +0800 CST 2018-12-29 04:46:01 +0800 CST

了解 .desktop 文件中的 AutostartCondition 键

  • 772

带有 GNOME 3 Shell 的 CentOS 7.x 默认在with键下提供以下*.desktop文件:/etc/xdg/autostart/AutostartCondition

# gnome-welcome-tour.desktop
[Desktop Entry]
Type=Application
Name=Welcome
Exec=/usr/libexec/gnome-welcome-tour
AutostartCondition=if-exists run-welcome-tour
OnlyShowIn=GNOME;
NoDisplay=true

和

# gnome-initial-setup-first-login.desktop
[Desktop Entry]
Name=Initial Setup
#...
Icon=preferences-system
Exec=/usr/libexec/gnome-initial-setup --existing-user
Terminal=false
Type=Application
StartupNotify=true
Categories=GNOME;GTK;System;
OnlyShowIn=GNOME;
NoDisplay=true
AutostartCondition=unless-exists gnome-initial-setup-done
#...

我的问题:

  1. 我是否正确地认为key在启动时读取文件后AutostartCondition确定 key 的值是否Exec由 GNOME 3(或其他 XDG 兼容桌面或会话管理器)执行?/etc/xdg/autostart/*.desktop
  2. 如何查询当前值AutostartCondition?

关于问题 #2:我尝试了以下失败(我已经完成了 gnome-welcome-tour 和 gnome-initial-setup 并且在登录时没有提示):

[user@user-centos-7 ~]$ gconftool-2 --recursive-list / | grep gnome-initial-setup-done
[user@user-centos-7 ~]$ gsettings list-schemas | while read -r SCHEMA; do gsettings list-recursively $SCHEMA; done | grep gnome-initial-setup-done
[user@user-centos-7 ~]$ 
[user@user-centos-7 ~]$ gconftool-2 --recursive-list / | grep run-welcome-tour
[user@user-centos-7 ~]$ gsettings list-schemas | while read -r SCHEMA; do gsettings list-recursively $SCHEMA; done | grep run-welcome-tour
[user@user-centos-7 ~]$ 
gnome gnome-shell
  • 1 1 个回答
  • 2185 Views

1 个回答

  • Voted
  1. Best Answer
    don_crissti
    2018-12-29T13:21:22+08:002018-12-29T13:21:22+08:00

    会话管理器读取.desktop所有启动应用程序的文件。如果AutostartCondition在任何这些文件中找到一个键,它会检查它的值:如果不满足条件,则从启动应用程序列表中删除该特定应用程序。自动启动条件在freedesktop邮件列表上的一篇非常古老的帖子中进行了描述:

    The Autostart-Condition Key
    
    The Autostart-Condition key gives a condition which should be tested before
    autostarting the application; if the condition is not met, then the application
    MUST NOT be autostarted. The condition can be in one of the following forms:
    
        if-exists FILE
    
            The application should only be autostarted if FILE exists
            (relative to $XDG_CONFIG_HOME).
    
        unless-exists FILE
    
            The application should only be autostarted if FILE *doesn't* exist
            (relative to $XDG_CONFIG_HOME).
    
        DESKTOP-ENVIRONMENT-NAME [DESKTOP-SPECIFIC-TEST]
    
            The application should only be autostarted under the named desktop environment
            (as with OnlyShowIn). If DESKTOP-SPECIFIC-TEST is also given, the desktop
            environment will evaluate it in some manner specific to that desktop to
            determine whether or not the application should be autostarted.
    
    
    which would end up being used like:
    
    Name=kgpg
    # start only under KDE, and only if the given kconfig key is set
    Autostart-Condition=KDE kgpgrc:User Interface:AutoStart:false
    
    Name=vino
    # start only under GNOME, and only if the given gconf key is set
    Autostart-Condition=GNOME /desktop/gnome/remote_access/enabled
    
    Name=beagled
    # start under any desktop environment, unless
    # ~/.config/beagle/disable-autostart exists
    Autostart-Condition=unless-exists beagle/disable-autostart
    

    因此,在您的特定情况下,自动启动条件是./config/run-welcome-tour存在和./config/gnome-initial-setup-done不存在。

    • 3

相关问题

  • 如何在没有真实硬件的情况下在 hidpi 支持上测试 Linux?

  • Parabola (Arch-like) - ICU 更新导致某些程序需要两个不同版本的 ICU 库。两者都无法启动。无法复制

  • Debian Stretch:libgs_plugin_systemd-updates.so 中的 gnome-software 段错误

  • 如何在拼音输入法中输入ü?

  • 在 Gnome3 中禁用窗口的自动最大化

Sidebar

Stats

  • 问题 205573
  • 回答 270741
  • 最佳答案 135370
  • 用户 68524
  • 热门
  • 回答
  • Marko Smith

    如何将 GPG 私钥和公钥导出到文件

    • 4 个回答
  • Marko Smith

    ssh 无法协商:“找不到匹配的密码”,正在拒绝 cbc

    • 4 个回答
  • Marko Smith

    我们如何运行存储在变量中的命令?

    • 5 个回答
  • Marko Smith

    如何配置 systemd-resolved 和 systemd-networkd 以使用本地 DNS 服务器来解析本地域和远程 DNS 服务器来解析远程域?

    • 3 个回答
  • Marko Smith

    如何卸载内核模块“nvidia-drm”?

    • 13 个回答
  • Marko Smith

    dist-upgrade 后 Kali Linux 中的 apt-get update 错误 [重复]

    • 2 个回答
  • Marko Smith

    如何从 systemctl 服务日志中查看最新的 x 行

    • 5 个回答
  • Marko Smith

    Nano - 跳转到文件末尾

    • 8 个回答
  • Marko Smith

    grub 错误:你需要先加载内核

    • 4 个回答
  • Marko Smith

    如何下载软件包而不是使用 apt-get 命令安装它?

    • 7 个回答
  • Martin Hope
    rocky 如何将 GPG 私钥和公钥导出到文件 2018-11-16 05:36:15 +0800 CST
  • Martin Hope
    Wong Jia Hau ssh-add 返回:“连接代理时出错:没有这样的文件或目录” 2018-08-24 23:28:13 +0800 CST
  • Martin Hope
    Evan Carroll systemctl 状态显示:“状态:降级” 2018-06-03 18:48:17 +0800 CST
  • Martin Hope
    Tim 我们如何运行存储在变量中的命令? 2018-05-21 04:46:29 +0800 CST
  • Martin Hope
    Ankur S 为什么 /dev/null 是一个文件?为什么它的功能不作为一个简单的程序来实现? 2018-04-17 07:28:04 +0800 CST
  • Martin Hope
    user3191334 如何从 systemctl 服务日志中查看最新的 x 行 2018-02-07 00:14:16 +0800 CST
  • Martin Hope
    Marko Pacak Nano - 跳转到文件末尾 2018-02-01 01:53:03 +0800 CST
  • Martin Hope
    Kidburla 为什么真假这么大? 2018-01-26 12:14:47 +0800 CST
  • Martin Hope
    Christos Baziotis 在一个巨大的(70GB)、一行、文本文件中替换字符串 2017-12-30 06:58:33 +0800 CST
  • Martin Hope
    Bagas Sanjaya 为什么 Linux 使用 LF 作为换行符? 2017-12-20 05:48:21 +0800 CST

热门标签

linux bash debian shell-script text-processing ubuntu centos shell awk ssh

Explore

  • 主页
  • 问题
    • 最新
    • 热门
  • 标签
  • 帮助

Footer

AskOverflow.Dev

关于我们

  • 关于我们
  • 联系我们

Legal Stuff

  • Privacy Policy

Language

  • Pt
  • Server
  • Unix

© 2023 AskOverflow.DEV All Rights Reserve