From 6241450e421fbcd0c39a8b2c15ad40c854d0a5ca Mon Sep 17 00:00:00 2001 From: 10sr <8slashes+git@gmail.com> Date: Mon, 16 Sep 2013 17:16:10 +0900 Subject: [PATCH 1/4] add func dtscr, not works --- bashrc | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) diff --git a/bashrc b/bashrc index 80cc1eb..d334356 100755 --- a/bashrc +++ b/bashrc @@ -549,6 +549,28 @@ scr(){ __MY_SCRIPT=${_file} script ${_file} "$@" } +dtscr(){ + # dtscr + if test -z "$1" + then + echo "dtscr: usage: dtscr " + return 1 + fi + + local _cmdstr="`echo $@ | tr ' ' +`" + local _tformat="%Y%m%d-%H%M%S%z" + local _name="${pf}`date +${_tformat}`-${_cmdstr}" + + local _scr_file="${HOME}/${_name}.script" + + local _dt_dir="${TMP}/dtscr" + install -d "$_dt_dir" + + dtach -n "${_dt_dir}/${_name}" script "${_scr_file_}" "$@" + # echo $_name + # echo $_file +} + mcrypt-stream(){ test $# -eq 2 || return 1 case $1 in From c55ba632e8e421417690a548935d384242634314 Mon Sep 17 00:00:00 2001 From: 10sr <8slashes+git@gmail.com> Date: Wed, 18 Sep 2013 15:11:59 +0900 Subject: [PATCH 2/4] add ext open-remote-init-file --- _keysnail.js | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/_keysnail.js b/_keysnail.js index 8facf61..49c32a2 100644 --- a/_keysnail.js +++ b/_keysnail.js @@ -248,6 +248,11 @@ plugins.options["twitter_client.use_jmp"] = true; //////////////////////////////////////////// // my ext +ext.add("open-remote-init-file", function(ev, arg){ + const URL = "https://raw.github.com/10sr/dotfiles/master/_keysnail.js"; + window.openUILinkIn(URL, "tab"); +}, "Open remote initialization file"); + (function(){ function getOrganizer(){ // [How to call for Firefox bookmark dialog? - Stack Overflow] From 34504789d03374a545a6991d24465358517b18d1 Mon Sep 17 00:00:00 2001 From: 10sr <8slashes+git@gmail.com> Date: Wed, 18 Sep 2013 21:54:55 +0900 Subject: [PATCH 3/4] update feed ext --- _keysnail.js | 42 ++++++++++++++++++++++++++++++------------ 1 file changed, 30 insertions(+), 12 deletions(-) diff --git a/_keysnail.js b/_keysnail.js index 49c32a2..11c67cf 100644 --- a/_keysnail.js +++ b/_keysnail.js @@ -523,6 +523,8 @@ ext.add("restart-firefox-add-menu", function(){ ///////////////////////////////////////// // feed url (function(){ + var feedhandler = "http://cloud.feedly.com/#subscription%2Ffeed%2F%s"; + function getFeeds(){ const doc = content.document; @@ -535,14 +537,18 @@ ext.add("restart-firefox-add-menu", function(){ "$1"); for (i = 0; i < feeds.length; i++) if ( feeds[i][1].substr(0,1) == "/" ) feeds[i][1] = uh + feeds[i][1]; - feeds.unshift([window.content.document.title, - window.content.location.href]); + // feeds.unshift([window.content.document.title, + // window.content.location.href]); return feeds; }; ext.add("copy-feed-url", function () { var feeds = getFeeds(); + if (! feeds.length) { + display.echoStatusBar("No feed found."); + return; + } prompt.selector( { message : "Select Feed", @@ -558,17 +564,29 @@ ext.add("restart-firefox-add-menu", function(){ ext.add("open-feed", function () { var feeds = getFeeds(); - prompt.selector( - { - message : "Select Feed", - collection : feeds, - callback : function (i) { - if (i >= 0) { - window.openUILinkIn(feeds[i][1], "tab"); - } + if (! feeds.length) { + display.echoStatusBar("No feed found."); + return; + } + prompt.selector({ + message : "Select Feed", + collection : feeds, + callback : function (i) { + if (i < 0) { + return; + } + + var feedurl = feeds[i][1]; + if (feedhandler) { + window.openUILinkIn( + feedhandler.replace("%s", feedurl), + "tab" + ); + } else { + window.openUILinkIn(feedurl, "tab"); } } - ); + }); }, "Copy url or feed url of current page"); })(); @@ -717,7 +735,7 @@ key.suspendKey = "Not defined"; hook.setHook('KeyBoardQuit', function (aEvent) { - ext.exec("hide-sidebar"); + // ext.exec("hide-sidebar"); let(elem = document.commandDispatcher.focusedElement) elem && elem.blur(); gBrowser.focus(); content.focus(); From 7e23df416e7c7498362b0b008b7e52a3c699c15e Mon Sep 17 00:00:00 2001 From: 10sr <8slashes+git@gmail.com> Date: Sat, 21 Sep 2013 11:08:57 +0900 Subject: [PATCH 4/4] do not run setterm if login with ssh --- profile | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/profile b/profile index a41a3e2..d4ed007 100755 --- a/profile +++ b/profile @@ -38,4 +38,5 @@ export PKG_CONFIG_PATH="$PKG_CONFIG_PATH:$_python_pkg_conf" #export MANPATH="`manpath`:$HOME/.local/share/man" # in my environment powerdown does not work -type setterm >/dev/null 2>&1 && setterm -blank 30 -powersave on # -powerdown 10 +test -z "$SSH_CONNECTION" && \ + type setterm >/dev/null 2>&1 && setterm -blank 30 -powersave on # -powerdown 10