mirror of
https://github.com/basecamp/omarchy.git
synced 2026-02-17 15:25:37 +00:00
Compare commits
8 Commits
colors-gem
...
improve-rd
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
8997907c04 | ||
|
|
ed462b223e | ||
|
|
9e3bb43c2f | ||
|
|
ef4ecdbfcf | ||
|
|
7bf1c38937 | ||
|
|
4a07b94cb6 | ||
|
|
a7d76bfc24 | ||
|
|
f5d0c16f85 |
@@ -3,4 +3,9 @@
|
|||||||
cd ~/.local/share/omarchy
|
cd ~/.local/share/omarchy
|
||||||
migration_file="$HOME/.local/share/omarchy/migrations/$(git log -1 --format=%cd --date=unix).sh"
|
migration_file="$HOME/.local/share/omarchy/migrations/$(git log -1 --format=%cd --date=unix).sh"
|
||||||
touch $migration_file
|
touch $migration_file
|
||||||
nvim $migration_file
|
|
||||||
|
if [[ "$1" != "--no-edit" ]]; then
|
||||||
|
nvim $migration_file
|
||||||
|
fi
|
||||||
|
|
||||||
|
echo $migration_file
|
||||||
|
|||||||
@@ -254,6 +254,25 @@ remove_windows() {
|
|||||||
echo "Windows VM removal completed!"
|
echo "Windows VM removal completed!"
|
||||||
}
|
}
|
||||||
|
|
||||||
|
wait_for_rdp_ready() {
|
||||||
|
local WIN_USER="$1"
|
||||||
|
local WIN_PASS="$2"
|
||||||
|
local TIMEOUT=240
|
||||||
|
local SECONDS=0
|
||||||
|
|
||||||
|
echo "Waiting for Windows VM to be ready..."
|
||||||
|
|
||||||
|
while ! timeout 5s xfreerdp3 /auth-only /cert:ignore /u:"$WIN_USER" /p:"$WIN_PASS" /v:127.0.0.1:3389 &>/dev/null; do
|
||||||
|
sleep 2
|
||||||
|
if [ $SECONDS -gt $TIMEOUT ]; then
|
||||||
|
echo "❌ Timeout waiting for RDP!"
|
||||||
|
echo " The VM might still be installing Windows."
|
||||||
|
echo " Check progress at: http://127.0.0.1:8006"
|
||||||
|
return 1
|
||||||
|
fi
|
||||||
|
done
|
||||||
|
}
|
||||||
|
|
||||||
launch_windows() {
|
launch_windows() {
|
||||||
KEEP_ALIVE=false
|
KEEP_ALIVE=false
|
||||||
if [ "$1" = "--keep-alive" ] || [ "$1" = "-k" ]; then
|
if [ "$1" = "--keep-alive" ] || [ "$1" = "-k" ]; then
|
||||||
@@ -266,6 +285,14 @@ launch_windows() {
|
|||||||
exit 1
|
exit 1
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
# Extract credentials from compose file
|
||||||
|
WIN_USER=$(grep "USERNAME:" "$COMPOSE_FILE" | sed 's/.*USERNAME: "\(.*\)"/\1/')
|
||||||
|
WIN_PASS=$(grep "PASSWORD:" "$COMPOSE_FILE" | sed 's/.*PASSWORD: "\(.*\)"/\1/')
|
||||||
|
|
||||||
|
# Use defaults if not found
|
||||||
|
[ -z "$WIN_USER" ] && WIN_USER="docker"
|
||||||
|
[ -z "$WIN_PASS" ] && WIN_PASS="admin"
|
||||||
|
|
||||||
# Check if container is already running
|
# Check if container is already running
|
||||||
CONTAINER_STATUS=$(docker inspect --format='{{.State.Status}}' omarchy-windows 2>/dev/null)
|
CONTAINER_STATUS=$(docker inspect --format='{{.State.Status}}' omarchy-windows 2>/dev/null)
|
||||||
|
|
||||||
@@ -282,32 +309,12 @@ launch_windows() {
|
|||||||
notify-send -u critical "Windows VM" "Failed to start Windows VM"
|
notify-send -u critical "Windows VM" "Failed to start Windows VM"
|
||||||
exit 1
|
exit 1
|
||||||
fi
|
fi
|
||||||
|
fi
|
||||||
|
|
||||||
# Wait for RDP to be ready
|
if ! wait_for_rdp_ready "$WIN_USER" "$WIN_PASS"; then
|
||||||
echo "Waiting for Windows VM to be ready..."
|
notify-send -u critical "Windows VM" "Did not come alive in time."
|
||||||
WAIT_COUNT=0
|
|
||||||
while ! nc -z 127.0.0.1 3389 2>/dev/null; do
|
|
||||||
sleep 2
|
|
||||||
WAIT_COUNT=$((WAIT_COUNT + 1))
|
|
||||||
if [ $WAIT_COUNT -gt 60 ]; then # 2 minutes timeout
|
|
||||||
echo "❌ Timeout waiting for RDP!"
|
|
||||||
echo " The VM might still be installing Windows."
|
|
||||||
echo " Check progress at: http://127.0.0.1:8006"
|
|
||||||
exit 1
|
exit 1
|
||||||
fi
|
fi
|
||||||
done
|
|
||||||
|
|
||||||
# Give it a moment more to fully initialize
|
|
||||||
sleep 5
|
|
||||||
fi
|
|
||||||
|
|
||||||
# Extract credentials from compose file
|
|
||||||
WIN_USER=$(grep "USERNAME:" "$COMPOSE_FILE" | sed 's/.*USERNAME: "\(.*\)"/\1/')
|
|
||||||
WIN_PASS=$(grep "PASSWORD:" "$COMPOSE_FILE" | sed 's/.*PASSWORD: "\(.*\)"/\1/')
|
|
||||||
|
|
||||||
# Use defaults if not found
|
|
||||||
[ -z "$WIN_USER" ] && WIN_USER="docker"
|
|
||||||
[ -z "$WIN_PASS" ] && WIN_PASS="admin"
|
|
||||||
|
|
||||||
# Build the connection info
|
# Build the connection info
|
||||||
if [ "$KEEP_ALIVE" = true ]; then
|
if [ "$KEEP_ALIVE" = true ]; then
|
||||||
|
|||||||
17
config/omarchy/extensions/menu.sh
Normal file
17
config/omarchy/extensions/menu.sh
Normal file
@@ -0,0 +1,17 @@
|
|||||||
|
# Overwrite parts of the omarchy-menu with user-specific submenus.
|
||||||
|
# See $OMARCHY_PATH/bin/omarchy-menu for functions that can be overwritten.
|
||||||
|
#
|
||||||
|
# WARNING: Overwritten functions will obviously not be updated when Omarchy changes.
|
||||||
|
#
|
||||||
|
# Example adding suspend to the system menu:
|
||||||
|
#
|
||||||
|
# show_system_menu() {
|
||||||
|
# case $(menu "System" " Lock\n Screensaver\n Suspend\n Restart\n Shutdown") in
|
||||||
|
# *Lock*) omarchy-lock-screen ;;
|
||||||
|
# *Screensaver*) omarchy-launch-screensaver force ;;
|
||||||
|
# *Suspend*) systemctl suspend ;;
|
||||||
|
# *Restart*) omarchy-cmd-reboot ;;
|
||||||
|
# *Shutdown*) omarchy-cmd-shutdown ;;
|
||||||
|
# *) back_to show_main_menu ;;
|
||||||
|
# esac
|
||||||
|
# }
|
||||||
Reference in New Issue
Block a user