Labels

Friday, March 29, 2013

Install Deepin Music Player on Ubuntu 12.04(2014.03.30 update)

I have only tested the 64 bit version on Ubuntu 12.04.

Download packages

  1. UI library: deepin-ui

    32bit & 64bit:
    http://packages.linuxdeepin.com/deepin/pool/main/d/deepin-ui/deepin-ui_1%2bgit20140325085729~1db408f84b_all.deb
  2. Patched Deepin python-gtk2 to prevent memory leak 

    64bit:
    http://mirrors.ustc.edu.cn/deepin/pool/main/p/pygtk/python-gtk2_2.24.0-3deepin2.1_amd64.deb

    32bit:
    http://mirrors.ustc.edu.cn/deepin/pool/main/p/pygtk/python-gtk2_2.24.0-3deepin2.1_i386.deb
  3. python-deepin-gsettings

    there is a newer version, but don't work with me.

    64bit: 
    http://packages.linuxdeepin.com/deepin/pool/main/d/deepin-gsettings/python-deepin-gsettings_0.1%2bgit20130318115600_amd64.deb

    32bit
    http://packages.linuxdeepin.com/deepin/pool/main/d/deepin-gsettings/python-deepin-gsettings_0.1%2bgit20130318115600_i386.deb
  4. Deep music Player

    32 bit & 64 bit:

    http://packages.linuxdeepin.com/deepin/pool/main/d/deepin-music-player/deepin-music-player_1%2bgit20140226145604~3f30b22573_all.deb
  5. python-deepin-utils 

    64bit:
     http://mirrors.ustc.edu.cn/deepin/pool/main/d/deepin-utils/python-deepin-utils_0.0.1-1%2bgit20131213163147~b0fcaedd21_amd64.deb

    32bit:

     http://mirrors.ustc.edu.cn/deepin/pool/main/d/deepin-utils/python-deepin-utils_0.0.1-1%2bgit20131213163147~b0fcaedd21_i386.deb

    Install Dependencies

    copy and paste this command in terminal window, hit enter and enter account password:
    sudo apt-get install libgio2.0-cil-dev python-keybinder python-cddb python-webob python-pyquery python-numpy python-scipy gettext  python-xlib python-mutagen python-chardet python-pycurl gstreamer0.10-ffmpeg gstreamer0.10-plugins-ugly gstreamer0.10-plugins-good gstreamer0.10-plugins-bad gstreamer0.10-plugins-bad-multiverse python-gst0.10

    Installation

    After downloading previous packages, open a terminal, cd to the directory where these .deb files lies in and fire the command:
    sudo dpkg -i deepin*.deb python-*.deb
    
    if there are any unmet dependencies, try
    sudo apt-get -f install
    

    Warn: don't enable global hot key

    I enabled the global hot keys, and the player don't start the second time I run it. If you have done it, edit the following config file:
    vi ~/.config/deepin-music-player/config
    
    change enable = true to enable = false in the globalkey field. save and exit.

    Global hot key now works.

    Integrate with Unity shortcut list

    make a new text file in ~/.local/share/applications, filename is deepin-music-player.desktop. copy the following code into this file.
    [Desktop Entry]
    Version=1.0
    Name=Deepin Music Player
    Comment=Deepin Music Player
    Terminal=false
    X-MultipleArgs=false
    Type=Application
    Icon=deepin-music-player.png
    StartupNotify=true
    X-Ayatana-Desktop-Shortcuts=Next;Previous;Pause/Play;Fast Forward;Fast Backward;
    Exec=deepin-music-player
    
    [Next Shortcut Group]
    Name=Next
    Exec=deepin-music-player --next
    TargetEnvironment=Unity
    
    [Previous Shortcut Group]
    Name=Previous
    Exec=deepin-music-player --prev
    TargetEnvironment=Unity
    
    [Pause/Play Shortcut Group]
    Name=Pause/Play
    Exec=deepin-music-player --play-pause
    TargetEnvironment=Unity
    
    [Fast Forward Shortcut Group]
    Name=Fast Forward
    Exec=deepin-music-player --forward
    TargetEnvironment=Unity
    
    [Fast Backward Shortcut Group]
    Name=Fast Backward
    Exec=deepin-music-player --rewind
    TargetEnvironment=Unity
    

    The result looks like this:


    but the Quit menu doesn't work.

    more screenshots




    Reference

    LinuxDeepin offical blog tutorial.


    列出存档文件信息的优雅命令

    ls -AFlhR --full-time | cut -f 5- -d " " | sed '/^[0-9 ]/{s/\.[0-9]\{9\}.\{2\}0800//};' > file_list.txt 
    测试文件的内容如下:
    woops@woopsU:~/tmp$ ls -RF
    .:
    font_cn.txt  lyric.lrc  missfont.log  new_dir/
    
    ./new_dir:
    fog.aux  fog.dvi  fog.log  fog.pdf  fog.tex  fog.tex~
    woops@woopsU:~/tmp$ 
    
    我要想得到的最终结果是:
    • 需要出现的文件信息:创建日期、文件大小、文件名。其余信息都是不必要的,有时反而是一种干扰。
    • 递归地列出所有的子目录和子目录中的文件。
    • 把输出结果保存到文本文件。
    下面详细解释每个参数。

    ls -AFlhR --full-time

    使用带l参数的ls -l命令输出长格式,结果如下:
    长格式ls -l 的输出

    仔细观察输出可以发现,输出信息的文件时间没有年份,而且月份不是用数字表示的,这样不利于进一步处理。所以我们选用 --full-time 选项得到完整的日期。
    • -A:不显示.和..这两个文件。
    • -F:为不同类型的文件添加记号(*/=>@|),方便区分目录和普通文件。
    • -l:使用长格式,列出文件的详细信息。
    • -h:使用易读的格式显示文件大小,即智能选用K、M、G等单位显示文件大小。如果要得到精确的文件大小,不要使用这个参数。
    • -R:遍历子目录。列出以指定文件夹(默认为当前目录)为根的目录树上的所有文件和文件夹。
    • --full-time:使用完整的时间格式。
    因为在Linux里单个字符的选项可以写在一起,所以就得到了上面这个命令。现在的输出如下:

    ls -AFlhR --full-time
    上面命令的输出如果以空格为界,可以分为9列。如下图,我们不需要1-4列和第8列,第7列不需要秒以后的时间。

    cut -f 5- -d " "

    要除去前4列的内容,我们使用cut命令。
    • -f 5-:指定要留下来的字段(field),也就是上图中用数字分隔的列。后面可以使用逗号分隔的单个数字,也可以用m-,m-n,-m分别指定m列以后,m到n列,前m列。本例中是第5列及其后面的列。
    • -d " ":我们要明确什么是“一列”,在cut命令中,默认的列分隔符为Tab(在文本编辑器里按键盘上的Tab键产生的不可见字符),而这里我们显然需要空格作为列分隔符(delimiter),使用-d选项指定列分隔符。
    另外,命令中的"|"表示管道(pipeline),管道在Linux操作系统中是一个非常重要的概念。它把管道左边命令产生的输出作为管道右边命令的输入。在这里,ls 产生的输出通过管道送到第一个cut命令中。
    现在命令产生的输出如下: