Browse Source

Merge branch 'master' of github.com:10sr/dotfiles

Conflicts:
	bashrc
pull/1/head
10sr 12 years ago
parent
commit
48d60a8204
5 changed files with 108 additions and 73 deletions
  1. +91
    -54
      _keysnail.js
  2. +10
    -3
      bashrc
  3. +4
    -4
      conkyrc
  4. +3
    -3
      conkyrc.2
  5. +0
    -9
      profile

+ 91
- 54
_keysnail.js View File

@@ -49,7 +49,7 @@ plugins.options["search-url-list"] = [
];

plugins.options["my-keysnail-bookmarks"] = [
"twitter.com",
"twitter.com"
];

// sitelocal keymap
@@ -67,7 +67,7 @@ local["^http://127.0.0.1:8823/thread/"] = [
kurl = curl.replace(/http:.*thread\/(.*\/).*/, "chaika://post/$1");
window.content.location.href = kurl;
}
],
]
];

local["^http://w2.p2.2ch.net/p2/read.php"] = [
@@ -78,7 +78,7 @@ local["^http://w2.p2.2ch.net/p2/read.php"] = [
var k = format("chaika://post/http://%s/test/read.cgi/%s/%s/", result[1], result[2], result[3]);
window.content.location.href = k;
}
],
]
];

/////////////////////////////////////////
@@ -99,7 +99,7 @@ local["^http://www.feedly.com/"] = [
// ['x', function (ev, arg) {ev.target.dispatchEvent(key.stringToKeyEvent("g", true));}],
['l', function (ev, arg) {window.content.location.href = "http://www.feedly.com/home#latest";}],
[['t', 'p'], function (ev, arg) {ev.target.dispatchEvent(key.stringToKeyEvent("t", true));}],
[['t', 'w'], function (ev, arg) {ext.exec("twitter-client-tweet", arg, ev);}],
[['t', 'w'], function (ev, arg) {ext.exec("twitter-client-tweet", arg, ev);}]
];

/////////////////////////////////////////
@@ -116,7 +116,7 @@ local["http://(www|tw|es|de|)\.nicovideo\.jp\/(watch|playlist)/*"] = [
kurl = curl.replace(/nicovideo.jp/, "nicovideofire.jp");
window.content.location.href = kurl;
}
],
]
];

/////////////////////////////////////////
@@ -130,12 +130,18 @@ local["^http://www.tumblr.com/dashboard"] = [
if (window.loadURI) {
loadURI("javascript:(function(){b=20;s=100;t=document.getElementById('next_page_link').href.split('/')[5];max=t.substr(0,t.length-5);min=max-s;i=Math.floor(Math.random()*(max-min)+min);u=(i<b)?'http://www.tumblr.com/dashboard':'http://www.tumblr.com/dashboard/2/'+i+'00000';window.content.location.href=u;}())");
}
}],
}]
];

///////////////////////////////////////////
// plugin option

plugins.options["builtin_commands_ext.ext_list"] = [
"focus-to-prompt",
"open-url-from-clipboard",
"restart-firefox"
];

plugins.options["instapaper.close_after_post"] = true;
plugins.options["instapaper.initial_comment_function"] = function(){
var now = new Date();
@@ -163,16 +169,48 @@ plugins.options["twitter_client.use_jmp"] = true;
////////////////////////////////////////////
// my ext

ext.add("open-url-from-clipboard", function(){
var list = command.getClipboardText().split("\n");
for(var i = 0; i < list.length; i++){
if(list[i] != ""){
gBrowser.loadOneTab(list[i], null, null, null, false);
ext.add("echo-tab-info", function(){
var all = gBrowser.tabs.length;
var ix = gBrowser.mCurrentTab._tPos;
var title = window.document.title;
var url = window.content.location.href;
display.echoStatusBar((ix + 1).toString() + " / " +
all.toString() + " : " +
title + " <" +
url + ">");
}, "echo tab info");

ext.add("strong-fullscreen", function(){
var elemids = [
"navigator-toolbox"
//"verticaltabs-box", //dont work well when open new tab
//"verticaltabs-splitter"
];
BrowserFullScreen();
var isfullscreen = window.fullScreen;

for(var i = 0; i < elemids.length; i++){
var elem = document.getElementById(elemids[i]);
if(elem){
if(isfullscreen){
elem.style.display = "none";
}else{
elem.style.display = null;
}
}
}
}, "open tabs of newline separated url list from clipboard");

ext.add("list-url", function(){
}, "go fullscreen with hiding toolbar and tabbar");

// ext.add("open-url-from-clipboard", function(){
// var list = command.getClipboardText().split("\n");
// for(var i = 0; i < list.length; i++){
// if(list[i] != ""){
// gBrowser.loadOneTab(list[i], null, null, null, false);
// }
// }
// }, "open tabs of newline separated url list from clipboard");

ext.add("list-page-url", function(){
var urls = [];
var aa = window.content.document.getElementsByTagName("a");
var text = "";
@@ -329,16 +367,11 @@ ext.add("open-hatebu-comment", function (ev, arg) {
}
}, 'hatebu');

ext.add("fullscreen-page",function (ev) {
getBrowser().selectedTab = getBrowser().addTab("http://home.tiscali.nl/annejan/swf/timeline.swf");
BrowserFullScreen();
}, "fullscreen page");

ext.add("focus-on-content", function(){
let(elem = document.commandDispatcher.focusedElement) elem && elem.blur();
gBrowser.focus();
content.focus();
}, "forcus on content");
// ext.add("focus-on-content", function(){
// let(elem = document.commandDispatcher.focusedElement) elem && elem.blur();
// gBrowser.focus();
// content.focus();
// }, "forcus on content");

ext.add("hide-sidebar", function(){
var sidebarBox = document.getElementById("sidebar-box");
@@ -349,7 +382,7 @@ ext.add("hide-sidebar", function(){

ext.add("close-and-next-tab", function (ev, arg) {
var n = gBrowser.mCurrentTab._tPos;
BrowserCloseTabOrWindow();
gBrowser.removeCurrentTab();
gBrowser.selectedTab = gBrowser.mTabs[n];
}, "close and focus to next tab");

@@ -377,31 +410,31 @@ ext.add("restart-firefox-add-menu", function(){
//////////////////////////////////////
// restart firefox
// http://keysnail.g.hatena.ne.jp/Shinnya/20100723/1279878815
ext.add("restart-firefox",function (ev) {
const nsIAppStartup = Components.interfaces.nsIAppStartup;
// Notify all windows that an application quit has been requested.
var os = Components.classes["@mozilla.org/observer-service;1"]
.getService(Components.interfaces.nsIObserverService);
var cancelQuit = Components.classes["@mozilla.org/supports-PRBool;1"]
.createInstance(Components.interfaces.nsISupportsPRBool);
os.notifyObservers(cancelQuit, "quit-application-requested", null);
// Something aborted the quit process.
if (cancelQuit.data)
return;
// Notify all windows that an application quit has been granted.
os.notifyObservers(null, "quit-application-granted", null);
// Enumerate all windows and call shutdown handlers
var wm = Components.classes["@mozilla.org/appshell/window-mediator;1"]
.getService(Components.interfaces.nsIWindowMediator);
var windows = wm.getEnumerator(null);
while (windows.hasMoreElements()) {
var win = windows.getNext();
if (("tryToClose" in win) && !win.tryToClose())
return;
}
Components.classes["@mozilla.org/toolkit/app-startup;1"].getService(nsIAppStartup)
.quit(nsIAppStartup.eRestart | nsIAppStartup.eAttemptQuit);
}, "restart firefox");
// ext.add("restart-firefox",function (ev) {
// const nsIAppStartup = Components.interfaces.nsIAppStartup;
// // Notify all windows that an application quit has been requested.
// var os = Components.classes["@mozilla.org/observer-service;1"]
// .getService(Components.interfaces.nsIObserverService);
// var cancelQuit = Components.classes["@mozilla.org/supports-PRBool;1"]
// .createInstance(Components.interfaces.nsISupportsPRBool);
// os.notifyObservers(cancelQuit, "quit-application-requested", null);
// // Something aborted the quit process.
// if (cancelQuit.data)
// return;
// // Notify all windows that an application quit has been granted.
// os.notifyObservers(null, "quit-application-granted", null);
// // Enumerate all windows and call shutdown handlers
// var wm = Components.classes["@mozilla.org/appshell/window-mediator;1"]
// .getService(Components.interfaces.nsIWindowMediator);
// var windows = wm.getEnumerator(null);
// while (windows.hasMoreElements()) {
// var win = windows.getNext();
// if (("tryToClose" in win) && !win.tryToClose())
// return;
// }
// Components.classes["@mozilla.org/toolkit/app-startup;1"].getService(nsIAppStartup)
// .quit(nsIAppStartup.eRestart | nsIAppStartup.eAttemptQuit);
// }, "restart firefox");

/////////////////////////////////////////
// copy feed url
@@ -567,15 +600,14 @@ key.suspendKey = "Not defined";

// ================================= Hooks ================================= //

hook.setHook('KeySnailInitialized', function () {
ext.exec("shiitake-enable-style");
});

hook.setHook('KeyBoardQuit', function (aEvent) {
ext.exec("hide-sidebar");

// focus to content
let(elem = document.commandDispatcher.focusedElement) elem && elem.blur();
gBrowser.focus();
content.focus();

command.closeFindBar();
if (util.isCaretEnabled()) {
command.resetMark(aEvent);
@@ -598,6 +630,7 @@ hook.setHook('Unload', function () {
});



// ============================= Key bindings ============================== //

key.setGlobalKey('C-<right>', function () {
@@ -839,3 +872,7 @@ key.setViewKey('U', function (ev) {
key.setEditKey('C-<tab>', function (ev) {
command.walkInputElement(command.elementsRetrieverTextarea, true, true);
}, '次のテキストエリアへフォーカス');

key.setGlobalKey('<f11>', function (ev, arg) {
ext.exec('strong-fullscreen', arg, ev);
}, 'go fullscreen with hiding toolbar and tabbar', true);

+ 10
- 3
bashrc View File

@@ -66,6 +66,13 @@ mkdir -p "/tmp/${USER}-tmp"
#######################

iswindows && alias tty="echo cmd.exe"
type fortune >/dev/null 2>&1 && {
echo
fortune
echo
fortune -o
echo
}
uname -a
echo TERM $TERM connected to $(tty), running $BASH $BASH_VERSION
echo
@@ -116,9 +123,9 @@ alias mpg123="mpg123 -C -v --title"
export PLAYER="mpg123 -C -v --title"
alias screen="screen -e^z^z"

alias xe=notepad
null type gedit && alias xe=gedit
null type leafpad && alias xe=leafpad
alias pad=notepad
null type gedit && alias pad=gedit
null type leafpad && alias pad=leafpad

alias wic=wicd-curses
alias wil="wicd-cli -y -l | head"


+ 4
- 4
conkyrc View File

@@ -8,14 +8,14 @@ xftfont DejaVu Sans Mono:size=10
xftalpha 0.8

update_interval 1.0
total_run_times 0

own_window yes
own_window_type desktop
own_window_transparent yes
own_window_colour hotpink
own_window_hints undecorated,below,skip_taskbar,sticky,skip_pager
#own_window_hints undecorated,below,skip_taskbar,sticky,skip_pager

minimum_size 200
draw_shades no
@@ -27,13 +27,13 @@ alignment top_right
gap_x 20
gap_y 40

default_color green # slategrey
default_color green # slategrey
default_shade_color lightgrey
default_outline_color black
color0 white # value
color1 white # vertical border
color2 green # name
color3 gray # displays
color3 gray # displays
color4 888888 # border of netspeed graph

no_buffers yes


+ 3
- 3
conkyrc.2 View File

@@ -8,7 +8,7 @@ xftfont DejaVu Sans Mono:size=10
xftalpha 0.8

update_interval 1.0
total_run_times 0

own_window yes
@@ -18,13 +18,13 @@ own_window_colour hotpink
own_window_hints undecorated,below,skip_taskbar,sticky,skip_pager

minimum_size 200
#maximum_width 2000
#maximum_text_width 2000
draw_shades no
draw_outline no
draw_borders no
stippled_borders 0
border_width 1
default_color green # slategrey
default_color green # slategrey
default_shade_color lightgrey
default_outline_color black
alignment bottom_left


+ 0
- 9
profile View File

@@ -2,14 +2,6 @@

# ~/.dotfiles/profile

type fortune >/dev/null 2>&1 && {
echo
fortune
echo
fortune -o
echo
}

# export PS1="\$ "
# export LANG=ja_JP.UTF-8
export LC_TIME=C
@@ -36,4 +28,3 @@ type setterm >/dev/null 2>&1 && setterm -blank 30 -powersave on # -powerdown 10

mkdir -p ~/.my/log
mkdir -p "/tmp/$USER-tmp"


Loading…
Cancel
Save