Try to rely less on hardcoded paths
This commit is contained in:
@@ -1,4 +1,4 @@
|
||||
#!/bin/bash
|
||||
#!/run/current-system/sw/bin/bash
|
||||
|
||||
if [ $# -ne 1 ]; then
|
||||
echo "Usage: $0 <target_dir>"
|
||||
@@ -12,15 +12,18 @@ check_dir() {
|
||||
for application in "$dir/"*; do
|
||||
file="$(basename "$application")"
|
||||
|
||||
sed "s/^Exec=/Exec=bwshell --name '$file' --profile gui /gi" "$application" > "$target/$file"
|
||||
sed "s/^Exec=/Exec=bwbox --name '$file' --profile wayland /gi" "$application" > "$target/$file"
|
||||
done
|
||||
}
|
||||
|
||||
dirs=("/usr/share/applications" "$HOME/.local/share/applications")
|
||||
dirs=($(echo "$XDG_DATA_DIRS" | tr ':' '\n'))
|
||||
dirs+=("$HOME/.local/share")
|
||||
target="$1"
|
||||
|
||||
mkdir -p "$target"
|
||||
|
||||
for dir in "${dirs[@]}"; do
|
||||
check_dir "$dir"
|
||||
if [ -d "$dir/applications" ]; then
|
||||
check_dir "$dir/applications"
|
||||
fi
|
||||
done
|
||||
|
||||
Reference in New Issue
Block a user