summarylogtreecommitdiffstats
path: root/httpie-desktop
blob: 9e97872db393c2534052ab7f9219f791cdcb7c79 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
#!/bin/bash

set -euo pipefail

add_flags() {
	declare -g -a flags
	local file name

	for name; do
		file="${XDG_CONFIG_HOME:-"$HOME/.config"}/${name}-flags.conf"
		if ! [[ -f "${file}" ]]; then
			continue
		fi
		while IFS='' read -r line; do
			if ! [[ "${line}" =~ ^[[:space:]]*(#|$) ]]; then
				flags+=("${line}")
			fi
		done <"${file}"
	done
}

flags=()
add_flags httpie
add_flags electron

export DESKTOPINTEGRATION=0
export APPIMAGELAUNCHER_DISABLE=1
exec /usr/lib/httpie-desktop/httpie "${flags[@]}" "$@"