Created
February 21, 2009 16:59
-
-
Save satyr/68094 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// ==UserScript== | |
// @name toprightmost | |
// @namespace http://d.hatena.ne.jp/murky-satyr/ | |
// @description Puts Firefox at toprightmost position with specified sizes. | |
// @include main | |
// @version 2010-04-02 | |
// ==/UserScript== | |
var toprightmost = let(off = 1, x, y, w, h) function trm(width, height){ | |
if(off ^= 1) return moveTo(x, y), resizeTo(w, h); | |
x = screenX, y = screenY, w = outerWidth, h = outerHeight; | |
var borderWidth = outerWidth - innerWidth >> 1, | |
captionHeight = outerHeight - innerHeight - borderWidth; | |
moveTo(screen.availWidth - width + borderWidth, 1 - captionHeight); | |
resizeTo(width, height); | |
}; | |
let(W = 1140, H = 800){ | |
let cmd = 'toprightmost('+ W +','+ H +')'; | |
let key = (document.getElementById('mainKeyset') | |
.appendChild(document.createElement('key'))); | |
for each(let [k, v] in Iterator({ | |
oncommand: cmd, label: cmd, | |
modifiers: 'accel', key: 'M', | |
id: 'key_toprightmost'})) key.setAttribute(k, v); | |
toprightmost(W, H); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment