From 526e6cae2688c54f67a7732cf64a6410f0cde454 Mon Sep 17 00:00:00 2001 From: Xavier Logerais Date: Sun, 28 Sep 2025 17:55:51 +0200 Subject: [PATCH] feat(functions): Add a function to start and log into the devenv container --- functions.d/devenv | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) create mode 100644 functions.d/devenv diff --git a/functions.d/devenv b/functions.d/devenv new file mode 100644 index 0000000..e93826d --- /dev/null +++ b/functions.d/devenv @@ -0,0 +1,18 @@ +#!/bin/bash + +function devenv() { + + local status + + # Get LXC container status + status=$(lxc info devenv | yq .Status) + + # Start container if not running + if [ "${status}" != "RUNNING" ]; then lxc start devenv; fi + + # Rename tmux window if inside tmux + if [ -n "$TMUX" ]; then tmux rename-window "devenv"; fi + + # Login as user xavier + lxc exec devenv -- login -f xavier +}