Um script bash para adicionar atalhos aos arquivos executáveis no sistema operacional Linux.
Clone o repo em sua máquina ou copie o código dentro do arquivo "Desktopfy.sh".
Se quiser executar globalmente em sua máquina, renomeie o arquivo e remova o ".sh" no nome do arquivo:
mv /path/to/script/desktopfy.sh /path/to/script/desktopfyEm seguida, mova o novo arquivo dentro do local dos binários em sua máquina. Recomendado para se mover para dentro "~/.local/bin":
mv /path/to/script/desktopfy ~ /.local/binAcesso
Primeiro de tudo, precisa ver como acessar o script em sua máquina.
1.1. Acesso global
Se configurado o acesso global (dentro de um bin dir), conforme explicado no tutorial de instalação, basta ligar:
desktopfy1.2. Acesso local
Para ligar, mova -se dentro do arquivo que contém o script e ligue usando:
mv /path/to/script./desktopfy.shOu apenas ligar usando o caminho absoluto:
/path/to/script/desktopfy.shArgumentos
Desktopfy Precisa de 4 argumentos posicionais para funcionar:
Nome (-n): o nome dos aplicativos.
Para várias palavras, envolva -se dentro de "" ("alguma coisa").
Evite o uso de caracteres especiais, use apenas letras ([AZ] | [AZ]), números ([0-9]) e espaço ("").
Executável (-e): o caminho para o executável.
Recomende o uso do caminho absoluto ("/the/complete/path/to/file.appimage").
Recomende o uso de arquivos ".Appimage".
Se apenas o nome do arquivo for usado, o script será concluído com o diretor que trabalha.
Ícone (-i): O caminho para a miniatura da imagem.
Recomende o uso do caminho absoluto ("/the/complete/path/to/image.ico").
Recomende o uso de arquivos ".ico".
Se apenas o nome do arquivo for usado, o script será concluído com o diretor que trabalha.
Terminal (-t): indica se o terminal mostrou ao executar.
Apenas "verdadeiro" de "falsos" argumentos de string são permitidos.
Levante "erro" de qualquer outra entrada.
Os exemplos terão um processo para adicionar um atalho para "Balena Etcher".
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 falseNão ("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 processSim ("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)