]> git.mar77i.info Git - zenbook_gui/commitdiff
fix create_desktop_file.sh. add create_desktop_files.sh master
authormar77i <mar77i@protonmail.ch>
Mon, 22 Sep 2025 18:03:25 +0000 (20:03 +0200)
committermar77i <mar77i@protonmail.ch>
Mon, 22 Sep 2025 18:03:25 +0000 (20:03 +0200)
create_desktop_file.sh
create_desktop_files.sh [new file with mode: 0755]

index c749c436015fadabf6556ccc931daa30b1a12911..b64340e15491b919aa01fd211919588eef33f192 100755 (executable)
@@ -1,17 +1,16 @@
 #!/usr/bin/env bash
 
 #!/usr/bin/env bash
 
-script_dir="$(realpath -Pe "$(dirname "${0}")")"
-executable="${script_dir}/zenbook_conf.py"
-icon="${script_dir}/laptop-single.svg"
-name="Zenbook Duo Settings"
+executable=""
+icon=""
+name=""
 
 help() {
 
 help() {
-    echo " ${0} [--executable PATH] [--icon PATH] [--virtual-env PATH] | -h|--help"
+    echo " ${0} --executable PATH --icon PATH --name NAME | -h|--help"
     echo "Create a desktop launcher for zenbook_conf.py"
     echo "  --executable PATH   specify the executable"
     echo "  --icon PATH         specify the icon"
     echo "  --name NAME         specify the name"
     echo "Create a desktop launcher for zenbook_conf.py"
     echo "  --executable PATH   specify the executable"
     echo "  --icon PATH         specify the icon"
     echo "  --name NAME         specify the name"
-    echo "  -h | --help        show this help message"
+    echo "  -h|--help        show this help message"
     exit 0
 }
 
     exit 0
 }
 
@@ -46,10 +45,21 @@ if (( help )); then
     help
     exit 0
 fi
     help
     exit 0
 fi
+if [[ -z "${executable}" ]]; then
+    echo "Error: missing executable." >&2
+    exit 1
+fi
+if [[ -z "${icon}" ]]; then
+    echo "Error: missing icon." >&2
+    exit 1
+fi
+if [[ -z "${name}" ]]; then
+    echo "Error: missing name." >&2
+    exit 1
+fi
 
 echo "[Desktop Entry]"
 echo "Type=Application"
 
 echo "[Desktop Entry]"
 echo "Type=Application"
-echo "Exec=$(realpath -Pe "${executable}")"
-echo "Icon=${icon}"
-echo ""
+echo "Exec=${executable}"
+echo "Icon=${icon}"$'\n'
 echo "Name=${name}"
 echo "Name=${name}"
diff --git a/create_desktop_files.sh b/create_desktop_files.sh
new file mode 100755 (executable)
index 0000000..4ebe9da
--- /dev/null
@@ -0,0 +1,12 @@
+#!/usr/bin/env bash
+
+script_dir="$(realpath -Pe "$(dirname "${0}")")"
+
+"${script_dir}/create_desktop_file.sh" \
+    --executable "${script_dir}/zenbook_conf.py" \
+    --name "Zenbook Settings" \
+    --icon "$(realpath -Pe "${script_dir}/laptop-single.svg")" >Zenbook\ Settings_.desktop
+"${script_dir}/create_desktop_file.sh" \
+    --executable "${script_dir}/keyboard.py" \
+    --name "Zenbook Keyboard" \
+    --icon "input-keyboard" >Zenbook\ Keyboard_.desktop