Ein Bash -Skript zum Hinzufügen von Verknüpfungen zu ausführbaren Dateien im Linux -Betriebssystem.
Klonen Sie das Repo in Ihrem Computer oder kopieren Sie den Code in die Datei "Desktopfy.sh".
Wenn Sie global in Ihrem Computer ausführen möchten, benennen Sie die Datei um und entfernen Sie die ".sh" im Dateinamen:
mv /path/to/script/desktopfy.sh /path/to/script/desktopfyVerschieben Sie dann die neue Datei in den Binärdatum in Ihrem Computer. Empfohlen, sich in "~/.local/bin" zu bewegen:
mv /path/to/script/desktopfy ~ /.local/binZugang
Müssen Sie zunächst sehen, wie Sie auf das Skript in Ihrer Maschine zugreifen können.
1.1. Globaler Zugang
Wenn Sie den globalen Zugriff (in einem Bin Dir) konfigurieren, wie im Installations -Tutorial erläutert, rufen Sie einfach an:
desktopfy1.2. Lokaler Zugang
Um aufzurufen, gehen Sie in die Datei mit dem Skript und rufen Sie mit:
mv /path/to/script./desktopfy.shOder rufen Sie einfach mit dem absoluten Pfad an:
/path/to/script/desktopfy.shArgumente
Desktopfy benötigen 4 Positionsargumente, um zu funktionieren:
Name (-n): Der Name der Anwendungen.
Für mehrere Wort, wickeln Sie in "" "(" etwas Ding ").
Vermeiden Sie die Verwendung von Sonderzeichen, verwenden Sie nur Buchstaben ([Az] | [Az]), Zahlen ([0-9]) und Space ("").
Ausführbare Datei (-E): Der Pfad zur ausführbaren Datei.
Empfehlen Sie die Verwendung des absoluten Pfades ("/the/complete/path/to/file.appimage").
Empfehlen Sie die Verwendung von ".Appimage" -Dateien.
Wenn nur Dateiname verwendet wird, wird das Skript mit dem Arbeitsverfahren abgeschlossen.
Icon (-i): Der Weg zum Bildministerag.
Empfehlen Sie die Verwendung des absoluten Pfades ("/the/complete/path/to/image.ico").
Empfehlen Sie die Verwendung von ".ICO" -Dateien.
Wenn nur Dateiname verwendet wird, wird das Skript mit dem Arbeitsverfahren abgeschlossen.
Terminal (-t): Gibt an, ob das Terminal beim Ausführen angezeigt wird.
Nur "wahr" von "falschen" String -Argumenten sind erlaubt.
Erhöhen Sie "Fehler" jede andere Eingabe.
Die Beispiele sind ein Prozess, um eine Abkürzung für "Balenaetcher" hinzuzufügen.
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 falseNein ("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 processJa ("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)