README (1809B)
1 dumbsh - dumb shell 2 =================== 3 Your shell is dumb, make it smarter. 4 5 6 Description 7 ----------- 8 If you have multiple layouts in your keyboard mappings, sometimes 9 you are typing in your second layout by mistake, like this: 10 11 عدشپث 12 13 But you meant: 14 15 uname 16 17 By default, your shell will not understand what you wanted to say (of 18 course shell is the dumb one in this situation, you're never wrong) 19 20 After installing this script, a layout table will be generated from 21 your second layout to your first layout, using xmodmap. (Your first 22 layout is english and your second layout is your other language) 23 24 25 Installation 26 ------------ 27 Enter the following command to source the dumb.sh script once you've 28 entered to your shell: (bash in this example) 29 30 echo "source path/to/dumb.sh" >> ~/.bashrc 31 32 or if you're a zsh user: 33 34 echo "source path/to/dumb.sh" >> ~/.zshrc 35 36 Restart your shell. Now when you are typing on your second layout, your 37 commands will be translated using the layout table which you've generated 38 on the first execution. 39 40 This script is supported both on zsh and bash, but if you are using 41 something else, you'll need to find a way to handle non-found commands 42 in your shell, if there is a function for it in your shell, edit the script 43 and add like how bash is added as a support. 44 45 46 Configuration 47 ------------- 48 This script can be configured through environmental variables: 49 50 DUMBSH_KEY_INDEX: 51 If set, the layout table will be generated to the place 52 you've set, but if not it sets to: 53 $XDG_DATA_HOME/dumbsh_table 54 $HOME/.local/share/dumbsh_table 55 56 DUMBSH_ASK_REPLACE: 57 If set to true, It'll ask before running the command, 58 or else it'll Automatically run the translated command. 59 60 You can set these variables in your shell configuration/login profile in 61 order to config this script.