更新软件包
1 2 |
$ sudo apt-get update $ sudo apt-get upgrade |
安装依赖项
1 |
$ sudo apt-get install libqtcore4 libqtwebkit4 libqt4-sql libqt4-sql-sqlite libssl-dev libqtscript4-core libpcap0.8 |
下载 & 解压
这里的下载链接为 Ubuntu x64 版本,如果系统版本不同就更换第三行的下载链接,见 Downloads | WhatPulse。注意:由于版本更新,第四行的文件名请根据实际情况修改。
1 2 3 4 |
$ sudo mkdir /usr/local/src/whatpulse $ cd /usr/local/src/whatpulse $ sudo wget http://whatpulse.org/downloads/167/64bit/ $ sudo tar -xvzf whatpulse-linux-64bit-2.5.tar.gz |
安装 & 设置权限
1 2 |
$ sudo ln -s /usr/local/src/whatpulse/whatpulse /usr/local/bin/ $ sudo ./setup-input-permissions.sh |
接下来你会看到
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 |
This script sets up read permissions for the kernel's event devices in order for your user to be able to run WhatPulse. It will create a new group called 'input', add your username to that group, and make the event devices readable for the group. Press Ctrl+C now if you don't want this, or press Return to continue. # 此处回车 UDEV rules file has been set up. Created group 'input'. Please enter the username that should get added to the group: # 此处输入你的用户名,回车 Added user '%username%' to group 'input'. Setup of persistent permission settings complete. Since the UDEV rules will only be applied when you restart your computer, this script will now apply temporary read permissions for all users to the device files to let you use WhatPulse immediately. You have the chance to cancel this by pressing Ctrl+C now (which you should do if you fear that other users on your computer might log your keyboard events!). Otherwise press Return to continue. # 此处回车 Adding user %username% to group input All done, have fun using WhatPulse! |
然后
1 |
$ sudo setcap cap_net_raw,cap_net_admin=eip ./whatpulse |
最后运行一下 whatpulse & ,各统计功能应当正常工作。
[可选]添加 Dashboard 图标
下载图标
1 2 |
$ cd /usr/local/src/whatpulse $ sudo wget https://dkqnkzjkqr9h2.cloudfront.net/images/whatpulse-w.png |
建立 Desktop Entry
1 |
$ sudo nano /usr/share/applications/whatpulse.desktop |
输入以下内容:
1 2 3 4 5 6 7 8 9 10 |
[Desktop Entry] Name=WhatPulse GenericName=Statistics collector Comment=All you need to know everything about your computing habits Exec=/usr/local/bin/whatpulse Terminal=false Type=Application Icon=/usr/local/src/whatpulse/whatpulse-w.png Categories=Network;Statistics; StartupNotify=false |
按 Ctrl+X,y,回车保存。稍等,应该就能看到 Dashboard 中的 WhatPulse 应用程序。(暂时不能看到的话,重启以后也会正常显示。)
[可选]设置开机启动(只对当前用户有效)
1 |
$ sudo nano ~/.config/autostart/whatpulse.desktop |
输入以下内容:
1 2 3 4 5 6 7 8 9 10 |
[Desktop Entry] Name=WhatPulse GenericName=Statistics collector Comment=All you need to know everything about your computing habits Exec=/usr/local/bin/whatpulse -delaystartup -closedwindow Terminal=false Type=Application Icon=/usr/local/src/whatpulse/whatpulse-w.png Categories=Network;Statistics; StartupNotify=false |
按 Ctrl+X,y,回车保存。
收尾工作
所有工作完成后请重启一下,确认重启以后 WhatPulse 各项功能正常工作。
Enjoy it!