Skip to main content

iBus not working on Ubuntu 20.04.4 LTS, 无法在Ubuntu中输入中文

· One min read

问题现象

  • Ubuntu 20.04.4 LTS
  • 添加汉语语言
  • 安装完 iBus 及相关的输入法 (ibus-pinyin, ibus-table-wubi)后,就算是切换到 zh 语言也无法输入中文字符

换成 fcitx 后解决:

  • 安装 fcitx:
$ sudo apt install fcitx
  • 打开工具 Language Support/语言支持, 把 Keyboard input method system 改成 fcitx
  • 安装五笔输入法
$ sudo apt install fcitx-table-wubi
  • 按 Ctrl + Space 或 Left Shift 在中英文之间切换
  • 按 Ctrl + Shift 在不同的中文输入法之间切换

Powershell does not support pass Boolean parameter when -File parameter is used

· One min read

Let’s say there is a Powershell script file named test.ps1 with the following content:

param ([Boolean] $FromSchTask)

if ($FromSchTask)
{
echo Yes
} else {
echo No
}

When I run this script with -File parameter in command prompt by powershell.exe, for example:

C:\>powershell.exe -ExecutionPolicy bypass -File ./test.ps1 -FromSchTask $True

It will throw the following error message:

C:\test.ps1 : Cannot process argument transformation on parameter 'FromSchTask'. Cannot convert value "System.String" to type
"System.Boolean". Boolean parameters accept only Boolean values and numbers, such as $True, $False, 1 or 0.
+ CategoryInfo : InvalidData: (:) [test.ps1], ParentContainsErrorRecordException
+ FullyQualifiedErrorId : ParameterArgumentTransformationError,test.ps1

As mentioned in this comments in stackoverflow: https://stackoverflow.com/a/7302626/9657874, it seems the -File parameter does not support pass Boolean parameter to script file. After change -File to -Command, it works like a clarm:

C:\>powershell.exe -ExecutionPolicy bypass -Command ./test.ps1 -FromSchTask $True
Yes
ClustrMaps