-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Booting a fully-functional phrog greeter session under greetd is a little complicated. The right way to do it varies by distribution. This commit introduces prescriptive configuration for Alpine and Fedora. Eventually Debian will be a first-class citizen here too (when I finally wrap my head around its packaging/tooling). Since Alpine already allows the greetd config file to be specified in /etc/conf.d/greetd, we make use of that. On Fedora, a distinct phrog.service unit is introduced which conflicts with greetd's default greetd.service. For now, the only difference this service has to the default is a --config arg. Later, when we support Plymouth flicker-free boot, it will also Conflict=plymouth-quit.service to take over that process (just like gdm.service does). This commit also introduces the use of gnome-session to run the phrog shell. This ensures auxiliary services like the gsd-* daemons and an OSK are present. Since gnome-session is in place, we also use that to spawn phrog itself. A mobi.phosh.Phrog.desktop file is now shipped for that. The phrog-session wrapper example Guido introduced recently is moved to data/ and shipped in Alpine and Fedora. Since this script is only intended to be referenced by greetd's default_session.command config, it goes in /usr/libexec rather than in the PATH. As such the --help and --version are excised, and the script is made as minimal as possible. The README is updated and cleaned up a bit to reflect this work. Signed-off-by: Sam Day <me@samcday.com>
- Loading branch information
Showing
12 changed files
with
135 additions
and
71 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
[Desktop Entry] | ||
Name=Phrog | ||
Comment=Greeter shell for greetd | ||
Type=Application | ||
Exec=phrog | ||
NoDisplay=true |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
#!/bin/sh | ||
|
||
# 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" | ||
|
||
PHOC_INI="/usr/share/phrog/phoc.ini" | ||
if [ -f /etc/phrog/phoc.ini ]; then | ||
PHOC_INI=/etc/phrog/phoc.ini | ||
fi | ||
|
||
# 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 | ||
|
||
exec phoc -S -C "${PHOC_INI}" -E 'gnome-session --session=phrog' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
[GNOME Session] | ||
Name=phrog | ||
# Keep this in sync with systemd/user/gnome-session@phrog.target.d/session.conf | ||
RequiredComponents=mobi.phosh.Phrog;org.gnome.SettingsDaemon.MediaKeys;org.gnome.SettingsDaemon.Power;sm.puri.OSK0; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
[Unit] | ||
# Keep this in sync with phrog.session | ||
Wants=org.gnome.SettingsDaemon.MediaKeys.target | ||
Wants=org.gnome.SettingsDaemon.Power.target |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
# This is a greetd config.toml preconfigured to run phrog. | ||
# You can use it by adding the following line to /etc/conf.d/greetd: | ||
# cfgfile="/etc/phrog/greetd-config.toml" | ||
|
||
[terminal] | ||
vt = 7 | ||
|
||
[default_session] | ||
command = "sh -c 'dbus-run-session /usr/libexec/phrog-greetd-session 2>&1 | logger -t phrog'" | ||
user = "greetd" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
# This is a greetd config.toml preconfigured to run phrog. | ||
# It's intended to be used with phrog.service | ||
# But you can also use it directly by running greetd --config=/etc/phrog/greetd-config.toml | ||
|
||
[terminal] | ||
vt = 1 | ||
|
||
[default_session] | ||
command = "systemd-cat --identifier=phrog /usr/libexec/phrog-greetd-session" | ||
user = "greetd" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
[Unit] | ||
Description=Phrog greeter daemon | ||
After=systemd-user-sessions.service plymouth-quit-wait.service | ||
After=getty@tty1.service | ||
Conflicts=getty@tty1.service greetd.service gdm.service | ||
|
||
[Service] | ||
Type=simple | ||
ExecStart=greetd --config=/etc/phrog/greetd-config.toml | ||
IgnoreSIGPIPE=no | ||
SendSIGHUP=yes | ||
TimeoutStopSec=30s | ||
KeyringMode=shared | ||
Restart=always | ||
RestartSec=1 | ||
StartLimitBurst=5 | ||
StartLimitInterval=30 | ||
|
||
[Install] | ||
Alias=display-manager.service |
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters