Add 'custom' status plugin to get status texts from external scripts. #163
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Allow custom status plugins by way of invoking arbitrary scripts (only within plugin scripts' directory).
Script output will be passed as status text (which can be also tmux's status bar placeholders, such as
#{host}
). The plugin name iscustom:
followed by the script, which must reside in the plugins dir and be executable (symlinks are OK). Otherwise an error will be shown in the plugin slot. Declaring multiple plugins works OK.Added corresponding
@dracula-custom-plugin-colors
variable, as done in all plugins, all custom plugins have the same colour, thou, which I think it's fine (just interleave them). However, I can devise a fix, if required.Example
Adding to plugins
custom:cpu_info.sh
would mimic adding thecpu-usage
plugin. Drop your custom script or symlink in the plugins dir and adjust name as needed.Remaining tasks
Documentation: Just added a notice in the readme. I guess it should go here, when it's reviewed & merged.
I can also send a PR with a
command:
(or should it beshell:
?) plugin to run custom commands (eg.cat ~/file.txt
). However, it would require theread -r -a
for plugins to be aread -a
to allow spaces. I didn't send in case it's not acceptable, but it "Works on My Machine:tm:" :grin:.