Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
sway(bar) with tray support [SOLVED]
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Desktop Environments
View previous topic :: View next topic  
Author Message
Zucca
Veteran
Veteran


Joined: 14 Jun 2007
Posts: 1800
Location: KUUSANKOSKI, Finland

PostPosted: Thu Aug 15, 2019 6:43 pm    Post subject: sway(bar) with tray support [SOLVED] Reply with quote

Does anyone have it working?

Doesn't look good, doesn't it?

I have absolutely zero success to get it working. The documentation for tray is also lacking or I just don't find it. :(
_________________
..: Zucca :..

Code:
ERROR: '--failure' is not an option. Aborting...


Last edited by Zucca on Tue Nov 05, 2019 6:51 pm; edited 1 time in total
Back to top
View user's profile Send private message
GDH-gentoo
Guru
Guru


Joined: 20 Jul 2019
Posts: 419
Location: South America

PostPosted: Fri Aug 16, 2019 5:48 pm    Post subject: Re: sway(bar) with tray support Reply with quote

Zucca wrote:
Doesn't look good, doesn't it?

libsystemd's sd-bus API (for implementing a D-Bus client) is also provided by libelogind, the build system knows it and links swaybar to lo libelogind if it doesn't find libsystemd. So... not that bad? :)

Zucca wrote:
The documentation for tray is also lacking or I just don't find it. :(

I don't use anything Wayland-related, but since nobody else answered, doesn't man 5 sway or man sway-bar help?
Back to top
View user's profile Send private message
The Doctor
Moderator
Moderator


Joined: 27 Jul 2010
Posts: 2618

PostPosted: Fri Aug 16, 2019 11:26 pm    Post subject: Reply with quote

I seem to recall it worked out of the box for me a few months ago. Auto hide is/was not implemented so I went back to i3. I think it uses your same config for i3, just moved.

copy ~.3i/config to .config/sway/config and I think .config/i3status/config does the bar...
_________________
First things first, but not necessarily in that order.

Apologies if I take a while to respond. I'm currently working on the dematerialization circuit for my blue box.
Back to top
View user's profile Send private message
Zucca
Veteran
Veteran


Joined: 14 Jun 2007
Posts: 1800
Location: KUUSANKOSKI, Finland

PostPosted: Sat Aug 17, 2019 9:56 am    Post subject: Reply with quote

I have this on my config.
*snip*:
bar {
        position bottom
        font terminus

        output DP-1
        output DP-2

        tray_output DP-1

        status_command while date +'%Y-%m-%d %l:%M:%S %p'; do sleep 1; done

        colors {
            statusline #aaffaa
            background #222222
            inactive_workspace #32323200 #32323200 #5c5c5c
        }
}


Everything else works but the tray. :(

For i3 config... I have one from several years ago. :P So my current config is derived from the sway default.
_________________
..: Zucca :..

Code:
ERROR: '--failure' is not an option. Aborting...
Back to top
View user's profile Send private message
GDH-gentoo
Guru
Guru


Joined: 20 Jul 2019
Posts: 419
Location: South America

PostPosted: Sat Aug 17, 2019 3:39 pm    Post subject: Reply with quote

Output of swaymsg -t get_bar_config and dbus-send --print-reply --dest=org.freedesktop.DBus /org/freedesktop/DBus org.freedesktop.DBus.ListNames?
Back to top
View user's profile Send private message
Zucca
Veteran
Veteran


Joined: 14 Jun 2007
Posts: 1800
Location: KUUSANKOSKI, Finland

PostPosted: Thu Aug 22, 2019 11:29 am    Post subject: Reply with quote

I'm back again. :)

shellcmd: swaymsg -t get_bar_config :
[
   "bar-0"
 ]
shellcmd: dbus-send --print-reply --dest=org.freedesktop.DBus /org/freedesktop/DBus org.freedesktop.DBus.ListNames :
method return time=1566473452.145552 sender=org.freedesktop.DBus -> destination=:1.4309 serial=3 reply_serial=2
   array [
      string "org.freedesktop.DBus"
      string ":1.3"
      string ":1.4307"
      string "org.mozilla.firefox.enVjY2E_"
      string ":1.3874"
      string ":1.13"
      string ":1.0"
      string ":1.5"
      string ":1.1"
      string ":1.4309"
      string ":1.2"
   ]


The first command output looks odd. But with the config I have, I have been able to modify the bar. So... I don't know what to make out of that...
_________________
..: Zucca :..

Code:
ERROR: '--failure' is not an option. Aborting...
Back to top
View user's profile Send private message
GDH-gentoo
Guru
Guru


Joined: 20 Jul 2019
Posts: 419
Location: South America

PostPosted: Thu Aug 22, 2019 4:51 pm    Post subject: Reply with quote

Zucca wrote:
shellcmd: swaymsg -t get_bar_config :
[
   "bar-0"
 ]

I think this is OK. I'm not sure if it is the correct syntax, but I think you can get the full configuration with swaymsg -t get_bar_config bar-0 now.

Zucca wrote:
shellcmd: dbus-send --print-reply --dest=org.freedesktop.DBus /org/freedesktop/DBus org.freedesktop.DBus.ListNames :
method return time=1566473452.145552 sender=org.freedesktop.DBus -> destination=:1.4309 serial=3 reply_serial=2
   array [
      string "org.freedesktop.DBus"
      string ":1.3"
      string ":1.4307"
      string "org.mozilla.firefox.enVjY2E_"
      string ":1.3874"
      string ":1.13"
      string ":1.0"
      string ":1.5"
      string ":1.1"
      string ":1.4309"
      string ":1.2"
   ]

So you have several D-Bus clients (org.freedesktop.DBus doesn't count, and 1:4309 is the transient dbus-send process), but only one has requested another bus name (I suppose that is Firefox). I believe a tray watcher should appear there with name org.freedesktop.StatusNotifierWatcher. There should be some "Failed to acquire service name" message in sway's log, wherever it is stored. To get the obvious question out of the way, you did install gui-wm/sway with USE=tray, right?
Back to top
View user's profile Send private message
Zucca
Veteran
Veteran


Joined: 14 Jun 2007
Posts: 1800
Location: KUUSANKOSKI, Finland

PostPosted: Fri Aug 23, 2019 11:38 am    Post subject: Reply with quote

shellcmd: swaymsg -t get_bar_config bar-0 :
{
   "id": "bar-0",
   "mode": "dock",
   "hidden_state": "hide",
   "position": "bottom",
   "status_command": "while date +'%Y-%m-%d %l:%M:%S %p'; do sleep 1; done",
   "font": "terminus",
   "gaps": {
     "top": 0,
     "right": 0,
     "bottom": 0,
     "left": 0
   },
   "bar_height": 0,
   "status_padding": 1,
   "status_edge_padding": 3,
   "wrap_scroll": false,
   "workspace_buttons": true,
   "strip_workspace_numbers": false,
   "strip_workspace_name": false,
   "binding_mode_indicator": true,
   "verbose": false,
   "pango_markup": false,
   "colors": {
     "background": "#222222ff",
     "statusline": "#aaffaaff",
     "separator": "#666666ff",
     "focused_background": "#222222ff",
     "focused_statusline": "#aaffaaff",
     "focused_separator": "#666666ff",
     "focused_workspace_border": "#4c7899ff",
     "focused_workspace_bg": "#285577ff",
     "focused_workspace_text": "#ffffffff",
     "inactive_workspace_border": "#32323200",
     "inactive_workspace_bg": "#32323200",
     "inactive_workspace_text": "#5c5c5cff",
     "active_workspace_border": "#333333ff",
     "active_workspace_bg": "#5f676aff",
     "active_workspace_text": "#ffffffff",
     "urgent_workspace_border": "#2f343aff",
     "urgent_workspace_bg": "#900000ff",
     "urgent_workspace_text": "#ffffffff",
     "binding_mode_border": "#2f343aff",
     "binding_mode_bg": "#900000ff",
     "binding_mode_text": "#ffffffff"
   },
   "outputs": [
     "DP-1",
     "DP-2"
   ],
   "tray_outputs": [
     "DP-1"
   ],
   "tray_padding": 2
 }
This looks ok.

And yes, USE="tray" is enabled.
shellcmd: equery u sway :
+X
+elogind
-fish-completion
+man
+swaybar
+swaybg
+swayidle
+swaylock
+swaymsg
+swaynag
-systemd
+tray
+wallpapers
-zsh-completion


I start my sway session from sddm if that matters at all. sddm should handle all the dbus related things automatically afaik..?
_________________
..: Zucca :..

Code:
ERROR: '--failure' is not an option. Aborting...
Back to top
View user's profile Send private message
GDH-gentoo
Guru
Guru


Joined: 20 Jul 2019
Posts: 419
Location: South America

PostPosted: Fri Aug 23, 2019 3:45 pm    Post subject: Reply with quote

Zucca wrote:
shellcmd: swaymsg -t get_bar_config bar-0 :
   "outputs": [
     "DP-1",
     "DP-2"
   ],
   "tray_outputs": [
     "DP-1"
   ],

Two outputs for swaybar but one for the tray?

Zucca wrote:
I start my sway session from sddm if that matters at all. sddm should handle all the dbus related things automatically afaik..?

SDDM should start both a login session message bus and sway, yes. And the dbus-send test worked, so that seems OK. However, I'm not sure if the D-Bus side of the tray is working. If it isn't, there should be error messages. sway and swaybar seem to log to their standard error file descriptors, but I don't know if SDDM stores those logs, and where. Do you know that?
Back to top
View user's profile Send private message
Zucca
Veteran
Veteran


Joined: 14 Jun 2007
Posts: 1800
Location: KUUSANKOSKI, Finland

PostPosted: Fri Aug 23, 2019 5:55 pm    Post subject: Reply with quote

GDH-gentoo wrote:
Two outputs for swaybar but one for the tray?
Intentional. I tested with both outputs too, but no success.

GDH-gentoo wrote:
However, I'm not sure if the D-Bus side of the tray is working. If it isn't, there should be error messages. sway and swaybar seem to log to their standard error file descriptors, but I don't know if SDDM stores those logs, and where. Do you know that?
I think I can tweak /usr/share/wayland-sessions/sway.desktop a little to be able to get debug logging redirected into a regular file.
_________________
..: Zucca :..

Code:
ERROR: '--failure' is not an option. Aborting...
Back to top
View user's profile Send private message
Zucca
Veteran
Veteran


Joined: 14 Jun 2007
Posts: 1800
Location: KUUSANKOSKI, Finland

PostPosted: Fri Aug 23, 2019 9:01 pm    Post subject: Reply with quote

Well.
One line showed up in the debug log:
Code:
[sway-1.1.1/swaybar/tray/tray.c:42] Failed to connect to user bus: No such file or directory
...as to which file is missing... I can only make wild guesses.
_________________
..: Zucca :..

Code:
ERROR: '--failure' is not an option. Aborting...
Back to top
View user's profile Send private message
GDH-gentoo
Guru
Guru


Joined: 20 Jul 2019
Posts: 419
Location: South America

PostPosted: Sat Aug 24, 2019 3:17 am    Post subject: Reply with quote

Zucca wrote:
Well.
One line showed up in the debug log:
Code:
[sway-1.1.1/swaybar/tray/tray.c:42] Failed to connect to user bus: No such file or directory
...as to which file is missing... I can only make wild guesses.

That is quite an informative diagnostic message, actually. The "No such file or directory" in this case means that apparently the swaybar process could not connect to the login session message bus because neither the DBUS_SESSION_BUS_ADDRESS nor the XDG_RUNTIME_DIR variables are set to meanigful values in its environment. It needs the variables to find the bus daemon's socket. You can find swaybar's process ID with ps and check its environment variables with cat /proc/<PID>/environ | xargs -0 printf '%s\n'. You might need to do that as root. Did this message appear when sway was launched in your usual way, i.e. from SDDM?
Back to top
View user's profile Send private message
Zucca
Veteran
Veteran


Joined: 14 Jun 2007
Posts: 1800
Location: KUUSANKOSKI, Finland

PostPosted: Sun Aug 25, 2019 5:38 pm    Post subject: Reply with quote

Well...
Code:
$ pgrep swaybar | while read pid; do cat "/proc/${pid}/environ" | xargs -0 printf '%s\n'; echo '==='; done | grep -E 'DBUS|XDG|^===$'
XDG_CONFIG_HOME=/home/zucca/.config/
XDG_VTNR=8
XDG_SESSION_ID=c5
XDG_SESSION_TYPE=wayland
XDG_DATA_DIRS=/usr/local/share:/usr/share
XDG_SESSION_DESKTOP=
XDG_SESSION_CLASS=user
XDG_SEAT_PATH=/org/freedesktop/DisplayManager/Seat0
XDG_CURRENT_DESKTOP=
XDG_SEAT=seat0
XDG_RUNTIME_DIR=/run/user/999
XDG_SESSION_PATH=/org/freedesktop/DisplayManager/Session1
XDG_CONFIG_DIRS=/etc/xdg
===
XDG_CONFIG_HOME=/home/zucca/.config/
XDG_VTNR=9
XDG_SESSION_ID=c7
XDG_SESSION_TYPE=wayland
XDG_DATA_DIRS=/usr/local/share:/usr/share
XDG_SESSION_DESKTOP=
XDG_SESSION_CLASS=user
XDG_SEAT_PATH=/org/freedesktop/DisplayManager/Seat0
XDG_CURRENT_DESKTOP=
XDG_SEAT=seat0
XDG_RUNTIME_DIR=/run/user/999
XDG_SESSION_PATH=/org/freedesktop/DisplayManager/Session1
XDG_CONFIG_DIRS=/etc/xdg
===
XDG_CONFIG_HOME=/home/zucca/.config/
XDG_VTNR=10
XDG_SESSION_ID=c8
XDG_SESSION_TYPE=wayland
XDG_DATA_DIRS=/usr/local/share:/usr/share
XDG_SESSION_DESKTOP=
XDG_SESSION_CLASS=user
XDG_SEAT_PATH=/org/freedesktop/DisplayManager/Seat0
XDG_CURRENT_DESKTOP=
XDG_SEAT=seat0
XDG_RUNTIME_DIR=/run/user/999
XDG_SESSION_PATH=/org/freedesktop/DisplayManager/Session1
XDG_CONFIG_DIRS=/etc/xdg
===


dbus session environment variables are all unset. :o
_________________
..: Zucca :..

Code:
ERROR: '--failure' is not an option. Aborting...
Back to top
View user's profile Send private message
GDH-gentoo
Guru
Guru


Joined: 20 Jul 2019
Posts: 419
Location: South America

PostPosted: Sun Aug 25, 2019 8:56 pm    Post subject: Reply with quote

Zucca wrote:
dbus session environment variables are all unset. :o

Hmm, but XDG_RUNTIME_DIR is (to /run/user/999). Does ls -l show that /run/user/999/bus exists, and that it is a socket? Also, three swaybar processes? I was expecting only one…

At this point, I'm not sure I understand which program starts which program. Can you start sway in your usual way, and post the process tree as reported by ps axf -o uid,gid,args? I'm not interested in all of it, only in the sddm, sway* and dbus-* part. When you do the dbus-send test, which I assume is from a GUI terminal, is DBUS_SESSION_BUS_ADDRESS set in the environment?
Back to top
View user's profile Send private message
Zucca
Veteran
Veteran


Joined: 14 Jun 2007
Posts: 1800
Location: KUUSANKOSKI, Finland

PostPosted: Mon Aug 26, 2019 4:05 pm    Post subject: Reply with quote

Well. There's surely something missing. Looks like sddm doesn't start dbus session properly or at all...

shellcmd: tree /run/user/999/ :
/run/user/999/
├── dbus-1
│   └── services
├── dconf
│   └── user
├── pulse
│   ├── native
│   └── pid
├── sway-ipc.999.28083.sock
├── wayland-0
└── wayland-0.lock

4 directories, 6 files

I got pretty messy output from ps, so I ran this:
shellcmd: pgrep "^sddm$" | xargs -n 1 pstree -scutaU :
init
  └─sddm
      ├─X -nolisten tcp -auth /var/run/sddm/{e9bc5d76-a483-4f10-bde4-0374692f51e6} -background none -noreset -displayfd 17 ...
      │  ├─{InputThread}
      │  ├─{X:cs0}
      │  ├─{X:disk$0}
      │  ├─{X:gdrv0}
      │  ├─{X:sh0}
      │  ├─{X:sh1}
      │  ├─{X:sh2}
      │  ├─{X:sh3}
      │  ├─{X:sh4}
      │  ├─{X:sh5}
      │  ├─{X:shlo0}
      │  ├─{X:shlo1}
      │  ├─{X:shlo2}
      │  └─{X:shlo3}
      ├─sddm-helper --socket /tmp/sddm-authaec59d17-ad4d-4c1f-b8ce-b828822101ee --id 2 --start/usr/bin/sddm-greeter --socket /
      │   └─sddm-greeter,sddm --socket /tmp/sddm-:0-BEmNMy --theme /usr/share/sddm/themes/maya
      │       ├─{QDBusConnection}
      │       ├─{QQmlThread}
      │       ├─{QSGRenderThread}
      │       ├─{QXcbEventQueue}
      │       ├─{sddm-gr:disk$0}
      │       ├─{sddm-gre:gdrv0}
      │       ├─{sddm-gre:shlo0}
      │       ├─{sddm-gre:shlo1}
      │       ├─{sddm-gre:shlo2}
      │       ├─{sddm-gre:shlo3}
      │       ├─{sddm-greet:cs0}
      │       ├─{sddm-greet:sh0}
      │       ├─{sddm-greet:sh1}
      │       ├─{sddm-greet:sh2}
      │       ├─{sddm-greet:sh3}
      │       ├─{sddm-greet:sh4}
      │       └─{sddm-greet:sh5}
      ├─sddm-helper --socket /tmp/sddm-authaec59d17-ad4d-4c1f-b8ce-b828822101ee --id 1 --start sway --user zucca
      │   └─sway,zucca
      │       ├─(sam)
      │       ├─swaybar -b bar-0
      │       │   └─sh -c while date +'%Y-%m-%d %l:%M:%S %p'; do sleep 1; done
      │       │       └─sleep 1
      │       ├─{sway:cs0}
      │       ├─{sway:disk$0}
      │       ├─{sway:gdrv0}
      │       ├─{sway:sh0}
      │       ├─{sway:sh1}
      │       ├─{sway:sh2}
      │       ├─{sway:sh3}
      │       ├─{sway:sh4}
      │       ├─{sway:sh5}
      │       ├─{sway:shlo0}
      │       ├─{sway:shlo1}
      │       ├─{sway:shlo2}
      │       └─{sway:shlo3}
      └─{QDBusConnection}
shellcmd: pgrep dbus | xargs -n 1 pstree -scutaU :
init
  └─dbus-daemon,messagebus --system
init
  └─dbus-launch,zucca --autolaunch dc2fc133e83ce50f2dcb99b757265152 --binary-syntax --close-stderr
init
  └─dbus-daemon,zucca --syslog-only --fork --print-pid 5 --print-address 7 --session
init
  └─dbus-launch,sddm --autolaunch dc2fc133e83ce50f2dcb99b757265152 --binary-syntax --close-stderr
init
  └─dbus-daemon,sddm --syslog-only --fork --print-pid 5 --print-address 7 --session
init
  └─dbus-launch,zucca --autolaunch=dc2fc133e83ce50f2dcb99b757265152 --binary-syntax --close-stderr
init
  └─dbus-daemon,zucca --syslog-only --fork --print-pid 5 --print-address 7 --session
init
  └─at-spi-bus-laun,zucca
      └─dbus-daemon --config-file=/usr/share/defaults/at-spi2/accessibility.conf --nofork --print-address 3

_________________
..: Zucca :..

Code:
ERROR: '--failure' is not an option. Aborting...
Back to top
View user's profile Send private message
GDH-gentoo
Guru
Guru


Joined: 20 Jul 2019
Posts: 419
Location: South America

PostPosted: Tue Aug 27, 2019 2:50 am    Post subject: Reply with quote

Zucca wrote:
Well. There's surely something missing. Looks like sddm doesn't start dbus session properly or at all...

shellcmd: tree /run/user/999/ :
/run/user/999/
├── dbus-1
│   └── services
├── dconf
│   └── user
├── pulse
│   ├── native
│   └── pid
├── sway-ipc.999.28083.sock
├── wayland-0
└── wayland-0.lock

This just means that the bus daemon's socket isn't there. Depending on the setup, it could have been.

Zucca wrote:
Code:
init
  └─dbus-launch,zucca --autolaunch dc2fc133e83ce50f2dcb99b757265152 --binary-syntax --close-stderr
...
init
  └─dbus-launch,sddm --autolaunch dc2fc133e83ce50f2dcb99b757265152 --binary-syntax --close-stderr
...
init
  └─dbus-launch,zucca --autolaunch=dc2fc133e83ce50f2dcb99b757265152 --binary-syntax --close-stderr

Oh, so SDDM is using dbus-launch. That should be setting DBUS_SESSION_BUS_ADDRESS with the bus daemon's socket for the relevant processes.

Zucca wrote:
Code:
init
  └─dbus-daemon,messagebus --system

The system-wide message bus, this doesn´t count.

Zucca wrote:
Code:
init
  └─at-spi-bus-laun,zucca
      └─dbus-daemon --config-file=/usr/share/defaults/at-spi2/accessibility.conf --nofork --print-address 3

Special-purpose bus, probably doesn´t matter.

Zucca wrote:
Code:
init
  └─dbus-daemon,zucca --syslog-only --fork --print-pid 5 --print-address 7 --session
...
init
  └─dbus-daemon,sddm --syslog-only --fork --print-pid 5 --print-address 7 --session
...
init
  └─dbus-daemon,zucca --syslog-only --fork --print-pid 5 --print-address 7 --session

These are login session message buses. The one with UID="sddm" is probably used by sddm-greeter, but are there really two more dbus-daemon processes instead of one?

Zucca wrote:
Code:
init
  └─sddm
      │  ...
      ├─sddm-helper --socket /tmp/sddm-authaec59d17-ad4d-4c1f-b8ce-b828822101ee --id 2 --start/usr/bin/sddm-greeter --socket /
      │   └─sddm-greeter,sddm --socket /tmp/sddm-:0-BEmNMy --theme /usr/share/sddm/themes/maya
      │       ...
      ├─sddm-helper --socket /tmp/sddm-authaec59d17-ad4d-4c1f-b8ce-b828822101ee --id 1 --start sway --user zucca
      │   └─sway,zucca
      │       ├ ...
      │       ├─swaybar -b bar-0

I'd start checking again which of these have DBUS_SESSION_BUS_ADDRESS set in their environment and which don't.

Edit to add: For comparison, this is how things look on my simple startx + Openbox setup.

Code:
$ ps axf -o pid,uid,gid,args
  PID   UID   GID COMMAND
...
 1538     0  1000 /bin/login --
 1554  1000  1000  \_ -bash
 1557  1000  1000      \_ /bin/sh /usr/bin/startx
 1573  1000  1000          \_ xinit /etc/X11/xinit/xinitrc -- /etc/X11/xinit/xserverrc :0 ...
 1574     0  1000              \_ /usr/bin/X -nolisten tcp :0 ...
 1579  1000  1000              \_ /bin/sh /etc/X11/Sessions/openbox
 1641  1000  1000                  \_ /usr/bin/openbox --startup /usr/libexec/openbox-autostart OPENBOX
 1747  1000  1000                      \_ links -g
...
 1639  1000  1000 /usr/bin/dbus-launch --exit-with-session /etc/X11/Sessions/openbox
 1640  1000  1000 /usr/bin/dbus-daemon --syslog --fork --print-pid 5 --print-address 7 --session
 1652  1000  1000 urxvtd -q -o
 1709  1000  1000  \_ bash
 1748  1000  1000      \_ ps axf -o pid,uid,gid,args

In this case, dbus-launch is invoked (indirectly) by xinit, and everything that is launched by Openbox has DBUS_SESSION_BUS_ADDRESS set to the login session message bus' socket.

Code:
$ cat /proc/1579/environ | xargs -0 printf '%s\n' | grep DBUS_SESSION_BUS_ADDRESS
DBUS_SESSION_BUS_ADDRESS=unix:abstract=/tmp/dbus-4qaQ5Kp8V9,guid=b9bbb7e1bd8690a84fb2774b5d6721fb

$ cat /proc/1641/environ | xargs -0 printf '%s\n' | grep DBUS_SESSION_BUS_ADDRESS
DBUS_SESSION_BUS_ADDRESS=unix:abstract=/tmp/dbus-4qaQ5Kp8V9,guid=b9bbb7e1bd8690a84fb2774b5d6721fb

$ cat /proc/1747/environ | xargs -0 printf '%s\n' | grep DBUS_SESSION_BUS_ADDRESS
DBUS_SESSION_BUS_ADDRESS=unix:abstract=/tmp/dbus-4qaQ5Kp8V9,guid=b9bbb7e1bd8690a84fb2774b5d6721fb

$ cat /proc/1709/environ | xargs -0 printf '%s\n' | grep DBUS_SESSION_BUS_ADDRESS
DBUS_SESSION_BUS_ADDRESS=unix:abstract=/tmp/dbus-4qaQ5Kp8V9,guid=b9bbb7e1bd8690a84fb2774b5d6721fb
Back to top
View user's profile Send private message
Zucca
Veteran
Veteran


Joined: 14 Jun 2007
Posts: 1800
Location: KUUSANKOSKI, Finland

PostPosted: Fri Sep 06, 2019 2:50 pm    Post subject: Reply with quote

Well. I "[SOLVED]" this.

Normally sddm starts wayland sessions via /usr/share/sddm/scripts/wayland-session.
I changed the script location via sddm.conf. And created my own which sets/exports some wayland specific environment variables and finally sources the upstream wayland session script (mentioned above) via this trick:
Code:
source /usr/share/sddm/scripts/wayland-session dbus-launch --exit-with-session "$@"


Although I should probably first check if DBUS_SESSION_BUS_ADDRESS is set and/or if $1 equals to 'sway'.

Full DEs, like KDE and GNOME start/create dbus session by themselves, right? Or should it start ever earlier?
_________________
..: Zucca :..

Code:
ERROR: '--failure' is not an option. Aborting...
Back to top
View user's profile Send private message
GDH-gentoo
Guru
Guru


Joined: 20 Jul 2019
Posts: 419
Location: South America

PostPosted: Sat Sep 07, 2019 8:01 pm    Post subject: Reply with quote

Zucca wrote:
Well. I "[SOLVED]" this.

So the tray works now with your change?

Zucca wrote:
Full DEs, like KDE and GNOME start/create dbus session by themselves, right? Or should it start ever earlier?

I believe GDM does it for GNOME, and SDDM's /usr/share/sddm/scripts/Xsession does it (with a Gentoo patch) for X11 sessions. I'm not sure about Wayland sessions; if I understand correctly, KDE does it in /usr/share/wayland-sessions/plasmawayland.desktop (not sure if it is the right name or location) using dbus-run-session. Maybe as a test you could go back to your original setup, but use dbus-run-session in your /usr/share/wayland-sessions/sway.desktop, to see if it still works. Someting like:

Code:
Exec=dbus-run-session sway

dbus-launch seems to be intended for X11 sessions.
Back to top
View user's profile Send private message
Zucca
Veteran
Veteran


Joined: 14 Jun 2007
Posts: 1800
Location: KUUSANKOSKI, Finland

PostPosted: Sat Sep 07, 2019 9:14 pm    Post subject: Reply with quote

GDH-gentoo wrote:
Zucca wrote:
Well. I "[SOLVED]" this.

So the tray works now with your change?
Yes it does. \o/ But is it the right way?
GDH-gentoo wrote:
dbus-launch seems to be intended for X11 sessions.
Hm! That might explain some qt programs behaving oddly... (Just installed konqueror and boy... it does not accept any mouse or keyboard input, even if I have unset all *QT* env variables.) I'll investigate dbus-run-session.

So far... A HUGE thank you! The whole dbus concept has been quite a mystery (lazy me) for me before this.
_________________
..: Zucca :..

Code:
ERROR: '--failure' is not an option. Aborting...
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Desktop Environments All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum