Super User is a question and answer site for computer enthusiasts and power users. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I've set my panel to autohide. I can make it reappear by moving my pointer to the bottom of the screen, but, I'd also like to assign a shortcut key to do the same thing. Is there any way to do that?

share|improve this question
up vote 2 down vote accepted

This should do the trick.

Long story short:

1- write a short script (yourtogglescript.sh) that toggle the hide status in gconf:

#!/bin/bash
#find the current state of the panels
state=`gconftool-2 --get "/apps/panel/toplevels/top_panel_screen0/auto_hide"`
#if autohide on, turn it off
if [ $state = "true" ]; then
gconftool-2 --set "/apps/panel/toplevels/top_panel_screen0/unhide_delay" --type integer "0"
gconftool-2 --set "/apps/panel/toplevels/top_panel_screen0/auto_hide" --type bool "false"
gconftool-2 --set "/apps/panel/toplevels/bottom_panel_screen0/unhide_delay" --type integer "0"
gconftool-2 --set "/apps/panel/toplevels/bottom_panel_screen0/auto_hide" --type bool "false"
fi
#if autohide off, turn it on
if [ $state = "false" ]; then
gconftool-2 --set "/apps/panel/toplevels/top_panel_screen0/unhide_delay" --type integer "100000"
gconftool-2 --set "/apps/panel/toplevels/top_panel_screen0/auto_hide" --type bool "true"
gconftool-2 --set "/apps/panel/toplevels/bottom_panel_screen0/unhide_delay" --type integer "100000"
gconftool-2 --set "/apps/panel/toplevels/bottom_panel_screen0/auto_hide" --type bool "true"
fi

2- Make your script executable:

chmod +x yourtogglescript.sh

3- create a gnome keyboard shortcut with System -> Preferences -> Keyboard shortcuts using the following command:

/path/to/yourtogglescript.sh

Alternatively you can put yourtogglescript.sh in the PATH (~/bin for example) and simply use

yourtogglescript.sh

as your keyboard shortcut command

(you might want to adjust the delays to fit your usage)

share|improve this answer
    
Awesome, thanks for this :) – invert Oct 15 '09 at 7:45

I've changed the script to work with all panels, including any extra panel created:

#!/bin/bash

panelList=$(gconftool-2 --all-dirs "/apps/panel/toplevels")

for panel in $panelList
do
    state=$(gconftool-2 --get "$panel/auto_hide")
    if [ $state = "true" ]; then
        gconftool-2 --set "$panel/unhide_delay" --type integer "0"
        gconftool-2 --set "$panel/auto_hide" --type bool "false"
    else
        gconftool-2 --set "$panel/unhide_delay" --type integer "100000"
        gconftool-2 --set "$panel/auto_hide" --type bool "true"
    fi
done
share|improve this answer

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .