wayfire icon indicating copy to clipboard operation
wayfire copied to clipboard

Run applications as a different user

Open hernan604 opened this issue 7 months ago • 1 comments

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.

hernan604 avatar May 25 '25 22:05 hernan604

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.

ammen99 avatar May 31 '25 18:05 ammen99

XDG_RUNTIME_DIR=/var/run/xdg/my_username is wrong, just set the right path and will work.

killown avatar Jul 07 '25 16:07 killown

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.

ammen99 avatar Jul 07 '25 16:07 ammen99

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.

hernan604 avatar Jul 09 '25 01:07 hernan604