Crates.io | pyc-shell |
lib.rs | pyc-shell |
version | 0.3.0 |
source | src |
created_at | 2020-05-26 19:04:25.171458 |
updated_at | 2020-11-14 10:55:41.617596 |
description | Pyc is a simple CLI application, which allows you to perform shell commands in cyrillic and other alphabets, through command and output transliteration. |
homepage | https://github.com/ChristianVisintin/Pyc |
repository | https://github.com/ChristianVisintin/Pyc |
max_upload_size | |
id | 246320 |
size | 536,909 |
~ Use your alphabet with your favourite shell ~
Developed by Christian Visintin
Current version: 0.3.0 (14/11/2020)
Рус (Pronounced "Rus") is a simple CLI application, written in Rust, which allows you to interface with your favourite shell, giving you the possibility to perform commands in cyrillic and other alphabets, through command and output transliteration.
Well, basically I started studying russian and to become practical with the cyrillic alphabet I wanted to use it whenever was possible, even while typing on the console; but then I found out that there's not a single console which allow people which use a different alphabet to use it, so I came out with this project.
The goal of this project is to give everybody who uses an alphabet different from latin, to use the computer shell without having to switch the keyboard layout.
Basically Рус is a shell interface, which means that it reads the user input, it converts it according to the configured alphabet and then it sends the translated input to the shell which processes it; then the output is read from the shell's stdout and is (if enabled) translated back to the original alphabet and printed to user's output.
Other alphabets are not planned for the moment.
Can't find yours? Contribute to the project implementing it 😀 ! Read More
If you're considering to install Pyc I want to thank you 💛 ! I hope this project can be useful for you!
If you want to contribute to this project, don't forget to check out our contribute guide. Read More
#Install pyc through cargo
cargo install pyc-shell
#Install configuration
mkdir -p $HOME/.config/pyc/
#Copy configuration file from repository
wget -O $HOME/.config/pyc/pyc.yml https://raw.githubusercontent.com/ChristianVisintin/Pyc/master/pyc.yml
Coming soon
Pyc can be started with the following options:
-c, --command <command>
Runs the provided command and return-C, --config <config>
Specify Pyc configuration file location.-l, --lang <ru|рус>
Specify the language used by Pyc-s, --shell </bin/bash>
Specify the shell binary path-v, --version
Print version info-h, --help
Print help pagePyc supports a user configuration which adds some features and customization.
The configuration must be stored at $HOME/.config/pyc/pyc.yml
. A default configuration is located in the repository in pyc.yml.
Let's see how the configuration is written
language: ru
shell:
exec: "bash"
args:
- "-l"
alias:
- чд: cd
- пвд: pwd
- уич: which
output:
translate: true
prompt:
prompt_line: "${USER} on ${HOSTNAME} in ${WRKDIR} ${GIT_BRANCH} ${GIT_COMMIT} ${CMD_TIME}"
history_size: 256
translate: false
break:
enabled: true
with: "❯"
duration:
min_elapsed_time: 2000
rc:
ok: "✔"
error: "✖"
git:
branch: "on "
commit_ref_len: 8
commit_prepend: "("
commit_append: ")"
The prompt configuration is used to setup the prompt line when using the interactive mode. The prompt configuration provides parameters to customize the line printed when interacting with the shell. In addition to the parameters described before, here the prompt line keys are illustrated.
Each prompt line key must have the following syntax ${VAR_NAME}
Key | Description |
---|---|
USER | Username |
HOSTNAME | Hostname |
WRKDIR | Current directory |
LANG | The language configured for Pyc in flag colors of the associated country |
CMD_TIME | Execution time of the last command if >= min_elapsed_time |
RC | Shows the string associated to a successful exitcode or to an error |
Key | Description |
---|---|
KYEL | Yellow |
KRED | Red |
KBLU | Blue |
KMAG | Magenta |
KGRN | Green |
KWHT | White |
KBLK | Black |
KGRY | Gray |
KBOLD | Bold text |
KBLINK | Blinking text |
KSELECT | Selected text |
KRST | Reset |
Key | Description |
---|---|
GIT_BRANCH | The current git branch |
GIT_COMMIT | The current git commit ref |
The developer documentation can be found on Rust Docs at https://docs.rs/pyc-shell
The documentation related to translator modules can be instead found here:
It is possible to escape texts (only when the prompt line is visible, not while a program is running), preventing it from being transliterated to latin. To do so, just use quotes:
#Touch foobar.txt
тоуч фообар.ткст
Escaped:
#Touch фообар.мксм
тоуч "фообар.ткст"
If you see this character �
when you're typing cyrillic characters, these steps may fix the problem:
Reconfigure locales:
sudo dpkg-reconfigure locales
Select all the locales you need from the list, but most important select ru_RU.UTF-8.
Regenerate locales:
sudo locale-gen
If this didn't solve your problem it's probably an issue of your terminal. Up to now I've found out that some terminals just don't let you type non-ascii characters when executing an application. These are the terminals which I've used or have been reported which DON'T work.
Yep. Unfortunately it seems there's no way to make it work in oneshot mode. If you know a possible way to make it work, please contribute to this project to implement it.
Uuhm, I don't know why, I need some time to investigate why, maybe it doesn't use stdout to write (?).
I will fix this soon
An integrated text editor will be available in 0.4.0
Pyc-shell is an active project, development effort is minimum at the moment due to my spare time and to the little interest from the community. In addition I'm working on other bigger projects.
Planned for 2021
Contributions are welcome! 😉
If you think you can contribute to Рус, please follow Рус's contributions guide
See the enire changelog HERE
Licensed under the GNU GPLv3 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at
http://www.gnu.org/licenses/gpl-3.0.txt
Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.
You can read the entire license HERE