Un script bash pour ajouter des raccourcis aux fichiers exécutables dans Linux OS.
Clone le dépôt dans votre machine ou copiez le code dans le fichier "Desktopfy.sh".
Si vous souhaitez exécuter globalement dans votre machine, renommez le fichier et supprimez le ".sh" dans le nom de fichier:
mv /path/to/script/desktopfy.sh /path/to/script/desktopfyEnsuite, déplacez le nouveau fichier à l'intérieur de l'emplacement des binaires dans votre machine. Recommandé de se déplacer à l'intérieur "~ / .local / bin":
mv /path/to/script/desktopfy ~ /.local/binAccéder
Tout d'abord, il faut voir comment accéder au script dans votre machine.
1.1. Accès global
Si l'accès global configuré (à l'intérieur d'un bin dir) comme expliqué dans le tutoriel d'installation, alors appelez simplement:
desktopfy1.2. Accès local
Pour appeler, déplacez-vous à l'intérieur du fichier contenant le script et appelez en utilisant:
mv /path/to/script./desktopfy.shOu appelez simplement en utilisant le chemin absolu:
/path/to/script/desktopfy.shArguments
Desktopfy a besoin de 4 arguments de position pour fonctionner:
Nom (-n): le nom des applications.
Pour plusieurs mots, enveloppez à l'intérieur "" ("quelque chose").
Évitez l'utilisation de caractères spéciaux, utilisez uniquement des lettres ([az] | [az]), des nombres ([0-9]) et de l'espace ("").
Executable (-e): le chemin d'accès à l'exécutable.
Recommande l'utilisation du chemin absolu ("/the/compte/path/to/file.appimage").
Recommandez l'utilisation des fichiers ".AppIMage".
Si seul le nom de fichier est utilisé, le script va terminer avec le Dir de travail.
Icône (-i): le chemin vers la vignette de l'image.
Recommande l'utilisation du chemin absolu ("/the/compte/path/to/image.ico").
Recommander l'utilisation des fichiers ".ico".
Si seul le nom de fichier est utilisé, le script va terminer avec le Dir de travail.
Terminal (-T): indique si le terminal a montré lors de l'exécution.
Seuls les arguments "vrai" des "false" de chaîne sont autorisés.
Richer "Erreur" toute autre entrée.
Les exemples seront d'un processus pour ajouter un raccourci pour "Balena graveur".
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 falseNon ("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 processOui ("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)