Shortcut to toggle panel autohide? [SOLVED]

Forum rules
Before you post read how to get help. Topics in this forum are automatically closed 6 months after creation.
Locked
ander111
Level 3
Level 3
Posts: 179
Joined: Sat Jul 17, 2010 5:18 am

Shortcut to toggle panel autohide? [SOLVED]

Post by ander111 »

Hi guys,

I'm using a portable PC with a very small display. I usually like to keep the panel visible, but sometimes I like to set it to auto-hide to get a bit more browser space, depending on the webpages I'm viewing... It's rather tedious having to open the panel's Properties each time I want to turn auto-hide on or off again.

Is there a way to create a shortcut to toggle the panel's auto-hide feature? Or maybe there's an actual applet you can add to the panel that does this with a click? Certainly I can't be the first person to wonder about this. Thanks, Ander
Last edited by LockBot on Wed Dec 28, 2022 7:16 am, edited 2 times in total.
Reason: Topic automatically closed 6 months after creation. New replies are no longer allowed.
yeti

Re: Shortcut to toggle panel autohide?

Post by yeti »

Greetings, Ander111
Are you looking for something even easier than right-click on the panel?
MtnDewManiac
Level 6
Level 6
Posts: 1491
Joined: Fri Feb 22, 2013 5:18 pm
Location: United States

Re: Shortcut to toggle panel autohide?

Post by MtnDewManiac »

I take it that this computer does not have a mouse (or a laptop-style "mousepad" touch device) and that you cannot, therefore, simply move a mouse cursor to the side of the screen which the panel is anchored to so that the panel will appear?

Have you asked at the XFCE web forum?

Code: Select all

http://forum.xfce.org/
Regards,
MDM
Mint 18 Xfce 4.12.

If guns kill people, then pencils misspell words, cars make people drive drunk, and spoons made Rosie O'Donnell fat.
ander111
Level 3
Level 3
Posts: 179
Joined: Sat Jul 17, 2010 5:18 am

Re: Shortcut to toggle panel autohide?

Post by ander111 »

yeti wrote:Are you looking for something even easier than right-click on the panel?
It's not just "right-click on the panel". Fortunately I'm a tech writer, so I'm used to describing all the steps that are actually necessary to do anything on a computer [smile]:

1. Take hand off of keyboard and grab mouse (which I rarely use—having, in true Linux style, learned to use the keyboard for just about everything).

2. Right-click a Panel item to see its context menu (not just any item, though; it must be one whose context menu includes the "Panel" sub-menu—some do, some don't).

3. Point to Panel; then point to and click Panel Preferences.

4. The "Panel" dialog box appears. Zero in on and click the tiny "Automatically show and hide the panel" checkbox to select or clear it.

5. Click Close.

6. Put your hand back on the keyboard and try to remember what you were doing. (Hey, I'm in my 50s.)

Now repeat all that every time you want to hide or show the Panel, depending on the webpage you happen to be trying to view on your 1024x600 mobile display.
MtnDewManiac wrote:I take it that this computer does not have a mouse (or a laptop-style "mousepad" touch device) and that you cannot, therefore, simply move a mouse cursor to the side of the screen which the panel is anchored to so that the panel will appear?
No, I do have a mouse. And yes, I understand one can restore the auto-hidden Panel by moving one's mouse pointer to it. And no, my question wasn't "Do you think I should leave auto-hide on, and have to take my hand off the keyboard and move the mouse back and forth every time I want to see anything on my Panel (much of it being of a monitoring nature—which, to be useful, must be visable at any time)?" I can see how you might've misunderstood one or more of those things, though.
MtnDewManiac wrote:Have you asked at the XFCE web forum?
Guess I will!
MtnDewManiac
Level 6
Level 6
Posts: 1491
Joined: Fri Feb 22, 2013 5:18 pm
Location: United States

Re: Shortcut to toggle panel autohide?

Post by MtnDewManiac »

I didn't think of it earlier because it doesn't, strictly speaking, do what your topic title asks for - IOW, it doesn't toggle the auto-hide function.

But if a keyboard-activated method of causing a hidden panel to display will help:

I have two panels. This only works on one of them. If you have multiple panels and wish to be able to display more then one of them, this won't work. My XFCE menu is on the top panel. Whenever I press my linux key ("Windows" key with penguin sticker from Mandrake 8.1 PowerPack Edition kit on it, lol), said menu activates... and this causes that panel to appear. Pressing the Esc(ape) key causes it - and the menu - to go back to whichever reality they inhabit when they aren't in mine. So, one key to show the panel, one (different) key to hide it.

IIRC, initially I had to press two keys together (an Alt key and F1 or somesuch) to transport the menu into my reality, but there was a way to change things so that I only had to press my linux key. Unfortunately, I do not remember the method. I believe there is a thread on this forum that describes it and that the thread might have mentioned something called a "Super L" key. Or, perhaps, it mentioned two keys, one being a Super key and the other being an L key. I'm a little foggy on all that and am not aware of either a "Super L" or a Super key (but most assuredly do have an L key) on my keyboard, so I might be falling victim to that thing that happens where, when searching my mind for a memory that is not there, my mind decides to be helpful by, well, making something up and presenting it to me as a memory that is a bit hard to recall. (BtW, I cannot really say whether or not this has truly been helpful - but it has led to some rather interesting journeys when traveling.) However, I am quite sure indeed that the actual "displaying XFCE menu shows the panel it springs forth from as Athena sprang from Zeus' forehead" part. It's just that some of the details have gone a bit off....

Regards,
MDM
Mint 18 Xfce 4.12.

If guns kill people, then pencils misspell words, cars make people drive drunk, and spoons made Rosie O'Donnell fat.
ander111
Level 3
Level 3
Posts: 179
Joined: Sat Jul 17, 2010 5:18 am

Re: Shortcut to toggle panel autohide?

Post by ander111 »

MtnDewManiac wrote:I didn't think of it earlier because it doesn't, strictly speaking, do what your topic title asks for - IOW, it doesn't toggle the auto-hide function... But if a keyboard-activated method of causing a hidden panel to display will help... Whenever I press my linux key ("Windows" key with penguin sticker from Mandrake 8.1 PowerPack Edition kit on it, lol), said menu activates... and this causes that panel to appear...
It's not exactly what I was looking for (a way of actually toggling auto-hide on/off—so, when practical, I can see said Panel at all times), but your suggestion is brilliant nonetheless. I have indeed remapped my Windows—er, XFCE menu to the "Super" key (though personally, I would've chosen a different appellation, as "Super" could imply a fondness for the Windows logo, if not the company it represents). It's good to realize I can so effortlessly show the Panel at times when it is hidden, even if I must still open its Preferences to change its normal state.
MtnDewManiac wrote:I'm a little foggy on all that and am not aware of either a "Super L" or a Super key (but most assuredly do have an L key) on my keyboard, so I might be falling victim to that thing that happens where, when searching my mind for a memory that is not there, my mind decides to be helpful by, well, making something up and presenting it to me as a memory that is a bit hard to recall...
Take heart: Mountain Dew contains more caffeine than any other soft drink (significantly more than Coke). Simply consume more of it. You're already a maniac for the stuff, so this shouldn't cause any concern among the people who know you. "He's just a maniac for the stuff," they'll say—perhaps more often, that's all. Cheers, A.
ander111
Level 3
Level 3
Posts: 179
Joined: Sat Jul 17, 2010 5:18 am

Re: Shortcut to toggle panel autohide?

Post by ander111 »

I found it! It's at the bottom of the official XFCE site's "tips" wiki (http://wiki.xfce.org/tips):
Toggle panel autohide
Short Bash script to toggle the autohide property of a panel, so you can bind for example a keyboard shortcut to quickly show and hide a panel.

Code: Select all

#!/bin/sh
 
test -z "$1" && echo missing panel id  && exit 1
test ! -z "`echo $1 | sed s/[0-9]*//g`" && echo bad panel id  && exit 1
 
CHANNEL=xfce4-panel
PANELID=$1
PROP=/panels/panel-$PANELID/autohide
 
if `xfconf-query -c $CHANNEL -p $PROP >/dev/null 2>&1`; then
    xfconf-query -c $CHANNEL -T -p $PROP
else
    xfconf-query -c $CHANNEL -n -p $PROP -t bool -s false
fi
When you run the script, you have to include the panel's ID as a parameter—so for the default panel:

Code: Select all

# [name you gave your script] 1
rahul89

Re: Shortcut to toggle panel autohide? [SOLVED]

Post by rahul89 »

I keep getting
Fail to run "panel.sh"
Failed to execute child process "/home/bob/documents/panel.sh" (Permission denied)
I have copy and pasted the script from the official website

what did you mean when you said
When you run the script, you have to include the panel's ID as a parameter—so for the default panel:
# [name you gave your script] 1
I'm a newbie to linux :)
ajgreeny
Level 7
Level 7
Posts: 1640
Joined: Mon Nov 19, 2007 3:27 pm

Re: Shortcut to toggle panel autohide? [SOLVED]

Post by ajgreeny »

I suspect that the /home/bob/documents/panel.sh file is not executable, so either run

Code: Select all

chmod +x /home/bob/documents/panel.sh
or right click on it in the file-manager and change permissions there to allow execution as a program.
Locked

Return to “Xfce”