<- Back to projects page
Cbar - scriptable context sidebar for KDE
About
Cbar is a sidebar with the following goals:
- Provide contextual information when browsing directories,
similar to Metabar and Windows sidebar.
- Easy to extend by providing extensions in the form of
scripts.
- Cross-platform (thanks to using scripts, which are
platform-independent).
Cbar wouldn't be created without many other people. Thanks go to:
- KDE team - for creating such a great and extensible system
as KDE.
- Phil Thompson - for creating Python bindings for Qt (pyQt)
and KDE (pyKDE).
- Sebastian Sauer - for creating Kross
scripting engine for KDE.
- Florian Roth - for creating Metabar.
- OU - for everything.
Author: Krzysztof Lichota <krzysiek-cbar@lichota.net>
Homepage: http://lichota.net/~krzysiek/projects/cbar/
License: GPL v2
News
October 18, 2006
Release first Ubuntu/Debian package for version 0.9.3.
October 11, 2006
Version 0.9.3 released with new features.
September 28, 2006
Version 0.9.2 released with speedup improvements and removing Kross dependency.
August 27, 2006
Version 0.9.1 with bugfix for configuration saving released.
August 25, 2006
Initial version 0.9.0 released.
Screenshots
Version 0.9.3
New script manager
New widget - file management actions
Version 0.9.0 (beta1 aka "Warsaw Uprising")
Screenshot 1 - Cbar after selecting archive file
Screenshot 2 - HTML file, open with contains 2 applications.
Clicking on app starts it.
Screenshot 3 - preview of image file
Screenshot 4 - 2 items selected, note that "Open with" group
automatically hidden itself as there are no actions possible
Screenshot 5 - metadata information for image file, Places
group has been folded to not use space
Screenshot 6 - script configuration dialog
Screenshot 7 - context information for opened image file
Screenshot 8 - eject button appears when CD item is selected
Releases
Version 0.9.3 (October 11, 2006)
Download source: cbar-0.9.3.tar.gz
Download Ubuntu/Debian package (warning - no dependencies!): cbar_0.9.3-1_i386.deb
Changes since last version:
- Added new widget - file management actions.
- Implemented new script manager, which supports choosing theme
manager, choosing script loader and installing new scripts from .tgz
archive.
- Python is initialized only if it has not been initialized previously.
- Removed unnecessary -L/usr/lib from compilation. Compilation on x86_64 should work fine now.
Requirements and installation the same as in version 0.9.2.
Version 0.9.2 (September 28, 2006)
First beta version for users.
Features:
- Pluggable scripts for selected items, selected folder, theme and script loading.
- Konqueror sidebar module.
- Preloading plugin for fast loading.
- Basic scripts showing capabilities of Cbar:
- Image preview
- Other places
- File details
- Eject media
- Generic Cbar library with scripting capabilities, which can be embedded in other modules.
Download: cbar-0.9.2.tar.gz
Requirements (for compilation):
- KDE headers - on Ubuntu it is package "kdelibs4-dev" and
"kdebase-dev".
- Python - on Ubuntu it is package "python2.4".
- pyQt and pyKDE (Python bindings for Qt and KDE). On Ubuntu
it is package "python-qt3" and "python-kde3", respectively.
- autoconf 2.5 and automake>1.6 - on Ubuntu it is
package "autoconf" and "automake1.9", respectively. You have to switch
automake to 1.9 by running "sudo update-alternatives --config automake"
on Ubuntu.
Installation:
- Compile according to these instructions.
- Open Konqueror in "filemanagement" profile (for example using "Home" icon on taskbar).
- Right click on sidebar icon bar, in context menu choose Configure Navigation Panel->Add New->Cbar.
- Switch to Cbar in sidebar.
- Go to Konqueror settings dialog (Settings->Configure Konqueror...).
- Choose "Performance" tab (at the bottom).
- Make sure "Minimize memory usage" is set to "For file browsing only (recommended)".
- Make sure in "Preloading" section "Maximum number instances kept preloaded" is set to at least 1.
- Make sure in "Preloading" section "Preload an instance after KDE startup" is checked.
- For best experience, set icon activation to "Double click" in KDE Control Center. Otherwise you cannot click on icon to see its description or options, you have to select it with Ctrl key.
Notes:
- If you experience long loading time of Konqueror, make sure you are using "file management" profile (see in Konqueror menu Settings->Save view profile XXX,
XXX is the name of profile. If you have right profile, check if
preloading is set up properly as described in "Installation" step above.
Changes since last version:
- Improved startup time by preloading Python KDE libraries (3 seconds -> 120 ms).
- Removed dependency on Kross.
- Cleaned up scripts as importing libraries in each function is no longer needed.
Installation has been tested on Kubuntu 6.06 and KDE 3.5.3.
Version 0.9.1 (August 27, 2006)
Bugfix release fixing problem with saving configuration of enabled scripts.
Download: cbar-0.9.1.tar.gz
Version 0.9.0 (August 25, 2006)
This is beta release aimed mainly at developers (although fully
functional) to get feedback.
Installation has been tested on Kubuntu 6.06 and KDE 3.5.3.
Download: cbar-0.9.0.tar.gz
Features:
- Cbar library with scripting capabilities (using Kross).
- Konqueror sidebar module.
- Python binding library.
- Basic scripts showing capabilities of Cbar:
- Image preview
- Other places
- File details
- Eject media
Current issues:
- Initial loading of sidebar is slow.
Requirements (for compilation):
- KDE headers - on Ubuntu it is package "kdelibs4-dev" and
"kdebase-dev".
- Kross (part of KOffice) - on Ubuntu it is package
"koffice-dev".
- Python - on Ubuntu it is package "python2.4".
- pyQt and pyKDE (Python bindings for Qt and KDE). On Ubuntu
it is package "python-qt3" and "python-kde3", respectively.
- autoconf 2.5 and automake>1.6 - on Ubuntu it is
package "autoconf" and "automake1.9", respectively. You have to switch
automake to 1.9 by running "sudo update-alternatives --config automake"
on Ubuntu.
Documentation
Compilation
- Install all required packages (see Requirements above).
- Run: WANT_AUTOCONF_2_5="1" WANT_AUTOMAKE_1_6="1" make -f
Makefile.cvs
- Run: ./configure --prefix=`kde-config --prefix`
- Run: make
- Run: sudo make install
For users
Compile and install package. Then add Cbar sidebar into Konqueror
sidebar - open Konqueror, press F9 to show sidebar, click on
configuration button, then "Add new"->"Cbar".
You can configure, which scripts will be enabled by clicking button
"Configure scripts" at the top.
For developers
Cbar consists of Cbar library and Cbar sidebar.
Cbar library is aimed at providing generic bar widget, which can be
reused in many types of applications. Cbar sidebar is a Konqueror
sidebar which uses Cbar library.
As library can be reused in different components, configuration is
two-tiered, first subdirectory for specific type of Cbar is checked
(based on Cbar name, passed in Cbar constructor), then common
configuration file is checked.
Please keep it in mind, for example do not assume Konqueror instance
will always be the available in script.
For script writers
Overview
In Cbar library C++ part is kept to the minimum possible, all work is
delegated to scripts.
There are 3 types of scripts:
- Script loader - handles management of scripts. See
defaultScriptLoader.py script for example.
- Theme manager - handles display of widgets. Arranges them
on screen, provides frames, show/hide buttons, and background theme.
- Widget scripts - scripts which create widgets.
All scripts can be replaced. If theme or script loader script is not
present, Cbar will try to fall back to default script. Paths to scripts
are kept in file ~/.kde/share/config/CbarSidebar/cbarrc. You can modify
it to load your scripts for testing. Note that ScriptsToLoad section is
modified by script configuration dialog, so using it will overwrite
your changes in this section.
Example contents of cbarrc:
[ScriptLoader]
scriptPath=/home/user/mydeveldirectory/defaultScriptLoader.py
[ScriptsToLoad]
scripts=/usr/share/apps/cbar/scripts/cbarEjectMedia.py,/usr/share/apps/cbar/scripts/cbarFilePrevie
w.py,/usr/share/apps/cbar/scripts/cbarOpenWith.py,/usr/share/apps/cbar/scripts/cbarOtherPlaces.py,
/usr/share/apps/cbar/scripts/cbarSelectedItems.py
[ThemeManager]
scriptPath=/home/user/mydeveldirectory/defaultThemeManager.py
If you provide paths to your development directory, you don't have to
install scripts every time you edit them. Just modify script and run
Konqueror again :)
API for scripts
NOTE: API is
still unstable and subject to change in future versions.
API for scripts is in module "cbar". Then you have to create
Cbar class instance and you can use its methods.
For widget scripts the most important method is "addCbarWidget(widget, params)".
It takes the following parameters:
- widget - reference to class inheriting from QWidget.
- params - dictionary with parameters which control how this
widget can be used. Currently there is only one interpreted parameter
"type", which controls in which action group theme manager will show
widget.
addCbarWidget() returns QObject reference, which can be used to connect
signals to your widget's slots.
The following signals are currently available:
- signalItemsSelected(const KFileItemList &) - some
file items have been selected in directory view
- signalUrlOpened(const QString &) - directory view
has been switched to this directory
IMPORTANT: For unknown for me reasons, you have to import all necessary
modules in each method. Importing at the module level does not provide
proper symbols.
Notes:
- Do not assume any background color for your widget.
Background is determined by theme manager.
- If your widget does not present valid information for given
URL/file items, hide() it. Theme manager can hide any action group if
it does not provide useful information, to save space.
In your widget you can use any KDE/Qt feature thanks to pyKDE and pyQt.
For example, to perform action on Konqueror, you can use DCOP (see
otherPlaces script for example how to use DCOP).
Scripts provided with cbar should give you a template how to create
your own script. Remember to change .desktop file if you change name of
python script!
If you want to install your new script manually, copy .desktop and .py
file to directory ~/.kde/share/apps/cbar/scripts/ (or global
/usr/share/apps/cbar/scripts/)
Preparing package with script
Script can be installed using configuration window. Such package must contain at least 2 files: scriptname.desktop and scriptname.py.
Desktop file contains properties of script (name, type, etc.) and
location of .py file. For examples, see desktop files of scripts in
package. If there are any other files needed by script, they should be
put in subdirectory to avoid clashes between scripts.
To prepare package, pack files into tarred gzip, for example like that:
tar zcf myscript.tgz myscript.desktop myscript.py myscriptfiles/
Package must have extension .tgz
Disclaimer:
This tool is provided "as is". Author is not responsible for any
damages done by this tool.
This project is dedicated to OU.