Скрипт Bash для добавления ярлыков в исполняемые файлы в ОС Linux.
Клонировать репо в вашем компьютере или скопируйте код внутри файла "desktopfy.sh".
Если захотите выполнить глобально в своей машине, переименовать файл и удалить «.sh» в имени файла:
mv /path/to/script/desktopfy.sh /path/to/script/desktopfyЗатем переместите новый файл в местоположении двоичных файлов в вашей машине. Рекомендуется перемещаться внутрь "~/.local/bin":
mv /path/to/script/desktopfy ~ /.local/binДоступ
Прежде всего, нужно увидеть, как получить доступ к сценарию на вашей машине.
1.1. Глобальный доступ
Если настроен Global Access (Inside Bin Dir), как объяснено в учебном пособии по установке, просто вызовите:
desktopfy1.2. Местный доступ
Чтобы позвонить, перейдите в файл, содержащий скрипт, и вызов, используя:
mv /path/to/script./desktopfy.shИли просто позвоните по абсолютному пути:
/path/to/script/desktopfy.shАргументы
Настольная работа нужно 4 позиционных аргумента для работы:
Имя (-n): имя приложений.
Для нескольких слов, оберните внутрь "" («кое -что»).
Избегайте использования специальных символов, используйте только буквы ([AZ] | [AZ]), числа ([0-9]) и пространство ("").
Исполняемая (-e): путь к исполняемому файлу.
Рекомендую использовать абсолютный путь ("/th/complete/path/to/file.appimage").
Рекомендую использовать файлы «.appimage».
Если используется только имя файла, сценарий завершится с рабочим директором.
Значок (-i): Путь к миниатюре изображения.
Рекомендую использовать абсолютный путь ("/th/complete/path/to/image.ico").
Рекомендую использовать файлы ".ico".
Если используется только имя файла, сценарий завершится с рабочим директором.
Терминал (-t): указывает, показал ли терминал терминал при выполнении.
Только «истина» из «ложных» строковых аргументов разрешено.
Поднимите «ошибку» любого другого ввода.
Примеры будут из процесса для добавления ярлыка для «Балена Эшер».
desktopfy -n balena -e ~ /balena_etcher/etcher/balenaEtcher-1.7.8-x64.AppImage -i ~ /balena_etcher/etcher/etcher.ico -t false Creating " balena " as balena.desktop
" balena " was created as balena.desktopdesktopfy -n " balena etcher " -e ~ /balena_etcher/etcher/balenaEtcher-1.7.8-x64.AppImage -i ~ /balena_etcher/etcher/etcher.ico -t false Creating " balena etcher " as " balena_etcher.desktop "
" balena etcher " was created as " balena_etcher.desktop "mv ~ /balena_etcher/etcherdesktopfy -n " balena etcher " -e balenaEtcher-1.7.8-x64.AppImage -i etcher.ico -t false Creating " balena etcher " as " balena_etcher.desktop "
" balena etcher " was created as " balena_etcher.desktop "desktopfy -n " BaleNa 2etcher " -e ~ /balena_etcher/etcher/balenaEtcher-1.7.8-x64.AppImage -i ~ /balena_etcher/etcher/etcher.ico -t false Creating " BaleNa 2etcher " as " balena_2etcher.desktop "
" BaleNa 2etcher " was created as " balena_2etcher.desktop "desktopfy -n " balena etcher " -e ~ /balena_etcher/etcher/balenaEtcher-1.7.8-x64.AppImage -i ~ /balena_etcher/etcher/etcher.ico -t falseНет ("n"):
Creating " balena etcher " " as balena_etch.desktop "
" balena_etch.desktop " already exists among the shortcuts, do you want to overwrite file ? [y/n]: n
Stoping processДа ("y"):
Creating " balena etcher " as " balena_etch.desktop "
" balena_etch.desktop " already exists among the shortcuts, do you want to overwrite file ? [y/n]: y
" balena etcher " was created as " balena_etcher.desktop "desktopfy -n " balena_etcher " -e ~ /balena_etcher/etcher/balenaEtcher-1.7.8-x64.AppImage -i ~ /balena_etcher/etcher/etcher.ico -t invalidArgumentError: Invalid name " balena_etcher "
Usage: desktopfy [-n < programm_name > ] [-e < executable_path > ] [-i < icon_path > ] [-t < true | false > ]
-n Name of the program, for multiple words need to start and end with " " (ex. " some thing " )
(Avoid the use of special characters as * , / or others similar)
-e Path to the .AppImage, .bin or executable file gonna be used for execution
(If only name is provided, the current dir gonna be used as parent)
-i Path to the .ico, .png or other image file that gonna be used for icon
(If only name is provided, the current dir gonna be used as parent)
-t Declare if the terminal it ' s gonna be showed when executing the program
(Only "true" or "false" arguments are accepted)desktopfy -n " balena etcher " -e ~ /balena_etcher/etcher/falseBalena.AppImage -i ~ /balena_etcher/etcher/etcher.ico -t false Error: " ~/balena_etcher/etcher/falseBalena.AppImage " doesn ' t exist
Usage: desktopfy [-n <programm_name>] [-e <executable_path>] [-i <icon_path>] [-t <true|false>]
-n Name of the program, for multiple words need to start and end with "" (ex. "some thing")
(Avoid the use of special characters as *, / or others similar)
-e Path to the .AppImage, .bin or executable file gonna be used for execution
(If only name is provided, the current dir gonna be used as parent)
-i Path to the .ico, .png or other image file that gonna be used for icon
(If only name is provided, the current dir gonna be used as parent)
-t Declare if the terminal it ' s gonna be showed when executing the program
(Only " true " or " false " arguments are accepted)desktopfy -n " balena etcher " -e ~ /balena_etcher/etcher/balenaEtcher-1.7.8-x64.AppImage -i ~ /balena_etcher/etcher/falseEtcher.ico -t false Error: " ~/balena_etcher/etcher/falseEtcher.ico " doesn ' t exist
Usage: desktopfy [-n <programm_name>] [-e <executable_path>] [-i <icon_path>] [-t <true|false>]
-n Name of the program, for multiple words need to start and end with "" (ex. "some thing")
(Avoid the use of special characters as *, / or others similar)
-e Path to the .AppImage, .bin or executable file gonna be used for execution
(If only name is provided, the current dir gonna be used as parent)
-i Path to the .ico, .png or other image file that gonna be used for icon
(If only name is provided, the current dir gonna be used as parent)
-t Declare if the terminal it ' s gonna be showed when executing the program
(Only " true " or " false " arguments are accepted)desktopfy -n " balena etcher " -e ~ /balena_etcher/etcher/balenaEtcher-1.7.8-x64.AppImage -i ~ /balena_etcher/etcher/etcher.ico -t invalidArgumentError: " invalidArgument " isn ' t a valid argument for -t
Usage: desktopfy [-n <programm_name>] [-e <executable_path>] [-i <icon_path>] [-t <true|false>]
-n Name of the program, for multiple words need to start and end with "" (ex. "some thing")
(Avoid the use of special characters as *, / or others similar)
-e Path to the .AppImage, .bin or executable file gonna be used for execution
(If only name is provided, the current dir gonna be used as parent)
-i Path to the .ico, .png or other image file that gonna be used for icon
(If only name is provided, the current dir gonna be used as parent)
-t Declare if the terminal it ' s gonna be showed when executing the program
(Only " true " or " false " arguments are accepted)