Skip to content

Instantly share code, notes, and snippets.

@albertski
Forked from zachleat/rwdurl
Created September 16, 2016 14:05
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save albertski/c1deff6bca016243eac2f6a747db75de to your computer and use it in GitHub Desktop.
Save albertski/c1deff6bca016243eac2f6a747db75de to your computer and use it in GitHub Desktop.
A command line utility to open a url with a bunch of different screen widths (and organize the windows).
#!/bin/bash
display_usage() {
echo "This script should be run with one argument."
echo "Example: rwulr http://www.siteurl.com"
}
if [ $# -le 0 ]
then
display_usage
exit 1
fi
if [[ ( $@ == "--help") || $@ == "-h" ]]
then
display_usage
exit 0
fi
open -n -g -a "Google Chrome" --args --new-window --profile-directory=Profile\ 1 --app="data:text/html,<html><body><script>window.moveTo(0,0);window.resizeTo(320,1395);window.location='$1';</script></body></html>"
open -n -g -a "Google Chrome" --args --new-window --profile-directory=Profile\ 1 --app="data:text/html,<html><body><script>window.moveTo(330,0);window.resizeTo(480,1395);window.location='$1';</script></body></html>"
open -n -g -a "Google Chrome" --args --new-window --profile-directory=Profile\ 1 --app="data:text/html,<html><body><script>window.moveTo(815,0);window.resizeTo(640,1395);window.location='$1';</script></body></html>"
open -n -g -a "Google Chrome" --args --new-window --profile-directory=Profile\ 1 --app="data:text/html,<html><body><script>window.moveTo(1460,0);window.resizeTo(800,1395);window.location='$1';</script></body></html>"
open -n -g -a "Google Chrome" --args --new-window --profile-directory=Profile\ 1 --app="data:text/html,<html><body><script>window.moveTo(2265,0);window.resizeTo(1024,1395);window.location='$1';</script></body></html>"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment