xiwrap

slightly higher-level container setup utility
git clone https://git.ce9e.org/xiwrap.git

commit
6529937cb9c1bfea249919264f4d721c5ed798c8
parent
8ea65f0a61f572c73999cc92e6b93ef3d7325c9c
Author
Tobias Bengfort <tobias.bengfort@posteo.de>
Date
2024-06-16 00:49
align setenv with bwrap

Diffstat

M rules/audio 2 +-
M xiwrap.py 6 +++---

2 files changed, 4 insertions, 4 deletions


diff --git a/rules/audio b/rules/audio

@@ -1,2 +1,2 @@
    1    -1 env XDG_RUNTIME_DIR
   -1     1 setenv XDG_RUNTIME_DIR
    2     2 ro-bind $XDG_RUNTIME_DIR/pulse

diff --git a/xiwrap.py b/xiwrap.py

@@ -14,13 +14,13 @@ DBUS_PROXY_PATH = XDG_RUNTIME_DIR / f'dbus-proxy-{os.getpid()}'
   14    14 
   15    15 USAGE = """Usage: xiwrap [OPTION]... -- [BWRAP_OPTIONS]... CMD
   16    16 
   17    -1 Example: xiwrap --import host-os --env TERM -- --chdir /tmp bash
   -1    17 Example: xiwrap --import host-os --setenv TERM -- --chdir /tmp bash
   18    18 
   19    19 The following options are available:
   20    20 
   21    21 -h, --help              Print this message and exit
   22    22 --debug                 Print the bwrap command instead of executing it.
   23    -1 --env VAR [VALUE]       Set an environment variable. If VALUE is not provided,
   -1    23 --setenv VAR [VALUE]    Set an environment variable. If VALUE is not provided,
   24    24                         the value from the current environment is kept.
   25    25 --bind DEST [SRC]       Bind mount the host path SRC on DEST. If SRC is not
   26    26                         provided, it is the same as DEST. Ignored if SRC does
@@ -118,7 +118,7 @@ class RuleSet:
  118   118                 raise RuleError(key, args)
  119   119             self.ensure_dbus()
  120   120             self.dbus[args[0]] = key.removeprefix('dbus-')
  121    -1         elif key == 'env':
   -1   121         elif key == 'setenv':
  122   122             var, value = self.parse_env(key, args)
  123   123             self.env[var] = value
  124   124         elif key in ['ro-bind', 'bind']: