Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/xuchunyang/tongbu.el

Share text/file between your computer and phone
https://github.com/xuchunyang/tongbu.el

Last synced: about 1 month ago
JSON representation

Share text/file between your computer and phone

Awesome Lists containing this project

README

        

# A web server to share text or files between two devices
[![Melpa](https://melpa.org/packages/tongbu-badge.svg)](https://melpa.org/#/tongbu)

`tongbu.el` (同步) is an Emacs package which creates a web server for sharing
text and files between your computer and phone via a web browser.

## Usage

Use `M-x tongbu` to start the server, then goto http://0.0.0.0:8888.

- To share text, edit textarea and hit "Save" to update to the server
- To upload file, use the file input
- To download file, click the filename; click `..` to go to parent directory

tongbu.el screenshot

Use `M-x list-processes` to stop the server, the process name looks like `ws-server`.

## Customization

### `tongbu-port` (defaults to 8888)

The server port. If you set it to 0, Emacs will pick a random port for you.

### `tongbu-host` (defaults to `"0.0.0.0"`)

Host name used by the server.

You can change it to `"127.0.0.1"` then setup a reverse proxy to 127.0.0.1:8888.

### `tongbu-css`

The stylesheet. The default value is

``` emacs-lisp
(setq tongbu-css "
textarea {
font-size: 1rem;
line-height: 1.5;
padding: 10px;
width: 100%;
}
")
```

### `tongbu-js`

The script. The default value is an empty string `""`, if you want to change it,
don't forget the ` ... `, for example,

``` emacs-lisp
;; inline script
(setq tongbu-js " alert('Hello World!'); ")

;; external script
(setq tongbu-js "")
```

## Dependencies

- Emacs 25.1
- [emacs-web-server](https://github.com/eschulte/emacs-web-server)