Tickeys鍵盤音效軟件
Tickeys Linux 版。Tickeys 是一款很強(qiáng)大的鍵盤音效軟件。Tickeys 自帶了多種聲音效果方案,有打字機(jī)、冒泡、機(jī)械鍵盤、劍氣等。每天都聽著鍵盤聲音是不是很煩悶,現(xiàn)在有了這款神器你就可以瞬間幫助自己的鍵盤加上逼格特效。
這個(gè)軟件之前發(fā)布了 Windows 和 Mac 版,Tickeys 是由 Nozama 所做的一個(gè) Mac 平臺(tái)的開源小項(xiàng)目 (GitHub),Windows 版由黃飛實(shí)現(xiàn)。
項(xiàng)目網(wǎng)站
http://www.yingdev.com/projects/tickeys
PyPI: https://pypi.python.org/pypi/tickeys
Tickeys的Mac版本
https://github.com/yingDev/Tickeys
安裝說(shuō)明
在不同發(fā)行版上可能會(huì)有因?yàn)槲募娜笔Щ蛘攮h(huán)境不同導(dǎo)致無(wú)法使用,需要安裝相關(guān)依賴。
下載打包好的安裝包安裝(建議)
- 下載deb安裝包:
下載32位tickeys_0.2.4_i386.deb:http://pan.baidu.com/s/1sk3NND7
下載64位tickeys_0.2.4_amd64.deb:http://pan.baidu.com/s/1kUanMN9
- 安裝后,在啟動(dòng)器中找到Tickeys打開。
編譯安裝(需要安裝依賴):
- 以下方法需要先執(zhí)行sudo apt-get install python-dev python-pip python-kivy xdotool gksu來(lái)安裝依賴,一般這樣就可以滿足運(yùn)行條件了。
- 安裝庫(kù)(注意版本): sudo pip install cython==0.20.2 notify2 pyinstaller==3.0 kivy==1.9.0 evdev
快速編譯安裝:執(zhí)行sudo apt-get install python-dev python-pip python-kivy xdotool && sudo easy_install tickeys。
方法1.自動(dòng)安裝
- 執(zhí)行sudo easy_install tickeysorsudo pip install tickeys安裝
- 然后通過(guò)sudo tickeys來(lái)打開 (sudo tickeys -c 打開CLI版本)
方法2.半自動(dòng)安裝
- 下載 https://github.com/BillBillBillBill/Tickeys-linux/archive/master.zip ,解壓后運(yùn)行sudo python setup.py install
- 然后通過(guò)sudo tickeys來(lái)打開 (sudo tickeys -c 打開CLI版本)
錯(cuò)誤解決方案:
- 無(wú)法隱藏窗口:
解決方法:使用sudo apt-get install xdotool安裝xdotool
- 若沒(méi)有setuptools or pip
解決方法:使用sudo apt-get install python-pip安裝
- Python.h:沒(méi)有那個(gè)文件或目錄
解決方法:使用sudo apt-get install python-dev安裝
- ImportError: No module named Cython.Distutils
解決方法:使用sudo easy_install cython安裝
-
ImportError: libSDL-1.2.so.0: cannot open shared object file: No such file or directory
解決方法:使用yum install libSDL-1.2.so.0安裝依賴
-
NotImplementedError: mixer module not available
解決方法:同上
Debian and Ubuntu 用戶則可以嘗試安裝:
* sudo apt-get install xdotool * sudo apt-get install libsdl1.2-dev * sudo apt-get install libsdl-mixer1.2 * sudo apt-get install libsdl-ttf2.0
使用說(shuō)明
需要以root權(quán)限才能啟動(dòng),實(shí)現(xiàn)了CLI版本和GUI版本,默認(rèn)啟動(dòng)GUI版本,GUI版本啟動(dòng)后會(huì)自動(dòng)隱藏,按QAZ123喚出窗口。
調(diào)整參數(shù)后會(huì)自動(dòng)保存,下次開啟會(huì)使用該設(shè)置。
Open at startup是開啟開機(jī)自啟動(dòng)功能選項(xiàng),開關(guān)置為ON開啟功能,開關(guān)置為OFF關(guān)閉功能。
TODO
1.打開程序后出現(xiàn)氣泡提醒(已實(shí)現(xiàn)) 2.使GUI真正后臺(tái)化(已實(shí)現(xiàn)) 3.按最小化按鈕或退出按鈕隱藏GUI 4.程序運(yùn)行情況輸出到log文件中,以便調(diào)試(已實(shí)現(xiàn))
依賴安裝:
pip install -r requirements.txt
使用cx_freeze進(jìn)行打包:
命令:sudo python bulid.py bulid
使用pyinstaller打包 命令:pyinstaller build.spec
播放音樂(lè)通過(guò)pygame的mixer實(shí)現(xiàn)。
鍵盤事件的獲取通過(guò)evdev實(shí)現(xiàn)。
窗口的控制使用工具xdotool來(lái)實(shí)現(xiàn)。(另一方法是使用wmctrl來(lái)控制窗口)
xdotool的使用:
-
獲取窗口ID: WID=xdotool search "Tickeys" | head -1
-
激活窗口: xdotool windowactivate --sync $WID xdotool windowmap --sync $WID && xdotool windowactivate --sync $WID
-
隱藏窗口實(shí)現(xiàn): xdotool getactivewindow windowunmap ~~xdotool getactivewindow windowminimize~~ 或 ~~xdotool getactivewindow windowmove 999 0~~
項(xiàng)目結(jié)構(gòu)
Tickeys-linux
├── AUTHOURS ├── build.sh ├── build.spec pyinstaller打包用 ├── Changelog 版本變動(dòng)說(shuō)明 ├── deb.sh ├── dist │ ├── make_deb.sh 打包成deb包的腳本 ├── lib 運(yùn)行所用的一些庫(kù) ├── LICENSE ├── MANIFEST.in ├── README.md ├── screenshot Tickeys截圖文件 ├── setup.py 分發(fā)用 ├── tickeys │ ├── build.py cx_freeze打包,已不用 │ ├── CLI.py 啟動(dòng)CLI的模塊 │ ├── config.py 處理配置保存和讀取的模塊 │ ├── GUI.py 啟動(dòng)GUI的模塊 │ ├── __init__.py │ ├── keyboardHandler.py 處理鍵盤輸入的函數(shù) │ ├── logger.py 日志記錄函數(shù),調(diào)試時(shí)使用 │ ├── requirements.txt 開發(fā)模塊依賴包 │ ├── Resources 程序資源,包括音效,字體等 │ │ ├── data │ │ │ ├── bubble │ │ │ ├── Cherry_G80_3000 │ │ │ ├── Cherry_G80_3494 │ │ │ ├── drum │ │ │ ├── mechanical │ │ │ ├── sword │ │ │ └── typewriter │ │ │ ├── schemes.json │ │ └── fonts │ │ └── DroidSansFallbackFull.ttf │ ├── run.py 程序入口 │ ├── run_with_CLI.py 程序入口,帶CLI版(失敗時(shí)運(yùn)行CLI) │ ├── soundPlayer.py 播放聲效的模塊 │ ├── startupHandler.py 控制開機(jī)自啟動(dòng)的模塊 │ ├── tickeys 啟動(dòng)tickeys的腳本,打包時(shí)放進(jìn)打包后的文件夾使用 │ ├── tickeys.png │ ├── tickeys_tray.py 托盤,由于打包大小問(wèn)題尚未放入 │ ├── tickeysui.kv kv的ui文件,現(xiàn)在已直接寫入GUI.py中 │ └── windowManager.py 提供窗口控制的方法 ├── tickeys_0.2.3.deb └── tickeys.egg-info
文件說(shuō)明
-
build.py cx_freeze打包函數(shù)
-
run.py 存放入口函數(shù)
-
readme.txt 放進(jìn)打包后程序文件夾的readme
-
requirements.txt
-
tickeys
-
CLI.py
-
GUI.py
-
config.py
-
tickeysui.kv
-
KeyboardHandler.py
-
logger.py
-
SoundPlayer.py
-
StartupHandler.py
作者
Huang Xiongbiao
