Commit cfd1c144 authored by anonym's avatar anonym

Move env fix from caller to callee.

This way tails-additional-software-notify will open a browser with
propoer "GNOME" environment no matter who calls it.
parent 2bc052e5
...@@ -6,6 +6,8 @@ import os.path ...@@ -6,6 +6,8 @@ import os.path
import subprocess import subprocess
import sys import sys
from tailslib.gnome import gnome_env_vars
import gi import gi
from gi.repository import GLib from gi.repository import GLib
...@@ -56,7 +58,9 @@ class ASPNotifier(object): ...@@ -56,7 +58,9 @@ class ASPNotifier(object):
elif action == "deny": elif action == "deny":
sys.exit(3) sys.exit(3)
elif action == "documentation": elif action == "documentation":
subprocess.Popen(["tails-documentation", user_data]) subprocess.Popen(
["env", *gnome_env_vars(), "tails-documentation", user_data]
)
sys.exit(5) sys.exit(5)
def cb_notification_closed(self, notification): def cb_notification_closed(self, notification):
......
...@@ -23,8 +23,6 @@ from tailslib.additionalsoftware import ( ...@@ -23,8 +23,6 @@ from tailslib.additionalsoftware import (
get_packages_list_path, get_packages_list_path,
remove_additional_packages) remove_additional_packages)
from tailslib.gnome import gnome_env_vars
from tailslib.persistence import ( from tailslib.persistence import (
has_unlocked_persistence, has_unlocked_persistence,
has_persistence, has_persistence,
...@@ -112,7 +110,6 @@ def _notify(title, body="", accept_label="", deny_label="", ...@@ -112,7 +110,6 @@ def _notify(title, body="", accept_label="", deny_label="",
completed_process = subprocess.run( completed_process = subprocess.run(
[ [
"sudo", "-u", LIVE_USERNAME, "sudo", "-u", LIVE_USERNAME,
'env', *gnome_env_vars(),
cmd, title, body, accept_label, deny_label, cmd, title, body, accept_label, deny_label,
documentation_target, urgent documentation_target, urgent
], ],
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment