Xfce Forum

Sub domains
 

You are not logged in.

#1 2010-12-29 08:19:01

zsharon
Member
Registered: 2010-12-29
Posts: 3

How do I change which screen the panel is on from the command line?

I have a laptop that I use with a second display from time to time (both at work and at home), and I need some more flexibility with the xfce panel.

When I'm at home, I have the second monitor (VGA1 henceforth) physically on the left-hand-side, but I want the panel on the main laptop screen (LVDS1 henceforth), which is on the right. Of course I can do this by opening the panel properties and setting "Select Monitor" to "2". However, when I turn off VGA1, I have no panel, since that was screen 2. Thus, I'd have to change the panel from 1 to 2, and then back again.....every time.

I have some xrandr commands set in some buttons on the panel so that it's easy to switch the screens around quickly, and I'd like to be able to change the screen that the panel is on (from 1 to 2, and back) from the command line so that the buttons I have set up can do it for me.

I've tried using this:

zsharon@Weierstrass:~$ xfce4-panel --help-all
Usage:
  xfce4-panel [OPTION...] 

Help Options:
  -h, --help               Show help options
  --help-all               Show all help options
  --help-gtk               Show GTK+ Options

GTK+ Options
  --class=CLASS            Program class as used by the window manager
  --name=NAME              Program name as used by the window manager
  --screen=SCREEN          X screen to use
  --sync                   Make X calls synchronous
  --gtk-module=MODULES     Load additional GTK+ modules
  --g-fatal-warnings       Make all warnings fatal

Application Options:
  -V, --version            Print version information and exit
  -c, --customize          Show 'Customize Panel' dialog
  -s, --save               Save the panel configuration
  -r, --restart            Restart the running instance of xfce4-panel
  -q, --quit               Log out the active session
  -x, --exit               Close all panels and end the program
  -a, --add                Show 'Add New Items' dialog
  --display=DISPLAY        X display to use

But displays can't be opened:

zsharon@Weierstrass:~$ xfce4-panel --display=1
xfce4-panel: Cannot open display: 1

and

zsharon@Weierstrass:~$ xfce4-panel --screen=X

apparently has the same result for any X. Huh?

Offline

#2 2010-12-29 20:15:14

Nick
Dev
From: ~
Registered: 2005-02-17
Posts: 1,144
Website

Re: How do I change which screen the panel is on from the command line?

Xfce4-panel 4.7 fixes this (you can set screen/monitor/output) or always keep it on the current screen. The setting can also be changes in 4.7 through xfconf-query.

Offline

#3 2010-12-30 00:40:52

zsharon
Member
Registered: 2010-12-29
Posts: 3

Re: How do I change which screen the panel is on from the command line?

Nick wrote:

Xfce4-panel 4.7 fixes this (you can set screen/monitor/output) or always keep it on the current screen. The setting can also be changes in 4.7 through xfconf-query.

Thanks.

Now I'm looking for an Ubuntu 10.10 Maverick deb/ppa/git/etc.  If anyone here knows of one, I'd appreciate a link for it, though I expect that unless I find one myself, I'll ask on an ubuntu forum.  (Or I'll end up compiling from source.)

Last edited by zsharon (2010-12-30 00:42:11)

Offline

#4 2012-02-06 09:11:16

jvdurme
Member
Registered: 2012-01-10
Posts: 6

Re: How do I change which screen the panel is on from the command line?

So does anyone know how to do this in xfce4-panel 4.8?
My screens are named LVDS and CRT1. Cannot get it to work from the command line...

EDIT: found it. For anyone who is interested:

xfconf-query -c xfce4-panel -p /panels/panel-0/output-name -s <NAME OF OUTPUT SCREEN>

EDIT: the output-name property only becomes available when you have played with panel output settings a little from the panel preferences dialog.

Last edited by jvdurme (2012-02-08 10:24:36)


Xubuntu 12.04 Alpha 2

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: 533.44 KiB (Peak: 534.28 KiB) ]