Move scripts that require gui to gui/

This commit is contained in:
ItsDrike 2022-08-13 13:44:00 +02:00
parent 2ef59a7720
commit 7e111fd566
No known key found for this signature in database
GPG key ID: B014E761034AF742
11 changed files with 0 additions and 0 deletions

View file

@ -0,0 +1,11 @@
#!/bin/sh
# Find the line with exec, if there's multiple lines
# use the last one
exec_line=$(grep '^Exec' "$1" | tail -1)
# Remove 'Exec' and arguments (%u, %f, ...)
cmd=$(echo $exec_line | sed 's/^Exec=//' | sed 's/%.//')
# Remove "" around command (if present)
cmd=$(echo $cmd | sed 's/^"//g' | sed 's/" *$//g')
# Run the exec line of the application using /bin/sh
/bin/sh -c "$cmd"