PyPanel

From ArchWiki

Jump to: navigation, search

Contents

Download and Install

The latest version of pypanel currently resides in the AUR under community. Be sure to make it accessible in /etc/pacman.conf then download it with:

# pacman -S pypanel

Basic Customization

Although pypanel is lightweight, it still has a lot of eyecandy that can be accessed and manipulated through the .pypanelrc file. This file is created in our home directory the first time pypanel is run.

To start pypanel simply type:

$ pypanel

To start pypanel every time you start an Xwindows session, add the following to ~/.xinitrc before you start the window manager (otherwise it would show up after the window manager quits):

pypanel &

For example:

#!/bin/sh
pypanel &
exec openbox

If you use Openbox, GNOME, Xfce or another desktop environment with support for autostarting of applications or sessions, you may choose to start PyPanel using the appropriate alternative ways.

Now that we have a default configuration file in our home directory we can edit the behavior of pypanel. The ~/.pypanelrc file is actually a Python script, and therefore requires correct Python syntax and formatting. The file is well commented, so rather than duplicating it, here are some suggestions:

BG_COLOR        = "0xfaebd7"    # Panel background and tint (Antique White)
TASK_COLOR      = "0xffffff"    # Normal task name color
DESKTOP_COLOR   = "0xffffff"    # Desktop name color
CLOCK_COLOR     = "0xffffff"    # Clock text color

TASK_SHADOW_COLOR      = "0x000000"
FOCUSED_SHADOW_COLOR   = "0x000000"
SHADED_SHADOW_COLOR    = "0x000000"
MINIMIZED_SHADOW_COLOR = "0x000000" 
DESKTOP_SHADOW_COLOR   = "0x000000"
CLOCK_SHADOW_COLOR     = "0x000000"

SHADE           = 64

ABOVE           = 1             # Panel is always above other apps
APPICONS        = 1             # Show application icons
AUTOHIDE        = 0             # Autohide uses the CLOCK_DELAY timer above
SHADOWS         = 1             # Show text shadows
SHOWLINES       = 0             # Show object separation lines
SHOWBORDER      = 1             # Show a border around the panel

Many other settings can be changed. These examples only illustrate some of the visual options available. Mouse clicks and other behavior can be also adjusted according preference. Read the comments and experiment.

Launchers

If you wish to add Launchers to PyPanel, you will have to enable the launcher in the Panel Layout section.

 # Panel Layout:
 # ...
 DESKTOP    = 1
 TASKS      = 3
 TRAY       = 4
 CLOCK      = 5
 LAUNCHER   = 2

And then add your launch commands in the LAUNCH_LIST section. The first part is the command to run, the second part is a full path to the icon to display.

 LAUNCH_LIST  = [
            ("firefox", "/usr/lib/firefox-3.0.1/icons/mozicon16.xpm"),
            ("thunar", "/usr/share/icons/oxygen/16x16/apps/system-file-manager.png"),
            ("urxvt -bg black -fg grey", "/usr/share/icons/oxygen/16x16/apps/terminal.png"),
            ]

Take a look around /usr/share/icons for icons to use for your applications.

Tips&Tricks

If you want to make the mouse click act more traditionally, find the following lines in .pypanelrc:

#-------------------------------------
def taskButtonEvent(pp, button, task):
#-------------------------------------
   """ Button event handler for the panel's tasks """
   
   if button == 1:
       pp.taskFocus(task)
   

and then, add the last line once again, so that it looks like this:

#-------------------------------------
def taskButtonEvent(pp, button, task):
#-------------------------------------
   """ Button event handler for the panel's tasks """
   
   if button == 1:
       pp.taskFocus(task)
       pp.taskFocus(task)

If pypanel yields an error about non-existing .Xauthority file, add:

touch .Xauthority

above

pypanel &

line in your .xinitrc file.

External links

Personal tools