Linux OSの実行可能ファイルにショートカットを追加するBASHスクリプト。
マシンのレポをクローンするか、「desktopfy.sh」ファイル内のコードをコピーします。
マシンでグローバルに実行する場合は、ファイルの名前を変更し、ファイル名で「.sh」を削除します。
mv /path/to/script/desktopfy.sh /path/to/script/desktopfy次に、マシン内のバイナリの場所内に新しいファイルを移動します。 「〜/.local/bin」内に移動することをお勧めします:
mv /path/to/script/desktopfy ~ /.local/binアクセス
まず、マシン内のスクリプトにアクセスする方法を確認する必要があります。
1.1。グローバルアクセス
インストールチュートリアルで説明されているように、グローバルアクセスを構成した場合(ビン監督内)、次のように電話してください。
desktopfy1.2。ローカルアクセス
呼び出すには、スクリプトを含むファイル内を移動し、以下を呼び出します。
mv /path/to/script./desktopfy.shまたは、絶対パスを使用して電話するだけです。
/path/to/script/desktopfy.sh議論
desktopfyは、動作するために4つの位置的議論が必要です。
名前(-n):アプリケーションの名前。
複数の単語の場合、内部に巻き付けます ""( "some thing")。
特殊文字の使用を避け、文字([az] | [az])、数字([0-9])、スペース( "")のみを使用します。
実行可能ファイル(-e):実行可能ファイルへのパス。
絶対パスの使用をお勧めします( "/the/complete/path/to/file.appimage")。
「.Appimage」ファイルの使用をお勧めします。
ファイル名のみが使用されている場合、スクリプトは作業監督を完了します。
アイコン(-i):画像サムネイルへのパス。
絶対パスの使用をお勧めします( "/the/complete/path/to/image.ico")。
「.ico」ファイルの使用をお勧めします。
ファイル名のみが使用されている場合、スクリプトは作業監督を完了します。
ターミナル(-t):実行時に端子が表示されたかどうかを示します。
「false」文字列引数の「真」のみが許可されています。
他の入力を「エラー」します。
例は、「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 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)