https://github.com/user202729/plover_run_shell
Run a shell command from Plover.
https://github.com/user202729/plover_run_shell
plover plover-plugins stenography
Last synced: 3 months ago
JSON representation
Run a shell command from Plover.
- Host: GitHub
- URL: https://github.com/user202729/plover_run_shell
- Owner: user202729
- License: gpl-3.0
- Created: 2019-09-30T06:20:38.000Z (over 5 years ago)
- Default Branch: master
- Last Pushed: 2021-12-06T12:35:08.000Z (over 3 years ago)
- Last Synced: 2024-09-30T02:33:46.340Z (8 months ago)
- Topics: plover, plover-plugins, stenography
- Language: Python
- Homepage:
- Size: 22.5 KB
- Stars: 5
- Watchers: 2
- Forks: 0
- Open Issues: 3
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Plover Run Shell
Command plugin for [Plover](https://github.com/openstenoproject/plover) to run an arbitrary shell
command.The package is available on [GitHub](https://github.com/user202729/plover_run_shell) and
[PyPI](https://pypi.org/project/plover-run-shell/).## Common issues
The subprocess inherits Plover's environment, and some plugins might set some environment variables.
For instance, on some operating systems, [`plover-debugging-console`](https://github.com/user202729/plover-debugging-console)
may set `PAGER` environment variable. (see [issue #2](https://github.com/user202729/plover_run_shell/issues/2))
You may want to unset them explicitly, for example on systems with `env`:env -uPAGER -uGIT_PAGER xterm
Alternatively, install a sufficiently new version of package `background-zmq-ipython`,
see README of [`plover-debugging-console`](https://github.com/user202729/plover-debugging-console) for more details.## Usage
In order to use this plugin in [Plover](https://github.com/openstenoproject/plover) you need to
create a dictionary entry of the form:``` json
{
"example_stroke": "{PLOVER:SHELL:command}"
}
```Note:
* The command might be executed synchronously (so you can use `&` on Linux or `start` on Windows if
you don't want Plover to freeze, in case the called process is long-running).
* (on UNIX systems) The command may be executed by the `sh` shell. If you want to use another
shell, you can call that shell explicitly: `bash -c "command"`.## Example
These examples are only for X on GNU/Linux systems (it relies on many external tools).
You should be able to construct similar translations by searching for "how to do task X from
console/command-line".If there's none, you can still write an external program with other programming language and call it
from Plover. (alternatively, write it in Python and make a command plugin)Alternatively, if you already have a working binding in the windows manager, you don't have to use
this plugin and use Plover's key combination syntax.* Shutting down the machine
"{PLOVER:SHELL:\\{ sleep 2s;poweroff; \\}&}{PLOVER:QUIT}"
* Restart Plover (console GUI, in a new terminal)
"{PLOVER:SHELL:xterm -e bash -c \"sleep 0.5s; plover --gui console\" &}{PLOVER:QUIT}"
* Change brightness
"{PLOVER:SHELL:xbacklight -10}"
"{PLOVER:SHELL:xbacklight +10}"* Change volume (note that the solution with `pactl` is not robust because it relies on the sink
number being 0)"{PLOVER:SHELL:pactl set-sink-volume 0 -5%}"
"{PLOVER:SHELL:pactl set-sink-volume 0 +5%}"
"{PLOVER:SHELL:amixer -D pulse sset Master 5%+}"
"{PLOVER:SHELL:amixer -D pulse sset Master 5%-}"* Suspend (depends on your GNU/Linux distribution)
"{PLOVER:SHELL:systemctl suspend}"
"{PLOVER:SHELL:pm-suspend}"