Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

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

2 Answers 2

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

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.