mirror of
https://github.com/nestriness/nestri.git
synced 2026-03-17 03:43:07 +02:00
feat: WIP s6-overlay and friends
This commit is contained in:
@@ -21,3 +21,23 @@ if [[ ! -f /etc/nestri/gpu_helpers.sh ]]; then
|
||||
exit 1
|
||||
fi
|
||||
source /etc/nestri/gpu_helpers.sh || { log "Error: Failed to source /etc/nestri/gpu_helpers.sh"; exit 1; }
|
||||
|
||||
# Parses resolution string
|
||||
parse_resolution() {
|
||||
local resolution="$1"
|
||||
if [[ -z "$resolution" ]]; then
|
||||
log "Error: No resolution provided"
|
||||
return 1
|
||||
fi
|
||||
|
||||
IFS='x' read -r width height <<< "$resolution"
|
||||
if ! [[ "$width" =~ ^[0-9]+$ ]] || ! [[ "$height" =~ ^[0-9]+$ ]]; then
|
||||
log "Error: Invalid resolution format. Expected: WIDTHxHEIGHT (e.g., 1920x1080), got: $resolution"
|
||||
return 1
|
||||
fi
|
||||
|
||||
export WIDTH="$width"
|
||||
export HEIGHT="$height"
|
||||
return 0
|
||||
}
|
||||
parse_resolution "${RESOLUTION:-1280x720}" || exit 1
|
||||
|
||||
Reference in New Issue
Block a user