WidgetRelay 是一个 Tasker 插件,能从 Android 主屏幕小部件中读取文本和 JSON,并点击其中的元素,无需启动器。

Stars

6

7 天增长

暂无数据

Fork 数

0

开放 Issue

0

开源协议

GPL-3.0

最近更新

2026-07-28

AI 仓库情报摘要
FR-AI / ANALYSIS

为什么值得关注

它通过巧妙的变通方法(如使用不可见覆盖窗口和轮询)解决了此前无法完成的任务——提取并与小部件内容交互,从而使小部件专属数据可用于自动化。

适合谁使用

  • 希望自动化手机的 Tasker 高级用户
  • 需要获取小部件数据的 Android 自动化爱好者
  • 希望将小部件内容集成到自身应用或工作流中的开发者

典型使用场景

  • 读取仅在小部件中显示的未读计数、传感器读数或下一班车时间
  • 定时轮询小部件,当数值变化时触发操作
  • 从 Tasker 任务中点击小部件的刷新、播放/暂停或切换按钮

项目优势

  • 提供了四个专用的 Tasker 插件操作(获取数据、获取 JSON、按路径点击、按文本点击)
  • 通过不可见覆盖窗口和智能轮询等健壮变通方法,绕过了 Android 缺乏小部件读取 API 的限制
  • 基于 GPLv3 开源,允许社区审查和定制

使用前须知

  • 后台活动启动限制可能阻止某些打开活动的小部件按钮
  • 超时:加载超过 8 秒的小部件会超时;JSON 捕获可能错过后期到达的列表行
  • 路径在小部件布局变化时脆弱;基于文本的点击更可靠但并非总是可用

README 快速开始

WidgetRelay

Read and click Android home screen widgets from Tasker.

Lots of apps show information in a widget that they expose nowhere else — no API, no notification, no content provider. WidgetRelay hosts those widgets invisibly in the background, extracts their contents, and hands them to Tasker as plain text or JSON. It can also click elements inside them, so a widget button becomes something a task can trigger.

Typical uses:

  • Read a value that only exists in a widget (unread counts, a sensor reading, the next departure, a balance, "now playing")
  • Poll a widget on a schedule and act when the value changes
  • Press a widget's button from a task (refresh, play/pause, toggle)

Table of contents


Actions

WidgetRelay registers four Tasker plugin actions. All of them are configured the same way: pick an app and widget, choose a size, and — for all but the JSON action — tap the element you want in the extracted-data list.

ActionInputOutput
Get Widget Dataelement path%widget_value — the element's text, content description or resource id
Get Widget JSON%widget_json — the whole widget as a JSON tree
Click Widget Pathelement path
Click Widget Textelement text

Addressing elements

Elements are addressed by their path in the widget's view tree: /root is the widget itself, /root/0/2 is the third child of the first child, and so on. The configuration screen shows every extracted element with its path, so you normally never type one by hand — you tap the element and the path is filled in.

Paths are stable as long as the widget's layout doesn't change. If a widget rearranges itself (many do, depending on state or size), prefer Click Widget Text, which searches by the visible text or content description instead. Both input fields accept Tasker variables, so %par1 or %text work too.

JSON output

Get Widget JSON returns the widget as a nested tree. type is the view class, children is only present when a node ha

项目描述

Read and click Android home screen widgets from Tasker.

相关仓库与替代方案

根据分类、Topic 和编程语言匹配的相似项目。

makecindy
精选
makecindy GitHub avatar

cindy

Cindy is an open-source AI agent that runs locally on your machine, integrates multiple AI harnesses and models, and provides memory, skills, and automation to perform real work in your projects and apps.

AI 与机器学习大语言模型
958
immaghzbad
immaghzbad GitHub avatar

AetherST

AetherST Tunnel is an Android VPN client designed for high-performance censorship circumvention, using advanced protocols like MASQUE, WireGuard, and nested WireGuard (Gool) to evade Deep Packet Inspection.

移动开发
45
Blaizzy
精选
Blaizzy GitHub avatar

nativ

Nativ is a native macOS app that lets you run AI models locally on Apple silicon, offering chat, model management, performance analytics, and an OpenAI/Anthropic-compatible API server.

AI 与机器学习AI 视觉与语音
985