Forums

Skip to content

Advanced search
  • Quick links
    • Unanswered topics
    • Active topics
    • Search
  • FAQ
  • Login
  • Register
  • Board index Assistance Desktop Environments
  • Search

How to pass args to startxfce4?

Problems with GUI applications? Questions about X, KDE, Gnome, Fluxbox, etc.? Come on in. NOTE: For multimedia, go up one forum
Post Reply
Advanced search
7 posts • Page 1 of 1
Author
Message
npc
n00b
n00b
Posts: 32
Joined: Sat Oct 22, 2005 3:46 am

How to pass args to startxfce4?

  • Quote

Post by npc » Thu Mar 29, 2007 4:14 am

I'm using slim as a session manager and it reads ~/.xinitrc.
I've set 3 different server layouts, tv-out only, lcd only and dual-head lcd+tv and I'd like to choose between them by hitting F1 at SLiM's login screen. But, to do so, i need to add something like "-layout some_layout" to startxfce4-containing lines inside ~/.xinitrc.
Thus, it would look something like this:

Code: Select all

DEFAULT_SESSION=startxfce4

case $1 in
xfce4)
        exec startxfce4 -- -layout lcd-only
        ;;
xfce4-tv)
        exec startxfce4 -- -layout tv-only
        ;;
xfce4-tv-lfp)
        exec startxfce4 -- -layout tv-lcd
        ;;
*)
        exec $DEFAULT_SESSION
        ;;
esac
Does anybody know if it's possible to pass such args to startxfce4 as we do to startx?

Thanks in advance.
Tiburcio da Silva
Top
papal_authority
Veteran
Veteran
User avatar
Posts: 1823
Joined: Wed Mar 31, 2004 4:07 am
Location: Canada

  • Quote

Post by papal_authority » Fri Mar 30, 2007 4:32 am

Isn't startxfce4 just a script? It used to be at any rate, if it is can you edit it to accept the parameters?
The free market gave me gonorrhea.
Top
desultory
Bodhisattva
Bodhisattva
User avatar
Posts: 9410
Joined: Fri Nov 04, 2005 6:07 pm

  • Quote

Post by desultory » Fri Mar 30, 2007 7:39 am

There should be no need to edit startxfce4, simply invoke it with client flags prior to and server flags following a double hyphen and the script should handle the flags appropriately.
Top
npc
n00b
n00b
Posts: 32
Joined: Sat Oct 22, 2005 3:46 am

  • Quote

Post by npc » Sat Mar 31, 2007 10:27 am

All i've got is a server flag, the -layout one, i think. :)
Should it be then "startxfce4 <nothing> -layout layoutname --" ?

I tried "startxfce -layout layoutname --" and it retuned an error, without the "--" it startups, but ignores the -layout arg.

Thanks.
Tiburcio da Silva
Top
desultory
Bodhisattva
Bodhisattva
User avatar
Posts: 9410
Joined: Fri Nov 04, 2005 6:07 pm

  • Quote

Post by desultory » Sat Mar 31, 2007 10:42 pm

Code: Select all

startxfce4 -- -layout $layout
Top
npc
n00b
n00b
Posts: 32
Joined: Sat Oct 22, 2005 3:46 am

  • Quote

Post by npc » Sun Apr 01, 2007 1:59 pm

desultory wrote:

Code: Select all

startxfce4 -- -layout $layout
It doesnt work. It returns:

Fatal error:
Unrecognized option: --

Thanks.
Tiburcio da Silva
Top
npc
n00b
n00b
Posts: 32
Joined: Sat Oct 22, 2005 3:46 am

  • Quote

Post by npc » Sun Apr 01, 2007 3:29 pm

Found a solution! Partial at least.

I was hacking around the startxfce4 script, and i've found this $SERVERRC variable... hum...
So i tried the following from the console:
SERVERRC="-layout lfp-tv $SERVERRC" startxfce4

And guess what? It works! :D Xorg sees my other layout and loads it accordingly.

So, the .xinitrc, to allow slim to load xfce4 using one of the layout options passed by the %session variable.

Code: Select all

# the following variable defines the session which is started if the user
# doesn't explicitely select a session
DEFAULT_SESSION='startxfce4'

case $1 in
xfce4)
        export SERVERRC="-layout lfp $SERVERRC"
        ;;
xfce4-tv)
        export SERVERRC="-layout lfp-tv $SERVERRC"
        ;;
xfce4-vga)
        export SERVERRC="-layout lfp-vga $SERVERRC"
        ;;
*)
        exec $DEFAULT_SESSION
        ;;
esac
exec $DEFAULT_SESSION
And guess what? It DOESN'T work. Xfce loads fine, but xorg seems not to care about the $SERVERRC variable set on .xinitrc, it only loads the default serverlayout. On a term, echo $SERVERRC returns the exact value set in .xinitrc.
What the heck is going on???

Thanks again.
Tiburcio da Silva
Top
Post Reply

7 posts • Page 1 of 1

Return to “Desktop Environments”

Jump to
  • Assistance
  • ↳   News & Announcements
  • ↳   Frequently Asked Questions
  • ↳   Installing Gentoo
  • ↳   Multimedia
  • ↳   Desktop Environments
  • ↳   Networking & Security
  • ↳   Kernel & Hardware
  • ↳   Portage & Programming
  • ↳   Gamers & Players
  • ↳   Other Things Gentoo
  • ↳   Unsupported Software
  • Discussion & Documentation
  • ↳   Documentation, Tips & Tricks
  • ↳   Gentoo Chat
  • ↳   Gentoo Forums Feedback
  • ↳   Duplicate Threads
  • International Gentoo Users
  • ↳   中文 (Chinese)
  • ↳   Dutch
  • ↳   Finnish
  • ↳   French
  • ↳   Deutsches Forum (German)
  • ↳   Diskussionsforum
  • ↳   Deutsche Dokumentation
  • ↳   Greek
  • ↳   Forum italiano (Italian)
  • ↳   Forum di discussione italiano
  • ↳   Risorse italiane (documentazione e tools)
  • ↳   Polskie forum (Polish)
  • ↳   Instalacja i sprzęt
  • ↳   Polish OTW
  • ↳   Portuguese
  • ↳   Documentação, Ferramentas e Dicas
  • ↳   Russian
  • ↳   Scandinavian
  • ↳   Spanish
  • ↳   Other Languages
  • Architectures & Platforms
  • ↳   Gentoo on ARM
  • ↳   Gentoo on PPC
  • ↳   Gentoo on Sparc
  • ↳   Gentoo on Alternative Architectures
  • ↳   Gentoo on AMD64
  • ↳   Gentoo for Mac OS X (Portage for Mac OS X)
  • Board index
  • All times are UTC
  • Delete cookies

© 2001–2026 Gentoo Foundation, Inc.

Powered by phpBB® Forum Software © phpBB Limited

Privacy Policy

 

 

magic