xfce3rc -> xfce4rc conversion ?
Ric
fhj52ads at yahoo.com
Thu Jul 31 18:56:53 CEST 2003
Hi Matthew:
Thanks for the reply and offer.
I know some regex and can, generally, decipher simple PERL but I don't
know PERL well enuf to program with it.
I've been meaning to work out some of this and I suppose now is as good
a time as any. It will give you an idea of what is up and, maybe, too,
Olivier et al will make corrections and suggestions if I post thoughts
here.
The xfce3rc file is structured but I cannot be sure that the structure
I have is universal applied throughout the (XFce3) world's languages.
Olivier could help there; maybe somebody else too.
Here's part of an old one:
## Comment "do not edit" is here
[Coords]
31
0
[ButtonLabels]
base
mon
net
yech
fun
help
cnfig
prog
Nine
Ten
[External_Icons]
/USER/ICONS/Clock-ScheduleBook.xpm
/usr/X11R6/share/xfce/icons/-myICONS/Calculator.xpm
/USER/ICONS/rxvt-lrg.xpm
/usr/X11R6/share/xfce/icons/MicroPhonePro.xpm
/ICONS/galeon-lrg.xpm
/USER/ICONS/gnome-logo-icon-transparent.png
/USER/ICONS/GHB.xpm
/USER/ICONS/xkill.xpm
/USER/ICONS/Ferrari.xpm
/USER/ICONS/xmms.xpm
/usr/X11R6/share/xfce/icons/-myICONS/FAHpenguin.png
/usr/X11R6/share/xfce/icons/-myICONS/eye_a.jpeg
/USER/ICONS/xemacs-icon48.png
[Popups]
12
[Icons]
99,99,99,99,99,99,99,99,99,99,99,99,99
[WorkSpace]
NoRepaint
Solid
[Lock]
xflock
[MenuOption]
NoDetach
[XFwmOption]
ClickToFocus
OpaqueMove
NoOpaqueResize
3
115
NoAutoraise
OpaqueActive
GradientInactive
IconsOnBottom
-microsoft-verdana-bold-r-normal-*-12-*-*-*-p-*-iso8859-1
-microsoft-verdana-medium-r-normal-*-12-*-*-*-p-*-iso8859-1
-microsoft-tahoma-bold-r-normal-*-10-*-*-*-p-*-iso8859-1
MapFocus
Trench_engine
[Screens]
8
[Tooltips]
200
[Clock]
Digital
24hrs
[Sizes]
SmallPanelIcons
MediumMenuIcons
[XColors]
Apply
[Diagnostic]
Ignore
[Layer]
6
[Commands]
xfclock
xcalc -geometry -0+52
aterm -C -fade 50 -ut -bg black -sl 15000 -fn
-*-lucidatypewriter-medium-r-*-*-15-*-*-*-*-*-iso8859-1 -fb
-*-lucidatypewriter-bold-r-*-*-15-*-*-*-*-*-iso8859-1 -geometry
105x21+22+202
aumix
galeon -g 800x625+52+110
gnome-panel
yelp
/usr/X11R6/bin/xkill
emelfm
xmms -pe
/.PandeProjects/FAH/FoldingScriptsVT
/usr/bin/gps
xemacs -debug-init -geometry 86x32+75+70
[Menu1]
Periodic Tbl
/usr/X11R6/share/xfce/icons/Equation.xpm
gperiodic
XFtree
/usr/X11R6/share/xfce/icons/FileManager.xpm
xftree
XF diff
/usr/X11R6/share/xfce/icons/AZ.xpm
xfdiff
XEarth
/USER/ICONS/xearth.png
xearth -geometry 1024x768 -ncolors 512 -term 2 -grid -rot galactic
-pos fixed,34.00,-92.00 -bigstars 25 -label -labelpos +5+2 -markerfile
/USER/xearth/xearth_locations.txt
xfMount CDROM
/usr/share/pixmaps/nautilus/CD_drive.png
xfmountdev /mnt/cdrom
xfMount floppy
/usr/X11R6/share/xfce/icons/DiskFloppy.xpm
xfmountdev /mnt/floppy
XF glob
/usr/X11R6/share/xfce/icons/FileAPP.xpm
xfglob
XF run program
/usr/X11R6/share/xfce/icons/Penguin.xpm
xfrun
XFprint
/usr/X11R6/share/xfce/icons/Printer.xpm
xfprint
XFpager
/USER/ICONS/xfpager.jpg
module xfpager
Xephem
Default icon
/usr/X11R6/bin/xephem
Xaos
Default icon
xaos
xDaliClock
/usr/X11R6/share/xfce/icons/Stoplight.xpm
/usr/X11R6/bin/xdaliclock -24 -cycle -transparent -geometry +425+25
[Menu2]
and so forth to the end of the file(a new blank line).
I have not worked out all the _specific_ conversions but it goes
something like this:
the xfce3rc file is a text file with a comment at the top, NO blank
lines and a section title enclosed in brackets. The items that follow
are on single lines and are the data for the section head. e.g.,
[ButtonLabels]
base
mon
inet
work
play
help
conf
c
Nine
Ten
[External_Icons]
...
That section [Button Labels] corresponds to the workspace names but has
no function in the xfce4rc file. So it has to be ignored for xfce4rc
but perhaps can be used to set the "Desktop:workspaces" names widget.
There are other sections like that.
The next section is [External_Icons] which provides the
/path/to/name/of/icon which is needed to get the icons for the display
on top of the panel. Unfortunatley, the order is not left to right or
right to left. The first one goes to one spot on the xfce panel but
the next item goes to somewhere else that is not adjacent to it. If I
recall, & I might not(no sleep yet), it alternates from one side of the
xfce3 switcher to the other starting at the ends.
There are many items in the xfce3rc file that can be applied to other
XFce4 settings. E.g., the info is there to set focus and raise options
as well as desired default fonts and other xfce4 options.
Extracting only the panel information is possible but it would be nice
to also be able to interface to other Settings Manager items so that
the user can get the full benefit of converting from XFce3 to XFce4
without losing the settings they are accustomed to using. Of course,
there are items that do not correspond and nothing can be done about
that. E.g.,
[Lock]
xflock
has no meaning in XFce4. There is not a choice. xflock4 handles the
choosing.(At least I think that is the way it is now. I don't use a SS
so don't know for sure...)
Here's a bit of what has to be worked out.
[Coords] are where the panel is located from the top left corner. It
does not have a direct correspondence to
<Position x="61" y="3" because the sizes of the panel are different.
The
[Sizes]
SmallPanelIcons ~roughly corresponds to "Tiny" xfce4 panel and
MediumMenuIcons ~roughly means the user wants "Small" xfce4 panel
which is a conflict. A decision is required.
[ButtonLabels] was mentioned above.
[External_Icons] was mentioned above.
[Popups] is the number of "launchers" with menus attached & is ~
groups in xfce4rc
[Icons] got me ??? Olivier? I think one has to count the number of
"99"'s ...
[WorkSpace] this could be used but has no function at this time
[Lock] this has no value at all any more(well, I do not think it
does...)
[MenuOption] this has no value at all any more
[XFwmOption] no use in xfce4rc but most, not all, of these can be
mapped to other items in Settings Mgr.
[Screens] Ah, this is the number of workspaces. No settings in xfce4rc
but has to be used in Desktops: workspaces( a switcher/pager must be
present on the panel being created )
[Tooltips] is the time delay for a tooltip; no function in XFce4, yet.
[Clock]
Digital is <XfceClock Clock_type="1"
I presume "analog" is type "2"
24hrs is Toggle_military="1"
??? would be Toggle_military="0"
but xfce4 settings Toggle_am_pm and Toggle_secs have to use the
default values.
[Sizes] needs to be used to obtain XFce4 panel size
[XColors] this has no value; meant apply theme to all aps I think
[Diagnostic] this has no value at all any more
[Layer] number has to be interpolated to Top, Normal, etc
[Commands] the commands (duh? :) for
item at left end of panel
item at right end of panel
item adjacent to item at left end of panel
item adjacent to item at right end of panel
item adjacent to item adjacent to item at left end of panel
and so forth until they meet on both sides of the switcher.
Corresponds one to one for the [ExternalIcons], ithink.
[Menu1]
first item is the "Label" xfce4rc: <Caption>Label</Caption>
Second item is the /path/to/the/icon/and/name xfce4rc: <Icon
id="-1">/path/to/the/icon/and/name</Icon>
Third item is the "command" xfce4rc: <Command term="0"
sn="0">command</Command>
and it just repeats that until the next Menu.
"Default icon" is used whenever the user has not specified custom icon
and that is ~ Icon id= -1 in xfce4rc with no "other icon" choice( <Icon
id="1"/> ).
[Menu2]
The structure is the same for all menus until the bottom of the file is
reached, signified by a new blank line.
The real meat is that something similar to a DTDSS is needed to convert
the, probably, regex found items to the format that is the xfce4rc.
That should be available somewhere; after all, something is parsing and
creating/modifying the xfce4rc XML file.
Also, if the ap is to be really useful to a new convert, it needs to be
written so that it can supply the other configuration items even if,
initially, it does not do anything but the panel.
I do not know, now, how to get that info to other settings. H! I don't
even know how to get it into xfce4rc format, yet. :)
As you can see, it will take a bit of time _especially_ for someone
like me that does not know/understand the intricacies of xfce3 and
xfce4 as well as Olivier and other core developers do.
Well, that's plenty for you to think about. :)
I'm tired and going to sleep for a while. But let me know if it still
interests you, okay?
--- Matthew Weier OPhinney <matthew-lists at weierophinney.net> wrote:
> -- Ric <fhj52ads at yahoo.com> wrote
> (on Thursday, 31 July 2003, 03:52 AM -0700):
> > Hey Botsie:
> >
> > --- Biju Chacko <biju_chacko at vsnl.net> wrote:
> > > On Wed, 30 Jul 2003 20:48:25 -0700 (PDT), Ric wrote:
> > >
> > > > I... want to automate converting my XFce 3 panel info into
> XFce4
> > > panel
> > > > info.
> > >
> > > Search the archives.
> >
> > I am having no luck finding a single program that allows me to
> 'just do
> > it' in Linux.
> > Actually I have not found any OSS program in Linux that can take
> text
> > and produce XML using any kind of transformation tag sheet/doc/DTD
> so
> > that one can have a one to one correspondence between the
> (structured)
> > text and the XML file created.
> >
> > Fortunately, the parts in xfce3rc that need transformation are
> > structured so maybe it won't be that hard to do...
>
> While I can't think of a *program* that would do it, I *DO* know that
> there are ways to do this in perl.
>
> You claim that the xfce3rc file is structured, which means you
> *should*
> be able to parse it into a complex data structure in perl, which can
> then be rewritten to XML using a number of facilities -- XML::Simple
> being likely the easiest as you should be able to just throw it the
> data structure and have the XML generated by it.
>
> I may be able to help, if you'd like.
>
> --
> Matthew Weier O'Phinney
> http://weierophinney.net/matthew/
=====
Have A Great Day!
Ric
***
Mondale knew this was gonna be a bad day when he called
Dial-a-Prayer and the taped message answered him by name.
-- Bob Hope, 1903-2003
__________________________________
Do you Yahoo!?
Yahoo! SiteBuilder - Free, easy-to-use web site design software
http://sitebuilder.yahoo.com
More information about the Xfce4-dev
mailing list