summaryrefslogtreecommitdiff
path: root/Ports
diff options
context:
space:
mode:
authorJelle Raaijmakers <jelle@gmta.nl>2021-08-04 13:18:31 +0200
committerLinus Groh <mail@linusgroh.de>2021-08-04 13:54:08 +0100
commita76c208bae8f99845ffebb17e0a7a841ceb5ac5c (patch)
treecbd6079e0cca3fecf16096ac4a803daa6ce3ddf9 /Ports
parent1a4b1ecd04ec433a116b6bebdfa40fce7631f86c (diff)
downloadserenity-a76c208bae8f99845ffebb17e0a7a841ceb5ac5c.zip
Ports: Support icons for launchers with arguments
Diffstat (limited to 'Ports')
-rwxr-xr-xPorts/.port_include.sh13
1 files changed, 7 insertions, 6 deletions
diff --git a/Ports/.port_include.sh b/Ports/.port_include.sh
index dd925c65f3..bae6d29620 100755
--- a/Ports/.port_include.sh
+++ b/Ports/.port_include.sh
@@ -145,21 +145,22 @@ install_launcher() {
echo "Syntax: install_launcher <name> <category> <command>"
exit 1
fi
- launcher_name="$1"
- launcher_category="$2"
- launcher_command="$3"
- launcher_filename="${launcher_name,,}"
+ local launcher_name="$1"
+ local launcher_category="$2"
+ local launcher_command="$3"
+ local launcher_filename="${launcher_name,,}"
launcher_filename="${launcher_filename// /}"
+ local icon_override=""
case "$launcher_command" in
*\ *)
mkdir -p $DESTDIR/usr/local/libexec
launcher_executable="/usr/local/libexec/$launcher_filename"
cat >"$DESTDIR/$launcher_executable" <<SCRIPT
#!/bin/sh
-set -e
exec $(printf '%q ' $launcher_command)
SCRIPT
chmod +x "$DESTDIR/$launcher_executable"
+ icon_override="IconPath=${launcher_command%% *}"
;;
*)
launcher_executable="$launcher_command"
@@ -172,8 +173,8 @@ Name=$launcher_name
Executable=$launcher_executable
Category=$launcher_category
RunInTerminal=$launcher_run_in_terminal
+${icon_override}
CONFIG
- unset launcher_filename
}
# Checks if a function is defined. In this case, if the function is not defined in the port's script, then we will use our defaults. This way, ports don't need to include these functions every time, but they can override our defaults if needed.
func_defined() {