summaryrefslogtreecommitdiff
path: root/gui-wm/wayfire/files/wayfire-session-3
blob: c3f75133973cd3e706ce5a1a08e05c18e4cefb73 (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
29
30
31
#!/bin/bash

# output to syslog and stderr
# with PID and syslog identity 'wayfire'
exec 1> >(logger --id=$$ --stderr --tag wayfire) 2>&1

# if undefined, or empty, set to freedesktop specification defaults
[ -z "$XDG_DATA_DIRS" ] && export XDG_DATA_DIRS="/usr/local/share:/usr/share"

# freedesktop specifications mandate that the definition
# of XDG_SESSION_TYPE should be respected
export XDG_SESSION_TYPE=wayland
export GDK_BACKEND=wayland
export QT_QPA_PLATFORM=wayland
export MOZ_ENABLE_WAYLAND=1

# copy wayfire.ini to $HOME/.config/ if not already there
configdir="${XDG_CONFIG_HOME:=${HOME}/.config}"
if [[ ! -f ${configdir}/wayfire.ini ]]; then
	mkdir -p "${configdir}"
	seed=@EPREFIX@/usr/share/wayfire/wayfire.ini
	if [[ -f @EPREFIX@/usr/share/hedron/wayfire.ini ]] && command -v hedron >/dev/null 2>&1; then
		seed=@EPREFIX@/usr/share/hedron/wayfire.ini
	fi
	cp "${seed}" "${configdir}/wayfire.ini"
fi

# override or add environment variables
[[ -f @EPREFIX@/etc/wayfire.env ]] && . @EPREFIX@/etc/wayfire.env

exec @DBUS_RUN_SESSION@ @EPREFIX@/usr/bin/wayfire "$@"