Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
Start Fluxbox a'la startxfce!
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Documentation, Tips & Tricks
View previous topic :: View next topic  
Author Message
qnx
l33t
l33t


Joined: 25 Jun 2002
Posts: 638
Location: Göteborg, Sweden

PostPosted: Fri Jan 24, 2003 6:40 pm    Post subject: Start Fluxbox a'la startxfce! Reply with quote

Ever wanted to run KDE or GNOME by default and still have a little handy WM (like Fluxbox) which you can start when your system is preforming for instance a compilation and is quite slow? Sure! Just edit ~./xinitrc every time you want to run something else then your default environment, comment out 'exec startkde', add whatever you want to run and voila!
But, what about typing startflux everytime, instand of editing ~/.xinitrc ? Check it out!
Here's what you need:
1. Place this file in /usr/share/commonbox/xinitrc
Code:
#!/bin/sh
#
# xinitrc file for Fluxbox

# Some distro needs to allow even localhost to use the display
# Uncomment this if you experience "Can't open display" when running
# programs from xfce. BEWARE this is considered as a vulnerability !
#
# xhost +$HOSTNAME
#
xsetroot -solid black -cursor_name watch

# Start-up stuff from ~/Desktop/Autostart directory, if it exists
# (as it seems to be the new standard)
if [ -d "$HOME/Desktop/Autostart" ]; then
  for i in `ls -1 ${HOME}/Desktop/Autostart/ 2>/dev/null`; do
    if [ -x $HOME/Desktop/Autostart/$i ]; then
      $HOME/Desktop/Autostart/$i &
    fi
  done
fi

# Uncomment this if you have xmodmap loading additional keycodes.
# set the XKEYS variable to the correct file

# XKEYS=/etc/X11/xinit/.Xmodmap
# if [ -f $XKEYS ]; then
#   xmodmap $XKEYS
# fi 

# Uncomment this to launch xscreensaver (if available)
# xscreensaver -no-splash &

# Here you can add the programs you want to autostart with Fluxbox.
# Don't forget to put '&' at the end of each line!!
gkrellm2 -w &
gaim &
# Finally, launch Fluxbox window manager
exec fluxbox


2. Place this one in /usr/bin/startflux (you can rename it to 'startfluxbox' or whatever you prefer...
Code:
#!/bin/sh
#
#  startflux - Script that starts Fluxbox
#
#  Copyright (C) 1999 Olivier Fourdan (fourdan@xfce.org)
#  Modified by Jacob Wodzynski (jacobw@gmx.net) 2003
#
#  This program is free software; you can redistribute it and/or modify
#  it under the terms of the GNU General Public License as published by
#  the Free Software Foundation; either version 2 of the License, or
#  (at your option) any later version.
#
#  This program is distributed in the hope that it will be useful,
#  but WITHOUT ANY WARRANTY; without even the implied warranty of
#  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
#  GNU General Public License for more details.
#
#  You should have received a copy of the GNU General Public License
#  along with this program; if not, write to the Free Software
#  Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
#

if [ ! -d $HOME/.fluxbox/ ]; then
   mkdir $HOME/.fluxbox/
fi       
if test "x$DISPLAY" = "x"
then
  echo $0: Starting X server
  if [ -x $HOME/.fluxbox/xinitrc ]; then
   exec xinit $HOME/.fluxbox/xinitrc $*
  else
   exec xinit /usr/share/commonbox/xinitrc $*
  fi 
else
  echo $0: X server already running on display $DISPLAY
  if [ -x $HOME/.fluxbox/xinitrc ]; then
   exec /bin/sh $HOME/.fluxbox/xinitrc
  else
   exec /bin/sh /usr/share/commonbox/xinitrc
  fi
fi


Now just type
Code:
startflux
and Fluxbox'll start! And you can still have your "heavy" WM in your ~/.xinitrc which will be started by default, when you type
Code:
startx
!
Hope this can be useful for some of you....

BTW, probably somebody's already created something like this, it's so simple and useful. I've must had missed it, so a created another one =)
Cheers,
Jacob
_________________
Registred Linux user #191143!
Abit NF7-S rev. 2.00 (BIOS v. 2.7)
AMD AthlonXP 2500+ (Barton)
PATA Seagate ST3120022A
SATA Seagate ST3200822AS & Silicon Image 3112 chipset
Gentoo Linux :)
Back to top
View user's profile Send private message
PARENA
Guru
Guru


Joined: 06 Jan 2003
Posts: 349

PostPosted: Fri Jan 24, 2003 7:31 pm    Post subject: Reply with quote

How about running for example KDM and select a different session? ;)
Back to top
View user's profile Send private message
S_aIN_t
Guru
Guru


Joined: 11 May 2002
Posts: 488
Location: Ottawa

PostPosted: Fri Jan 24, 2003 8:00 pm    Post subject: Reply with quote

thanks.. that is pretty good.. i would like to try that as soon as i get home. i dont user KDM because i dont see the point.. there is only one person who uses that system, me. And i dont feel like going the KDM way.
Back to top
View user's profile Send private message
qnx
l33t
l33t


Joined: 25 Jun 2002
Posts: 638
Location: Göteborg, Sweden

PostPosted: Fri Jan 24, 2003 8:27 pm    Post subject: Reply with quote

PARENA wrote:
How about running for example KDM and select a different session? ;)
Cause I have a one-user system and I don't wanna start X as soon as the comuter starts, but I login into bash. From it I could of course start kdm and then login again and stuff...but it takes TIME! So why not write a little handy script that handles it?? That's my opinion.
Cheers!
_________________
Registred Linux user #191143!
Abit NF7-S rev. 2.00 (BIOS v. 2.7)
AMD AthlonXP 2500+ (Barton)
PATA Seagate ST3120022A
SATA Seagate ST3200822AS & Silicon Image 3112 chipset
Gentoo Linux :)
Back to top
View user's profile Send private message
PARENA
Guru
Guru


Joined: 06 Jan 2003
Posts: 349

PostPosted: Sat Jan 25, 2003 12:17 am    Post subject: Reply with quote

Ah yes, I see... I always use KDM here, I keep forgetting lots of people don't (or GDM/XDM, whatever). :)
Back to top
View user's profile Send private message
kerframil
l33t
l33t


Joined: 19 Apr 2002
Posts: 712

PostPosted: Mon Feb 03, 2003 1:42 pm    Post subject: Reply with quote

xwmm and wmselect are elegant ways of handling one's multi-wm requirements also (there are probably more). No ebuilds are available presently however.
Back to top
View user's profile Send private message
krunk
Guru
Guru


Joined: 27 Jul 2003
Posts: 316

PostPosted: Sun Oct 05, 2003 5:24 am    Post subject: Reply with quote

you could use gdm and just do something like: CTRL+ALT+F4

:wink:
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Documentation, Tips & Tricks All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum