【问题标题】:Nautilus script not showing up in right click menu when nothing is selected未选择任何内容时,Nautilus 脚本未显示在右键菜单中
【发布时间】:2021-03-17 11:40:39
【问题描述】:

我有以下脚本可以在 Nautilus 的右键菜单中添加一个操作(使用 Ubuntu 20.04):

~/.local/share/nautilus/scripts/Open with Disk Usage Analyzer:

#!/usr/bin/env bash
if [ -n "$NAUTILUS_SCRIPT_SELECTED_URIS" ]; then
    set $NAUTILUS_SCRIPT_SELECTED_URIS
    if [ $# -eq 1 ]; then
        destination="$1"
        if [ ! -d "$destination" ]; then
            destination="$(dirname "$destination")"
        fi
    else
        zenity --error --title="Error - Open with Disk Usage Analyzer" --text="You can only select one directory."
        exit 1
    fi
else
    destination="$NAUTILUS_SCRIPT_CURRENT_URI"
fi

baobab "$destination"

选择文件夹(或文件)时,脚本会正确显示在右键菜单中:

但是,如果没有选择文件或文件夹,则 Scripts 条目根本不会出现在右键菜单中:

无论是否做出选择,如何让脚本条目出现在右键菜单中?

【问题讨论】:

标签: ubuntu-20.04 nautilus


【解决方案1】:

Nautilus 一直都是这样,我用的是 Pcman-FM,2009 年迁移到 Nautilus,一直都是这样,可惜你必须选择一个文件夹才能拥有脚本。最好使用fff或ranger :)

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多