Comments (7)
Okay, the help is accessible with termux-notification --help-actions
(in termux-api-package v0.46). Please feel free to reopen this issue or draft a pull request to change the text!
from termux-api-package.
also
from termux-api-package.
No it's work fine check the running programs
execute 'ps' or 'top'
from termux-api-package.
Yes, it works fine. I never said it was not working though 😉
I'm just saying that it should be explained that the action is a string, executed as a command in a subprocess when the user taps on the notification. That its output will not be displayed. Things like that.
from termux-api-package.
Related to this: how could I make a tap on the notification focus the termux window? Is there an example somewhere?
By the way, great work with the termux-api. I love it :)
from termux-api-package.
@pawamoy I agree that some info on the quirks of --action
may help many users. The things that are worth documenting, in my opinion, are at least these:
- you should use actions that do things outside of the terminal, like
--action "termux-toast hello"
. Anything that outputs to the terminal is useless, so the output should either be redirected (--action "ls > ~/ls.txt"
) or shown to the user in a different way (--action "ls|termux-toast"
). - The argument to
--action
is fed todash -c
, so you don't need escaping or wizardry to run more than one command, it's as easy as--action "this; that; another"
or--action "if [ -e file ]; then termux-toast yes; else termux-toast no; fi"
. - for anything more complex, you should put your script in a file, make it executable, and just
--action ~/bin/script
. --action
invokesdash
in a different environment (not a subshell). Thus your environment is lost (most notably$PATH
), and~/.profile
is not sourced either. So if you need your$PATH
you should either- set it explicitly in the script (e.g.
export PATH="$HOME/bin:$PATH"
) - or use something like
--action "bash -l -c 'this; that'"
)
- set it explicitly in the script (e.g.
Apologies for any mistakes (it's 1AM here).
Feel free to add something (even in French).
Later we'll decide on the appropriate place for this info. I would like to avoid cluttering termux-notification -h
, so I'd either put it in the wiki or in termux-notification --action-help
.
from termux-api-package.
@xalexalex it's exactly the kind of info I was looking for 😀 I think it would be perfect to have an --action-help
or --help-action
flag, mirrored in the wiki of course.
from termux-api-package.
Related Issues (20)
- E: Package 'termux-api' has no installation candidate HOT 1
- Termux-telephony-call ignores # sign HOT 1
- l want to recognize spanish with Termux HOT 1
- termux-speech-to-text buffers progressive output
- `termux-api` never returns if Android app is not installed
- Feature request: toggle "Do not disturb" modes
- Termux-Screenshot HOT 1
- How to use TTS in termux without delay HOT 1
- android 11 termux API hangs HOT 1
- Create a new release for the SAF support HOT 4
- No command works!! HOT 6
- termux-api fails with a linker error HOT 6
- sms-list doesnt return images/pictures HOT 2
- termux-job-scheduler: New jobs default to job ID 0 HOT 5
- termux-microphone-record foreground argument would be nice
- Background jobs: Occasional hang HOT 2
- termux-camera-photo Directly return image data?
- Library not found in proot-distro
- termux-saf-managedir doesn't open a folder selection screen, it just hangs HOT 3
- Improving the camera app HOT 15
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from termux-api-package.