aboutsummaryrefslogtreecommitdiff
path: root/scripts/p7s/distrobox.py
blob: 787f05efa03cadfb326ee8fff39d07ecace73a86 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
import os
import subprocess


IMAGE="quay.io/alexpdp7/workstation:latest"
NAME="workstation-latest"


def create():
    subprocess.run(["distrobox", "create", "-i", IMAGE], check=True)


def enter():
    os.execvp("distrobox", ["distrobox", "enter", NAME])


def update():
    print("If this fails on ws, systemctl --user stop soju bitlbee // systemctl --user start soju bitlbee")
    subprocess.run(["distrobox", "rm", "-f", NAME], check=True)
    subprocess.run(["podman", "rmi", IMAGE], check=True)
    subprocess.run(["podman", "pull", IMAGE], check=True)
    subprocess.run(["distrobox", "create", "-i", IMAGE], check=True)