Command plugin for Plover to run an arbitrary shell command.
The package is available on GitHub and PyPI.
The subprocess inherits Plover's environment, and some plugins might set some environment variables.
For instance, on some operating systems, plover-debugging-console
may set PAGER
environment variable. (see issue #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
for more details.
In order to use this plugin in Plover you need to create a dictionary entry of the form:
{
"example_stroke": "{PLOVER:SHELL:command}"
}
Note:
&
on Linux or start
on Windows ifsh
shell. If you want to use anotherbash -c "command"
.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}"