You are not logged in.

#1 2007-11-08 21:27:30

ConnorBehan
Package Maintainer (PM)
From: Long Island NY
Registered: 2007-07-05
Posts: 1,359
Website

Real-time shifting of XFCE panels?

I was trying to give my XFCE desktop a new look, when I got a really cool idea.  I could arrange the workspaces so that they are four quadrants of one big square.  Then I'd have a panel on the left and a panel on the bottom for the upper right, a panel on the bottom and a panel on the right for the upper left, a panel on top and a panel on the right for the lower left and a panel on top and a panel on the left for the lower right.  That way it would be just like the XY plane.  Know what I mean?

Basically I want to be able to shift the panels every time I change workspaces.  I know one way to do this would be to change the numbers in ~/.config/xfce4/panel/panels.xml and killall xfce4-panel and xfce4-panel.  That would have to restart both panels every time workspaces change and makes it very non-fluid.  Plus there's a system tray on one of them and some programs that are minimized to the system tray stop showing up there if you restart the panel.

Is there a way to move 1 of 2 panels in XFCE without killing and restarting both of them?  Or at the very least, could I fix the system tray so programs can still use it if it has been restarted?

I'll post screenshots if I get this working... thanks.


6EA3 F3F3 B908 2632 A9CB E931 D53A 0445 B47A 0DAB
Great things come in tar.xz packages.

Offline

#2 2007-11-08 21:32:05

iphitus
Forum Fellow
From: Melbourne, Australia
Registered: 2004-10-09
Posts: 4,927

Re: Real-time shifting of XFCE panels?

maybe use "wmctrl" or something similar to tell the WM to move it.

Offline

#3 2007-11-09 03:55:28

ConnorBehan
Package Maintainer (PM)
From: Long Island NY
Registered: 2007-07-05
Posts: 1,359
Website

Re: Real-time shifting of XFCE panels?

Thanks for this tip, I got wmctrl to move the panels alright... but there are still a few problems.  If you tell XFCE that the panels have a "fixed position" when you originally set them up... XFCE will try to move them back every time the content of the panel changes.  i.e. my clock ticks every second so when wmctrl moves it, it will move back one second later.  I had wmctrl going in a loop so it was a fight between XFCE and wmctrl... it looked pretty awful.  The panel with no changing content, however, behaved properly.

If XFCE sees the panels as being "freely movable" then dynamic panels and static panels will both obey wmctrl... but there are alot of things about freely movable panels I don't like:

1) They don't have the option of spanning the whole screen unconditionally, a full width panel gets limited to normal width when changed to freely movable.  Separators tend to push things off the edge of the screen if I put too many in, and the taskbar has a minimum width option but the system tray is not able to cut into this and thus gets pushed off the screen if I minimize pidgin or something.

2) Maximized windows go BEHIND them.  There is nothing more frustrating than maximizing firefox and having the left side of the paragraph you're trying to read become hidden.

3) The handles XFCE makes you put at one or both ends waste a bit of space but that's not a big deal.

So I guess I'm looking for one of two things.  I either need a way to make movable panels span the whole screen and constrain maximized windows (which probably requires a whole rewrite of xfce4-panel) or I need to use fixed panels and change my script so that instead of "moving" the panel, it changes the variable that XFCE associates with the "origin" of the panel.

This sounds rather complicated... I looked at the source code for xfce4-panel, but didn't really learn much.  The variable I'm trying to change is XFCE_SCREEN_POSITION which normally takes one of 12 values.  These are enumerated in /usr/include/xfce4/libxfce4panel/xfce-panel-enums.h and are written to ~/.config/xfce4/panel/panels.xml.  A few of the .c files are responsible for changing this when one uses the GUI for panel configuration.  Even if it were as simple as just changing this variable, how can I?  Do you have any idea how to change the environment of another process?

Basically when you run xfce4-panel -c, a GUI pops up and when you click on a certain place, the program does whatever commands it needs to anchor the panel somewhere else.  I want to do this exact same thing except in a bash script.  There is one really ugly option that might work, which is putting commands in my script to open the GUI, take control of the mouse briefly, click in the desired spot and close the window, all in a split second so the user might not see it.

Would you say this is the only realistic way to do this?  Or is the "elegant" solution doable by someone with only 6 months of experience writing bash scripts that never exceed 100 lines?


6EA3 F3F3 B908 2632 A9CB E931 D53A 0445 B47A 0DAB
Great things come in tar.xz packages.

Offline

#4 2007-11-12 05:22:06

ConnorBehan
Package Maintainer (PM)
From: Long Island NY
Registered: 2007-07-05
Posts: 1,359
Website

Re: Real-time shifting of XFCE panels?

I actually did it... sort of!  Here are the four pics.

http://img.photobucket.com/albums/v420/ … _scrot.png
http://img.photobucket.com/albums/v420/ … _scrot.png
http://img.photobucket.com/albums/v420/ … _scrot.png
http://img.photobucket.com/albums/v420/ … _scrot.png

I didn't realize panels could be made to show up on only one workspace.  I thought Xfce treated them as special "omni-desktop" windows because the desktop as read by wmctrl was -1.  But wmctrl -r Xfce Panel -t <DESK> will actually restrict them to one desktop.

So I just made 8 of them and distributed them across the right desktops and set Xfce to do that every time it starts up.  There are 3 problems with this right now:

1) Clipman, Notes and System Tray only allow you to have one instance running at a time.
2) It is a little memory intensive.
3) It might really confuse me and harm my productivity no matter how cool/symmetric/nerdy I think it is.

Problems 1 and 2 could be solved if I edited the source code such that the panels actually "moved" rather than existed concurrently.  Could they be solved with xfce-svn?

I never tried xfce-svn and it seems to have newer versions of not only the core packages but extras like the clipman plugin.  I should have read more about it when I was first installing Arch... instead I just followed the standard Xfce how-to in the wiki.

Would it be more likely to allow multiple instances of panel plugins, or have shell commands for changing panel origins or options for expanding movable panels and constraining maximized windows to their borders? 

If these things are easier with the svn version of Xfce, is it easy to upgrade to this?  It wants to remove all my packages and replace them with the svn ones that may work differently?  Will this force me to setup everything again, clean up configuration files and have unexpected issues?

I doubt that the developers actually expect anyone to want to customize panels this way so I think editing the source is still the only realistic way to do any better than this.  I'll just have fun with this setup for awhile and if it gets annoying, I'll backup the panels.xml file so I can hang on to it for when I'm feeling math-ish.


6EA3 F3F3 B908 2632 A9CB E931 D53A 0445 B47A 0DAB
Great things come in tar.xz packages.

Offline

#5 2007-11-13 06:21:08

ConnorBehan
Package Maintainer (PM)
From: Long Island NY
Registered: 2007-07-05
Posts: 1,359
Website

Re: Real-time shifting of XFCE panels?

I scrapped the idea because one time the panels arranged themselves in a completely different way.  I guess they aren't drawn on the screen in the same order every time, which makes it impossible for the script to determine the order in which to move them... curiously it took a few reboots before this happened.  Nevertheless its a pain to fix even if it only happens every few days.

There however, are a few ways around the other problems that I just thought of.  To restrict maximized windows so that they do not go behind movable panels, one could actually make a fixed panel in that location and leave it empty with transparency 100% with the compositor on.  But the compositor wastes even more memory and the script still might be a bit chaotic in where it places the empty panels.

To have clipman, system tray and notes apparently on all screens, I could put them on their own, movable panel and create empty space on one of my other panels that they overlap.  Then they will appear to be part of the fixed panels but they would be able to move around if I have a loop telling wmctrl to do that whenever the workspace changes.

These solutions are minor however and I still think the only way to REALLY have this thing work permanently would be to edit the source. Xfce4-panel is also buggy in that removing one panel sometimes kills the process and doesn't actually remove any panel.  For now I can just use this to impress random people by correcting the script every time... but for normal work... I like my old layout.

Sorry for talking to myself this much.


6EA3 F3F3 B908 2632 A9CB E931 D53A 0445 B47A 0DAB
Great things come in tar.xz packages.

Offline

#6 2007-11-13 06:44:47

Allan
Pacman
From: Brisbane, AU
Registered: 2007-06-09
Posts: 11,365
Website

Re: Real-time shifting of XFCE panels?

ConnorBehan wrote:

Sorry for talking to myself this much.

I usually tend to ignore mad ramblings anyway...  big_smile

Offline

#7 2008-03-01 02:32:38

ConnorBehan
Package Maintainer (PM)
From: Long Island NY
Registered: 2007-07-05
Posts: 1,359
Website

Re: Real-time shifting of XFCE panels?

Oh this actually is possible. The script I made that failed just moved panel #1 to workspace #1, panel #2 to workspace #2 etc. But sometimes they were in a different order and screwed the whole thing up. If you get wmctrl to list the open windows with the "verbose" data, it will say the position on the screen, and I used that to tell one panel from the other and they now assort properly.


6EA3 F3F3 B908 2632 A9CB E931 D53A 0445 B47A 0DAB
Great things come in tar.xz packages.

Offline

Board footer

Powered by FluxBB