Xfce Forum

Sub domains
 

You are not logged in.

#1 2007-02-03 12:59:12

ozroc
Member
Registered: 2007-02-03
Posts: 13

Ozganizator: Organize your applications in virtual Desktops

Ozganizator (http://ozganizator.berlios.de/index_en.html) is a little script that will let you associate a certain application to a virtual Desktop so when you want to organize your Desktop the configured applications will automatically go to the choosen one.
That's a feature some other window managers (as Afterstep, WindowMaker, KDE...)  have but not xfwm.

Basically you'll have a configuration dialog (written in GTK with GTKDialog so will integrate with your XFCE theme) with 4 textboxes associated to 4 virtual Desktops (maybe a choosable number in future versions). You'll put in each box the name of the aplication you want to be there and each time you run the script it will magically go to the selected Desktop.

For integrating it in XFCE, you can put a launcher in your panel (maybe a keyboard shortcut too) pointing to the script:

sh ~/.ozganizator/ozganizator

and other (in a submenu of the main one, for example) pointing to the configuration dialog:

sh ~/.ozganizator/ozganizator c

Here are some screenshots (commented in Spanish, sorry) showing how it works in XFCE:
http://picasaweb.google.es/ozrocpablo/Ozganizator/
ozs3.jpg?imgmax=720

Please, excuse my poor English (it would be great if anyone could help with corrections...)

Offline

#2 2007-02-05 07:25:52

xanthon
Member
Registered: 2006-11-24
Posts: 18

Re: Ozganizator: Organize your applications in virtual Desktops

Greetings, ozroc and thank you for the information.

I have downloaded the zip file twice - once with the browser and once with MultiGet - to two different locations.  File-Roller cannot open either version and gives this result:

[/home/terry/Current/Reports/ozganizator_en_0.1.zip]
  End-of-central-directory signature not found.  Either this file is not
  a zipfile, or it constitutes one disk of a multi-part archive.  In the
  latter case the central directory and zipfile comment will be found on
  the last disk(s) of this archive.
unzip:  cannot find zipfile directory in one of /home/terry/Current/Reports/ozganizator_en_0.1.zip or
        /home/terry/Current/Reports/ozganizator_en_0.1.zip.zip, and cannot find /home/terry/Current/Reports/ozganizator_en_0.1.zip.ZIP, period.

xarchiver reports:

Archive format is not recognized!

unzip in the command line gives the same output as file-roller.

Offline

#3 2007-02-05 08:04:22

ozroc
Member
Registered: 2007-02-03
Posts: 13

Re: Ozganizator: Organize your applications in virtual Desktops

OK, I think you maybe did "right click -> save as..." directly on the link.
Just click on it normally (left click) and you'll be asked for choosing a mirror for downloading, something similar to sourceforge.
If that's not the problem, I'll pack and upload the file again, but it doesn't seem to be corrupted.

Offline

#4 2007-02-05 08:40:07

xanthon
Member
Registered: 2006-11-24
Posts: 18

Re: Ozganizator: Organize your applications in virtual Desktops

Thanks.  That did it.  (That's what I hate about SourceForge.)

Offline

#5 2007-02-05 09:41:29

xanthon
Member
Registered: 2006-11-24
Posts: 18

Re: Ozganizator: Organize your applications in virtual Desktops

This is very easy to use.  Note the dependencies.

I was able to get gtkdialog from my distro.  wmctrl is available here:
http://www.sweb.cz/tripie/utils/wmctrl/
It compiled on my OS without difficulty, which is a first, IIRC.

The English on the web page, as ozroc says, could use some attention but the meaning is clear enough.  I've just been asking about this in my distro's forum, so I will post a link there to this thread.

Offline

#6 2007-02-05 09:57:50

ozroc
Member
Registered: 2007-02-03
Posts: 13

Re: Ozganizator: Organize your applications in virtual Desktops

Thanks.

The goal now is to make it also easy to install and probably a bit more flexible.

And correct the En[Goo]glish translation.  roll
Sorry again, I'll try to do it better.

Offline

#7 2007-02-05 23:39:34

xanthon
Member
Registered: 2006-11-24
Posts: 18

Re: Ozganizator: Organize your applications in virtual Desktops

Perhaps I misunderstand what result/s should follow from associating a window with a particular desktop.

On desktop 1, I used a shortcut to open an OpenOffice file.  The OpenOffice window is associated with that desktop.  OpenOffice takes some time to open (more since I used ozganizator), so I moved back to desktop 2 to continue what I was doing there.  The OpenOffice file, some seconds later, opened on Desktop 2.

Could you please comment on that result?

Offline

#8 2007-02-06 02:34:44

xanthon
Member
Registered: 2006-11-24
Posts: 18

Re: Ozganizator: Organize your applications in virtual Desktops

When I try to add a window using the GUI, this result shows in the Terminal window:

(gtkdialog:4218): Gtk-CRITICAL **: gtk_file_chooser_add_shortcut_folder: assertion `GTK_IS_FILE_CHOOSER (chooser)' failed

I'm going to try using a text editor to add the window.

Edit: that got the window description added to D1 but the window still opened on the active desktop instead of D1.  The description I added (from ozganizator) was VCLSalFrame.DocumentWindow.OpenOffice.org

When I run wmctrl -l the window is listed as
0x02a00064  0 localhost Test.ods - OpenOffice.org Calc

Offline

#9 2007-02-06 10:32:09

ozroc
Member
Registered: 2007-02-03
Posts: 13

Re: Ozganizator: Organize your applications in virtual Desktops

xanthon wrote:

Perhaps I misunderstand what result/s should follow from associating a window with a particular desktop.

On desktop 1, I used a shortcut to open an OpenOffice file.  The OpenOffice window is associated with that desktop.  OpenOffice takes some time to open (more since I used ozganizator), so I moved back to desktop 2 to continue what I was doing there.  The OpenOffice file, some seconds later, opened on Desktop 2.

Could you please comment on that result?

Well, Ozganizator doesn't open your window directly in the choosen Desktop as Afterstep or DevilsPie do.

Ozganizator opens normally your window, in the desktop you are because it's not running all the time (so there's absolutely no reason for OpenOffice to take more time to open).

Just when you call ozganizator, the allready opened windows will be organized as you decided in the configuration.

In the case you mention, you have the window:
0x02a00064  0 localhost Test.ods - OpenOffice.org Calc
You put the word OpenOffice (so every window with OpenOffice in it's name will be associated) in the box called Desktop 1.
You have associated OpenOffice to Desktop 1 and closed the configuration dialog.
Now, you go to Desktop 2 and open your document in OpenOffice. It will be in Desktop 2 (because you called it from there).
In the moment you run ozganizator, OpenOffice will go to Desktop 1. Then you can move it to Desktop 3, work there for a while and the next time you decide that you want to organize your Desktop, you launch again ozganizator's script and it jumps again to Desktop 1.

It's a quite different way (I found better) for doing this.

When my girlfriend started using my Gnome with DevilsPie she said it was very confusing because she called a program and it opened in a Desktop she wasn't seeing or she was sent to another Desktop with the program so the other programs she was using before dissapeared...
This script will put all the opened windows in their respective Desktop when you think there are too much windows in your Desktop.

Hope you understand.

xanthon wrote:

When I try to add a window using the GUI, this result shows in the Terminal window:

(gtkdialog:4218): Gtk-CRITICAL **: gtk_file_chooser_add_shortcut_folder: assertion `GTK_IS_FILE_CHOOSER (chooser)' failed

I'm going to try using a text editor to add the window.

Well, I've seen the message in my system, it prompts it but everything works OK. I'll investigate what exactly does it mean but it does what it's supposed to do. It just copies the name of the window selected in the window list to the box where you have the writing cursor.

I've also discovered a stupid but important to fix bug. If you save an empty file for any of the desktops it fails to open the file with an error:

pip_malloc(): Unable to get memory for fill_edit_by_file.

Will be fixed in next release.

Offline

#10 2007-02-07 04:48:45

xanthon
Member
Registered: 2006-11-24
Posts: 18

Re: Ozganizator: Organize your applications in virtual Desktops

Thanks for your reply.  I need to use afterstep, perhaps.  One annoying problem I have with Xfce is that, when a script running in an application on desktop 1 opens files (=new windows), the new windows appear on the active desktop instead of desktop 1.

When ozganizator is run, the windows do indeed relocate to the associated desktop.

Offline

#11 2007-02-11 17:19:35

Cat Quevara
Member
Registered: 2007-02-06
Posts: 5

Re: Ozganizator: Organize your applications in virtual Desktops

Hi,

I found ozganizator quite useful, but as I'm using six desktops I modified the script a bit to work with six desktops - and then I modified it a bit more  smile

So, the results::

  • You can choose any number of desktops

  • You can change the number of columns in the gtkdialog window

  • No more crash if there's an empty desktop organization file

  • The apply setting also saves the settings now (I prefer it this way, though it could be others wont)

You'll need to edit a value in the script to get the number of desktops you want (two if you wan't to change the number of columns, but that's just cosmetics).

So I'm posting this here with the permission from ozroc:

#! /bin/bash

## Settable values:
N_DESKTOP=6     ## Number of desktops, feel free to change
        ## ozganizator does not create any scrollbars, and on my scree the window becomes too large when I have > 16 rows
N_COLUMNS=2    ## Number of columns in the gtkdialog window

## Just two initial values (do not set to anything other than 0):
DESKTOP_C=0     ## Desktop counter
COLUMN=0    ## Current Column

cd ~/.ozganizator
# Configurar
if [ $# -ne 0 ]
    then

export AYUDA='<vbox><hbox><pixmap><input file>ozganizator.png</input></pixmap><text><label>
"Put in each Desktop the name of each program you
want to be opened in it separed by enters.
The window list can help you to select the name of 
the aplication.
Choosing one and clicking on the corresponding menu
it will be added to the chosen Desktop."
        </label></text></hbox><hbox><button ok></button></hbox></vbox>'


### MENU CONSTRUCTOR: ###

until [ $DESKTOP_C -eq $N_DESKTOP ] ; do
    DESKTOP_C=$(($DESKTOP_C+1))
    DESKTOP_C_CHAR=`echo $DESKTOP_C | tr '1234567890' 'ABCDEFGHIJ'` # gtkdialog does not like variables with numbers
    [[ $COLUMN -lt $N_COLUMNS ]] && COLUMN=$(($COLUMN+1)) || COLUMN=1
    cd  ~/.ozganizator
    [[ -z `cat d$DESKTOP_C` ]] && echo " " > d$DESKTOP_C # gtkdialog dies if file exixts and size = 0 with error "pip_malloc(): Unable to get memory for fill_edit_by_file."
    DESKTOP_MENU=$DESKTOP_MENU'
            <menu>
                      <menuitem>
                       <label>gtk-add</label>
                <action type="insert">ENTRY, D'$DESKTOP_C_CHAR'</action>
                </menuitem>
            <label>Desktop '$DESKTOP_C'</label>
               </menu>
 '
     if [ $COLUMN -eq 1 ] ; then
        DESKTOP_FRAME=$DESKTOP_FRAME'
            <hbox>
' 
    fi      
    DESKTOP_FRAME=$DESKTOP_FRAME'
                <frame Desktop '$DESKTOP_C'>
                    <edit>
                      <variable>D'$DESKTOP_C_CHAR'</variable>
                      <input file>'d$DESKTOP_C'</input>
                    <output file>'d$DESKTOP_C'</output>
                      <width>150</width><height>100</height>
                    </edit>
                  </frame>'
    if [ $COLUMN -eq $N_COLUMNS ] ; then
                 DESKTOP_FRAME=$DESKTOP_FRAME'
                         </hbox>'
    elif [ $DESKTOP_C -eq $N_DESKTOP ] ; then
         DESKTOP_FRAME=$DESKTOP_FRAME'
                        </hbox>'    
    fi
    DESKTOP_SAVE=$DESKTOP_SAVE'
                <action>Save:D'$DESKTOP_C_CHAR'</action>'
done

### END MENU CONSTRUCTOR ###

export MENU='
    <vbox> 
        <menubar>
            '$DESKTOP_MENU'
            <menu>
                <menuitem>
                <label>gtk-help</label>
                <action>gtkdialog --program=AYUDA</action>
                </menuitem>
            <label>Help</label>
            </menu> 
        </menubar>  
        <hbox>
            <pixmap><input file>ozganizator.png</input></pixmap>
            <vbox>
            <frame Opened Window List>
                <list>
                    <variable>ENTRY</variable>
                    <input>wmctrl -x -l | cut -c 15- | cut -d \  -f 1 </input>
                    <width>170</width><height>100</height>
                </list>
            </frame>
            <hbox>
                <button>
                    <label>Rescan</label>
                    <action>Clear:ENTRY</action>
                    <action>Refresh:ENTRY</action>
                </button>            
            </hbox>
                 
        </vbox></hbox>
    
        <vbox>
            '$DESKTOP_FRAME'
        </vbox>
        <hbox>
            <button>
                <input file icon="desktop"></input>
                '$DESKTOP_SAVE'
                <action>sh ozganizator</action>
            </button>
            <button>
                <input file icon="filesave"></input>
                '$DESKTOP_SAVE'
            </button>
            <button ok>
            </button>
        </hbox>
    </vbox>
'
gtkdialog --program=MENU 

fi

DESKTOP_C=0

until [ $DESKTOP_C -eq $N_DESKTOP ] ; do
        DESKTOP_C=$(($DESKTOP_C+1))
    for i in $(cat d$DESKTOP_C) ; do
        for j in $(wmctrl -x -l | grep $i | cut -d " " -f 1 ); do 
            wmctrl -i -r $j -t $(($DESKTOP_C-1))  
        done

    done
done

Ozroc well be adding this and other hacks from other sources and his own in the next release. In the meantime, feel free to use this and hack it furher!

Offline

#12 2007-02-11 22:25:19

X-Nc
Member
Registered: 2007-02-11
Posts: 1

Re: Ozganizator: Organize your applications in virtual Desktops

xanthon wrote:

One annoying problem I have with Xfce is that, when a script running in an application on desktop 1 opens files (=new windows), the new windows appear on the active desktop instead of desktop 1.

The confusing thing for me is that the behavior you find annoying is exactly what a window manager is supposed to do.  Thankfully the power of UNIX is that there are tools/apps/configs for everyone.  AfterStep/Window Maker look like they'll do what you want. 

I've always liked both of those.  In fact, I like the majority of wm's/de's available for Linux.  The funny thing is that the ones I dislike the most are GNOME and KDE.  The whole WinXX look'n'feel is just wrong and following it just perpetuates it.  Luckily GNOME changed to something a little closet to the old Mac OS setup.

My personal favorite environment is/was CDE.  That's why I got into Xfce in the first place, back in the version 1 days.  It's to bad that Xig isn't supporting it anymore in their DeXtop product.  It's also to bad I can't code worth a crap else I'd shutup and hack what I need and contribute it back.  But, alas, it doesn't look like that's ever going to happen.

Joe

Offline

#13 2007-02-14 18:28:46

ozroc
Member
Registered: 2007-02-03
Posts: 13

Re: Ozganizator: Organize your applications in virtual Desktops

I've just finished a new version basically adding the hacks by Cat Guevara:

  • You can choose any number of desktops

  • You can change the number of columns in the gtkdialog window

  • No more crash if there's an empty desktop organization file

  • The apply setting also saves the settings now (I prefer it this way, though it could be others wont)

Whith some changes:

  • Automatically takes the configured number of desktops in your window manager (you can still set them manually by editing the script).

  • Change the name of gtkdialog window to Ozganizator (stupidly done, I know).

  • Tried to let user define box sizes... but doesn't work yet (just controls list) :?.

  • Added a save option in menus for each individual desktop.

  • Edited a bit his code because it just crashed on my system when trying to create the menu (something about " and '). Hope it doesn't crash now on other systems, but couldn't test it yet.

  • Added a really serious license text to the project. I hope Cat Guevara agrees the terms of license, if not, it will be inmediately removed/modified.

#! /bin/bash
#
#    OZGANIZATOR V 0.2beta
#
# ====================================================================
#           DO WHAT THE FUCK YOU WANT TO PUBLIC LICENSE
#                    Version 2, December 2004
#
# Copyright (C) 2004 Sam Hocevar
#  22 rue de Plaisance, 75014 Paris, France
# Everyone is permitted to copy and distribute verbatim or modified
# copies of this license document, and changing it is allowed as long
# as the name is changed.
#
#            DO WHAT THE FUCK YOU WANT TO PUBLIC LICENSE
#   TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION
#
#  0. You just DO WHAT THE FUCK YOU WANT TO.
# ====================================================================
#    AUTHORS
#    
# Original idea and spiritual leader: 
# Ozroc         ozrocpablo@gmail.com
# Multiple Desktops and some bug corrections:
# Ville Aakko        
# ====================================================================
# CONFIGURATION

## Settable values:

N_DESKTOP=$(wmctrl -d | wc -l)    ## Asks Window Manager for the number of Desktops. Uncomment next to set it manually.

# N_DESKTOP=6     ## Number of desktops, feel free to set it manually.

        ## ozganizator does not create any scrollbars, and on my screen the window becomes too large when I have > 16 rows
N_COLUMNS=2    ## Number of columns in the gtkdialog window


BOXWIDTH=170
BOXHEIGHT=100

# ====================================================================
# DON'T TOUCH FROM HERE UNTIL YOU KNOW WHAT YOU'RE DOING
# ====================================================================

## Just two initial values (do not set to anything other than 0):
DESKTOP_C=0     ## Desktop counter
COLUMN=0    ## Current Column

# ====================================================================

cd ~/.ozganizator

# ====================================================================
# CONFIGURATION MENU

if [ $# -ne 0 ]
    then

export AYUDA='<vbox><hbox><pixmap><input file>ozganizator.png</input></pixmap><text><label>
"Put in each Desktop the name of each program you
want to be opened in it separed by enters.
The window list can help you to select the name of 
the aplication.
Choosing one and clicking on the corresponding menu
it will be added to the chosen Desktop."
        </label></text></hbox><hbox><button ok></button></hbox></vbox>'


### MENU CONSTRUCTOR: ###

until [ $DESKTOP_C -eq $N_DESKTOP ] ; do
    DESKTOP_C=$(($DESKTOP_C+1))
    DESKTOP_C_CHAR=`echo $DESKTOP_C | tr '1234567890' 'ABCDEFGHIJ'` # gtkdialog does not like variables with numbers
    [ $COLUMN -lt $N_COLUMNS ] && COLUMN=$(($COLUMN+1)) || COLUMN=1

    [ -z "`cat d$DESKTOP_C`" ] && echo " " > d$DESKTOP_C # gtkdialog dies if file exixts and size = 0 with error "pip_malloc(): Unable to get memory for fill_edit_by_file."
    DESKTOP_MENU=$DESKTOP_MENU'
            <menu>
                      <menuitem>
                       <label>gtk-add</label>
                <action type="insert">ENTRY, D'$DESKTOP_C_CHAR'</action>
                </menuitem>
                      <menuitem>
                       <label>gtk-save</label>
                <action>Save:D'$DESKTOP_C_CHAR'</action>
                </menuitem>
            <label>Desktop '$DESKTOP_C'</label>
               </menu>
 '
     if [ $COLUMN -eq 1 ] ; then
        DESKTOP_FRAME=$DESKTOP_FRAME'
            <hbox>
' 
    fi      
    DESKTOP_FRAME=$DESKTOP_FRAME'
                <frame Desktop '$DESKTOP_C'>
                    <edit>
                      <variable>D'$DESKTOP_C_CHAR'</variable>
                      <input file>'d$DESKTOP_C'</input>
                    <output file>'d$DESKTOP_C'</output>
                      <width>$BOXWIDTH </width><height>$BOXHEIGHT </height>
                    </edit>
                  </frame>'
    if [ $COLUMN -eq $N_COLUMNS ] ; then
                 DESKTOP_FRAME=$DESKTOP_FRAME'
                         </hbox>'
    elif [ $DESKTOP_C -eq $N_DESKTOP ] ; then
         DESKTOP_FRAME=$DESKTOP_FRAME'
                        </hbox>'    
    fi
    DESKTOP_SAVE=$DESKTOP_SAVE'
                <action>Save:D'$DESKTOP_C_CHAR'</action>'
done

### END MENU CONSTRUCTOR ###

export MENU="
    <vbox> 
        <menubar>
            $DESKTOP_MENU
            <menu>
                <menuitem>
                <label>gtk-help</label>
                <action>gtkdialog --program=AYUDA</action>
                </menuitem>
            <label>Help</label>
            </menu> 
        </menubar>  
        <hbox>
            <pixmap><input file>ozganizator.png</input></pixmap>
            <vbox>
            <frame Opened Window List>
                <list>
                    <variable>ENTRY</variable>
                    <input>wmctrl -x -l | cut -c 15- | cut -d \  -f 1 </input>
                    <width>$BOXWIDTH </width><height>$BOXHEIGHT </height>
                </list>
            </frame>
            <hbox>
                <button>
                    <label>Rescan</label>
                    <action>Clear:ENTRY</action>
                    <action>Refresh:ENTRY</action>
                </button>            
            </hbox>
                 
        </vbox></hbox>
    
        <vbox>
            $DESKTOP_FRAME
        </vbox>
        <hbox>
            <button>
                <label> Ozganize!</label>
                $DESKTOP_SAVE
                <action>sh ozganizator</action>
            </button>
            <button>
                <label>Save all</label>
                $DESKTOP_SAVE
            </button>
            <button ok>
            </button>
        </hbox>
    </vbox>
"

gtkdialog --name="ozganizator_menu" --program=MENU &


## This is for changing the window name of the menu. It's probably a quite stupid and maybe buggy solution, but works for me.

INLIST=1
while [ $INLIST -eq 1 ] ; do
    wmctrl -l | grep gtkdialog
    INLIST=$?
    sleep 0.5
done

wmctrl -x -r GtkDialog -N Ozganizator
wait $(jobs -p)

fi

# ====================================================================
# ORGANIZATOR SCRIPT

DESKTOP_C=0

until [ $DESKTOP_C -eq $N_DESKTOP ] ; do
        DESKTOP_C=$(($DESKTOP_C+1))
    for i in $(cat d$DESKTOP_C) ; do
        for j in $(wmctrl -x -l | grep $i | cut -d " " -f 1 ); do 
            wmctrl -i -r $j -t $(($DESKTOP_C-1))  
        done

    done
done

# ====================================================================
# THAT'S ALL FOLKS

It won't be at berlios until I do some other modifications, much more code cleaning and testing.
It will (should) work just replacing the script in the "official" package.

Offline

#14 2007-02-16 15:59:42

ozroc
Member
Registered: 2007-02-03
Posts: 13

Re: Ozganizator: Organize your applications in virtual Desktops

New Wiki-style web site.
http://ozganizator.berlios.de
Help needed for correcting my spanglish, adding contents and many other things.
Ask me at:
ozrocpablo@gmail.com

Offline

#15 2007-02-23 15:10:10

Cat Quevara
Member
Registered: 2007-02-06
Posts: 5

Re: Ozganizator: Organize your applications in virtual Desktops

Hi!

I couldn't disagree with the license.

I noticed one spelling (or grammar error) in the script; I believe:

DON'T TOUCH FROM HERE UNTIL YOU KNOW WHAT YOU'RE DOING

... should be "Don't touch anything after this line UNLESS you know that you're doing" ; I think "from here" isn't proper English in this context, though I'm not sure since my english isn't that good aither smile.

And also the issue between ' and " hasn't caused any problems on my end. And the 0.2beta works as well as it should.

Offline

#16 2007-03-08 13:09:22

ozroc
Member
Registered: 2007-02-03
Posts: 13

Re: Ozganizator: Organize your applications in virtual Desktops

Packages for an easier installation in debian based distros has been uploaded. See the site:
http://ozganizator.berlios.de

Soon rpm's and maybe others.

Offline

#17 2007-03-14 17:53:11

ozroc
Member
Registered: 2007-02-03
Posts: 13

Re: Ozganizator: Organize your applications in virtual Desktops

  • Separated in 3 scripts.

  • New better way for managing application's lists

  • Added a simple manual editor

Download deb package at http://prdownload.berlios.de/ozganizato … or-0.3.deb.

Testers needed.

Offline

Board footer

Powered by FluxBB