Chinaunix首页 | 论坛 | 博客
  • 博客访问: 1717952
  • 博文数量: 410
  • 博客积分: 9563
  • 博客等级: 中将
  • 技术积分: 4517
  • 用 户 组: 普通用户
  • 注册时间: 2010-07-03 19:59
个人简介

文章分类

全部博文(410)

文章存档

2017年(6)

2016年(1)

2015年(3)

2014年(4)

2013年(32)

2012年(45)

2011年(179)

2010年(140)

分类: LINUX

2014-02-13 22:32:44

    女儿写作业使用番茄钟控制时间,唯一的要求是番茄中的音乐不要那么吓人,选来选去,发现ubuntu下面 pomodairo可以方便地替换MP3提醒音乐。唯一的问题是我们需要经常调整番茄中的时间,比如英文15分钟,阅读25分钟等等,每次调整都很不方便。于是hacker。

一、做一个shell脚本负责更改sqlite3数据库中的番茄时间项


点击(此处)折叠或打开

  1. #!/bin/bash -
  2. #===============================================================================
  3. #
  4. # FILE: changpomo.sh
  5. #
  6. # USAGE: ./changpomo.sh
  7. # 可选参数: 时间长度
  8. #
  9. # DESCRIPTION: 为解决pomodairo调整时间不方便,所以制作了一个脚本外壳
  10. #
  11. # CREATED: 2013年11月06日 21时23分28秒 CST
  12. #===============================================================================

  13. set -o nounset # Treat unset variables as an error
  14. if [ $# -gt 0 ]; then
  15.     echo $1
  16.     sqlite3 /home/bl/pomodairo-1.1.db <<EOS
  17.     update config set value=$1 where name="pomodoroLength";

  18. EOS
  19. else
  20.     value=`zenity --list \
  21.       --title="选择番茄时间长度" \
  22.       --column="时长--分钟" 5 10 15 20 25 30 35 40`
  23.     case $value in
  24.         5 | 10 | 15 | 20 | 25 | 30 | 35 | 40 )
  25.             sqlite3 /home/bl/pomodairo-1.1.db <<EOS
  26.             update config set value=$value where name="pomodoroLength";

  27. EOS
  28.             ;;
  29.         *)
  30.             sqlite3 /home/bl/pomodairo-1.1.db 'update config set value=25 where name="pomodoroLength";'
  31.     esac
  32. fi
  33.     pkill pomodairo
  34.     /opt/pomodairo/bin/pomodairo &
二、制作启动unity

在~/.local/share/applications/目录中建立一个tomoto.desktop文件,内容如下:


点击(此处)折叠或打开

  1. [Desktop Entry]
  2. Type=Application
  3. Exec=/opt/pomodairo/bin/pomodairo
  4. Name=番茄
  5. X-Ayatana-Desktop-Shortcuts=Server1;Server2;Server3;Server4;Server5;Server6;
  6. Icon=/opt/pomodairo/share/assets/appicons/tomato.png
  7. Name[zh_CN]=番茄钟

  8. [Server1 Shortcut Group]
  9. Name=自定义番茄时间
  10. Exec=/home/bl/bin/changpomo.sh
  11. TargetEnvironment=Unity

  12. [Server2 Shortcut Group]
  13. Name=10番茄时间
  14. Exec=/home/bl/bin/changpomo.sh 10
  15. TargetEnvironment=Unity

  16. [Server3 Shortcut Group]
  17. Name=15番茄时间
  18. Exec=/home/bl/bin/changpomo.sh 15
  19. TargetEnvironment=Unity

  20. [Server4 Shortcut Group]
  21. Name=20番茄时间
  22. Exec=/home/bl/bin/changpomo.sh 20
  23. TargetEnvironment=Unity

  24. [Server5 Shortcut Group]
  25. Name=25番茄时间
  26. Exec=/home/bl/bin/changpomo.sh 25
  27. TargetEnvironment=Unity

  28. [Server6 Shortcut Group]
  29. Name=30番茄时间
  30. Exec=/home/bl/bin/changpomo.sh 30
  31. TargetEnvironment=Unity




其他问题:

一、安装air

LD_LIBRARY_PATH=/usr/lib/x86_64-linux-gnu ./AdobeAIRInstaller.bin


二、pomodairo

数据库  sqlite

~/pomodairo-1.1.db

更换声音

在安装目录 /opt/pomodairo/share 内添加声音文件,貌似不支持路径


shell修改计时

sqlite3 pomodairo-1.1.db 'update config set  value = 15 where name="pomodoroLength"'

删除进程


pkill pomodairo


解决终端启动超慢的问题

UBUNTU_MENUPROXY=changpomo.sh




阅读(2988) | 评论(0) | 转发(0) |
0

上一篇:使用vim来编写VBA

下一篇:2003 vba 备忘

给主人留下些什么吧!~~