Xfce Forum

Sub domains
 

You are not logged in.

#1 2022-01-19 11:56:03

D.dave
Member
Registered: 2019-12-06
Posts: 58

There is a way to have/show panel only on first workspace?

Hi,

I have two workspaces and one panel, and I cannot figure out if there is a way to show such panel only on the first workspace; this method is only available in the dual monitor setup (the panel will show the option to choose on which monitor will reside).

Thank you.

Offline

#2 2022-01-19 14:06:02

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

Re: There is a way to have/show panel only on first workspace?

Not exactly what you are requesting (don't believe that's currently possible), but you could script something that will monitor which workspace you are on and it if is not a pre-specified one, then hide the panel using the built-in "hide panel" functionality - and if it is on the pre-defined workspace, then show it again.

Here is such a script that might work:

#!/bin/bash

WS=1			# which workspace to show panel on
SLEEP="1s"		# how long to sleep inbetween checks
PANEL=1			# which panel to affect

# make sure that only one instance of this script is running per user
lockfile=/tmp/.wp.$USER.lockfile
if ( set -o noclobber; echo "locked" > "$lockfile") 2> /dev/null; then
   trap 'rm -f "$lockfile"; exit $?' INT TERM EXIT
   echo "wp_DEBUG: Locking succeeded" >&2

   CURRENT_WORKSPACE=$(($(wmctrl -d | grep \* | cut -d' ' -f1)+1))

   while true
   do
      sleep $SLEEP

      NEW_WORKSPACE=$(($(wmctrl -d | grep \* | cut -d' ' -f1)+1))
      if [ $CURRENT_WORKSPACE -ne $NEW_WORKSPACE ]; then
         if [ $NEW_WORKSPACE -ne $WS ]; then
            # hide panel
            xfconf-query -c xfce4-panel -p /panels/panel-$PANEL/autohide-behavior -s 2
         else
            # show panel
            xfconf-query -c xfce4-panel -p /panels/panel-$PANEL/autohide-behavior -s 0
         fi
         CURRENT_WORKSPACE=$(($(wmctrl -d | grep \* | cut -d' ' -f1)+1))
      fi
   done			

# can't create lockfile - notify user and quit
else

   echo "wpDEBUG: Lock failed, check for existing process and/or lock file and delete - exiting." >&2
   exit 1
fi			

exit 0

Change the first three parameters:

  • WS - the workspace number that you want the panel to show on (default is 1)

  • SLEEP - the time to sleep between checks (default is 1 second) - lower to make the script more responsive

  • PANEL - the panel number to make the changes to (default is 1)

...and make the script executable. Run it manually in a terminal window to test it out and see if will suffice.


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

#3 2022-01-20 10:42:01

D.dave
Member
Registered: 2019-12-06
Posts: 58

Re: There is a way to have/show panel only on first workspace?

Hi ToZ, many thanks for your effort!

However, this script doesn't do the job, because I have already the Panel set to auto hide (but by transparency as shown in the following screenshot): it'll appears when I move the mouse on it, also by using your script.

Screenshot-2022-01-20-11-36-22.png


Peek-2022-01-20-11-38.gif

(I've used the application "Peek" to record this clip, which doesn't work very well: the animation of the panel, in reality is smooth)

Offline

#4 2022-01-20 11:58:45

D.dave
Member
Registered: 2019-12-06
Posts: 58

Re: There is a way to have/show panel only on first workspace?

After trying this script, I no longer see tooltips for the icons placed in the panel, like, eg, battery  and wireless percentage.. I tried to reset the panel by xfce4-panel -r as well by a reboot.

2022-01-20-12-55.png

Why? If I create a new panel on the Desktop, on such new panel, the tootips are shown: are no longer displayed on Panel 1.

Last edited by D.dave (2022-01-20 12:01:24)

Offline

#5 2022-01-20 12:59:30

D.dave
Member
Registered: 2019-12-06
Posts: 58

Re: There is a way to have/show panel only on first workspace?

Tooltips aren't gone: now they are displayed under the panel:

tooltips.png

EDIT: I found a solution here:

https://bugzilla.xfce.org/show_bug.cgi?id=14967

I had to set "Don't reserve space on borders".
Strange: I didn't had this option enabled, before.

Last edited by D.dave (2022-01-20 13:08:37)

Offline

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

Board footer

Powered by FluxBB
Modified by Visman

[ Generated in 0.013 seconds, 7 queries executed - Memory usage: 535.88 KiB (Peak: 536.73 KiB) ]