Droo-Labs

the perspicacious ramblings of droo

Scaling Script for Linux on Chromebook

This is a script for easily scaling your Chromebook running Linux (natively, not through Crouton). Put this in ~/bin/res.sh and use like so: res.sh 1280 — The common widths I would use are 1280 and 2560. You can experiment and find what works best for you though!

#!/bin/bash
#Original author: Travis Gibson
#Modified author: Josh Kaplan
#Modified for the Chromebook Pixel for use with bash by Andrew Dahl
#This script requires an argument for the resolution width
if [ -z “$1″ ]; then
echo “Usage: Res.sh “;
exit 1;
fi
erg=$( echo “$1″)
check=$(xrandr -q | grep eDP1 | cut -d ” ” -f 3 | cut -d “x” -f 1)
monitor=”eDP1″
dpi=$(bc <<< "$erg/(27.0 / 2.54)") # H-Res / ( DisplayWidthIn-cm / in/cm-conversion) if [[ "$erg" -eq "$check" ]]; then echo "The screen is already at this resolution" exit 1; fi resolution=$(xrandr -q | grep ${monitor} | cut -d " " -f 3); if [ "$resolution" != "2560x1700+0+0" ]; then xrandr --output ${monitor} --scale 1x1 --dpi $dpi; #Necessary to work around an issue where re-scaling #only works if the scale is set to 1x1 sleep 3; fi scale_w=$(echo "scale=4; $1/2560" | bc; exit ); arg=$(echo "$scale_w""x""$scale_w") xrandr --output ${monitor} --scale $arg --dpi $dpi sleep 1;

Leave a Reply

Your email address will not be published. Required fields are marked *

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>