个人工具

UbuntuHelp:CairoDock

来自Ubuntu中文

Wikibot讨论 | 贡献2007年11月22日 (四) 12:11的版本 (新页面: {{From|https://help.ubuntu.com/community/CairoDock}} {{Languages|UbuntuHelp:CairoDock}} #title Cairo-Dock [http://help.ubuntu.com/community/CairoDock?action=AttachFile&do=get&target=Cairo...)

(差异) ←上一版本 | 最后版本 (差异) | 下一版本→ (差异)
跳转至: 导航, 搜索


  1. title Cairo-Dock

[1]


Introduction

Gnome-dock (initially written by a certain MacSlow but since abandoned) is an animated application launch bar displayed on the Desktop.

Gnome-Dock was originally designed as a concept to test libcairo (a vectorial library).

This is the link to the Gnome Dock project

The idea was great but rather limited and a new developer (Fabounet) took it over to make a real and usable dock out of it.

This new version is called Cairo-Dock. It is compatible with Beryl, Compiz, Metacity+xcompmgr and probably KDE since Kwin now manage composite display.

There is a thread on the French Ubuntu forum that is quite active

There is also a project account on BerliOS where you can(no, should!) submit your bug and feature request. This is also the official place to get the latest package.


Installation and Initial Launch

Sources and deb files can be found here. The Project is split in 2 parts: the dock itself and the plug-ins (which provides mainly the applets). The installation for both is the same, so only the installation of the dock is explained. You just have
to make sure you install the plug-ins after the dock. ight Once installed the dock can be updated by using an option in the dock whic
*h will execute a script (written by Sombrero) that download and install the package when there is a new version.

The config file will not be overwritten during updates as Cairo-Dock is capable of inserting the missing fields if any.

From the deb package

Install first the package libcairo2 and librsvg2-2. As libcairo also needs libglitz1 (even though it is not used), you have to install it as well.

Then download the deb packages and install them with gdebi Note : the packages is compiled with glitz (for hardware acceleration), but not the libcairo (at least until Feisty), so if you want to use it, you have to compil your libcairo with the --enable-glitz option first.

By compiling it

You will need the packages build-essential, libcairo2-dev, libgtk2.0-dev and librsvg2-dev.

As a side note, if you have an AMD64 and you probably also have to install libglitz1-dev. This command should normally be enough :

sudo apt-get install build-essential libcairo2-dev libgtk2.0-dev librsvg2-dev libglitz1-dev libcairo2 librsvg2-2 libglitz1


For infor I have the packets autoconf, m4, autotools-dev, pkg-config, et automake1.9 installed because with automake 1.10 it doesn't work...

Download and decompress the source .tar.bz2, move to the newly created directory and type :

autoreconf -isvf && ./configure --prefix=/usr && make

sudo make install 

The program will be installed in /usr/bin.

What is installed ?

This is a question that everyone should ask when installing a program. Cairo-Dock stores your launchers and your parameters in a hidden directory .cairo-dock in your own user directory.

 ~/.cairo-dock  --> current_theme --> cairo-dock.conf+decorations+readme
|                 +--> launchers --> .desktop+icônes
+--> themes --> theme1 --> cairo-dock.conf+decorations+readme
|          +--> launchers --> desktop+icônes
+--> theme2 --> cairo-dock.conf+decorations+readme
|           +--> launchers --> desktop+icônes
+--> .... 

The package also installs ready made themes in /usr/share/cairo-dock/themes. YOu can't modify them and they will be updated along with the dock.

It is planned to add the dock in the Application menu (it already have an icon thanks to Necropotame) but I haven't yet found the way to add that in the deb file. If anyone feels like it..go ahead!

First Launch

On first launch, cairo-dock will configure itself and will propose a list of themes if it didn't detect the directory ~/.cairo-dock (this allow you to have an instant fully fonctionnal dock and an overview of the different functionalities and options). If it is your first install make sure you don't have a .~/cairo-dock.

After that if you want to test another theme just right click on the Dock and select "Manage themes". Some options are available, try cairo-dock --help to list them.

De-installation

If you installed by compiling the source, go to the source directory and type:

 sudo make uninstall

This won't delete the directory ~/.cairo-dock nor its content (the launchers and the config file).

If you install from the packages, deinstall it with your package manager or apt-get. The directory .cairo-dock and its content will not be delete, unless you selected a complete removal (purge).

Configuration

Configuration of the dock is very easy. You have a list of theme to choose from at the 1st start. This allow you to start easily and you can then modify the config to build your own theme and save for later use.
If you decide to try another theme just right click on the dock and select "Choose a theme". You will be able to select a new theme from the list.

To configure the dock, right click on it and select "Cairo-Dock" and "Configure". YOu can then choose which part of the dock you want to configure (All of it, only items related to the Appearance). A window will appear organized in tabs. Each one represent a group of common properties.

Each tab contains parameters. After Validating or Applying the changes the dock will reload automatically with its new config

Group POSITION

This tab will allow you to select the position of the dock on the Desktop .

<:> CairoDock?action=AttachFile&do=get&target=Cairo-Dock_PositionGroup.small.png
~-Click image for larger view-~

* You can choose on which edge of the screen the dock should be . The animation of the icons and the dock will adjust based on the position and the relative alignment * The 2 offsets are respectively for positioning the dock compare to the selected edge (useful for example to position the dock just above the Gnome Task bar) and the position compare to the middle of that edge. * You can also specify if the recall area picture should be reversed when the dock is at the top (so if you have some text in the picture untick it or if your recall areas is an arrow for example then tick it)

Group AUTO-HIDE

This tab allow you to control the Automatic hiding or not of the dock. The dock is replaced by a recall area when it is hidden. Just hover the mouse over the area and the dock will reappear.

<:> CairoDock?action=AttachFile&do=get&target=Cairo-Dock_AutoHideGroup.small.png
~-Click image for larger view-~

* The box to tick will decide if the dock should hide automatically or not and be replaced by the Recall Area. Ticked it will auto-hide. Untick it will always be visible. * Width/Height : The dimension in pixels of the recall area (default 200x20). * Name of the file to use for the recall area. This can be an absolute path , or a picture located in the directory ~/.cairo-dock/current_theme. You can also empty that field. The result will be an empty recall area (but definitely present). * The transparency of the recall area picture can be specified. Set it to 0 and the image will be completely transparent (invisible). Set it to 1 and it will be opaque. Default is 0.5 * Tick this box if you positioned the dock at the top and you want the recall area to be reversed

Group CAIRO DOCK

This tab control the visual effect of the dock.

<:> CairoDock?action=AttachFile&do=get&target=Cairo-Dock_CairoDockGroup.small.png
~-Click image for larger view-~
<align="left"> * Language of the configuration panel. Need to press OK to validate.

* Reorder the different section of the dock. Click the item to reorder and then use UP or DOWN button

* Maximum size for the dock. This will have a resulting effect that possibly not all icons on the dock will be visible at the same time but you will be able to make them turn around (like a carousel) with the mouse wheel.

* Force or not a carousel view (icon appearing in a 3D loop)

* Specify the amount of icon scrolling in pixels (0 means 1 icons at a time)

* Specify if the icon will come back to their original position when leaving the dock and if so at which speed they will do it

* Maximal amplitude of the wave (the maximal zoom factor applied to the icons is 1+A, where A is the amplitude

* Width of the wave. Outside that zone the the wave is flat

* Set the value of the radius of the corners of the dock in pixels (0 will give square corners), the width of the external line in pixels (the icons will never overflow the line whatever its width) and the colour of the line

* Select if the corner of the edge side of the dock should be rounded or not.

* Set the width of the line that links all icons together and its colour of the line

* Finally in this section you can tweaks the movement characteristics of the icons. It allows you to control the speed of the zooming and the up and down movement for the icons. It is Hard to explain so just try different values the value and see!

Group LABELS

This tab controls how the labels aboce the icons will be displayed.

<:> CairoDock?action=AttachFile&do=get&target=Cairo-Dock_LabelsGroup.small.png
~-Click image for larger view-~

* Select how the labels will be rendered (font sized, font. thickness of font, italic or not) * Will the labels will be printed only for the current icons or all of them. * This box define how much you will show the labels of the surrounding icons. Only active if you untick the "Show current label only"

Group BACKGROUND

This tab control the dock background design

<:> CairoDock?action=AttachFile&do=get&target=Cairo-Dock_BackgroundGroup.small.png
~-Click image for larger view-~

* Select the speed factor of the background movement relative to the mouse movement ( set to 1 to follow the mouse, set 2 to go half the speed) * Decide if the background should follow the direction of the cursor or not (tick if yes) * A Background image can be inserted by selecting a pictures. You can also set the transparency of the picture. You can tick if you want the picture to repeat as a motif rather than stretching * if no picture is selected, then the gradient parameters are used Specify the gradient colours (select the same colour for both to obtain a plain background). Set the angle of the gradient (0 degree will give an horizontal gradient from left to right, 90 degree will give a vertical gradient from top to bottom and -90 to reverse it) This gradient can be repeated several time to obtains stripes (if you specify a number of stripe bigger than 0). In that case you can also set the relative width of the stripes

As the number of stripes increase so does the density and the stripes get closer.The width is a percentage of a motif size. A motif contains N stripes so the width can be inferior or equal to 1/N . See Tips and Tricks for more.

For the 3 next tabs (Launchers, Application, Applet) the section Generic is the same so I will only explains once for the Launchers

Group LAUNCHERS

<:> CairoDock?action=AttachFile&do=get&target=Cairo-Dock_LaunchersGroup.small.png
~-Click image for larger view-~

* Set the minimum and maximum size of the icons. It is useful if all your icons don't have the same size and are either too big or too small. Set to 0 if you don't want force a specific size * Animation that will happen when you click an icon  : bounce, rotate, blink , random (any of the animations at random!) * Specify how many times the animation will occur (0 turns off the function :( ) * Enter the name of a specific theme here to use the set of icon form that theme. * Create a list of directories where the dock will go and search for the icons of the dock's Launchers. You can specify several and the dock will search the icons in the order specified until it finds one (but ~/.cairo-dock/current_theme/ has priority). By default the directories are the one where Ubuntu stores its icons. See Tips and Tricks for more details especially if you have some icons themes installed

Group APPLICATIONS

This tabs controls the Tasks Bar of Cairo-Dock.

<:> CairoDock?action=AttachFile&do=get&target=Cairo-Dock_AppicationsGroup.small.png
~-Click image for larger view-~

* Tick to display a Task bar with classical function like "Show", "Minimise" or "Maximise". You can also reorder the icons to your liking. Right click on each icon to see it *Tick to only display one icon for applications which have the same PID. * As some applications can have a lengthy name you can select the maximum number of characters to display in the label of each application. If it is longer the name will be truncated with "..." at the end

Group APPLETS

<:> CairoDock?action=AttachFile&do=get&target=Cairo-Dock_AppletsGroup.small.png
~-Click image for larger view-~

a list of all the installed applets is automatically loaded at the first launch.You can select to activate or deactivate them by ticking or unticking the box next to each of them. You can specify the order they will appear in the dock (Use the UP or DOWN arrow)

You can also remove an applet by directly right clicking on it and selecting "Remove this applet". The configuration of each applet is done by again right clicking it and selecting "configure this module". Each applet is different and will be based on what it is supposed to do. In general you will be able to select at least its icon. The horloge add also a section to generate alarms

Group SEPARATORS

This tabs control the separators that automatically place themselves between each different types of icons (launchers, task bar, applets). They have no other purpose.

<:> CairoDock?action=AttachFile&do=get&target=Cairo-Dock_SeparatorsGroup.small.png
~-Click image for larger view-~

* You can either specify your own separator by choosing a file or leave it empty if you don't want a separator.

Managing Launchers

Adding new Launchers

You have 3 ways to do it :

1/ Add an existing .desktop file (pre made launcher from Gnome) : Right click on the Launcher section of the dock and choose "Add a Launcher" A file browser will open that will initially point to /usr/share/app-install. In the subdirectory desktop are all the .desktop for the application installed by Ubuntu. You can choose several of them in this directory (CTRL+click to select several). Next Valid and Cairo-Dock will import and load them all in one go automatically. You can of course go to another directory if you have desktop file somewhere else on you disk. 2/ Start from Scratch : Right click on the Launcher section of the dock and choose "Add a Launcher" The same browser will open. This time select New. That window will close and another one will open. It contains a little form to fill in the details of your launcher (See Modify a Launcher for more detail). After validating the new launcher is created and loaded by Cairo-Dock!

3/ Use Drag-and-Drop : From the Gnome Application menu (or Nautilus or anything else) drag an application and drop it where you wish on the dock. A launcher will be automatically added by Cairo-Dock.


Removing a Launcher

Click on an icon and select the "Remove this Launcher" and select Yes in the confirmation window. That's it you have disintegrate your Launcher

Note: If the Launcher was a container and contained another dock with icon in it then these icons will either be destroyed or distributed in the main dock depending on what you answered in the confirmation window.

Modify a Launcher

Click on an icon and select the "Modify this Launcher". A new window will open containing all the fields from that launcher. Here is the list of the useful one  :

<:> CairoDock?action=AttachFile&do=get&target=Cairo-Dock_ModifyLauncher.small.png
~-Click image for larger view-~

* Its name : This is the labels that will appear above the icon. This field can exist in several languages, but Cairo-Dock will present the one that is according to your local setting. * The command to be executed when the icon is clicked. * The name of the picture to be used for the icon. See below to find out how Cairo-Dock finds the icons for an application * Its order : A number to allow the classification of the applications. A launcher with a higher number than another one will be located after that one. * The name of its container : This is the name of the container where the icon will be loaded. The default one is "_MainDock_". * A box to tick specifies if that icon should be a container or just be a simple launcher. if it is to be a Container then the field containing the command to execute is not used. (see Add containers in "Tips and Tricks" section)

Move an icon inside the dock

The easiest way is to just drag (with the mouse) the icon to another place in the dock. Another way s to right click the dock and choosing "Move this icon" , which contains a sub menu. You can then choose to move the icons one step to the left or the right. You can also set it to the first or last position in the dock. You can move launchers as well as the applications in the task bar or applets, and they will not mix with each others.

Note regarding the name of an image

You can either:

specify an absolute path (/path/to/picture, or ~/path/to/picture).

Specify only the name of the image. This is the case for the launcher already present in the system (in fact you don't have to specify the extension of the image either) For that purpose Cairo-Dock already know of some default image directory. They are mentioned in the config file and you can add as many as you want. The dock will look for image in the order they are listed. This is useful when you have installed themes which contains icons. You can change your theme in 2 seconds without having to change all your launchers! (NB : the directory ~/.cairo-dock/current_theme will have priority on the others so you can put your icons in it but you don't have to). If the image name doesn't have an extension Cairo-Dock will first search for SVG (vectorial picture which gives the best rendering), then PNG and finally XPM. The other format are not search as they don't support transparency which would not be as nice for an icon ;) If Cairo-dock can't find an icon there will just be an empty space instead but the launcher will definitely be present

Tips and Tricks

Move the dock

either :

- After making the dock active (click on it for example) use the arrows to move the dock. The movement will accelerate if you keep pressing for ease of use

- Press ALT then click on the dock then drag it where you want. With Beryl you can activate sticky edges which allows an better positioning. Release the mouse button and then release the ALT key.

Get icons themes easily swappable for the dock

If you either downloaded a icon theme or collect some icons in a directory : Right click on the dock then choose Configure and select the Launcher tab. Add in the directory list the directory where your icons are. Add as many as you want like that . Now to go from one theme to another easily just put the correct directory at the top of the list (use up and down arrow). Cairo-Dock will automatically load the new icons when you close the configuration panel.

Note : when an icon doesn't have an extension Cairo-Dock will first look for an .SVG in all the directory. So if you have matching .PNG in the top directory and another matching .SVG in the next directory then this one will be loaded. Keep this in mind when you build your theme and try to keep them homogeneous.

Change the style of the stripes

Here are a few concrete example:

- If I want thin and well spaced stripe: put their number to 8 (8 stripes per motif) and their width to 0.02 (2% of the width of a motif).

- If now I want thicker stripes: increase their width to may be 1/8, or 0.125 (12%), this will have the effect to spread them .

- If I prefer very dense (numerous) stripes: increase their number, to 30(30 stripes per motif). As there is a lot of stripes per motif they can't be very large or they will overflow each other, their maximum width should be 1/30 roughly 0.03 (3%).


Make sure all your icons have the same size

Cairo-Dock can deal with icons of any size. But for practical reason it would be nice to make sure that all icons appear to have the same size.. But you are too lazy to resize them yourself ! The solution is to set both values for the icons size equal in the tabs for the launchers, the applications, the applets and the separator. Cairo-Dock will then resize all the icons to that size. One little nice trick : set the size to 24 in all fields and 150 in the field for the width of the wave (see CAIRO-DOCK tab). You end up with a baby version of Cairo-Dock, Cute no?

Choose a ready made theme

If the directory ~/.cairo-dock doesn't exist at launch, Cairo-Dock will offer to choose a theme to choose among the predefined one.. Later if you change your mind and wish to change the theme : Right click "cairo-dock" and choose "Manage Theme".

Cairo-dock if needed will warn you that you need to save your actual theme first if it has been changed. You can either save it on another name or overwrite the existing one, except for pre-installed themes.


Add containers

Container are launchers with a special attribute : They are like drawers, so you can group similar applications (launchers) which will only appear when you go over the container. You can create a container inside a container and create a tree structure.

You create a container the same way you create a launcher for an application. You just have to tick the last box to indicate that it is a Container rather than an application. A new sub dock will be created and associated with that container. Initially you can't see it as it is empty so you have to create launcher to put in it as explained before. You can also of course just drag and drop applications on the Container


To move a launcher from one container to another one easy way is to edit the Launcher (Right Click the icon and choose "Modify Launcher") and change the name of the container in the Container field to point towards the new container (the main dock is called "_MainDock_").

Add/Remove visual effect with Compiz-Fusion

Compiz-Fusion set visual effect by default to the predefined windows types. You can also apply specific effect to the opening and closing of the dock and subdocks. Open CCSM (Compiz Config System Manager) and go the to option of the Animation plugin; in the "Open Animation" tab. Here we are going to create a new variable which will allow us to affect a specific effect when you open a window (Compiz-Fusion considers a sub-dock like a window)

* Click "Add" an choose your effect in the list from "Open effect". * Add "name=cairo-dock" in the field "xxx" (don't know the exact name in english :( ) * Get this value to show at the top of the list. Now Compiz-Fusion will apply that specific effect only to the windows called "cairo-dock". So all sub-dock opening will use that effect. Create the same effect in the "Close Animation" tab and while you are at it go to "Focus Animation" and create a variable there as well, but here select no effect. Name it cairo-dock again. This will make sure that no effect is triggered when you fly over the dock (focus). This can create an ugly flash if not

Recommended value Open Animation: Zoom effect with a duration of 250 Close Animation: Vaccuum effect with a duration of 250

Note: to optimize this effect I recommend to deactivate the folding of the icon in the dock. See to 0 the option for unfolding in "Movement speed and accelation. See Group Cairo-Dock.


Transform icons to SVG format with InkScape

1/ Install InkScape

The application is in the main repository so installing is easy:

sudo apt-get install inkscape

2/ Transform the icon

If the final icon will be sized to 48x48 pixels it is preferable to start from a bigger images to avoid loosing to much details (especially when the icon will zoom in in the dock.

The original icons for Cairo-Dock are coming from a Mac OS X theme (http://nekohayo.googlepages.com/icons) which are in PNG and sized at 128x128 (directory scalable)

3/ open the selected file:

File / Open

4/ Define the final size of the icon:

File / Document Properties... (Shift+Ctrl+D) and change the width and high to 48px. You will notice that your picture will overflow the new frame you just resized

5/ Reduce the picture without loosing quality:

Select the picture by clicking on it. You will notice in the tool bar that it indicates the size of you picture (in this case X:0 Y:-80 L:128 H:128)

Adjust using this setting: X:0 Y:0 L:48 H:48. The picture is now resized to 48x48 pix but it maintains the detail level that it ias when it was sized to 128x128px.

6/ Embed the image in the document :

Select the picture and choose "Menu/Effects/Images/Embed All Images" and confirm (otherwise the png will only exist as a link inside the SVG file)

7/ Save the icon ready to be used :

You can now save the icon directly where you normally save your icon.

Notes : Normally your distro will contain a directory full of ready made SVG icons. For example with Ubuntu Edgy Eft they are in /usr/share/icons/gnome/scalable/.

SVG Icon Collection

The solution described above is still a workaround and will cause issue when it comes to quality and clarity of the icons, especially when Cairo-Dock zoom the icons while you hover above them

The best solution is to collect and use icon that were made as real vectorial images. There are web site that contains huge amount of such icons. One important one is www.gnome-look.org. In there you can find original icons for some software but in general it contains subset of icons to be used in a theme. This is sometime interesting to get an homogeneous theme for your dock

Another site very complete is www.svgicons.o7a.net (it was created for the original cairo-dock).

In the sources of Cairo_Dock there is a directory More_Icons which contains a fair amount of SVG icons.

With or without Beryl?

  • With Beryl

If the Cairo-Dock is started before Beryl starts the dock will only appear on one of the Desktop. This is quite annoying. The workaround is to make sure that Cairo-Dock will start only after Beryl. A script is installed just for that with the dock (/usr/bin/launch-cairo-dock-after-beryl.sh). Allez dans System/Preferences/Session and add that script to the start-up section. it add a delay of 12 seconds to actual start of the dock. if you think it is too long or too short edit the script and change the value of the sleep command

It is possible that you will have to change the size of the "Vertical Virtual Size" for the dock to work correctly (Beryl Setting Manager / General Options / Vertical Virtual Size -> change the value from 1 to 2)

To be able to use the Dock in an optimal way deactivate the grabbing of focus in the "Beryl Setting Manager / General Options". Also in the "Animations" section of the "Visual effect" tab use the Zoom animation for the 2nd animation in the Create/Close windows part and also tick the menu box. Tips: set Animation duration to 300 for an "optimum" effect.

when you set the dock in the vertical view there is a 1 pixel shift from the edge of the screen even if you set a negative value in the Position Group tab. It is a "feature" of Beryl that will leave a 1 pixel space on the left and right edege of the desktop. Metacity doesn't have that issue


  • Without Beryl

If you are not using Beryl then is fairly certain that you will not have transparency in the dock. The result will a black border all around the dock

To fix this you will have to install a module that allow transparency like xcompmgr. This module for example allow Metacity to have transparency and will get of the black border. You can have all these program (Metacity+xcompmgr and Beryl) installed at the same time but of course shouldn't use them at the same time.

Once installed you have to start xcompmgr at startup. click on System/Preferences/Session and choose "startup" then create a new item with the following command in it: xcompmgr -c -f -n

This will activate transparency as well as shading and fading effects. FOr more help on xcompmgr to see the different option: xcompmgr --help


Cairo-Dock on 64bits CPU wiht no compilation, it is possible !

Here is a copy paste from a forum user (Ravan) who fought hard to make it works on his AMD64 :-)

Yes, it works perfectly now (as far as I tested :) ) but for the dependencies, I could have gone a simpler route... It turns out that the great AMD64 dependency solver tool (when running 32bit apps) called Getlibs does it all in one go: http://ubuntuforums.org/showthread.php?t=474790&highlight=getlibs

So here is a short How-To for Cairo-Dock on Ubuntu Gutsy AMD64:

  • Download the latest cairo-dock 32bit debs (both cairo-dock and plugins) to your home folder
  • Open a terminal screen and run a. ~$ sudo dpkg –force-all -i cairo-dock*.deb b. ~$ sudo getlibs /usr/bin/cairo-dock c. ~$ sudo apt-get -f install
  • Try Cairo-Dock by giving the command cairo-dock in the same terminal screen and see if there are any dependency errors left. If so, use the 'manual 32bit libs installation' described on the getlibs page above to get them. If not, cairo-dock should run and open itself on your screen :)
  • If all is well, add cairo-dock to the Sessions list to make it start up at login...