Xfce Forum

Sub domains
 

You are not logged in.

#1 2015-07-01 20:32:14

chkur
Member
Registered: 2015-07-01
Posts: 6

Change panel plugin on hover

I want to do such thing: on mouse hover panel plugin - I want to hide this plugin and show another on its place. I put xfce4-windowck-plugin (window title) on panel, but when move mouse to window title - I want to show xfce4-taskbar-plugin. I tried to do this with 2 differrent panels - first is fixed and second with "autohide" option, but when I click on static  panel - second "autohiding" panel hides behind it and does not show any more. So I cannot solve it with 2 panels. Any ideas?

Last edited by chkur (2015-07-01 20:32:40)

Offline

#2 2015-07-01 21:27:58

chkur
Member
Registered: 2015-07-01
Posts: 6

Re: Change panel plugin on hover

I found workaround - show/hide 2 panels with hotkey. I modified script from post https://forum.xfce.org/viewtopic.php?pid=34330#p34330:

#!/bin/bash

# Wait for all panels to load
while [ "$(wmctrl -l | grep -c xfce4-panel)" -lt "3" ];
do
   sleep 0.05s
done

# Determine identifiers for toggled panels
ID=$(wmctrl -l | grep xfce4-panel | sed 3p | awk '{ print $1 }' | head -1)
ID2=$(wmctrl -l | grep xfce4-panel | sed 3p | awk '{ print $1 }' | tail -1)
# Toggle panels z-indexes
wmctrl -i -r $ID -b toggle,above
wmctrl -i -r $ID2 -b toggle,above

And assigned hotkey for it. Problem is solved.

Last edited by chkur (2015-07-01 21:29:03)

Offline

#3 2015-07-02 06:58:23

chkur
Member
Registered: 2015-07-01
Posts: 6

Re: Change panel plugin on hover

After reboot script does not work - it brings to front one panel for the first time, but does not toggle it back.

Offline

#4 2015-07-02 10:23:22

ToZ
Administrator
From: Canada
Registered: 2011-06-02
Posts: 11,494

Re: Change panel plugin on hover

Seems to me that your script will always toggle panel with $ID2 above the other regardless. Why not just toggle the above status of the one panel only?


Please remember to mark your thread [SOLVED] to make it easier for others to find
--- How To Ask For Help | FAQ | Developer Wiki  |  Community | Contribute ---

Offline

#5 2015-07-02 12:26:05

chkur
Member
Registered: 2015-07-01
Posts: 6

Re: Change panel plugin on hover

Really I use 3 panels (2 at top - which I want to toggle) and one at left. But wmctrl -l shows me 4 lines for xfce4-panel. Now, for example:

0x01600004 -1 trusty xfce4-panel
0x01600033 -1 trusty xfce4-panel
0x01600036 -1 trusty xfce4-panel
0x0160003a -1 trusty xfce4-panel

I think - yesterday panels what I needed were randomly first and last. But after restart these panels are at another positions. I dont know which 2 I have to select today. If I toggle one panel only - it toggles once only. Maybe yesterday I toggled one panel one time manually and then one panel was with above=true and another panel with above=false and I toggled them.

Offline

#6 2015-07-02 12:35:29

ToZ
Administrator
From: Canada
Registered: 2011-06-02
Posts: 11,494

Re: Change panel plugin on hover

Yes, that will be problematic.

wmctrl also has a "-G" parameter that can be added to "-l" that might help to identify the panels. If the two panels that you want to to toggle share the same geometry and this geometry is different from the other panels, then you can us the -G option and grep for the geometry values to filter them out.

Try:

wmctrl -lG | grep xfce4-panel

...to see what displays and if it might be helpful.


Please remember to mark your thread [SOLVED] to make it easier for others to find
--- How To Ask For Help | FAQ | Developer Wiki  |  Community | Contribute ---

Offline

#7 2015-07-02 12:48:20

chkur
Member
Registered: 2015-07-01
Posts: 6

Re: Change panel plugin on hover

wow, thankx - it might be helpfull. I'll try to rewrite script. But what can it be?

0x01600036 -1 -9999 -9999 48   744  trusty xfce4-panel

Offline

#8 2015-07-03 06:06:10

chkur
Member
Registered: 2015-07-01
Posts: 6

Re: Change panel plugin on hover

Last version of scripts:
1st is for bring main panel to top by default - run once (autostarts with user session)

#!/bin/bash

# Wait for all panels to load
while [ "$(wmctrl -l | grep -c xfce4-panel)" -lt "4" ];
do
   sleep 0.05s
done

# Determine identifier for main panel
ID=$(wmctrl -lG | grep '1366 25   trusty xfce4-panel' | sed 3p | awk '{ print $1 }')

# Bring main panel to top
wmctrl -i -r $ID -b add,above

2nd is for toggle panels (set hotkey for it)

#!/bin/bash

# Wait for all panels to load
while [ "$(wmctrl -l | grep -c xfce4-panel)" -lt "4" ];
do
   sleep 0.05s
done

# Determine identifiers for toggled panels
ID=$(wmctrl -lG | grep '1366 25   trusty xfce4-panel' | sed 3p | awk '{ print $1 }')
ID2=$(wmctrl -lG | grep '915  24   trusty xfce4-panel' | sed 3p | awk '{ print $1 }')

# Toggle panels z-indexes
wmctrl -i -r $ID -b toggle,above
wmctrl -i -r $ID2 -b toggle,above

Offline

#9 2015-07-03 10:35:29

ToZ
Administrator
From: Canada
Registered: 2011-06-02
Posts: 11,494

Re: Change panel plugin on hover

You probably don't need:

# Wait for all panels to load
while [ "$(wmctrl -l | grep -c xfce4-panel)" -lt "4" ];
do
   sleep 0.05s
done

...this section in your second script since all the panels will already be loaded.


Please remember to mark your thread [SOLVED] to make it easier for others to find
--- How To Ask For Help | FAQ | Developer Wiki  |  Community | Contribute ---

Offline

Registered users online in this topic: 0, guests: 1
[Bot] ClaudeBot

Board footer

Powered by FluxBB
Modified by Visman

[ Generated in 0.009 seconds, 7 queries executed - Memory usage: 564.23 KiB (Peak: 581.51 KiB) ]