shin icon indicating copy to clipboard operation
shin copied to clipboard

Change to zsh possible?

Open Hedronmx opened this issue 3 years ago • 6 comments

Hello! instead of using bash would it be possible to use ZSH?

Hedronmx avatar Oct 29 '22 09:10 Hedronmx

I think you could just change this line in the main.go file:

command := exec.Command("bash", "-c", commandText) https://github.com/p-e-w/shin/blob/9c67a6d28b77a8d3eae9518f82e928bfe01d30d0/main.go#L173

0unknwn avatar Oct 29 '22 13:10 0unknwn

Making the command interpreter configurable is something I'm considering.

Could you describe your use case? This would help me decide whether adding this feature makes sense. Zsh and Bash differ mostly in the interactive shell, which is irrelevant for Shin. What would you be able to do differently if Shin ran Zsh instead of Bash?

p-e-w avatar Oct 30 '22 05:10 p-e-w

One use case I have would be to have a hotkey that opens shin but as a python command.

That way, I could activate shin and do simple multiplication or quick string manipulation.

Ideally it would be configurable as an argument (not sure if this is possible?) so I could bind separate hotkeys with ibus engine shin --shell 'bash -c' or ibus engine shin --shell 'python -c'

apockill avatar Oct 31 '22 19:10 apockill

Ideally it would be configurable as an argument (not sure if this is possible?) so I could bind separate hotkeys with ibus engine shin --shell 'bash -c' or ibus engine shin --shell 'python -c'

That is unfortunately not possible. ibus engine takes an engine name, which is cross-referenced with the engine definition from the component XML. It doesn't accept arbitrary commands. Switching between interpreters would need to be handled within Shin itself.

p-e-w avatar Nov 01 '22 05:11 p-e-w

Maybe there could be some standard shell scripts in shin's bin folder to easily use Python etc.

@apockill, you can have Python with:

#!/bin/bash

python3 -c "print($*)"

0unknwn avatar Nov 01 '22 12:11 0unknwn

One use case I have would be to have a hotkey that opens shin but as a python command.

That way, I could activate shin and do simple multiplication or quick string manipulation.

Ideally it would be configurable as an argument (not sure if this is possible?) so I could bind separate hotkeys with ibus engine shin --shell 'bash -c' or ibus engine shin --shell 'python -c'

This is exactly my use case! To change depending on the commands i want to run.

Hedronmx avatar Nov 02 '22 03:11 Hedronmx