Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 15 additions & 5 deletions root/etc/s6-overlay/s6-rc.d/svc-de/run
Original file line number Diff line number Diff line change
Expand Up @@ -8,11 +8,21 @@ while true; do
sleep .5
done

# set sane resolution before starting apps
if ! s6-setuidgid abc xrandr | grep -q "1024x768"; then
s6-setuidgid abc xrandr --newmode "1024x768" 63.50 1024 1072 1176 1328 768 771 775 798 -hsync +vsync
s6-setuidgid abc xrandr --addmode screen "1024x768"
s6-setuidgid abc xrandr --output screen --mode "1024x768" --dpi 96
# set resolution before starting apps
# Use environment variables if set, otherwise default to 1024x768
RESOLUTION_WIDTH=${SELKIES_MANUAL_WIDTH:-1024}
RESOLUTION_HEIGHT=${SELKIES_MANUAL_HEIGHT:-768}
RESOLUTION="${RESOLUTION_WIDTH}x${RESOLUTION_HEIGHT}"

# Generate modeline using cvt
MODELINE=$(s6-setuidgid abc cvt ${RESOLUTION_WIDTH} ${RESOLUTION_HEIGHT} | grep "Modeline" | sed 's/^.*Modeline //')
MODELINE_NAME=$(echo "$MODELINE" | cut -d' ' -f1 | tr -d '"')
MODELINE_PARAMS=$(echo "$MODELINE" | cut -d' ' -f2-)

if ! s6-setuidgid abc xrandr | grep -q "$RESOLUTION"; then
s6-setuidgid abc xrandr --newmode $MODELINE
s6-setuidgid abc xrandr --addmode screen "$MODELINE_NAME"
s6-setuidgid abc xrandr --output screen --mode "$MODELINE_NAME" --dpi 96
fi

# set xresources
Expand Down