Last active
          July 1, 2019 08:39 
        
      - 
      
- 
        Save Tetz/2d7a91247bfb469b3f7a230e55e38efc to your computer and use it in GitHub Desktop. 
    Change Japnese Input Mozc Default Input Method on Ubuntu 18.04 
  
        
  
    
      This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
      Learn more about bidirectional Unicode characters
    
  
  
    
  | #!/bin/bash | |
| echo 'setting ibus-mozc...' | |
| # Change ibus-mozc default input mode to hiragana | |
| sleep 3 && \ | |
| xdotool keydown super+space && sleep 0.2 && \ | |
| xdotool key space && sleep 0.2 && \ | |
| xdotool keyup super+space && \ | |
| for i in `seq 0 9` | |
| do | |
| mozc=`ps -ef | grep 'ibus-mozc' | grep -v grep | grep -v srvchk | wc -l` | |
| if [ $mozc -gt 0 ]; then | |
| sleep 1 | |
| xdotool keydown Hiragana && sleep 0.2 && \ | |
| xdotool keyup Hiragana && sleep 0.2 | |
| break | |
| else | |
| sleep 1 | |
| fi | |
| done | |
| sleep 3 && \ | |
| xdotool keydown super+space && sleep 0.2 && \ | |
| xdotool key space && sleep 0.2 && \ | |
| xdotool keyup super+space && sleep 0.2 && \ | |
| echo 'ibus-mozc setting done.' | |
| sleep 1 | 
  
    Sign up for free
    to join this conversation on GitHub.
    Already have an account?
    Sign in to comment
  
            
Run the scrypt automatically on boot.
And then paste