Skip to content

Commit

Permalink
Testing runing chromium on host dbus
Browse files Browse the repository at this point in the history
  • Loading branch information
KW-M committed Sep 18, 2024
1 parent 05c4b77 commit bd7d73f
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 14 deletions.
10 changes: 8 additions & 2 deletions rov-python/simple_chromium.py
Original file line number Diff line number Diff line change
Expand Up @@ -190,14 +190,20 @@
# add the URL to the end of the args list to open the webpage
chromium_args.append(URL)
ARGS_STRING = '"' + '" "'.join(chromium_args) + '"'
environmentVars = {
**os.environ,
"DBUS_SESSION_BUS_ADDRESS": "unix:path=/run/user/1000/bus",
}
if vdisplay is not None and vdisplay.is_alive():
ARGS_STRING = "DISPLAY=" + vdisplay.new_display_var + " " + ARGS_STRING
environmentVars["DISPLAY"] = vdisplay.new_display_var
print("Environment Variables:")
print(environmentVars)
print("Running chromium:")
print(ARGS_STRING)
browser_process = subprocess.Popen(
args=[ARGS_STRING],
shell=True,
env=os.environ,
env=environmentVars,
cwd=os.getcwd(),
)

Expand Down
24 changes: 12 additions & 12 deletions rov-tooling/config-files/supervisord.conf
Original file line number Diff line number Diff line change
Expand Up @@ -8,18 +8,18 @@ pidfile=/var/run/supervisord.pid
logfile=/dev/stdout
logfile_maxbytes=0

[program:DBUS]
# export DBUS_SESSION_BUS_ADDRESS=$(dbus-daemon --config-file=/usr/share/dbus-1/system.conf --print-address | cut -d, -f1) # --system
# command=/usr/bin/dbus-daemon --config-file=/usr/share/dbus-1/system.conf --nofork
command=/bin/bash -c "mkdir -p /run/dbus/; dbus-daemon --config-file=/usr/share/dbus-1/system.conf --nofork;"
priority=1
user=root
autostart=true
killasgroup=true
redirect_stderr=true
stdout_logfile=/dev/fd/1
stdout_logfile_maxbytes=0
autorestart=true
# [program:DBUS]
# # export DBUS_SESSION_BUS_ADDRESS=$(dbus-daemon --config-file=/usr/share/dbus-1/system.conf --print-address | cut -d, -f1) # --system
# # command=/usr/bin/dbus-daemon --config-file=/usr/share/dbus-1/system.conf --nofork
# command=/bin/bash -c "mkdir -p /run/dbus/; dbus-daemon --config-file=/usr/share/dbus-1/system.conf --nofork;"
# priority=1
# user=root
# autostart=true
# killasgroup=true
# redirect_stderr=true
# stdout_logfile=/dev/fd/1
# stdout_logfile_maxbytes=0
# autorestart=true

# [program:XVFB_DISPLAY]
# command=Xvfb :0 -screen 0 800x600x24
Expand Down

0 comments on commit bd7d73f

Please sign in to comment.