jacob-macleod / jacob-macleod/Shelly-Terminal-Shell
Develop custom core plugin
- Dominant language
- Python
- Stars
- 1
- Forks
- 1
- PR merge metrics
- No merged PRs in 30d
Description
We need more core plugins!
Core plugins display the current directory the user is in and the username, for example `default@home/default/my_dir`. To write a plugin, create a .py file with a function called 'core'. The output of this function will be printed whenever the user presses a key. To create a plugin that prints the current directory the user is in, you first need to `import subprocesses as sp`, then inside the core function, enter `return sp.getoutput("pwd")`. This line can be augmented, for example, `return sp.getoutput("whoami") + "/" + sp.getoutput("pwd")`. You can also use ansi escape codes to add color - here's an example: `return "\033[31m" + sp.getoutput("whoami") + "\033[0m~" + "\033[34m" + sp.getoutput("pwd") + "/\033[0m~$ "`
If you're interested, please clone the repository, develop the plugin in a new file, perhaps called 'my_plugin.py' then do a pull request when you're finished!
Remember, to actually use your plugin, you need to change the line in shellyRC.txt starting with a '#' to `#Core-Plugin ""`
Contributor guide
No contributing guide indexed for this repository
Research direction
Clone the repository and inspect how core plugins are loaded, then create a new .py file containing a core function as described. Point the Core-Plugin setting in shellyRC.txt at the local file and verify that its output appears when a key is pressed; the issue does not specify a particular plugin behavior.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- python
- Domain
- cli
- Issue type
- Feature
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 35/100