ubuntu 14.04 添加 CPU 温度 在面板标题栏上
2014-08-08 21:48
375 查看
http://tieba.baidu.com/p/3005287033
http://a-nerd.info/?p=1377
首先当然是用wget下载indicator-sysmonitor,终端执行命令:wget -c https://launchpad.net/indicator-sysmonitor/trunk/4.0/+download/indicator-sysmonitor_0.4.3_all.deb 。
下载好后,先不要急于安装,因为软件有些依赖关系还没解决。终端执行:sudo apt-get install python python-psutil python-appindicator 安装依赖。sudo dpkg -i indicator-sysmonitor_0.4.3_all.deb 安装indicator-sysmonitor 。
这样要安装的都安装好了,但是还需要进行一些配置,才能正常显示。由于软件默认显示图标是 sysmonitor.svg,而在 Ubuntu 14.04 64位系统中没有这个图标,这导致图标显示错误,很不美观。于是要把软件默认使用的图标改成一个存在的图标,当然也可以自己动手***一个图标。但是系统中已经有很多图标了,找个好点的直接用上就行!
系统图标存放在:/usr/share/icons/Humanity/apps/ XX目录下(XX 为:128 16 192 22 24 32 48 64 中任一个,对应同一图标的不同尺寸,同一图标并不是每个尺寸都有)。打开/usr/share/icons/Humanity/apps/32 ,发现application-community.svg 还不错,所以我就用这个图标了!当然用其他的或者自己***也是可以的!
找到喜欢的图标后,记下图标的文件名(不包括后缀),这里是 application-community,下面开始进行替换。终端执行命令:sudo
gedit /usr/bin/indicator-sysmonitor
将 724 行的 sysmonitor 改为刚才记下的 application-community
sudo apt-get install dstat
sudo apt-get install acpi
下载sysmon文件,放入主目录,重命名为.sysmon,在设置界面按下图配置,Customize
output中有{sysmon}就可以
http://a-nerd.info/?p=1377
首先当然是用wget下载indicator-sysmonitor,终端执行命令:wget -c https://launchpad.net/indicator-sysmonitor/trunk/4.0/+download/indicator-sysmonitor_0.4.3_all.deb 。
下载好后,先不要急于安装,因为软件有些依赖关系还没解决。终端执行:sudo apt-get install python python-psutil python-appindicator 安装依赖。sudo dpkg -i indicator-sysmonitor_0.4.3_all.deb 安装indicator-sysmonitor 。
这样要安装的都安装好了,但是还需要进行一些配置,才能正常显示。由于软件默认显示图标是 sysmonitor.svg,而在 Ubuntu 14.04 64位系统中没有这个图标,这导致图标显示错误,很不美观。于是要把软件默认使用的图标改成一个存在的图标,当然也可以自己动手***一个图标。但是系统中已经有很多图标了,找个好点的直接用上就行!
系统图标存放在:/usr/share/icons/Humanity/apps/ XX目录下(XX 为:128 16 192 22 24 32 48 64 中任一个,对应同一图标的不同尺寸,同一图标并不是每个尺寸都有)。打开/usr/share/icons/Humanity/apps/32 ,发现application-community.svg 还不错,所以我就用这个图标了!当然用其他的或者自己***也是可以的!
找到喜欢的图标后,记下图标的文件名(不包括后缀),这里是 application-community,下面开始进行替换。终端执行命令:sudo
gedit /usr/bin/indicator-sysmonitor
将 724 行的 sysmonitor 改为刚才记下的 application-community
#!/bin/bash #settings: netspeed=true ram=true cpu=true temp=true #------------------------------------------------------- #---------------- initialize --------------------------- rm /tmp/.sysmon > /dev/null 2>&1 dstat --net --mem --cpu --output=/tmp/.sysmon 1 1 > /dev/null 2>&1 #----------- up/down speed ----------------------------- if [ $netspeed = true ]; then upspeed=$(echo $(cat /tmp/.sysmon | tail -1 | cut -d ',' -f2)/1024 | bc) upkbmb=$(if [ $upspeed -gt 1024 ]; then up1=$(echo $(cat /tmp/.sysmon | tail -1 | cut -d ',' -f2)/1024/1024 | bc -l) echo $up1 | head -c 4 else echo $upspeed | head -c 3 fi) downspeed=$(echo $(cat /tmp/.sysmon | tail -1 | cut -d ',' -f1)/1024 | bc) downkbmb=$(if [ $downspeed -gt 1024 ]; then down1=$(echo $(cat /tmp/.sysmon | tail -1 | cut -d ',' -f1)/1024/1024 | bc -l) echo $down1 | head -c 4 else echo $downspeed | head -c 3 fi) #---------------- up/down speed unit -------------------- upunit=$(if [ $upspeed -gt 1024 ]; then echo "MiB/s"; else echo "KiB/s"; fi) downunit=$(if [ $downspeed -gt 1024 ]; then echo "MiB/s"; else echo "KiB/s"; fi) fi #------------------- CPU % used ------------------------- if [ $cpu = true ]; then cpufree=$(cat /tmp/.sysmon | tail -1 | cut -d ',' -f9) cpuused=$(echo 100-$cpufree | bc | sed -e 's/\..*//') fi #------------------- RAM % used -------------------------- if [ $ram = true ]; then memused=$(free -m | grep buffers/cache | tr -s ' ' | cut -d' ' -f 3) memfree=$(free -m | grep buffers/cache | tr -s ' ' | cut -d' ' -f 4) memtotal=$(echo $memused+$memfree | bc -l) memusedpercent=$(echo 100-100*$memfree/$memtotal | bc) fi #------------------- acpitemp -------------------------- if [ $temp = true ]; then #将acpi -t这个命令显示出第16-20个字符赋给acpitemp acpitemp=$(acpi -t| cut -c 16-20)°C fi #------------------ The Indicator Sysmonitor actual output - echo $(if [ $ram = true ]; then echo M:$memusedpercent% ; fi) $(if [ $cpu = true ]; then echo C: $cpuused% ; fi) $(if [ $netspeed = true ]; then echo ↑$upkbmb $upunit ↓$downkbmb $downunit; fi)$(if [ $temp = true ]; then echo T:$acpitemp; fi) #当temp为True时显示CPU温度
sudo apt-get install dstat
sudo apt-get install acpi
下载sysmon文件,放入主目录,重命名为.sysmon,在设置界面按下图配置,Customize
output中有{sysmon}就可以
相关文章推荐
- Ubuntu 14.04 标题栏实时显示上下行网速、CPU及内存
- Ubuntu 14.04 标题栏实时显示上下行网速、CPU及内存使用情况
- Ubuntu在标题栏显示CPU、内存、网速和温度
- Ubuntu 14.04 标题栏实时显示上下行网速、CPU及内存状态
- 为ubuntu添加CPU和硬盘温度监控
- Ubuntu 14.04 下读取CPU温度
- 在Ubuntu面板上添加CPU使用率及温度显示指示器
- 在Ubuntu面板上添加CPU使用率及温度显示指示器
- ubuntu14.04添加桌面快捷方式
- linux学习:解决Ubuntu运行时CPU温度过高导致自动关机保护
- Ubuntu下查看CPU温度风扇转速和硬盘温度
- Ubuntu 14.04为浏览器添加Flash插件
- 近期ubuntu 14.04 cpu占用高排障
- Ubuntu 14.04安装Chromium浏览器并添加Flash插件Pepper Flash Pl
- Ubuntu下经典JAVA开发环境搭建 以及 Ubuntu中如何在桌面、启动面板以及应用程序菜单上添加图标
- 关于为ubuntu14.04服务器版添加xfce桌面(作为备忘)
- Ubuntu 14.04安装Chromium浏览器并添加Flash插件Pepper Flas
- [小白技巧]如何在Ubuntu 14.04中添加多个时区时间
- Ubuntu12.04面板上添加温度指示器
- ubuntu14.04添加navicat快捷方式