• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

bitspook/spookfox: Make Emacs speak with Firefox

原作者: [db:作者] 来自: 网络 收藏 邀请

开源软件名称:

bitspook/spookfox

开源软件地址:

https://github.com/bitspook/spookfox

开源编程语言:

TypeScript 46.9%

开源软件介绍:

Spookfox

Communicate between Firefox and Emacs. Because Nyxt is just not there yet.

Caution: Spookfox is in early development and I am making breaking changes all over the place.

Windows is not supported right now. At this stage I have only tested spookfox on Linux, but it should theoretically work with Mac as well.

Features

  1. Chained tabs: use Emacs for tab management

    Every time you open a new tab in browser, an org entry is created in spookfox-saved-tabs-target (details below). The tab and this entry stay in sync (i.e URL changes are synced, closing the tab removes the org entry), unless you “unchain” the tab using a button provided in browser.

    On “unchain”, the browser tab is free and changes to it (including closing) aren’t written back to Emacs.

  2. Archived tabs: Maintain tabs as org-mode subtrees

    I have a habit of opening too many browser tabs open, many of which I don’t even visit as often. Although the browser would discard the tab to save resources, it is still clutter. And too easy to accidentally click on it and waste precious CPU/RAM.

    Using M-x spookfox-save-all-tabs I can quickly capture save all open tabs into my spookfox.org, and keep only necessary tabs open in browser.

    Note: spookfox-save-all-tabs will not close open tabs in browser. You can have that pleasure yourself.

  3. Organize tabs: as groups

    It is possible to create “tab groups” using org-mode tags. Applying a tag on a tab node will make it a member of that tab-group. Org subtree of tabs can be organized in any hierarchy as long as the you maintain the integrity of properties spookfox added to :PROPERTIES: drawer.

    M-x spookfox-open-tab and M-x spookfox-open-tab-group can be used to open a single tab, or all tabs belonging to a group.

    Behavior:

    • If an existing tab is selected
      • If it is already present in browser, it is focused. Else a new tab is opened
    • If you enter a string which don’t match any existing saved tabs
      • If entered string is a valid http(s) URL, a new tab with this URL is opened. Else a search with your configured search engine is performed in the new tab.
  4. Get active tab
    (sf--request-active-tab)
        

    I use this to quickly capture notes for what I am reading in Firefox. This is not an interactive command (i.e you can’t call it with M-x), because what would you want to do that for?

Installation

There are 3 parts to install spookfox.

  1. Install the browser addon

    Download the addon (.xpi file) from releases page, since it is not approved on Firefox addons yet. Firefox will prompt you to install as soon as you download it.

  2. Install Emacs package

    You can use straight.el to install it directly from where you’ve clone this repo.

    (straight-use-package
     '(spookfox :type git :host github :repo "bitspook/spookfox" :file "spookfox.el"))
        

    OR You can also simply clone this repo and use

    (load-file "<path-to-spookfox>/spookfox.el")
    (require 'spookfox)
        
  3. Use Emacs package to install spookfox-native, which is the glue code for communication b/w Emacs and browser

    Once spookfox.el is installed, you can call src_elisp{spookfox-install-native} interactively (by pressing M-x) in Emacs to install the final piece. Note this will only work on Linux.

Configuration

Following variables are available to configure some aspects of spookfox.

  1. spookfox-saved-tabs-target

    spookfox-saved-tabs-target is an org-capture-templates target, where the browser tabs are saved.

    (setq spookfox-saved-tabs-target `(file+headline ,(expand-file-name "spookfox.org" org-directory) "Tabs"))
        
  2. spookfox-max-reconnect-retry-interval

    Spookfox maintains a socket connection with the browser using browser native-messaging. This connection can sometimes break (e.g because browser isn’t open, extension isn’t installed etc), to remedy which spookfox tries to reconnect after an incrementing interval until a connection is established. spookfox-max-reconnect-retry-interval is the maximum number of seconds spookfox will wait between two retry attempts.

    (setq spookfox-max-reconnect-retry-interval 30)
        
  3. spookfox-native-installation-dir

    This is the directory in which spookfox will download and save spookfox-native binary (from the releases page).

Contribute

Please read the contributing.org document.




鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap