Scribus, Dockable Windows and Workspaces

For most things, I really like Scribus.  It’s a marvelous program that is easy to use and extremely powerful.  With that said, there is one design decision that drives me absolutely nuts:  the use of top-level windows for tool palettes.

I could go on (at length) about why this bothers me.  (If I were to do so, I might talk about how the palette windows block the view of my work, or the way in which they clutter up the desktop and makes it difficult to have more than one program at a time.)

But, since a picture is worth a thousand words, I’m not going to do that.  I’ll simply show you what working on a complicated document in Scribus can turn into.

Scribus - Top Level Windows - Complex

As you can see, it isn’t pretty.  There’s superfluous windows everywhere!  And because the display palettes require the vast majority of the desktop, the important stuff (your content) is relegated to a tiny parcel of the screen.

Now, my point in this post isn’t to beat up on the Scribus developers.  They’re well aware that top-level window palettes are not the best way to show a lot of information on-screen.  After talking with one of them yesterday, I was told that there are plans to re-work the UI and fix a number of the more obvious issues.  These enhancements will be in version 1.5 of the software.  (All I can say is: Go Team!)

Unfortunately, future plans do not fix current annoyances.  Nor am I content to wait for a fix.  I’m just not that patient.  Thus, I’ve been researching different ways to solve the Palette Problem, and, it turns out that there is a very elegant solution already used in other graphics programs.  This is to use dockable/floating widgets.

The Solution

In many respects, dock widgets work just like the top-level windows that Scribus uses now.  They can hold complex layouts, options and tool palettes.  You can arrange them on the desktop as you see fit.  There is, however, one important distinction.  Instead of requiring their own space, you can also “dock” them to the main window.

When docked, they will appropriately re-size, and you can even “stack” them on top of one another.  Using dock-widgets, you can transform the mess above into the much more pleasing layout below.

Scribus - Dock Widgets 2[7]

All the same tools and options are available, they’re just organized and accessible.  It’s a much better system.  Moreover, if you don’t need a particular palette (such as the Scrapbook or Outline), it can easily be hidden but still remain accessible.

Scribus - Dock Widgets 1

Now, you might be tempted to think that making such a magical transformation is difficult.  It is, after all, a major change.  But were to you subscribe to such a supposition, you would be wrong.  Transforming the Scribus GUI isn’t difficult in the least.  It simply requires that you download and run a couple of Python scripts.  In the remainder of this post, I’ll describe how to leave Palette Hell behind.

Downloads and Installation

All of the magic happens through the Scripter plug-in, and four custom scripts (one written by a guru, three hacked together by me).  Scripter is included in the scribus-ng package available from most distribution repositories.  I have tested these with Scribus 1.3.5 and Scribus 1.3.8 on Ubuntu and can testify that they work great.

After you download the archive, extract it to a folder somewhere on your computer.  Be sure to keep all four scripts inside the same folder, otherwise they will not work. Next, change your Scribus “Scripts” path to point at this folder.

The paths options are available under the “General Preferences” (File > Preferences > General).

Scribus - Preferences - Paths

Configuration

Once you have copied the scripts to the appropriate location, there is one setting that you need to change prior to using them.  The scripts create a simple text file called “WindowSetttings.conf” that stores the location of the dock widgets.  You will need to specify a path where you would like this to file to be stored.  For example, I store the file in my AppData folder:

/home/roakes/AppData/Applications/Scrbus

You will need to change the path in both “SaveWorkspace.py” and “LoadWorkspace.py”.   Make sure that the two match!

Usage

After you have installed and configured the python files, you are ready to use them.  As I said earlier, there are four scripts in total to handle all of your dock widget needs:

  • DockWidgets.py, which converts the top level window objects to dock widgets.  By default, it places these widgets on the right hand of the Window.
  • SaveWorkspace.py, which can be used to save your widget configuration.
  • LoadWorkspace.py, used to load your previously saved workspace.
  • Scribus_Startup.py, which can be used to load a previously saved workspace when Scribus first opens.

Scribus - Run Script - ExtensionAll of the scripts are run from the “Scripts > Execute Script” menu.  Note: When using them, it is important to run the code as an “Extension Script.”  If you don’t, they will cause Scribus to freeze.

This is the order that the scripts should be run:

  1. First, run DockWidgets.py.  The first time you run this script, it will load all of the dock widgets into the right hand pane.  You can then reorder the widgets to your liking.
  2. Next, run SaveWorkspace.py.  This will save the layout so that you can retrieve it later.
  3. You can then load your saved layout again by using LoadWorkspace.py.

Unfortunately, the changes made by DockWidgets.py are not permanent.  If you exit Scribus, you will be back in Palette Hell.  This is why the fourth script (Scribus_Startup.py) was included.

Scribus (theoretically) includes the ability to run a user-defined script on a start-up.  (I wasn’t actually able to get this to work, but others apparently have.)  Scribus_Startup.py runs DockWidgets.py and LoadWorkspace.py for you.  If you set it as your startup script, you will never have to worry about Palette Hell ever again.

To set it as a startup script, open the Scripter preferences (File > Preferences > Scripter) and type in the path to the script (or select it from the file browser).  Just make sure that Scribus_Startup.py is in the same directory as DockWidgets.py and LoadWorkspace.py.

4 Responses to “Scribus, Dockable Windows and Workspaces”

  1. hi,

    this sounds pretty cool. Is Scribus 1.4 also supported?

    Thanks a lot.

    Holger

    • Hi Holger,

      Yes. Scribus 1.4 is actually required. You have to PyQt installed for the menus to appear correctly, though, which means it is most useful on Linux. (Finding and installing PyQt on Mac OS X and Windows is something of a pain.)

      Cheers,

      Rob

  2. Peter Nemšák says:

    Hello Rob,
    I stumbled upon this post searching for docking-enabled Scribus. I tried to follow the steps as described, but when I start the DockWidgets script, it fails on the first import with “ImportError: No module named PyQt4.QtCore”. I’m not much into Python, but I guess some changes might be required for Windows instances – could you, please, give me a hand with this?

    I’m trying to get this working on Vista, with 1.4.0 RC6, which obviously includes the qt4 libs, so maybe adding a path or something could fix this. thanks in advance.

    • Hi Peter,

      I think the problem isn’t that you don’t have Qt installed, but that you don’t have PyQt installed. PyQt are the python bindings for Qt and aren’t included packaged with Scribus by default, though it would be nice if they were. To be honest, I haven’t tested this script on Windows, and so I can’t provide much guidance on getting it working.

      For Mac or Linux, I’d recommend that you download and install the PyQt bindings and then give it a go again. However, on Windows, Scribus ships with its own Python interpreter. For that reason, you would probably need to install the bindings into the site-packages for Scribus, but I’m not sure on the best way to have you do that. It might be possible to just install the PyQt libs for a system wide Python Interpreter. If so, you can find an installer on the main PyQt website.

      If you pursue this further and get it working, please let me know how it goes.

      Cheers,

      Rob

Leave a Reply