Merge ~jocave/checkbox-support:pulse-use-from-snaps into checkbox-support:master

Proposed by Jonathan Cave
Status: Merged
Approved by: Jonathan Cave
Approved revision: ecfd1f71db328a0f7c7d4b06c6b7ecca55c3b939
Merged at revision: 22f28b0bfd21102be78bbe7ad947728c08ed2fd9
Proposed branch: ~jocave/checkbox-support:pulse-use-from-snaps
Merge into: checkbox-support:master
Diff against target: 30 lines (+6/-1)
1 file modified
checkbox_support/scripts/audio_settings.py (+6/-1)
Reviewer Review Type Date Requested Status
Sheila Miguez (community) Approve
Review via email: mp+389084@code.launchpad.net

Description of the change

Same change as made in:

https://code.launchpad.net/~jocave/plainbox-provider-checkbox/+git/plainbox-provider-checkbox/+merge/388884

As this script also makes `pactl` calls the runtime path needs fixing when running from a snap

To post a comment you must log in.
Revision history for this message
Sheila Miguez (codersquid) wrote :

lgtm

review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1diff --git a/checkbox_support/scripts/audio_settings.py b/checkbox_support/scripts/audio_settings.py
2index f850e5a..6c00743 100644
3--- a/checkbox_support/scripts/audio_settings.py
4+++ b/checkbox_support/scripts/audio_settings.py
5@@ -1,7 +1,7 @@
6 #
7 # This file is part of Checkbox.
8 #
9-# Copyright 2013 Canonical Ltd.
10+# Copyright 2013-2020 Canonical Ltd.
11 #
12 # Checkbox is free software: you can redistribute it and/or modify
13 # it under the terms of the GNU General Public License version 3,
14@@ -31,6 +31,7 @@ import re
15 import sys
16
17 from checkbox_support.parsers.pactl import parse_pactl_output
18+from checkbox_support.snap_utils.system import in_classic_snap
19
20 TYPES = ("source", "sink")
21 DIRECTIONS = {"source": "input", "sink": "output"}
22@@ -54,6 +55,10 @@ def unlocalized_env(reset={"LANG": "POSIX.UTF-8"}):
23 """
24 env = dict(os.environ)
25 env.update(reset)
26+ if in_classic_snap():
27+ prp = '/run/user/{}/snap.{}/../pulse'.format(
28+ os.geteuid(), os.getenv('SNAP_NAME'))
29+ env['PULSE_RUNTIME_PATH'] = prp
30 return env
31
32

Subscribers

People subscribed via source and target branches