نص Bash لإضافة اختصارات إلى ملفات قابلة للتنفيذ في Linux OS.
استنساخ الريبو في جهازك أو انسخ الرمز الموجود داخل ملف "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الحجج
تحتاج سطح المكتب 4 حجج موضعية للعمل:
الاسم (-N): اسم التطبيقات.
لكلمة متعددة ، لف داخل "" ("بعض الشيء").
تجنب استخدام الأحرف الخاصة ، واستخدم فقط الحروف ([AZ] | [AZ]) ، والأرقام ([0-9]) والفضاء ("").
قابلة للتنفيذ (-e): المسار إلى القابل للتنفيذ.
نوصي باستخدام المسار المطلق ("/the/complete/path/to/file.appimage").
نوصي باستخدام ملفات ".appimage".
إذا تم استخدام اسم الملف فقط ، فسوف يكتمل البرنامج النصي مع DIR العاملة.
أيقونة (-i): الطريق إلى صورة مصغرة الصورة.
نوصي باستخدام المسار المطلق ("/the/complete/path/to/image.ico").
نوصي باستخدام ملفات ".ico".
إذا تم استخدام اسم الملف فقط ، فسوف يكتمل البرنامج النصي مع DIR العاملة.
المحطة (-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لا ("ن"):
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نعم ("ص"):
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)