rharish101 / ReGreet

Clean and customizable greeter for greetd
GNU General Public License v3.0
348 stars 16 forks source link

How can i disable secondary and tertiary monitors in Sway with ReGreet? #56

Closed winteriscariot closed 3 months ago

winteriscariot commented 5 months ago

/etc/greetd/config.toml:

command = "sway --config /etc/greetd/sway-config"

/etc/greetd/sway-config:

exec systemctl --user set-environment XDG_CURRENT_DESKTOP=sway
exec systemctl --user import-environment DISPLAY \
                                         SWAYSOCK \
                                         WAYLAND_DISPLAY \
                                         XDG_CURRENT_DESKTOP

exec hash dbus-update-activation-environment 2>/dev/null && \
     dbus-update-activation-environment --systemd DISPLAY \
                                                  SWAYSOCK \
                                                  XDG_CURRENT_DESKTOP=sway \
                                                  WAYLAND_DISPLAY
output DisplayPort-0 mode 2560x1440
output HDMI-A-0 power off
output DisplayPort-1 power off
exec "regreet --config /etc/greetd/regreet.toml; swaymsg exit"

(note: i merged /etc/sway.config.d/* into my sway-config file just to make sure it wasn't an issue with includes)

basically, DisplayPort-0 is my middle monitor, with DP-1 and HDMI-A-0 being side monitors. The default behavior is that ReGreet is displayed on the center monitor, with background applied (good) but the side panels are just blank gray.

this is not the worst outcome ever, but I'd prefer to turn off the side panels when ReGreet is running. however, the output commands in my sway-config don't seem to do anything.

is there somewhere else I can do this? swaymsg doesn't seem to do anything (even when setting SWAYSOCK to /var/run/greetd-XXX.sock) due to failure to connect to IPC

# swaymsg -s /var/run/greetd-1366.sock swaymsg output HDMI-A-O power off
00:00:03.011 [common/ipc-client.c:87] Unable to receive IPC response

Thanks!

iguanajuice commented 4 months ago

Try using HDMI-A-0 disable instead of HDMI-A-0 power off

rharish101 commented 3 months ago

The greetd sock is meant just for greetd. Thus, you'll have to set the Sway socket argument to a different value. As for Sway itself not working when run through greetd, it doesn't seem to be a ReGreet bug IMO, as ReGreet runs within Sway as a regular GTK app.