2022-05-12 17:51:55 +02:00
|
|
|
#!/run/current-system/sw/bin/bash
|
2021-08-14 13:15:07 +02:00
|
|
|
|
|
|
|
if [ $# -ne 1 ]; then
|
|
|
|
echo "Usage: $0 <target_dir>"
|
|
|
|
exit 1
|
|
|
|
fi
|
|
|
|
|
|
|
|
check_dir() {
|
|
|
|
local dir=$1
|
|
|
|
local file
|
|
|
|
|
|
|
|
for application in "$dir/"*; do
|
|
|
|
file="$(basename "$application")"
|
|
|
|
|
2022-05-12 17:51:55 +02:00
|
|
|
sed "s/^Exec=/Exec=bwbox --name '$file' --profile wayland /gi" "$application" > "$target/$file"
|
2021-08-14 13:15:07 +02:00
|
|
|
done
|
|
|
|
}
|
|
|
|
|
2022-05-12 17:51:55 +02:00
|
|
|
dirs=($(echo "$XDG_DATA_DIRS" | tr ':' '\n'))
|
|
|
|
dirs+=("$HOME/.local/share")
|
2021-08-14 13:15:07 +02:00
|
|
|
target="$1"
|
|
|
|
|
2021-08-29 19:40:24 +02:00
|
|
|
mkdir -p "$target"
|
|
|
|
|
2021-08-14 13:15:07 +02:00
|
|
|
for dir in "${dirs[@]}"; do
|
2022-05-12 17:51:55 +02:00
|
|
|
if [ -d "$dir/applications" ]; then
|
|
|
|
check_dir "$dir/applications"
|
|
|
|
fi
|
2021-08-29 19:40:24 +02:00
|
|
|
done
|