Learn how easy it is to sync an existing GitHub or Google Code repo to a SourceForge project! See Demo

Close

#5 Ability to display alternate task names

open
nobody
None
5
2008-03-20
2008-03-20
Anonymous
No

I have created this simple patch which adds the ability to display alternate names for running applications in the panel. After applying the patch one must add to the ~/.pypanelrc file with a line for each desired application and rename text:

RENAME_LIST = {
"gedit" : "Text Editor",
"firefox" : "Web Browser",
}

This patch has been tested and because of its simplicity should be completely bug-free. Its operation is similar to the icon renaming functionality.

I hope this is added to the patch section of the website.

Note: the value specified in the file should be the application's WM_CLASS value - almost always the command used to launch the app. Just run "patch rename.patch" with root privileges (sudo).

Discussion

  • Patch file

     
    Attachments
  • Logged In: NO

    Sorry, that file was a previous testing version. DO NOT USE THE ATTATCHED FILE.

    Instead, apply the latest version as follows:
    --- pypanel 2008-03-19 07:53:08.000000000 +0000
    +++ /usr/bin/pypanel 2008-03-20 16:01:48.000000000 +0000
    @@ -416,6 +416,13 @@ class PyPanel(object):
    def getName(self, task):
    #-----------------------
    """ Return the name of the given task obj """
    + for tec in RENAME_LIST:
    + try:
    + tempo = task.get_full_property(Xatom.WM_CLASS, 0).value
    + except Xlib.error.BadWindow:
    + continue
    + if tec in tempo:
    + return RENAME_LIST[tec]
    try:
    name = task.get_full_property(self._NAME, 0) or task.get_full_property(Xatom.WM_NAME, 0)
    return name.value
    @@ -914,6 +921,8 @@ SHADED_SHADOW_COLOR = "0xffffff"
    MINIMIZED_SHADOW_COLOR = "0xffffff"
    DESKTOP_SHADOW_COLOR = "0xffffff"
    CLOCK_SHADOW_COLOR = "0xffffff"
    +# rename patch
    +RENAME_LIST = {"default":""}

    #-------------------------
    if __name__ == "__main__":

    Sorry for any inconvenience.