Ubuntu與嘸蝦米: 在fcitx下,(boshiamy)嘸蝦米的使用最為順暢、穩定!(新酷音、m17n、倉頡、輕鬆法亦適用) [論壇 - Ubuntu 與中文]


正在瀏覽:   1 名遊客


 到底部   前一個主題   下一個主題  [無發表權] 請登錄或者註冊

« 1 2 3 4 (5)


回覆: Ubuntu與嘸蝦米: 在fcitx下,(boshiamy)嘸蝦米的使用最為順暢、穩定!(新酷音、m17n、倉頡、輕鬆法亦適用)
會員五級
註冊日期:
2012/4/22 10:50
所屬群組:
已註冊使用者
等級: 37
HP : 0 / 901
MP : 671 / 29281
EXP: 6
離線
================================================================================

# 索引

================================================================================

* 「#39」 - 關於「fcitx-tools」,「libime-bin」,「fcitx5-chinese-addons-bin」
* 「#40」 - 在「fcitx5」,如何編譯「boshiamy.txt」
* 「#42」 - 如何簡易安裝「fcitx5-table-boshiamy」 (嘸蝦米輸入法)
* 「#43」 - 如何簡易安裝「fcitx5-table-easy-large」(輕鬆輸入法)
* 「#44」 - 如何替「fcitx5 input method」加入「icon」 / 解析
* 「#45」 - 如何替「fcitx5 input method」加入「icon」

================================================================================

## Ubuntu 22.04 LTS (Jammy Jellyfish) Released

* 「#16」 - 關於「fcitx5-table-extra」
* 「#18」 - 如何編譯「fcitx5-table-extra」並且簡易打包成「Debian Package」
* 「#19」 - 何編譯「fcitx5-table-extra」並且打包成「Debian Package」和「Debian Source Package」
* 「#20」 - 如何編譯「fcitx5-table-extra」並且打包成多個「Debian Package」

================================================================================

## 範例

* fcitx5-table-boshiamy
* fcitx5-table-easy-large

================================================================================

## Github

* fcitx5 / discussions

================================================================================

4/1 7:59:11
應用擴展 工具箱
回覆: Ubuntu與嘸蝦米: 在fcitx下,(boshiamy)嘸蝦米的使用最為順暢、穩定!(新酷音、m17n、倉頡、輕鬆法亦適用)
會員五級
註冊日期:
2012/4/22 10:50
所屬群組:
已註冊使用者
等級: 37
HP : 0 / 901
MP : 671 / 29281
EXP: 6
離線
================================================================================

[回到索引]

================================================================================

# 如何簡易安裝「fcitx5-table-boshiamy」

================================================================================

延續「#40」提到的基礎概念



libime_tabledict boshiamy.txt boshiamy.main.dict




於是乎,我們就可以改採用簡易的方式來安裝「fcitx5-table-boshiamy」,以下是參考步驟,

一樣我有寫了專案,放在「Github」上,提供參考

================================================================================

測試環境: Ubuntu Mate 22.04

================================================================================

## prepare

執行下面指令


sudo apt-get install wget libime-bin fcitx5-chinese-addons



安裝下面幾個過程中需要的「Package」

* wget
* libime-bin
* fcitx5-chinese-addons

================================================================================

## download

執行下面指令,下載「boshiamy.txt


wget -c https://raw.githubusercontent.com/fcitx/fcitx5-table-extra/master/tables/boshiamy.txt




執行下面指令,下載「boshiamy.conf.in


wget -c https://raw.githubusercontent.com/fcitx/fcitx5-table-extra/master/tables/boshiamy.conf.in



> 這兩個檔案,可以在「fcitx5-table-extra / tables」找到。

================================================================================

## compile

執行下面指令,


libime_tabledict boshiamy.txt boshiamy.main.dict



> 關於「libime_tabledict」這個「指令」是屬於「libime-bin」這個「Package」,這個用法,請參考「#40」的說明。

================================================================================

## install

可以從

* Arch Package / fcitx5-table-extra / Package Contents

那裡看到下面的關鍵路徑


/usr/share/fcitx5/inputmethod/boshiamy.conf

/usr/share/fcitx5/table/boshiamy.main.dict



還有相關的「icons」路徑



/usr/share/icons/hicolor/16x16/apps/fcitx-boshiamy.png
/usr/share/icons/hicolor/16x16/apps/org.fcitx.Fcitx5.fcitx-boshiamy.png

/usr/share/icons/hicolor/22x22/apps/fcitx-boshiamy.png
/usr/share/icons/hicolor/22x22/apps/org.fcitx.Fcitx5.fcitx-boshiamy.png

...略...



> 關於「icons」是「非必要」,所以這裡就先忽略,不安裝。


執行下面指令,將「boshiamy.main.dict」安裝到「/usr/share/fcitx5/table/boshiamy.main.dict」這個路徑。


sudo install -Dm644 boshiamy.main.dict "/usr/share/fcitx5/table/boshiamy.main.dict"



執行下面指令,將「boshiamy.conf.in」安裝到「/usr/share/fcitx5/inputmethod/boshiamy.conf」這個路徑。


sudo install -Dm644 boshiamy.conf.in "/usr/share/fcitx5/inputmethod/boshiamy.conf"



================================================================================

以上的步驟,就將「fcitx5-boshiamy」簡易安裝完成了,

接著就可以到「fcitx5」的設定介面,去設定加入「boshiamy」。

================================================================================

## boshiamy.conf.in

關於「boshiamy.conf.in」,內容如下



[InputMethod]
Name=Boshiamy
Icon=fcitx-boshiamy
Label=嘸
LangCode=zh_TW
Addon=table
Configurable=True

[Table]
File=table/boshiamy.main.dict
AutoSelect=False
AutoSelectLength=0
NoMatchAutoSelectLength=0
OrderPolicy=No
Hint=False
OrderPolicy=No
UseFullWidth=True
IgnorePunc=True
ExactMatch=False
Learning=False

[Table/PrevPage]
0=Up
1=minus

[Table/NextPage]
0=Down
1=equal




在「fcitx5-table-extra / tables / CMakeLists.txt」,會將「boshiamy.conf.in」做「轉換」,

產生新的檔案「boshiamy.conf」,內容如下。



[InputMethod]
Name[ca]=Boshiamy
Name[da]=Boshiamy
Name[de]=Boshiamy
Name[ja]=Boshiamy
Name[ko]=Boshiamy
Name[ru]=Boshiamy
Name[tr]=Boshiamy
Name[zh_CN]=嘸蝦米
Name[zh_TW]=嘸蝦米
Name=Boshiamy
Icon=fcitx-boshiamy
Label=嘸
LangCode=zh_TW
Addon=table
Configurable=True

[Table]
File=table/boshiamy.main.dict
AutoSelect=False
AutoSelectLength=0
NoMatchAutoSelectLength=0
OrderPolicy=No
Hint=False
OrderPolicy=No
UseFullWidth=True
IgnorePunc=True
ExactMatch=False
Learning=False

[Table/PrevPage]
0=Up
1=minus

[Table/NextPage]
0=Down
1=equal




觀察了一下,它只是加了一些「翻譯」,也就是「綠色字」那些部份,

這些翻譯,可以在「fcitx5-table-extra / po」找到。

不過這個翻譯,並沒特別影響功能面,只是關於顯示而已,

所以為了簡化流程,因此上面的流程,就直接將「boshiamy.conf.in」安裝到「/usr/share/fcitx5/inputmethod/boshiamy.conf」這個路徑。

================================================================================

[回到索引]

================================================================================

4/1 8:04:01
應用擴展 工具箱
回覆: Ubuntu與嘸蝦米: 在fcitx下,(boshiamy)嘸蝦米的使用最為順暢、穩定!(新酷音、m17n、倉頡、輕鬆法亦適用)
會員五級
註冊日期:
2012/4/22 10:50
所屬群組:
已註冊使用者
等級: 37
HP : 0 / 901
MP : 671 / 29281
EXP: 6
離線
================================================================================

[回到索引]

================================================================================

# 如何簡易安裝「fcitx5-table-easy-large」

================================================================================

## 緣起

昨晚在逛「Ubuntu 正體中文社團」,

看到「#38 - TonyLinCyberView」也有個「發問」,跟這議題相關,

才了解到,原來「TonyLinCyberView」想要採用的是「輕鬆輸入法」,


昨晚使用「輕鬆輸入法」當作關鍵字查詢,

有找到「輕鬆輸入法之家」,

我對「輕鬆輸入法」沒概念,所以也找了「教學影片」,用來驗證測試。

一開始,我看到「輕鬆輸入法之家」提供的是「cin檔」的「格式」,

所以我下載了「EZInput-2017-Phrase.cin」,

然後仿照「boshiamy.txt」的格式

要轉成「EZInput-2017-Phrase.txt」的「格式」,

接著一樣上面的模式,使用「libime_tabledict EZInput-2017-Phrase.txt EZInput-2017-Phrase.main.dict」。

昨晚有試成功,但依照影片說的方式輸入,

我有些輸入可以產生正確結果,有些則不行。

而今天早上,看到這個討論串的「#1」,

原來在「fcitx」就有提供「fcitx-table-easy-big (輕鬆大詞庫)」,

也就是可以在「fcitx-table-extra / tables」找到。

於是回到「fcitx5-table-extra / tables」,

就可以找到「easy-large.conf.in」和「easy-large.txt」。

發現到原來「Selection」,要加上「Alt」,因為「1~9」也是「字根」。


[Table/Selection]
0=Alt+1
1=Alt+2
2=Alt+3
3=Alt+4
4=Alt+5
5=Alt+6
6=Alt+7
7=Alt+8
8=Alt+9
9=Alt+0





================================================================================

不過「fcitx5-table-extra / tables」既然已經有提供,我就不再花時間修改「EZInput-2017-Phrase.cin」。

依照「#42」簡易安裝「fcitx5-table-boshiamy」的模式,

來簡易安裝「fcitx5-table-easy-large」,以下是參考步驟,

一樣我有寫了專案,放在「Github」上,提供參考

================================================================================

測試環境: Ubuntu Mate 22.04

================================================================================

## prepare

執行下面指令


sudo apt-get install wget libime-bin fcitx5-chinese-addons



安裝下面幾個過程中需要的「Package」

* wget
* libime-bin
* fcitx5-chinese-addons

================================================================================

## download

執行下面指令,下載「easy-large.txt


wget -c https://raw.githubusercontent.com/fcitx/fcitx5-table-extra/master/tables/easy-large.txt




執行下面指令,下載「easy-large.conf.in


wget -c https://raw.githubusercontent.com/fcitx/fcitx5-table-extra/master/tables/easy-large.conf.in



> 這兩個檔案,可以在「fcitx5-table-extra / tables」找到。

================================================================================

## compile

執行下面指令,


libime_tabledict easy-large.txt easy-large.main.dict



> 關於「libime_tabledict」這個「指令」是屬於「libime-bin」這個「Package」,這個用法,請參考「#40」的說明。

================================================================================

## install

可以從

* Arch Package / fcitx5-table-extra / Package Contents

那裡看到下面的關鍵路徑


/usr/share/fcitx5/inputmethod/easy-large.conf

/usr/share/fcitx5/table/easy-large.main.dict



還有相關的「icons」路徑



/usr/share/icons/hicolor/16x16/apps/fcitx-easy-large.png
/usr/share/icons/hicolor/16x16/apps/org.fcitx.Fcitx5.fcitx-easy-large.png

/usr/share/icons/hicolor/22x22/apps/fcitx-easy-large.png
/usr/share/icons/hicolor/22x22/apps/org.fcitx.Fcitx5.fcitx-easy-large.png

...略...



> 關於「icons」是「非必要」,所以這裡就先忽略,不安裝。


執行下面指令,將「easy-large.main.dict」安裝到「/usr/share/fcitx5/table/easy-large.main.dict」這個路徑。


sudo install -Dm644 easy-large.main.dict "/usr/share/fcitx5/table/easy-large.main.dict"



執行下面指令,將「easy-large.conf.in」安裝到「/usr/share/fcitx5/inputmethod/easy-large.conf」這個路徑。


sudo install -Dm644 easy-large.conf.in "/usr/share/fcitx5/inputmethod/easy-large.conf"



================================================================================

以上的步驟,就將「fcitx5-easy-large」安裝完成了,

接著就可以到「fcitx5」的設定介面,去設定加入「Easy Large」。

================================================================================

## easy-large.conf.in

關於「easy-large.conf.in」,內容如下



[InputMethod]
Name=Easy Large
Icon=fcitx-easy-large
Label=輕
LangCode=zh_HK
Addon=table
Configurable=True

[Table]
File=table/easy-large.main.dict
OrderPolicy=No
PinyinKey=[
AutoSelect=False
MatchingKey=@
ExactMatch=False
Hint=True
DisplayCustomHint=True
IgnorePunc=True
PageSize=9
CandidateLayoutHint=Vertical

[Table/Selection]
0=Alt+1
1=Alt+2
2=Alt+3
3=Alt+4
4=Alt+5
5=Alt+6
6=Alt+7
7=Alt+8
8=Alt+9
9=Alt+0

[Table/PrevPage]
0=Up
1=Page_Up

[Table/NextPage]
0=Down
1=Page_Down





在「fcitx5-table-extra / tables / CMakeLists.txt」,會將「easy-large.conf.in」做「轉換」,

產生新的檔案「easy-large.conf」,內容如下。



[InputMethod]
Name[da]=Easy (store)
Name[ja]=Easy Large
Name[ko]=쉬운 큰부호
Name[ru]=Easy Large
Name[zh_CN]=简易大字集
Name[zh_TW]=Easy 大字集
Name=Easy Large
Icon=fcitx-easy-large
Label=輕
LangCode=zh_HK
Addon=table
Configurable=True

[Table]
File=table/easy-large.main.dict
OrderPolicy=No
PinyinKey=[
AutoSelect=False
MatchingKey=@
ExactMatch=False
Hint=True
DisplayCustomHint=True
IgnorePunc=True
PageSize=9
CandidateLayoutHint=Vertical

[Table/Selection]
0=Alt+1
1=Alt+2
2=Alt+3
3=Alt+4
4=Alt+5
5=Alt+6
6=Alt+7
7=Alt+8
8=Alt+9
9=Alt+0

[Table/PrevPage]
0=Up
1=Page_Up

[Table/NextPage]
0=Down
1=Page_Down




觀察了一下,它只是加了一些「翻譯」,也就是「綠色字」那些部份,

這些翻譯,可以在「fcitx5-table-extra / po」找到。

不過這個翻譯,並沒特別影響功能面,只是關於顯示而已,

所以為了簡化流程,因此上面的流程,就直接將「easy-large.conf.in」安裝到「/usr/share/fcitx5/inputmethod/easy-large.conf」這個路徑。

================================================================================

[回到索引]

================================================================================

4/1 10:41:49
應用擴展 工具箱
回覆: Ubuntu與嘸蝦米: 在fcitx下,(boshiamy)嘸蝦米的使用最為順暢、穩定!(新酷音、m17n、倉頡、輕鬆法亦適用)
會員五級
註冊日期:
2012/4/22 10:50
所屬群組:
已註冊使用者
等級: 37
HP : 0 / 901
MP : 671 / 29281
EXP: 6
離線
================================================================================

[回到索引]

================================================================================

# 如何替「fcitx5 input method」加入「icon」 / 解析

================================================================================

接下來,來紀錄如何替「fcitx5 input methond」加入「icon」。

在進入正題,先來探索「fcitx5-chewing」和「hicolor-icon-theme」這兩個「Package」。

之前我有紀錄一個「索引: 套件操作實務」,可以參考一些探索過程需要的技巧。

================================================================================

## fcitx5-chewing

執行


dpkg -L fcitx5-chewing | grep icon



顯示


/usr/share/icons
/usr/share/icons/hicolor
/usr/share/icons/hicolor/48x48
/usr/share/icons/hicolor/48x48/apps
/usr/share/icons/hicolor/48x48/apps/org.fcitx.Fcitx5.fcitx-chewing.png
/usr/share/icons/hicolor/48x48/apps/fcitx-chewing.png



執行


file /usr/share/icons/hicolor/48x48/apps/fcitx-chewing.png



顯示


/usr/share/icons/hicolor/48x48/apps/fcitx-chewing.png: symbolic link to org.fcitx.Fcitx5.fcitx-chewing.png



================================================================================

執行


dpkg -L fcitx5-chewing | grep inputmethod



顯示


/usr/share/fcitx5/inputmethod
/usr/share/fcitx5/inputmethod/chewing.conf



================================================================================

執行


cat /usr/share/fcitx5/inputmethod/chewing.conf



顯示


[InputMethod]
Name[ca]=Chewing
Name[da]=Chewing
Name[de]=Chewing
Name[ja]=Chewing
Name[ko]=Chewing
Name[ru]=Чжуинь
Name[tr]=Çiğneme
Name[zh_CN]=新酷音
Name[zh_TW]=新酷音
Name=Chewing
Icon=fcitx-chewing
Label=酷
LangCode=zh_TW
Addon=chewing
Configurable=True



================================================================================

執行


grep '^Icon=' /usr/share/fcitx5/inputmethod/chewing.conf



顯示


Icon=fcitx-chewing



================================================================================

## hicolor-icon-theme

執行


dpkg-query --control-path hicolor-icon-theme



或是執行


dpkg-query -c hicolor-icon-theme



顯示


/var/lib/dpkg/info/hicolor-icon-theme.postinst
/var/lib/dpkg/info/hicolor-icon-theme.prerm
/var/lib/dpkg/info/hicolor-icon-theme.triggers
/var/lib/dpkg/info/hicolor-icon-theme.md5sums



================================================================================

執行


ls /var/lib/dpkg/info/hicolor-icon-theme.*



顯示


/var/lib/dpkg/info/hicolor-icon-theme.list
/var/lib/dpkg/info/hicolor-icon-theme.md5sums
/var/lib/dpkg/info/hicolor-icon-theme.postinst
/var/lib/dpkg/info/hicolor-icon-theme.prerm
/var/lib/dpkg/info/hicolor-icon-theme.triggers



================================================================================

### hicolor-icon-theme.triggers

執行


cat /var/lib/dpkg/info/hicolor-icon-theme.triggers



顯示


interest-noawait /usr/share/icons/hicolor



================================================================================

### hicolor-icon-theme.postinst

執行


cat /var/lib/dpkg/info/hicolor-icon-theme.postinst



顯示


#! /bin/sh
set -e

UPDATE_CACHE=
if which gtk-update-icon-cache-3.0 >/dev/null 2>&1 ; then
    UPDATE_CACHE=gtk-update-icon-cache-3.0
elif which gtk-update-icon-cache >/dev/null 2>&1 ; then
    UPDATE_CACHE=gtk-update-icon-cache
fi

if [ -n "$UPDATE_CACHE" ]; then
    if ! "$UPDATE_CACHE" --force --quiet /usr/share/icons/hicolor; then
        echo "WARNING: icon cache generation failed"
    fi
fi

if [ "$1" = "triggered" ]; then
    exit 0
fi



================================================================================

### hicolor-icon-theme.prerm

執行


cat /var/lib/dpkg/info/hicolor-icon-theme.prerm



顯示


#! /bin/sh
set -e

if [ "$1" = "remove" ] || [ "$1" = "deconfigure" ] ; then
  rm -f /usr/share/icons/hicolor/icon-theme.cache
fi



================================================================================

## 參考指令

所以從上面的探索,可以歸納出兩個參考指令,如下


sudo gtk-update-icon-cache --force --quiet /usr/share/icons/hicolor




sudo rm -f /usr/share/icons/hicolor/icon-theme.cache



================================================================================

[回到索引]

================================================================================

4/3 8:12:32
應用擴展 工具箱
回覆: Ubuntu與嘸蝦米: 在fcitx下,(boshiamy)嘸蝦米的使用最為順暢、穩定!(新酷音、m17n、倉頡、輕鬆法亦適用)
會員五級
註冊日期:
2012/4/22 10:50
所屬群組:
已註冊使用者
等級: 37
HP : 0 / 901
MP : 671 / 29281
EXP: 6
離線
================================================================================

[回到索引]

================================================================================

# 如何替「fcitx5 input method」加入「icon」

================================================================================

應用「#44」的解析。

接下來回到主題,

在「fcitx5-table-extra / icons」,可以找到不同大小的「icon」,

簡化流程,所以下面範例只安裝「48x48」的「icon」,完整的範例一樣有放在「GitHub」上。

* fcitx5-table-boshiamy
* fcitx5-table-easy-large

================================================================================

## fcitx5-table-boshiamy

* 「#42」 - 如何簡易安裝「fcitx5-table-boshiamy」 (嘸蝦米輸入法)

接著

執行下面指令,下載「org.fcitx.Fcitx5.fcitx-boshiamy.png


wget -c https://raw.githubusercontent.com/fcitx/fcitx5-table-extra/master/icons/48x48/apps/org.fcitx.Fcitx5.fcitx-boshiamy.png



執行下面指令,將「org.fcitx.Fcitx5.fcitx-boshiamy.png」安裝到「/usr/share/icons/hicolor/48x48/apps/org.fcitx.Fcitx5.fcitx-boshiamy.png」這個路徑。


sudo install -Dm644 org.fcitx.Fcitx5.fcitx-boshiamy.png /usr/share/icons/hicolor/48x48/apps/org.fcitx.Fcitx5.fcitx-boshiamy.png



執行下面指令,切換到「/usr/share/icons/hicolor/48x48/apps」這個資料夾。


cd /usr/share/icons/hicolor/48x48/apps



執行下面指令,建立連結


sudo ln -sf org.fcitx.Fcitx5.fcitx-boshiamy.png fcitx-boshiamy.png



執行下面指令,確認


file /usr/share/icons/hicolor/48x48/apps/fcitx-boshiamy.png



顯示


/usr/share/icons/hicolor/48x48/apps/fcitx-boshiamy.png: symbolic link to org.fcitx.Fcitx5.fcitx-boshiamy.png



接著最後重要的一個步驟,執行下面指令


sudo gtk-update-icon-cache --force --quiet /usr/share/icons/hicolor



完整範例:「fcitx5-table-boshiamy

================================================================================

## fcitx5-table-easy-large

* 「#43」 - 如何簡易安裝「fcitx5-table-easy-large」(輕鬆輸入法)

接著

執行下面指令,下載「org.fcitx.Fcitx5.fcitx-easy-large.png


wget -c https://raw.githubusercontent.com/fcitx/fcitx5-table-extra/master/icons/48x48/apps/org.fcitx.Fcitx5.fcitx-easy-large.png



執行下面指令,將「org.fcitx.Fcitx5.fcitx-easy-large.png」安裝到「/usr/share/icons/hicolor/48x48/apps/org.fcitx.Fcitx5.fcitx-easy-large.png」這個路徑。


sudo install -Dm644 org.fcitx.Fcitx5.fcitx-easy-large.png /usr/share/icons/hicolor/48x48/apps/org.fcitx.Fcitx5.fcitx-easy-large.png



執行下面指令,切換到「/usr/share/icons/hicolor/48x48/apps」這個資料夾。


cd /usr/share/icons/hicolor/48x48/apps



執行下面指令,建立連結


sudo ln -sf org.fcitx.Fcitx5.fcitx-easy-large.png fcitx-easy-large.png



執行下面指令,確認


file /usr/share/icons/hicolor/48x48/apps/fcitx-easy-large.png



顯示


/usr/share/icons/hicolor/48x48/apps/fcitx-easy-large.png: symbolic link to org.fcitx.Fcitx5.fcitx-easy-large.png



接著最後重要的一個步驟,執行下面指令


sudo gtk-update-icon-cache --force --quiet /usr/share/icons/hicolor



完整範例:「fcitx5-table-easy-large

================================================================================

[回到索引]

================================================================================

4/3 11:41:30
應用擴展 工具箱
回覆: Ubuntu與嘸蝦米: 在fcitx下,(boshiamy)嘸蝦米的使用最為順暢、穩定!(新酷音、m17n、倉頡、輕鬆法亦適用)
會員一級
註冊日期:
2013/12/5 22:18
所屬群組:
已註冊使用者
等級: 1
HP : 0 / 2
MP : 1 / 75
EXP: 10
離線
感謝您的整理,雖然我已經暫時離開Linux桌面環境,但這些資訊正是我當時苦手的部分。

4/14 9:52:06
應用擴展 工具箱

« 1 2 3 4 (5)

 [無發表權] 請登錄或者註冊


可以查看帖子.
不可發帖.
不可回覆.
不可編輯自己的帖子.
不可刪除自己的帖子.
不可發起投票調查.
不可在投票調查中投票.
不可上傳附件.
不可不經審核直接發帖.