Skip to content

Commit

Permalink
feat(greetd): use greetd instead of sddm (#26)
Browse files Browse the repository at this point in the history
Co-authored-by: William <[email protected]>
  • Loading branch information
HerrNaN and williamleven authored Jan 7, 2024
1 parent 2bd0c7a commit 27cbf9f
Show file tree
Hide file tree
Showing 6 changed files with 49 additions and 1 deletion.
6 changes: 6 additions & 0 deletions config/files/usr/etc/greetd/config.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
[terminal]
vt = 1

[default_session]
command = "sway --config /etc/greetd/sway-config"
user = "greetd"
3 changes: 3 additions & 0 deletions config/files/usr/etc/greetd/environments
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
sway
bash
fish
10 changes: 10 additions & 0 deletions config/files/usr/etc/greetd/sway-config
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
# `-l` activates layer-shell mode. Notice that `swaymsg exit` will run after gtkgreet.
exec "gtkgreet -l; swaymsg exit"

bindsym Mod4+shift+e exec swaynag \
-t warning \
-m 'What do you want to do?' \
-b 'Poweroff' 'systemctl poweroff' \
-b 'Reboot' 'systemctl reboot'

include /etc/sway/config.d/*
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
[Unit]
Description=Workaround greetd not having the correct SElinux label
ConditionFileIsExecutable=/usr/bin/greetd
After=local-fs.target
Before=greetd.service

[Service]
Type=oneshot
ExecStart=/usr/sbin/greetd-selinux-workaround

[Install]
WantedBy=multi-user.target
10 changes: 10 additions & 0 deletions config/files/usr/sbin/greetd-selinux-workaround
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
#!/usr/bin/env bash

# This is a workaround to set the SELinux context of
# the greetd binary correctly.
# (See: https://github.com/sidusIO/sediment/pull/26)

cp /usr/bin/greetd /usr/local/bin/greetd
mount --bind /usr/local/bin/greetd /usr/bin/greetd
semanage fcontext -a -t xdm_exec_t /usr/bin/greetd
restorecon /usr/bin/greetd
9 changes: 8 additions & 1 deletion config/recipe.yml
Original file line number Diff line number Diff line change
Expand Up @@ -27,8 +27,13 @@ modules:
- https://download.docker.com/linux/fedora/docker-ce.repo
install:
- fish
- greetd
- gtkgreet
- docker-ce
- docker-ce-cli
remove:
- sddm
- sddm-wayland-sway

# configure what to pull in from ublue-os/bling
- type: bling
Expand All @@ -44,11 +49,13 @@ modules:
# set up the proper policy & signing files for signed images to work
- signing.sh
- setup-asdf.sh

- type: systemd
system:
enabled:
- docker
- greetd.service
- greetd-selinux-workaround.service

- type: fonts
fonts:
Expand Down

0 comments on commit 27cbf9f

Please sign in to comment.