From 23b463c613c15927b4b4a77ccd2a01def16f783a Mon Sep 17 00:00:00 2001 From: 10sr <8slashes+git@gmail.com> Date: Thu, 26 Jul 2012 16:05:26 +0900 Subject: [PATCH 1/8] move fortune to bashrc --- bashrc | 7 +++++++ profile | 9 --------- 2 files changed, 7 insertions(+), 9 deletions(-) diff --git a/bashrc b/bashrc index f6660b2..3cb8e3f 100755 --- a/bashrc +++ b/bashrc @@ -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 diff --git a/profile b/profile index 5fb9425..5dbe145 100755 --- a/profile +++ b/profile @@ -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" - From 5a2b11dc7059c6bfa1ccd88f5b9b2788828cca70 Mon Sep 17 00:00:00 2001 From: 10sr <8slashes+git@gmail.com> Date: Sat, 28 Jul 2012 03:03:37 +0900 Subject: [PATCH 2/8] add strong-fullscreen --- _keysnail.js | 21 +++++++++++++++------ 1 file changed, 15 insertions(+), 6 deletions(-) diff --git a/_keysnail.js b/_keysnail.js index 431dc0d..467a552 100644 --- a/_keysnail.js +++ b/_keysnail.js @@ -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,7 +130,7 @@ 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 Date: Sat, 28 Jul 2012 03:12:52 +0900 Subject: [PATCH 3/8] fix fullscreen ext --- _keysnail.js | 19 ++++++++++--------- 1 file changed, 10 insertions(+), 9 deletions(-) diff --git a/_keysnail.js b/_keysnail.js index 467a552..c91e61d 100644 --- a/_keysnail.js +++ b/_keysnail.js @@ -164,12 +164,18 @@ plugins.options["twitter_client.use_jmp"] = true; // my ext ext.add("strong-fullscreen", function(){ + var elemids = [ + "navigator-toolbox", + "verticaltabs-box", + "verticaltabs-splitter" + ]; BrowserFullScreen(); var isfullscreen = window.fullScreen; - var toolbox = document.getElementById("navigator-toolbox"); - var tabbox = document.getElementById("verticaltabs-box"); - var tabsplitter = document.getElementById("verticaltabs-splitter"); - toolbox.hidden = tabbox.hidden = tabsplitter.hidden = isfullscreen; + + for(var i = 0; i < elemids.length; i++){ + var elem = document.getElementById(elemids[i]); + if(elem){ elem.hidden = isfullscreen; } + } }, "go fullscreen with hiding toolbar and tabbar"); ext.add("open-url-from-clipboard", function(){ @@ -338,11 +344,6 @@ 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(); From a03b48ff9e0852d02731e6c3a8fc77613014ad9a Mon Sep 17 00:00:00 2001 From: 10sr <8slashes+git@gmail.com> Date: Sat, 28 Jul 2012 16:04:18 +0900 Subject: [PATCH 4/8] add ext echo-tab-info --- _keysnail.js | 102 +++++++++++++++++++++++++++++++-------------------- 1 file changed, 62 insertions(+), 40 deletions(-) diff --git a/_keysnail.js b/_keysnail.js index c91e61d..466908e 100644 --- a/_keysnail.js +++ b/_keysnail.js @@ -136,6 +136,12 @@ local["^http://www.tumblr.com/dashboard"] = [ /////////////////////////////////////////// // 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,6 +169,17 @@ plugins.options["twitter_client.use_jmp"] = true; //////////////////////////////////////////// // my ext +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", @@ -178,16 +195,16 @@ ext.add("strong-fullscreen", 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("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-url", function(){ +ext.add("list-page-url", function(){ var urls = []; var aa = window.content.document.getElementsByTagName("a"); var text = ""; @@ -344,11 +361,11 @@ ext.add("open-hatebu-comment", function (ev, arg) { } }, 'hatebu'); -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"); @@ -359,7 +376,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"); @@ -387,31 +404,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 @@ -608,6 +625,7 @@ hook.setHook('Unload', function () { }); + // ============================= Key bindings ============================== // key.setGlobalKey('C-', function () { @@ -849,3 +867,7 @@ key.setViewKey('U', function (ev) { key.setEditKey('C-', function (ev) { command.walkInputElement(command.elementsRetrieverTextarea, true, true); }, '次のテキストエリアへフォーカス'); + +key.setGlobalKey('', function (ev, arg) { + ext.exec('strong-fullscreen', arg, ev); +}, 'go fullscreen with hiding toolbar and tabbar', true); From 4470ff16298f6183e1ed287a7712993a462081e0 Mon Sep 17 00:00:00 2001 From: 10sr <8slashes+git@gmail.com> Date: Sat, 28 Jul 2012 16:04:46 +0900 Subject: [PATCH 5/8] update conky --- conkyrc | 8 ++++---- conkyrc.2 | 6 +++--- 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/conkyrc b/conkyrc index 8c55169..dbddc20 100644 --- a/conkyrc +++ b/conkyrc @@ -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 diff --git a/conkyrc.2 b/conkyrc.2 index 8e66ab8..19b5106 100644 --- a/conkyrc.2 +++ b/conkyrc.2 @@ -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 From 0d2218c6bd7539617ef483d9fd70889424b8566e Mon Sep 17 00:00:00 2001 From: 10sr <8slashes+git@gmail.com> Date: Sat, 28 Jul 2012 20:33:04 +0900 Subject: [PATCH 6/8] fix hook --- _keysnail.js | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/_keysnail.js b/_keysnail.js index 466908e..6b5734b 100644 --- a/_keysnail.js +++ b/_keysnail.js @@ -594,15 +594,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); From 1f80ca2aeaebbdc0ee7588d860185a4ffa954456 Mon Sep 17 00:00:00 2001 From: 10sr <8slashes+git@gmail.com> Date: Wed, 1 Aug 2012 17:19:52 +0900 Subject: [PATCH 7/8] fix fullscreen --- _keysnail.js | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/_keysnail.js b/_keysnail.js index 6b5734b..d2fcb2a 100644 --- a/_keysnail.js +++ b/_keysnail.js @@ -182,16 +182,22 @@ ext.add("echo-tab-info", function(){ ext.add("strong-fullscreen", function(){ var elemids = [ - "navigator-toolbox", - "verticaltabs-box", - "verticaltabs-splitter" + "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){ elem.hidden = isfullscreen; } + if(elem){ + if(isfullscreen){ + elem.style.display = "none"; + }else{ + elem.style.display = null; + } + } } }, "go fullscreen with hiding toolbar and tabbar"); From 7c53c8355974732965128afaf2ce18e9bfee34bd Mon Sep 17 00:00:00 2001 From: 10sr <8slashes+git@gmail.com> Date: Wed, 1 Aug 2012 17:22:55 +0900 Subject: [PATCH 8/8] add alias pad --- bashrc | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/bashrc b/bashrc index 3cb8e3f..b57a92c 100755 --- a/bashrc +++ b/bashrc @@ -123,6 +123,10 @@ alias mpg123="mpg123 -C -v --title" export PLAYER="mpg123 -C -v --title" alias screen="screen -e^z^z" +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" #alias wicn="wicd-cli -y -c -n"