tmux icon indicating copy to clipboard operation
tmux copied to clipboard

Add 'custom' status plugin to get status texts from external scripts.

Open pataquets opened this issue 1 year ago • 0 comments

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 is custom: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 the cpu-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 be shell:?) plugin to run custom commands (eg. cat ~/file.txt). However, it would require the read -r -a for plugins to be a read -a to allow spaces. I didn't send in case it's not acceptable, but it "Works on My Machine:tm:" :grin:.

pataquets avatar Jul 10 '22 18:07 pataquets