GitHub PullRequestReviewCommentEvent at 2014-10-27 07:18:19
Repository: crouton
Actor: dnschneid
Payload: {"action":"created","comment":{"url":"https://api.github.com/repos/dnschneid/crouton/pulls/comments/19390601","id":19390601,"diff_hunk":"@@ -0,0 +1,53 @@\n+#!/bin/sh -e\n+# Copyright (c) 2014 The crouton Authors. All rights reserved.\n+# Use of this source code is governed by a BSD-style license that can be\n+# found in the LICENSE file.\n+\n+# Changes the resolution of the current display, taking the closest,\n+# smaller, available resolution in xrandr.\n+# If no smaller resolution is available, pick the closest one.\n+# Outputs the applied resolution\n+\n+set -e\n+\n+if [ -z \"$1\" -o -z \"$2\" ]; then\n+   echo \"Usage: $0 width height\" 1>&2\n+   exit 2\n+fi\n+\n+TARGETW=\"$1\"\n+TARGETH=\"$2\"\n+\n+# This assumes modes have \"canonical\" names, in the form \"<w>x<h>[_<r>]\"\n+res=\"`xrandr | awk '\n+    function abs(x) { return x > 0 ? x : -x }\n+    BEGIN {\n+        tw='\"$TARGETW\"'\n+        th='\"$TARGETH\"'\n+        penalty = 1000000\n+    }\n+    $1 ~ /[0-9]+x[0-9]+/ {\n+        res = $1; sub(/_[0-9]+/, \"\", res)\n+        w = res; sub(/x[0-9]*/, \"\", w); w = int(w)\n+        h = res; sub(/[0-9]*x/, \"\", h); h = int(h)\n+        score = abs(tw-w) + abs(th-h)\n+        if (w > tw) score += penalty\n+        if (h > th) score += penalty\n+        if (!cmode || score < cscore) {\n+            cmode = $1\n+            cscore = score\n+        }\n+    }\n+    END {\n+        if (!cmode) exit 1\n+        print cmode\n+    }\n+'`\"\n+\n+if [ -z \"$res\" ]; then\n+   echo Cannot find resolution 1>&2\n+   exit 1\n+fi\n+\n+xrandr -s \"$res\" 2>/dev/null","path":"chroot-bin/findres","position":52,"original_position":52,"commit_id":"02b2f408f62d7b875a83df85f5642a86819ca852","original_commit_id":"02b2f408f62d7b875a83df85f5642a86819ca852","user":{"login":"dnschneid","id":522200,"avatar_url":"https://avatars.githubusercontent.com/u/522200?v=2","gravatar_id":"","url":"https://api.github.com/users/dnschneid","html_url":"https://github.com/dnschneid","followers_url":"https://api.github.com/users/dnschneid/followers","following_url":"https://api.github.com/users/dnschneid/following{/other_user}","gists_url":"https://api.github.com/users/dnschneid/gists{/gist_id}","starred_url":"https://api.github.com/users/dnschneid/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/dnschneid/subscriptions","organizations_url":"https://api.github.com/users/dnschneid/orgs","repos_url":"https://api.github.com/users/dnschneid/repos","events_url":"https://api.github.com/users/dnschneid/events{/privacy}","received_events_url":"https://api.github.com/users/dnschneid/received_events","type":"User","site_admin":false},"body":"It's not really \"findres\" if we set the size, is it?  Instead, why not combine this script with setres, since that's effectively what it is (just more selective in its resolutions)?","created_at":"2014-10-27T07:18:19Z","updated_at":"2014-10-27T07:18:19Z","html_url":"https://github.com/dnschneid/crouton/pull/1144#discussion_r19390601","pull_request_url":"https://api.github.com/repos/dnschneid/crouton/pulls/1144","_links":{"self":{"href":"https://api.github.com/repos/dnschneid/crouton/pulls/comments/19390601"},"html":{"href":"https://github.com/dnschneid/crouton/pull/1144#discussion_r19390601"},"pull_request":{"href":"https://api.github.com/repos/dnschneid/crouton/pulls/1144"}}},"pull_request":{"url":"https://api.github.com/repos/dnschneid/crouton/pulls/1144","id":23264385,"html_url":"https://github.com/dnschneid/crouton/pull/1144","diff_url":"https://github.com/dnschneid/crouton/pull/1144.diff","patch_url":"https://github.com/dnschneid/crouton/pull/1144.patch","issue_url":"https://api.github.com/repos/dnschneid/crouton/issues/1144","number":1144,"state":"open","locked":false,"title":"Crouton in a tab","user":{"login":"drinkcat","id":3467596,"avatar_url":"https://avatars.githubusercontent.com/u/3467596?v=2","gravatar_id":"","url":"https://api.github.com/users/drinkcat","html_url":"https://github.com/drinkcat","followers_url":"https://api.github.com/users/drinkcat/followers","following_url":"https://api.github.com/users/drinkcat/following{/other_user}","gists_url":"https://api.github.com/users/drinkcat/gists{/gist_id}","starred_url":"https://api.github.com/users/drinkcat/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/drinkcat/subscriptions","organizations_url":"https://api.github.com/users/drinkcat/orgs","repos_url":"https://api.github.com/users/drinkcat/repos","events_url":"https://api.github.com/users/drinkcat/events{/privacy}","received_events_url":"https://api.github.com/users/drinkcat/received_events","type":"User","site_admin":false},"body":"Still a few issues to iron up, more testing, and a few missing features, but the general idea is there.\r\n\r\nKnown issues:\r\n - Sometimes the extension does not start with focus (you need to click)\r\n - Touch events\r\n - IME events\r\n - \"Error target STRING not available\" sometimes appears during switch (croutonclip/cycle?)\r\n - Limit number of resolution changes when resizing (it's slow because we send far too many \"R\" requests)\r\n - A leftover FIXME in the code, we should force courtoncycle instead of removing files\r\n - Move the websocket functions into a common file\r\n - Errors when loading NaCl module are not reported","created_at":"2014-10-23T22:23:51Z","updated_at":"2014-10-27T07:18:19Z","closed_at":null,"merged_at":null,"merge_commit_sha":"0363c20f9f0a6f8b9076562e5e6aa521e24996f1","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/dnschneid/crouton/pulls/1144/commits","review_comments_url":"https://api.github.com/repos/dnschneid/crouton/pulls/1144/comments","review_comment_url":"https://api.github.com/repos/dnschneid/crouton/pulls/comments/{number}","comments_url":"https://api.github.com/repos/dnschneid/crouton/issues/1144/comments","statuses_url":"https://api.github.com/repos/dnschneid/crouton/statuses/02b2f408f62d7b875a83df85f5642a86819ca852","head":{"label":"drinkcat:criat","ref":"criat","sha":"02b2f408f62d7b875a83df85f5642a86819ca852","user":{"login":"drinkcat","id":3467596,"avatar_url":"https://avatars.githubusercontent.com/u/3467596?v=2","gravatar_id":"","url":"https://api.github.com/users/drinkcat","html_url":"https://github.com/drinkcat","followers_url":"https://api.github.com/users/drinkcat/followers","following_url":"https://api.github.com/users/drinkcat/following{/other_user}","gists_url":"https://api.github.com/users/drinkcat/gists{/gist_id}","starred_url":"https://api.github.com/users/drinkcat/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/drinkcat/subscriptions","organizations_url":"https://api.github.com/users/drinkcat/orgs","repos_url":"https://api.github.com/users/drinkcat/repos","events_url":"https://api.github.com/users/drinkcat/events{/privacy}","received_events_url":"https://api.github.com/users/drinkcat/received_events","type":"User","site_admin":false},"repo":{"id":9856262,"name":"chroagh","full_name":"drinkcat/chroagh","owner":{"login":"drinkcat","id":3467596,"avatar_url":"https://avatars.githubusercontent.com/u/3467596?v=2","gravatar_id":"","url":"https://api.github.com/users/drinkcat","html_url":"https://github.com/drinkcat","followers_url":"https://api.github.com/users/drinkcat/followers","following_url":"https://api.github.com/users/drinkcat/following{/other_user}","gists_url":"https://api.github.com/users/drinkcat/gists{/gist_id}","starred_url":"https://api.github.com/users/drinkcat/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/drinkcat/subscriptions","organizations_url":"https://api.github.com/users/drinkcat/orgs","repos_url":"https://api.github.com/users/drinkcat/repos","events_url":"https://api.github.com/users/drinkcat/events{/privacy}","received_events_url":"https://api.github.com/users/drinkcat/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/drinkcat/chroagh","description":"Chromium OS Archlinux Chroot Environment","fork":true,"url":"https://api.github.com/repos/drinkcat/chroagh","forks_url":"https://api.github.com/repos/drinkcat/chroagh/forks","keys_url":"https://api.github.com/repos/drinkcat/chroagh/keys{/key_id}","collaborators_url":"https://api.github.com/repos/drinkcat/chroagh/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/drinkcat/chroagh/teams","hooks_url":"https://api.github.com/repos/drinkcat/chroagh/hooks","issue_events_url":"https://api.github.com/repos/drinkcat/chroagh/issues/events{/number}","events_url":"https://api.github.com/repos/drinkcat/chroagh/events","assignees_url":"https://api.github.com/repos/drinkcat/chroagh/assignees{/user}","branches_url":"https://api.github.com/repos/drinkcat/chroagh/branches{/branch}","tags_url":"https://api.github.com/repos/drinkcat/chroagh/tags","blobs_url":"https://api.github.com/repos/drinkcat/chroagh/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/drinkcat/chroagh/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/drinkcat/chroagh/git/refs{/sha}","trees_url":"https://api.github.com/repos/drinkcat/chroagh/git/trees{/sha}","statuses_url":"https://api.github.com/repos/drinkcat/chroagh/statuses/{sha}","languages_url":"https://api.github.com/repos/drinkcat/chroagh/languages","stargazers_url":"https://api.github.com/repos/drinkcat/chroagh/stargazers","contributors_url":"https://api.github.com/repos/drinkcat/chroagh/contributors","subscribers_url":"https://api.github.com/repos/drinkcat/chroagh/subscribers","subscription_url":"https://api.github.com/repos/drinkcat/chroagh/subscription","commits_url":"https://api.github.com/repos/drinkcat/chroagh/commits{/sha}","git_commits_url":"https://api.github.com/repos/drinkcat/chroagh/git/commits{/sha}","comments_url":"https://api.github.com/repos/drinkcat/chroagh/comments{/number}","issue_comment_url":"https://api.github.com/repos/drinkcat/chroagh/issues/comments/{number}","contents_url":"https://api.github.com/repos/drinkcat/chroagh/contents/{+path}","compare_url":"https://api.github.com/repos/drinkcat/chroagh/compare/{base}...{head}","merges_url":"https://api.github.com/repos/drinkcat/chroagh/merges","archive_url":"https://api.github.com/repos/drinkcat/chroagh/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/drinkcat/chroagh/downloads","issues_url":"https://api.github.com/repos/drinkcat/chroagh/issues{/number}","pulls_url":"https://api.github.com/repos/drinkcat/chroagh/pulls{/number}","milestones_url":"https://api.github.com/repos/drinkcat/chroagh/milestones{/number}","notifications_url":"https://api.github.com/repos/drinkcat/chroagh/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/drinkcat/chroagh/labels{/name}","releases_url":"https://api.github.com/repos/drinkcat/chroagh/releases{/id}","created_at":"2013-05-04T15:50:52Z","updated_at":"2014-10-26T22:05:14Z","pushed_at":"2014-10-25T04:43:16Z","git_url":"git://github.com/drinkcat/chroagh.git","ssh_url":"git@github.com:drinkcat/chroagh.git","clone_url":"https://github.com/drinkcat/chroagh.git","svn_url":"https://github.com/drinkcat/chroagh","homepage":"","size":10204,"stargazers_count":92,"watchers_count":92,"language":"Shell","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":true,"forks_count":9,"mirror_url":null,"open_issues_count":5,"forks":9,"open_issues":5,"watchers":92,"default_branch":"master"}},"base":{"label":"dnschneid:master","ref":"master","sha":"b3b8f733ccf16d2c53a93ff3b36a6b3e74e87270","user":{"login":"dnschneid","id":522200,"avatar_url":"https://avatars.githubusercontent.com/u/522200?v=2","gravatar_id":"","url":"https://api.github.com/users/dnschneid","html_url":"https://github.com/dnschneid","followers_url":"https://api.github.com/users/dnschneid/followers","following_url":"https://api.github.com/users/dnschneid/following{/other_user}","gists_url":"https://api.github.com/users/dnschneid/gists{/gist_id}","starred_url":"https://api.github.com/users/dnschneid/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/dnschneid/subscriptions","organizations_url":"https://api.github.com/users/dnschneid/orgs","repos_url":"https://api.github.com/users/dnschneid/repos","events_url":"https://api.github.com/users/dnschneid/events{/privacy}","received_events_url":"https://api.github.com/users/dnschneid/received_events","type":"User","site_admin":false},"repo":{"id":7229063,"name":"crouton","full_name":"dnschneid/crouton","owner":{"login":"dnschneid","id":522200,"avatar_url":"https://avatars.githubusercontent.com/u/522200?v=2","gravatar_id":"","url":"https://api.github.com/users/dnschneid","html_url":"https://github.com/dnschneid","followers_url":"https://api.github.com/users/dnschneid/followers","following_url":"https://api.github.com/users/dnschneid/following{/other_user}","gists_url":"https://api.github.com/users/dnschneid/gists{/gist_id}","starred_url":"https://api.github.com/users/dnschneid/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/dnschneid/subscriptions","organizations_url":"https://api.github.com/users/dnschneid/orgs","repos_url":"https://api.github.com/users/dnschneid/repos","events_url":"https://api.github.com/users/dnschneid/events{/privacy}","received_events_url":"https://api.github.com/users/dnschneid/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/dnschneid/crouton","description":"Chromium OS Universal Chroot Environment","fork":false,"url":"https://api.github.com/repos/dnschneid/crouton","forks_url":"https://api.github.com/repos/dnschneid/crouton/forks","keys_url":"https://api.github.com/repos/dnschneid/crouton/keys{/key_id}","collaborators_url":"https://api.github.com/repos/dnschneid/crouton/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/dnschneid/crouton/teams","hooks_url":"https://api.github.com/repos/dnschneid/crouton/hooks","issue_events_url":"https://api.github.com/repos/dnschneid/crouton/issues/events{/number}","events_url":"https://api.github.com/repos/dnschneid/crouton/events","assignees_url":"https://api.github.com/repos/dnschneid/crouton/assignees{/user}","branches_url":"https://api.github.com/repos/dnschneid/crouton/branches{/branch}","tags_url":"https://api.github.com/repos/dnschneid/crouton/tags","blobs_url":"https://api.github.com/repos/dnschneid/crouton/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/dnschneid/crouton/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/dnschneid/crouton/git/refs{/sha}","trees_url":"https://api.github.com/repos/dnschneid/crouton/git/trees{/sha}","statuses_url":"https://api.github.com/repos/dnschneid/crouton/statuses/{sha}","languages_url":"https://api.github.com/repos/dnschneid/crouton/languages","stargazers_url":"https://api.github.com/repos/dnschneid/crouton/stargazers","contributors_url":"https://api.github.com/repos/dnschneid/crouton/contributors","subscribers_url":"https://api.github.com/repos/dnschneid/crouton/subscribers","subscription_url":"https://api.github.com/repos/dnschneid/crouton/subscription","commits_url":"https://api.github.com/repos/dnschneid/crouton/commits{/sha}","git_commits_url":"https://api.github.com/repos/dnschneid/crouton/git/commits{/sha}","comments_url":"https://api.github.com/repos/dnschneid/crouton/comments{/number}","issue_comment_url":"https://api.github.com/repos/dnschneid/crouton/issues/comments/{number}","contents_url":"https://api.github.com/repos/dnschneid/crouton/contents/{+path}","compare_url":"https://api.github.com/repos/dnschneid/crouton/compare/{base}...{head}","merges_url":"https://api.github.com/repos/dnschneid/crouton/merges","archive_url":"https://api.github.com/repos/dnschneid/crouton/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/dnschneid/crouton/downloads","issues_url":"https://api.github.com/repos/dnschneid/crouton/issues{/number}","pulls_url":"https://api.github.com/repos/dnschneid/crouton/pulls{/number}","milestones_url":"https://api.github.com/repos/dnschneid/crouton/milestones{/number}","notifications_url":"https://api.github.com/repos/dnschneid/crouton/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/dnschneid/crouton/labels{/name}","releases_url":"https://api.github.com/repos/dnschneid/crouton/releases{/id}","created_at":"2012-12-18T19:31:14Z","updated_at":"2014-10-26T21:36:18Z","pushed_at":"2014-10-27T06:30:38Z","git_url":"git://github.com/dnschneid/crouton.git","ssh_url":"git@github.com:dnschneid/crouton.git","clone_url":"https://github.com/dnschneid/crouton.git","svn_url":"https://github.com/dnschneid/crouton","homepage":"https://goo.gl/fd3zc","size":13885,"stargazers_count":2084,"watchers_count":2084,"language":"Shell","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":225,"mirror_url":null,"open_issues_count":211,"forks":225,"open_issues":211,"watchers":2084,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/dnschneid/crouton/pulls/1144"},"html":{"href":"https://github.com/dnschneid/crouton/pull/1144"},"issue":{"href":"https://api.github.com/repos/dnschneid/crouton/issues/1144"},"comments":{"href":"https://api.github.com/repos/dnschneid/crouton/issues/1144/comments"},"review_comments":{"href":"https://api.github.com/repos/dnschneid/crouton/pulls/1144/comments"},"review_comment":{"href":"https://api.github.com/repos/dnschneid/crouton/pulls/comments/{number}"},"commits":{"href":"https://api.github.com/repos/dnschneid/crouton/pulls/1144/commits"},"statuses":{"href":"https://api.github.com/repos/dnschneid/crouton/statuses/02b2f408f62d7b875a83df85f5642a86819ca852"}}}}