Skip to content

Commit

Permalink
Fixed #112, config ALWAYS_DBUS_LAUNCH respects configuration now.
Browse files Browse the repository at this point in the history
If `DBUS_SESSION_BUS_ADDRESS` is already set, skip start of `dbus-launch`.
  • Loading branch information
tvrzna committed Jun 11, 2024
1 parent 661c08a commit fa3723f
Showing 1 changed file with 7 additions and 7 deletions.
14 changes: 7 additions & 7 deletions src/session.go
Original file line number Diff line number Diff line change
Expand Up @@ -79,10 +79,6 @@ func (s *commonSession) start() {
s.auth.usr().setenv(envXdgSessionType, s.d.env.sessionType())
}

if s.conf.AlwaysDbusLaunch {
s.dbus = &dbus{}
}

session, strExec := s.prepareGuiCommand()
s.cmd = session

Expand All @@ -93,8 +89,12 @@ func (s *commonSession) start() {
logPrint(sessionErrLogErr)
}

if s.dbus != nil {
s.dbus.launch(s.auth.usr())
if s.conf.AlwaysDbusLaunch {
if s.auth.usr().getenv(dbusSessionBusAddress) == "" {
s.dbus.launch(s.auth.usr())
} else {
logPrint("DBUS_SESSION_BUS_ADDRESS is already set, skipping start of DBUS_LAUNCH")
}
}

logPrint("Starting " + strExec)
Expand All @@ -115,7 +115,7 @@ func (s *commonSession) start() {

err := session.Wait()

if s.dbus != nil {
if s.dbus.pid > 0 {
s.dbus.interrupt()
}

Expand Down

0 comments on commit fa3723f

Please sign in to comment.