ubuntu 中增加鼠标右键菜单,为Windows 的exe 程序快速增加桌面快捷键

#!/bin/bash
myfile=$NAUTILUS_SCRIPT_SELECTED_FILE_PATHS
myfilename=${myfile##*/}
myfilename=${myfilename%.*}
myhome=~
linkpath=~/Desktop/${myfilename}.desktop echo [Desktop Entry] >> $linkpath
echo Name=$myfilename >> $linkpath
echo Exec=env WINEPREFIX=\"${myhome}/.wine\" wine \"$NAUTILUS_SCRIPT_SELECTED_FILE_PATHS\" >> $linkpath
echo Type=Application >> $linkpath
echo StartupNotify=true >> $linkpath
echo Icon=terminal.0 >> $linkpath
echo Comment= >> $linkpath
echo Path=${myfile%/*} >> $linkpath

进入以下位置,新建一个文件,文件名就是右键菜单名,例如:“生成Wine桌面快捷键”

~/.local/share/nautilus/scripts/

文件中加入第一段代码

done

PS: 传入变量有以下几种

https://help.ubuntu.com/community/NautilusScriptsHowto

  • NAUTILUS_SCRIPT_SELECTED_FILE_PATHS

    • newline-delimited paths for selected files (only if local)
  • NAUTILUS_SCRIPT_SELECTED_URIS

    • newline-delimited URIs for selected files
  • NAUTILUS_SCRIPT_CURRENT_URI

    • current location
  • NAUTILUS_SCRIPT_WINDOW_GEOMETRY

    • position and size of current window
上一篇:Android开发 - 获取Android设备的唯一标识码(Android 6.0或更高)


下一篇:如何唯一的标识一台Android设备?