File: phrog-greetd-session

package info (click to toggle)
phrog 0.50.0-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 716 kB
  • sloc: makefile: 35; sh: 28; xml: 25
file content (39 lines) | stat: -rw-r--r-- 1,607 bytes parent folder | download | duplicates (2)
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
32
33
34
35
36
37
38
39
#!/bin/bash

# This simple wrapper script is intended to be used directly by greetd to
# start up the phrog greeter session.
# Your distribution packaging should have already set something up for you,
# but if you're doing this manually you can make use of this script by
# adding something like this to your config.toml:
# [default_session]
# command = "/usr/libexec/phrog-greetd-session"

# We prefer phoc.ini from phrog, falling back to Phosh otherwise
PHOC_INI=/etc/phrog/phoc.ini
[ ! -f $PHOC_INI ] && PHOC_INI=/usr/share/phrog/phoc.ini
[ ! -f $PHOC_INI ] && PHOC_INI=/etc/phosh/phoc.ini
[ ! -f $PHOC_INI ] && PHOC_INI=/usr/share/phosh/phoc.ini

# Need to set XDG_CURRENT_DESKTOP now, otherwise gnome-session defaults it to
# "GNOME", which is a problem because default desktop files for Squeekboard and
# phosh-osk-stub specify "OnlyShowIn=Phosh;"
export XDG_CURRENT_DESKTOP=Phosh:GNOME

export GNOME_SESSION_AUTOSTART_DIR=/usr/share/phrog/autostart:/etc/phrog/autostart

# greetd swallows all output from the greeters it spawns. We don't want that.
# Redirect all output to journald or syslog.
if command -v systemd-cat >/dev/null 2>&1; then
  exec > >(systemd-cat --identifier=phrog) 2>&1
elif command -v logger >/dev/null 2>&1; then
  exec > >(logger -s -t phrog) 2>&1
fi

# phoc needs a dbus session bus present or it fails to initialize. Since a
# healthy greeter session needs one anyway, let's ensure it's started now.
dbus_command=""
if [ -z "$DBUS_SESSION_BUS_ADDRESS" ]; then
  dbus_command=dbus-run-session
fi

exec $dbus_command phoc -S -C "${PHOC_INI}" -E 'gnome-session --session=phrog'