local-control 0.1.2__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- local_control/__init__.py +11 -0
- local_control/app.py +291 -0
- local_control/auth.py +240 -0
- local_control/cli.py +143 -0
- local_control/clipboard.py +342 -0
- local_control/config.py +47 -0
- local_control/control.py +1043 -0
- local_control/startup.py +140 -0
- local_control/static/css/styles.css +393 -0
- local_control/static/index.html +140 -0
- local_control/static/js/app.js +1658 -0
- local_control/utils/__init__.py +9 -0
- local_control/utils/qrcodegen.py +907 -0
- local_control/utils/terminal_qr.py +34 -0
- local_control-0.1.2.dist-info/METADATA +49 -0
- local_control-0.1.2.dist-info/RECORD +20 -0
- local_control-0.1.2.dist-info/WHEEL +5 -0
- local_control-0.1.2.dist-info/entry_points.txt +2 -0
- local_control-0.1.2.dist-info/licenses/LICENSE +21 -0
- local_control-0.1.2.dist-info/top_level.txt +1 -0
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
"""
|
|
2
|
+
Helpers for rendering QR codes as terminal-friendly ASCII art.
|
|
3
|
+
"""
|
|
4
|
+
|
|
5
|
+
from __future__ import annotations
|
|
6
|
+
|
|
7
|
+
from typing import Iterable
|
|
8
|
+
|
|
9
|
+
from . import qrcodegen
|
|
10
|
+
|
|
11
|
+
_DARK = "██"
|
|
12
|
+
_LIGHT = " "
|
|
13
|
+
|
|
14
|
+
|
|
15
|
+
def render_text(data: str) -> str:
|
|
16
|
+
"""
|
|
17
|
+
Render a QR code pointing to ``data`` using double-width ASCII blocks.
|
|
18
|
+
Returns the multi-line string that can be printed directly.
|
|
19
|
+
"""
|
|
20
|
+
qr = qrcodegen.QrCode.encode_text(data, qrcodegen.QrCode.Ecc.LOW)
|
|
21
|
+
border = 2
|
|
22
|
+
lines = []
|
|
23
|
+
for y in range(-border, qr.size + border):
|
|
24
|
+
row = []
|
|
25
|
+
for x in range(-border, qr.size + border):
|
|
26
|
+
row.append(_DARK if qr.get_module(x, y) else _LIGHT)
|
|
27
|
+
lines.append("".join(row).rstrip())
|
|
28
|
+
return "\n".join(lines)
|
|
29
|
+
|
|
30
|
+
|
|
31
|
+
def iter_lines(data: str) -> Iterable[str]:
|
|
32
|
+
"""Yield the rendered lines lazily."""
|
|
33
|
+
for line in render_text(data).splitlines():
|
|
34
|
+
yield line
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
Metadata-Version: 2.4
|
|
2
|
+
Name: local_control
|
|
3
|
+
Version: 0.1.2
|
|
4
|
+
Summary: LAN-accessible remote control server for mouse, keyboard, and power management
|
|
5
|
+
Author: DIYer22
|
|
6
|
+
License: MIT License
|
|
7
|
+
Project-URL: Homepage, https://github.com/DIYer22/local_control
|
|
8
|
+
Requires-Python: >=3.9
|
|
9
|
+
Description-Content-Type: text/markdown
|
|
10
|
+
License-File: LICENSE
|
|
11
|
+
Requires-Dist: flask>=2.3
|
|
12
|
+
Dynamic: license-file
|
|
13
|
+
|
|
14
|
+
# 🖱️ Local Control
|
|
15
|
+
|
|
16
|
+
Let you steer the computer's mouse, keyboard from any device's browser.
|
|
17
|
+
|
|
18
|
+
<a href="https://yl-data.github.io/2511.local_control/images/local-send-screenshot.jpeg">
|
|
19
|
+
<img style="height:384px" src=https://yl-data.github.io/2511.local_control/images/local-send-screenshot.jpeg>
|
|
20
|
+
</a>
|
|
21
|
+
|
|
22
|
+
The server is written in pure Python with minimal dependencies and ships with a mobile-friendly frontend.
|
|
23
|
+
|
|
24
|
+
## Features
|
|
25
|
+
- Mouse cursor movement and click controls from touch or mouse devices.
|
|
26
|
+
- Realtime input field streams keystrokes (including Backspace/Delete) as you type.
|
|
27
|
+
- OS-level lock, and shutdown shortcuts (best-effort across Windows, macOS, Linux).
|
|
28
|
+
- Authentication that reuses the current OS account credentials, remembers trusted devices, and rate-limits brute-force attempts.
|
|
29
|
+
- Build with GPT-5-Codex, easy to customize and modify with vibe coding.
|
|
30
|
+
|
|
31
|
+
## Requirements
|
|
32
|
+
- Python 3.9 or newer.
|
|
33
|
+
- Desktop environments capable of receiving simulated input (X11/Wayland, Windows, or macOS).
|
|
34
|
+
- Linux/X11 hosts require the `libX11` and `libXtst` system libraries (commonly present on desktop distributions; Wayland sessions need XWayland support).
|
|
35
|
+
- macOS hosts must grant the Python process accessibility permissions (System Settings → Privacy & Security → Accessibility).
|
|
36
|
+
|
|
37
|
+
## Installation
|
|
38
|
+
```bash
|
|
39
|
+
pip install local_control
|
|
40
|
+
```
|
|
41
|
+
|
|
42
|
+
## Usage
|
|
43
|
+
```bash
|
|
44
|
+
local-control --help
|
|
45
|
+
local-control --port 4001
|
|
46
|
+
```
|
|
47
|
+
|
|
48
|
+
Open `http://<host-ip>:4001` from your phone, tablet, or another computer on the same LAN. Sign in with the current desktop user's username and password. Devices marked as trusted skip future logins under the same secret.
|
|
49
|
+
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
local_control/__init__.py,sha256=E47eodGPK2AWoDvC-5kwYlGc7WzcVMgFpwDPh5sZ78s,251
|
|
2
|
+
local_control/app.py,sha256=8a8O4zAV2Bziwt11qIfC7aLO0fsdnf8wOdePsItYnUY,10002
|
|
3
|
+
local_control/auth.py,sha256=-07TjUq0fRobrZ5O3Ewh_Y1Vs68BnHxT5loLEO68QuU,8104
|
|
4
|
+
local_control/cli.py,sha256=NUH7N_DntkzWbYg-NiyP09RC-2s3j2u2KbFbsInjtNA,4244
|
|
5
|
+
local_control/clipboard.py,sha256=P_8rG6nCT3yxH24zImYvsKx58nDglZ_BfiM8PwFeUwM,10575
|
|
6
|
+
local_control/config.py,sha256=ZkCxE54mWHuDpQsKR_oK6LU9xZGnQ5c4u3gZXryHCf8,1283
|
|
7
|
+
local_control/control.py,sha256=i493Cm3rmsdFOC7o_mk5NkWZE584VwZoInSmGpwtS04,33982
|
|
8
|
+
local_control/startup.py,sha256=QMnPOeYgMdjS7aSN-Lj4SxjPREcNkxgLzTNT6kXeNs4,4860
|
|
9
|
+
local_control/static/index.html,sha256=M7QF5TQEAKb3gwWRaQqNwZSQJnRcK8157zwiTMks7mw,5645
|
|
10
|
+
local_control/static/css/styles.css,sha256=FWrX_Bdqp1H1N7kuVstmb8s_0Q6acJr1_7Y3Hta9qC0,6412
|
|
11
|
+
local_control/static/js/app.js,sha256=RwZZqec0TmfbFgjVxzDYJ9QT_Nh2zrVd1wpdSNT7A1Q,51390
|
|
12
|
+
local_control/utils/__init__.py,sha256=e6Rt3jnluwMD3FMaz2EP2PvQzbeSQ_QYDeGwhyh6xTQ,186
|
|
13
|
+
local_control/utils/qrcodegen.py,sha256=n07R3SAdy5KxvA1uFPRsdUvP8M5IWAxdforOj2kmyO8,39349
|
|
14
|
+
local_control/utils/terminal_qr.py,sha256=8fKGNe6JsSnUiUuKpxS_Yu63PFpcIp5J51AGtm1T53g,893
|
|
15
|
+
local_control-0.1.2.dist-info/licenses/LICENSE,sha256=ALXQVDxH2TNPFAEiprM_egcewL8o26q23pvi3NKhQWM,1064
|
|
16
|
+
local_control-0.1.2.dist-info/METADATA,sha256=AKC7U4o-4uWan0NdE3kP51DtAxLeotXCeZ7CKEP55UI,2016
|
|
17
|
+
local_control-0.1.2.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
|
|
18
|
+
local_control-0.1.2.dist-info/entry_points.txt,sha256=_iqjkaEOmIXZNARVaWVlAqTd36ktUb-I56epCG6SY4Q,57
|
|
19
|
+
local_control-0.1.2.dist-info/top_level.txt,sha256=8exDAIZWm498Hfiw8OY18Q-KSSbVizqST6cp8aFubZ0,14
|
|
20
|
+
local_control-0.1.2.dist-info/RECORD,,
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2024 DIYer22
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
local_control
|