Skip to content

Commit

Permalink
create specific vscode user-level unit file
Browse files Browse the repository at this point in the history
  • Loading branch information
jeefy committed Dec 31, 2023
1 parent 709e0e3 commit a55d530
Show file tree
Hide file tree
Showing 4 changed files with 35 additions and 22 deletions.
12 changes: 0 additions & 12 deletions dx/usr/bin/bluefin-dx-user-setup

This file was deleted.

21 changes: 21 additions & 0 deletions dx/usr/bin/bluefin-dx-user-vscode
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
#!/usr/bin/env bash

# SCRIPT VERSION
USER_SETUP_VER=1
USER_SETUP_VER_FILE="$HOME/.bluefin-vscode-configured"
USER_SETUP_VER_RAN=$(cat "$USER_SETUP_VER_FILE")

# Run script if updated
if [[ -f $USER_SETUP_VER_FILE && "$USER_SETUP_VER" = "$USER_SETUP_VER_RAN" ]]; then
echo "User setup has already run. Exiting..."
exit 0
fi

# Setup VSCode
# Pre-install preferred VSCode Extensions
code --install-extension ms-vscode-remote.remote-containers
code --install-extension ms-azuretools.vscode-docker

# Prevent future executions
echo "Writing state file"
echo "$USER_SETUP_VER" > "$USER_SETUP_VER_FILE"
14 changes: 14 additions & 0 deletions dx/usr/lib/systemd/user/bluefin-dx-user-vscode.service
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
[Unit]
Description=Run
Wants=network-online.target
After=network-online.target bluefin-dx-user-setup.service

[Service]
Type=oneshot
ExecStart=/usr/bin/bluefin-dx-vscode
Restart=on-failure
RestartSec=30
StartLimitInterval=0

[Install]
WantedBy=default.target
10 changes: 0 additions & 10 deletions usr/bin/ublue-user-setup
Original file line number Diff line number Diff line change
Expand Up @@ -11,19 +11,9 @@ if [[ -f $USER_SETUP_VER_FILE && $USER_SETUP_VER = $USER_SETUP_VER_RAN ]]; then
exit 0
fi

IMAGE_INFO="/usr/share/ublue-os/image-info.json"
IMAGE_NAME=$(jq -r '."image-name"' < $IMAGE_INFO)

# Enable NTP
timedatectl set-ntp true

if [[ $IMAGE_NAME = "bluefin-dx" ]]; then

source /usr/bin/bluefin-dx-user-setup

fi


# Prevent future executions
echo "Writing state file"
echo $USER_SETUP_VER > $USER_SETUP_VER_FILE

0 comments on commit a55d530

Please sign in to comment.