#!/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() {
- 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 " -h | --help show this help message"
+ echo " -h|--help show this help message"
exit 0
}
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 "Exec=$(realpath -Pe "${executable}")"
-echo "Icon=${icon}"
-echo ""
+echo "Exec=${executable}"
+echo "Icon=${icon}"$'\n'
echo "Name=${name}"
--- /dev/null
+#!/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