diff --git a/usr/share/ublue-os/just/custom.just b/usr/share/ublue-os/just/custom.just index 94432935723..7b32604f465 100644 --- a/usr/share/ublue-os/just/custom.just +++ b/usr/share/ublue-os/just/custom.just @@ -148,6 +148,25 @@ nix-devbox-global: echo 'run "devbox global run" to see other available configuration commands' # Install better touch-friendly GNOME extensions +podmansh: + sudo mkdir -p /etc/containers/systemd/users/${UID} + sudo cp /usr/share/ublue-os/quadlets/podmansh.container /etc/containers/systemd/users/${UID}/podmansh.container + sudo lchsh $USER /usr/bin/podmansh + podman pull ghcr.io/ublue-os/ubuntu-toolbox:latest + + systemctl --user daemon-reload + systemctl --user start podmansh.service + echo "Shell now switched to podmansh. Spawn a new terminal to get going!" + echo "By default, the shell will be Bash. To override it, create ~/.profile with your preferred shell" + echo "Note: That shell must exist in the toolbox!" + +podmansh-switch IMAGE: + sudo sed -i "/Image\=.*$/c Image\={{IMAGE}}" /etc/containers/systemd/users/${UID}/podmansh.container + podman pull {{IMAGE}} + podman rm -f podmansh + systemctl --user daemon-reload + systemctl --user start podmansh.service + echo "Image now switched to {{IMAGE}}" touch: pip install --upgrade gnome-extensions-cli gext install improvedosk@nick-shmyrev.dev diff --git a/usr/share/ublue-os/quadlets/podmansh.container b/usr/share/ublue-os/quadlets/podmansh.container new file mode 100644 index 00000000000..7dc97120aa0 --- /dev/null +++ b/usr/share/ublue-os/quadlets/podmansh.container @@ -0,0 +1,41 @@ +[Unit] +Description=The Podmansh container +After=local-fs.target + +[Container] +Image=ghcr.io/ublue-os/ubuntu-toolbox:latest +ContainerName=podmansh +RemapUsers=keep-id +RunInit=yes +Network=host +AddCapability=all +NoNewPrivileges=no +Exec=sleep infinity +WorkingDir=%h + +Volume=%h:%h +Volume=/:/run/host:rslave +Volume=/dev:/dev:rslave +Volume=/sys:/sys:rslave +Volume=/tmp:/tmp:rslave +Volume=/sys/fs/selinux +Volume=/var/log/journal +Volume=/run/user/1000:/run/user/1000:rslave +Volume=/etc/hosts:/etc/hosts:ro +Volume=/etc/resolv.conf:/etc/resolv.conf:ro + +Environment=ENV=%h/.profile + +PodmanArgs=--env-host +PodmanArgs=--privileged +PodmanArgs=--mount=type=devpts,destination=/dev/pts +PodmanArgs=--userns=keep-id +PodmanArgs=--ulimit=host +PodmanArgs=--security-opt=label=disable +PodmanArgs=--cgroupns=private +PodmanArgs=--log-level=debug + +Annotation=run.oci.keep_original_groups=1 + +[Install] +RequiredBy=default.target \ No newline at end of file