Run applications as a different user
For security reasons i prefer to use the browser as another user.
Im not sure why wayfire is not capable of running applications as another user. And why sway is able to.
Here is the command that opens firefox as another user:
sudo chown :other_username "$XDG_RUNTIME_DIR" "$XDG_RUNTIME_DIR/$WAYLAND_DISPLAY" "$XDG_RUNTIME_DIR/dconf/user" ; chmod g+x "$XDG_RUNTIME_DIR" ; chmod g+rwx "$XDG_RUNTIME_DIR/$WAYLAND_DISPLAY" ; sudo su - other_username -c "XDG_SESSION_TYPE=wayland WAYLAND_DISPLAY=wayland-1 XDG_RUNTIME_DIR=/var/run/xdg/my_username firefox"
The command above does not throw errors but the application is not visible to WM.
If you try that under sway, you will see it works.
Have you compared env vars between Sway and Wayfire? I think this should work, afaik there is nothing the compositor has to do (or to prevent) in this case. So if you have the same env vars as Sway, it should work.
XDG_RUNTIME_DIR=/var/run/xdg/my_username is wrong, just set the right path and will work.
XDG_RUNTIME_DIR=/var/run/xdg/my_username is wrong, just set the right path and will work.
Good point, for me XDG_RUNTIME_DIR is also /run/user/<id>. I suspect this might be the issue.
XDG_RUNTIME_DIR was/is correct.
And i just tested again using the same command as above and now it works...
So something has changed... no idea what.. but works now.