alex-courtis / way-displays

way-displays: Auto Manage Your Wayland Displays
MIT License
239 stars 12 forks source link

Undying unconfigurable process #170

Closed xeruf closed 4 days ago

xeruf commented 3 weeks ago

I am observing some odd behavior the last weeks:

❯ way-displays -s SCALE '' 2
ERROR: way-displays not running, check $XDG_VTNR
❯ ps aux | grep way-displays
janek     718100  0.0  0.0  10556  6712 ?        Ss   06:52   0:00 way-displays > /tmp/way-displays..janek.log 2>&1
❯ echo $XDG_VTNR
2
❯ pgrep way-displays
718100

❯ pkill way-displays
❯ ps aux | grep way-displays
janek     723001  0.6  0.0  10556  6764 ?        Ss   06:56   0:00 way-displays > /tmp/way-displays..janek.log 2>&1

❯ systemctl --user status way-displays | cat
● way-displays.service - Auto Manages Your Wayland Displays
     Loaded: loaded (/etc/xdg/systemd/user/way-displays.service; enabled; preset: enabled)
     Active: active (running) since Tue 2024-06-11 06:56:16 EAT; 2min 19s ago
       Docs: https://github.com/alex-courtis/way-displays
   Main PID: 723001 (way-displays)
      Tasks: 1 (limit: 76795)
     Memory: 1.2M ()
        CPU: 25ms
     CGroup: /user.slice/user-1000.slice/user@1000.service/app.slice/way-displays.service
             └─723001 way-displays ">" /tmp/way-displays..janek.log "2>&1"
❯ pacman -Qo /etc/xdg/systemd/user/way-displays.service
/etc/systemd/user/way-displays.service is owned by manjaro-sway-settings 16.19.6-7
alex-courtis commented 3 weeks ago

sending a command to way-displays does not work, it says it is not running

The client determines whether the server is running by looking for a pid at /tmp/way-displays.${XDG_VTNR}.pid. What do you see in your /tmp?

It then finds the socket to use by looking at ${XDG_RUNTIME_DIR}/way-displays.${XDG_VTNR}.sock. What's in your ${XDG_RUNTIME_DIR}?

I suspect that the XDG_VTNR is different for the service. Are you using a login manager that sets 2?

trying to make changes through a plain swaymsg command (swaymsg output * scale 2) get reverted immediately by way-displays

Working as intended. way-displays will react to changes and apply its configuration. Canonical case: display arrives, sway sets it to default resolution.

this one is now clear since it is a systemd service

That's pretty cool. Can you please share your setup as a recipe?

xeruf commented 4 days ago

That's pretty cool. Can you please share your setup as a recipe?

It's not by me but the fellow great manjaro-sway maintainer, see https://github.com/manjaro-sway/desktop-settings/blob/sway/community/sway/etc/systemd/user/way-displays.service :)

Seems to work fine again, I think I accidentally had two processes running as mentioned in https://github.com/alex-courtis/way-displays/issues/161