Take the 2-minute tour ×
Ask Ubuntu is a question and answer site for Ubuntu users and developers. It's 100% free, no registration required.

I'm using gnome with Xmonad as my window manager on Ubuntu 11.10. When I use a external monitor with my laptop, extending the desktop with either nvidia-settings or disper, the gnome-panels (Top bar and running applications/workspaces bar) seem to display on either monitor randomly. How can I either force them to use one monitor or change their position with a scriptable command that I can hot-key?

Here are things that don't work:

  • I can move them by right click->Properties-> Uncheck "expand" -> Alt-drag, etc. This works, but requires way too much mouse-work every time I plug in my external monitor.
  • Using gconf-editor to change any of the gnome-panel settings doesn't actually change anything: gconftool-2 --type string --set /apps/panel/toplevels/top_panel_screen0/orientation top The /monitor "1" setting also doesn't change anything

[edit] gpoo's solution is almost correct - just use dconf instead of gsettings.

dconf write /org/gnome/gnome-panel/layout/toplevels/bottom-panel/monitor 1

gsettings doesn't let me change the required keys, though it's likely I just can't understand its cryptic and undocumented syntax. All of dconf, dconf-editor, and gsettings need man pages. (gsettings's man page does nothing to explain what the terms mean.)

share|improve this question
    
If you like xmonad, you might also like xmobar, which can be forced to a particular monitor with the "-x" parameter. –  Joe Jul 28 '12 at 20:00
add comment

1 Answer

up vote 0 down vote accepted

Try gsettings or dconf. You might want to change org.gnome.gnome-panel.layout.toplevels.top-panel.monitor and org.gnome.gnome-panel.layout.toplevels.top-panel.orientation.

It would be something like:

$ gsettings set org.gnome.gnome-panel.layout.toplevels.top-panel.orientation top
$ gsettings set org.gnome.gnome-panel.layout.toplevels.top-panel.monitor 1
share|improve this answer
    
While gsettings doesn't work, dconf does: dconf write /org/gnome/gnome-panel/layout/toplevels/bottom-panel/monitor 0 moves the bottom-panel to the first monitor, and .../monitor 1 to the second. gsettings didn't work for me, since it claims these keys and dirs (or whatever "schema" are) don't exist: $ gsettings list-keys org.gnome.gnome-panel.layout object-id-list toplevel-id-list $ gsettings list-recursively org.gnome.gnome-panel.layout org.gnome.gnome-panel.layout object-id-list ['menu-bar',...] org.gnome.gnome-panel.layout toplevel-id-list ['top-panel', 'bottom-panel'] –  reasgt Aug 3 '12 at 19:34
add comment

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.