Github messages for voidlinux
 help / color / mirror / Atom feed
* [ISSUE] sway: add wrapper scripts
@ 2021-01-19 15:31 gspe
  2021-01-19 15:42 ` ericonr
                   ` (11 more replies)
  0 siblings, 12 replies; 13+ messages in thread
From: gspe @ 2021-01-19 15:31 UTC (permalink / raw)
  To: ml

[-- Attachment #1: Type: text/plain, Size: 1410 bytes --]

New issue by gspe on void-packages repository

https://github.com/void-linux/void-packages/issues/28036

Description:
@olafmersmann I'd like to ask you what do you think about adding some wrapper scripts to help user with the problem of setting enviromental variable correctly in sway and wayland in general.
I'm thinking about this:
https://man.sr.ht/%7Ekennylevinsen/greetd/#how-to-set-xdg_session_typewayland
https://en.opensuse.org/Portal:OpenSUSEway/Configuration


Based on OpenSuse configuration I'm thinking about having:

- a file to store enviromental variables  `/etc/sway/env` :
```
# recomended enviroment variables for sway based desktop
MOZ_ENABLE_WAYLAND=1
QT_QPA_PLATFORM=wayland-egl
CLUTTER_BACKEND=wayland
ECORE_EVAS_ENGINE=wayland-egl
ELM_ENGINE=wayland_egl
SDL_VIDEODRIVER=wayland
_JAVA_AWT_WM_NONREPARENTING=1
NO_AT_BRIDGE=1

# QT theme
QT_QPA_PLATFORMTHEME=qt5ct
```

- a wrap script to run sway `/usr/bin/sway-run.sh` :
```
#!/bin/sh

# Session
export XDG_SESSION_TYPE=wayland
export XDG_SESSION_DESKTOP=sway
export XDG_CURRENT_DESKTOP=sway

# this file imports sway desktop enviroments
set -a
. /etc/sway/env
set +a

sway $@

```
- a desktop file to run sway from login manager `/usr/share/wayland-sessions/sway.desktop` :

```
[Desktop Entry]
Name=Sway
Comment=An i3-compatible Wayland compositor
Exec=sway-run.sh
Type=Application
```

^ permalink raw reply	[flat|nested] 13+ messages in thread

* Re: sway: add wrapper scripts
  2021-01-19 15:31 [ISSUE] sway: add wrapper scripts gspe
@ 2021-01-19 15:42 ` ericonr
  2021-01-19 16:26 ` gspe
                   ` (10 subsequent siblings)
  11 siblings, 0 replies; 13+ messages in thread
From: ericonr @ 2021-01-19 15:42 UTC (permalink / raw)
  To: ml

[-- Attachment #1: Type: text/plain, Size: 600 bytes --]

New comment by ericonr on void-packages repository

https://github.com/void-linux/void-packages/issues/28036#issuecomment-762927162

Comment:
I'm very against this. That's waaaay too much vendoring of things that, for the most part, are a user preference. And making a special case for sway vs the other wayland compositors doesn't make sense. Upstream should ship saner defaults and/or improve their configuration file to allow setting the environment.

`SDL_VIDEODRIVER=wayland` was also quite crashy for me, iirc.

Should use `exec sway $@`, btw, otherwise signal handling gets all messed up.

^ permalink raw reply	[flat|nested] 13+ messages in thread

* Re: sway: add wrapper scripts
  2021-01-19 15:31 [ISSUE] sway: add wrapper scripts gspe
  2021-01-19 15:42 ` ericonr
@ 2021-01-19 16:26 ` gspe
  2021-01-19 20:00 ` ericonr
                   ` (9 subsequent siblings)
  11 siblings, 0 replies; 13+ messages in thread
From: gspe @ 2021-01-19 16:26 UTC (permalink / raw)
  To: ml

[-- Attachment #1: Type: text/plain, Size: 459 bytes --]

New comment by gspe on void-packages repository

https://github.com/void-linux/void-packages/issues/28036#issuecomment-762957361

Comment:
Just an observation, these environmental variables just set app to use wayland as preferred video server and nothing else.

Proposed  `/etc/sway/env` file is not sway specific and can be moved somewhere else and used by other wayland compositor, mine was just an example for the actually most know wayland compositor.

^ permalink raw reply	[flat|nested] 13+ messages in thread

* Re: sway: add wrapper scripts
  2021-01-19 15:31 [ISSUE] sway: add wrapper scripts gspe
  2021-01-19 15:42 ` ericonr
  2021-01-19 16:26 ` gspe
@ 2021-01-19 20:00 ` ericonr
  2021-01-19 20:00 ` ericonr
                   ` (8 subsequent siblings)
  11 siblings, 0 replies; 13+ messages in thread
From: ericonr @ 2021-01-19 20:00 UTC (permalink / raw)
  To: ml

[-- Attachment #1: Type: text/plain, Size: 261 bytes --]

New comment by ericonr on void-packages repository

https://github.com/void-linux/void-packages/issues/28036#issuecomment-763093184

Comment:
We could consider shipping a wayland friendly setup for greet, maybe, but besides that I'm not really sure about this.

^ permalink raw reply	[flat|nested] 13+ messages in thread

* Re: sway: add wrapper scripts
  2021-01-19 15:31 [ISSUE] sway: add wrapper scripts gspe
                   ` (2 preceding siblings ...)
  2021-01-19 20:00 ` ericonr
@ 2021-01-19 20:00 ` ericonr
  2021-01-19 20:08 ` olafmersmann
                   ` (7 subsequent siblings)
  11 siblings, 0 replies; 13+ messages in thread
From: ericonr @ 2021-01-19 20:00 UTC (permalink / raw)
  To: ml

[-- Attachment #1: Type: text/plain, Size: 262 bytes --]

New comment by ericonr on void-packages repository

https://github.com/void-linux/void-packages/issues/28036#issuecomment-763093184

Comment:
We could consider shipping a wayland friendly setup for greetd, maybe, but besides that I'm not really sure about this.

^ permalink raw reply	[flat|nested] 13+ messages in thread

* Re: sway: add wrapper scripts
  2021-01-19 15:31 [ISSUE] sway: add wrapper scripts gspe
                   ` (3 preceding siblings ...)
  2021-01-19 20:00 ` ericonr
@ 2021-01-19 20:08 ` olafmersmann
  2021-01-19 22:15 ` gspe
                   ` (6 subsequent siblings)
  11 siblings, 0 replies; 13+ messages in thread
From: olafmersmann @ 2021-01-19 20:08 UTC (permalink / raw)
  To: ml

[-- Attachment #1: Type: text/plain, Size: 418 bytes --]

New comment by olafmersmann on void-packages repository

https://github.com/void-linux/void-packages/issues/28036#issuecomment-763097814

Comment:
> We could consider shipping a wayland friendly setup for greetd, maybe, but besides that I'm not really sure about this.

Maybe add a INSTALL.msg file that lists the environment variables for new users? Or maybe we could add it to the Wayland section of the handbook?

^ permalink raw reply	[flat|nested] 13+ messages in thread

* Re: sway: add wrapper scripts
  2021-01-19 15:31 [ISSUE] sway: add wrapper scripts gspe
                   ` (4 preceding siblings ...)
  2021-01-19 20:08 ` olafmersmann
@ 2021-01-19 22:15 ` gspe
  2021-01-21 18:21 ` kkga
                   ` (5 subsequent siblings)
  11 siblings, 0 replies; 13+ messages in thread
From: gspe @ 2021-01-19 22:15 UTC (permalink / raw)
  To: ml

[-- Attachment #1: Type: text/plain, Size: 319 bytes --]

New comment by gspe on void-packages repository

https://github.com/void-linux/void-packages/issues/28036#issuecomment-763176667

Comment:
> Or maybe we could add it to the Wayland section of the handbook?

This could be a solution, at least user with doubt about how to setup wayland wm can find a solution quicker.

^ permalink raw reply	[flat|nested] 13+ messages in thread

* Re: sway: add wrapper scripts
  2021-01-19 15:31 [ISSUE] sway: add wrapper scripts gspe
                   ` (5 preceding siblings ...)
  2021-01-19 22:15 ` gspe
@ 2021-01-21 18:21 ` kkga
  2021-01-21 18:22 ` kkga
                   ` (4 subsequent siblings)
  11 siblings, 0 replies; 13+ messages in thread
From: kkga @ 2021-01-21 18:21 UTC (permalink / raw)
  To: ml

[-- Attachment #1: Type: text/plain, Size: 430 bytes --]

New comment by kkga on void-packages repository

https://github.com/void-linux/void-packages/issues/28036#issuecomment-764845047

Comment:
I generally agree that this is better left for the user to decide how to setup their Wayland session, so either a post-install message or some specific details in the handbook would be good.

> We could consider shipping a wayland friendly setup for greetd

:+1: This would be nice!



^ permalink raw reply	[flat|nested] 13+ messages in thread

* Re: sway: add wrapper scripts
  2021-01-19 15:31 [ISSUE] sway: add wrapper scripts gspe
                   ` (6 preceding siblings ...)
  2021-01-21 18:21 ` kkga
@ 2021-01-21 18:22 ` kkga
  2021-01-22 10:33 ` travankor
                   ` (3 subsequent siblings)
  11 siblings, 0 replies; 13+ messages in thread
From: kkga @ 2021-01-21 18:22 UTC (permalink / raw)
  To: ml

[-- Attachment #1: Type: text/plain, Size: 470 bytes --]

New comment by kkga on void-packages repository

https://github.com/void-linux/void-packages/issues/28036#issuecomment-764845047

Comment:
I generally agree that this is better left for the user to decide how to setup their Wayland session, so either a post-install message or some specific details in the handbook would be good.

> We could consider shipping a wayland friendly setup for greetd

:+1: This would be nice! I wanted to try out greetd for a while.



^ permalink raw reply	[flat|nested] 13+ messages in thread

* Re: sway: add wrapper scripts
  2021-01-19 15:31 [ISSUE] sway: add wrapper scripts gspe
                   ` (7 preceding siblings ...)
  2021-01-21 18:22 ` kkga
@ 2021-01-22 10:33 ` travankor
  2021-01-22 10:38 ` travankor
                   ` (2 subsequent siblings)
  11 siblings, 0 replies; 13+ messages in thread
From: travankor @ 2021-01-22 10:33 UTC (permalink / raw)
  To: ml

[-- Attachment #1: Type: text/plain, Size: 281 bytes --]

New comment by travankor on void-packages repository

https://github.com/void-linux/void-packages/issues/28036#issuecomment-765310653

Comment:
@kkga I have a pending package for greetd #20873. It got delayed for reasons... but it's ready for review now.

Please give it a shot.

^ permalink raw reply	[flat|nested] 13+ messages in thread

* Re: sway: add wrapper scripts
  2021-01-19 15:31 [ISSUE] sway: add wrapper scripts gspe
                   ` (8 preceding siblings ...)
  2021-01-22 10:33 ` travankor
@ 2021-01-22 10:38 ` travankor
  2021-01-31 16:21 ` gspe
  2021-01-31 20:30 ` ericonr
  11 siblings, 0 replies; 13+ messages in thread
From: travankor @ 2021-01-22 10:38 UTC (permalink / raw)
  To: ml

[-- Attachment #1: Type: text/plain, Size: 311 bytes --]

New comment by travankor on void-packages repository

https://github.com/void-linux/void-packages/issues/28036#issuecomment-765310653

Comment:
@kkga I have a pending package for greetd #20873. It got delayed for reasons... but it's ready for review now.

Please give it a shot and report issues/suggestions.

^ permalink raw reply	[flat|nested] 13+ messages in thread

* Re: sway: add wrapper scripts
  2021-01-19 15:31 [ISSUE] sway: add wrapper scripts gspe
                   ` (9 preceding siblings ...)
  2021-01-22 10:38 ` travankor
@ 2021-01-31 16:21 ` gspe
  2021-01-31 20:30 ` ericonr
  11 siblings, 0 replies; 13+ messages in thread
From: gspe @ 2021-01-31 16:21 UTC (permalink / raw)
  To: ml

[-- Attachment #1: Type: text/plain, Size: 2174 bytes --]

New comment by gspe on void-packages repository

https://github.com/void-linux/void-packages/issues/28036#issuecomment-770407450

Comment:
I'll post an update here so if someone have problems with D-Bus configuration can find some help.
I've taken inspiration from how kde plasma wayland is started, https://github.com/KDE/plasma-workspace/blob/master/startkde/plasma-dbus-run-session-if-needed

I have modified the wrap script to run sway `/usr/bin/sway-run.sh` as follow:

```
#!/bin/sh

# Session
export XDG_SESSION_TYPE=wayland
export XDG_SESSION_DESKTOP=sway
export XDG_CURRENT_DESKTOP=sway

# D-Bus
# If the session bus is not available it is spawned and wrapper round our program
# Otherwise we spawn our program directly
drs=
if [ -z "${DBUS_SESSION_BUS_ADDRESS}" ]
then
   drs=dbus-run-session
fi

# Environment
# Source environmental variable from all files in PATH_ENVIRONMENT
# file should be named *.conf and have KEY=value format use # for comment
PATH_ENVIRONMENT=$HOME/.config/environment.d
if [ -d "$PATH_ENVIRONMENT" ]; then
  for i in "$PATH_ENVIRONMENT"/*.conf ; do
  if [ -f "$i" ]; then
    set -a; . "$i"; set +a
  fi
  done
fi

exec ${drs} sway "$@"
```

So if there is already a running dbus user session sway is started normally but if there isn't any the script start one dbus user session and sway inside it.

With this script Environmental variable are read from `~/.config/environment.d` directory, like how systemd user does.
User can put any file ending in `*.conf` inside this directory and they are sourced before sway start importing any `KEY=value` defined into environment.
In my case i have ` ~/.config/environment.d/wayland.conf` like this: 

```
# recomended enviroment variables for sway based desktop
MOZ_ENABLE_WAYLAND=1
QT_QPA_PLATFORM=wayland-egl
CLUTTER_BACKEND=wayland
ECORE_EVAS_ENGINE=wayland-egl
ELM_ENGINE=wayland_egl
SDL_VIDEODRIVER=wayland
_JAVA_AWT_WM_NONREPARENTING=1
NO_AT_BRIDGE=1

# QT theme
QT_QPA_PLATFORMTHEME=qt5ct
```

With this modification I don't have `/etc/sway/env` anymore but an user defined  configuration `~/.config/environment.d/wayland.conf`

^ permalink raw reply	[flat|nested] 13+ messages in thread

* Re: sway: add wrapper scripts
  2021-01-19 15:31 [ISSUE] sway: add wrapper scripts gspe
                   ` (10 preceding siblings ...)
  2021-01-31 16:21 ` gspe
@ 2021-01-31 20:30 ` ericonr
  11 siblings, 0 replies; 13+ messages in thread
From: ericonr @ 2021-01-31 20:30 UTC (permalink / raw)
  To: ml

[-- Attachment #1: Type: text/plain, Size: 758 bytes --]

New comment by ericonr on void-packages repository

https://github.com/void-linux/void-packages/issues/28036#issuecomment-770445616

Comment:
At issue here is that Void can't ship wrapper scripts for every WM we have (there are many). Some display managers support a setup script which can set these variables for you and/or go through `~/.config/environment.d`, and I would recommend using those.

The root cause is that, as a distro that doesn't use systemd, we lose out on some of their goodies, which include seamless dbus user session. If you have suggestions for improving the docs about dbus, feel free to open an issue there. However, I don't know how we should proceed beyond that, since, for better or for worse, void supports dbus-less systems.

^ permalink raw reply	[flat|nested] 13+ messages in thread

end of thread, other threads:[~2021-01-31 20:30 UTC | newest]

Thread overview: 13+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-01-19 15:31 [ISSUE] sway: add wrapper scripts gspe
2021-01-19 15:42 ` ericonr
2021-01-19 16:26 ` gspe
2021-01-19 20:00 ` ericonr
2021-01-19 20:00 ` ericonr
2021-01-19 20:08 ` olafmersmann
2021-01-19 22:15 ` gspe
2021-01-21 18:21 ` kkga
2021-01-21 18:22 ` kkga
2021-01-22 10:33 ` travankor
2021-01-22 10:38 ` travankor
2021-01-31 16:21 ` gspe
2021-01-31 20:30 ` ericonr

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).