สคริปต์ทุบตีเพื่อเพิ่มทางลัดในไฟล์ที่เรียกใช้งานได้ใน Linux OS
โคลน repo ในเครื่องของคุณหรือคัดลอกรหัสภายในไฟล์ "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): ชื่อของแอปพลิเคชัน
สำหรับหลายคำให้ห่อไว้ข้างใน "" ("บางสิ่ง")
หลีกเลี่ยงการใช้อักขระพิเศษใช้ตัวอักษรเท่านั้น ([AZ] | [AZ]), ตัวเลข ([0-9]) และพื้นที่ ("")
ปฏิบัติการ (-e): เส้นทางไปยังปฏิบัติการ
แนะนำการใช้เส้นทางสัมบูรณ์ ("//complete/path/to/file.appimage")
แนะนำการใช้ไฟล์ ".AppImage"
หากมีการใช้ชื่อไฟล์เท่านั้นสคริปต์จะสมบูรณ์ด้วย DIR ที่ใช้งานได้
ไอคอน (-i): เส้นทางไปยังรูปขนาดย่อของภาพ
แนะนำการใช้เส้นทางสัมบูรณ์ ("//complete/path/to/image.ico")
แนะนำการใช้ไฟล์ ".ico"
หากมีการใช้ชื่อไฟล์เท่านั้นสคริปต์จะสมบูรณ์ด้วย DIR ที่ใช้งานได้
เทอร์มินัล (-t): ระบุว่าเทอร์มินัลแสดงเมื่อดำเนินการ
อนุญาตให้ใช้ข้อโต้แย้งสตริง "true" ของ "เท็จ" เท่านั้น
เพิ่ม "ข้อผิดพลาด" อินพุตอื่น ๆ
ตัวอย่างจะเป็นกระบวนการในการเพิ่มทางลัดสำหรับ "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)