LinuxQuestions.org
Register a domain and help support LQ
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 01-03-2008, 02:55 PM   #1
kryptobs2000
Member
 
Registered: Dec 2003
Distribution: Slackware
Posts: 306

Rep: Reputation: 30
.xinitrc not working?


I wanted to run some things when I start the xserver so I read putting them into the .xinitrc file would do this, but it doesn't seem to be working. I don't know if it would help but here is my .xinitrc, I've highlighted what I added to it:

Code:
#!/bin/sh

# fix broken $UID on some system...
if test "x$UID" = "x"; then
	if test -x /usr/xpg4/bin/id; then
		UID=`/usr/xpg4/bin/id -u`;
	else
		UID=`id -u`;
	fi
fi

# $XDG_CONFIG_HOME defines the base directory relative to which user specific 
# configuration files should be stored. If $XDG_CONFIG_HOME is either not set 
# or empty, a default equal to $HOME/.config should be used.
if test "x$XDG_CONFIG_HOME" = "x" ; then
  XDG_CONFIG_HOME=$HOME/.config
fi
[ -d "$XDG_CONFIG_HOME" ] || mkdir "$XDG_CONFIG_HOME"

# $XDG_CACHE_HOME defines the base directory relative to which user specific 
# non-essential data files should be stored. If $XDG_CACHE_HOME is either not 
# set or empty, a default equal to $HOME/.cache should be used.
if test "x$XDG_CACHE_HOME" = "x" ; then
  XDG_CACHE_HOME=$HOME/.cache
fi
[ -d "$XDG_CACHE_HOME" ] || mkdir "$XDG_CACHE_HOME"

# For now, start with an empty list
XRESOURCES=""

# Has to go prior to merging Xft.xrdb, as its the "Defaults" file
test -r $HOME/.Xdefaults && XRESOURCES=$HOME/.Xdefaults

BASEDIR=$XDG_CONFIG_HOME/xfce4
if test -r "$BASEDIR/Xft.xrdb"; then
  XRESOURCES="$XRESOURCES $BASEDIR/Xft.xrdb"
elif test -r "$XFCE4HOME/Xft.xrdb"; then
  mkdir -p "$BASEDIR"
  cp "$XFCE4HOME/Xft.xrdb" "$BASEDIR"/
  XRESOURCES="$XRESOURCES $BASEDIR/Xft.xrdb"
fi

# merge in X cursor settings
test -r "$BASEDIR/Xcursor.xrdb" && XRESOURCES="$XRESOURCES $BASEDIR/Xcursor.xrdb"

# ~/.Xresources contains overrides to the above
test -r "$HOME/.Xresources" && XRESOURCES="$XRESOURCES $HOME/.Xresources"

# load all X resources (adds /dev/null to avoid an empty list that would hang the process)
cat /dev/null $XRESOURCES | xrdb -nocpp -merge -

# load local modmap
test -r $HOME/.Xmodmap && xmodmap $HOME/.Xmodmap

# Launch xscreensaver (if available), but only as non-root user
test $UID -gt 0 -a -z "$VNCSESSION" && xscreensaver -no-splash &

# Use ssh-agent if installed and not already running.  Run it separately
# so it populates the environment here, so we can clean it up later.
sshagent=`which ssh-agent`
kill_sshagent=0
if test -z "$SSH_AGENT_PID" -a "$sshagent" -a "x$sshagent" != "xno"; then
	eval `$sshagent -s`
	kill_sshagent=1
fi

# Use dbus-launch if installed.
if test x"$DBUS_SESSION_BUS_ADDRESS" = x""; then
	dbuslaunch=`which dbus-launch`
	if test x"$dbuslaunch" != x"" -a x"$dbuslaunch" != x"no"; then
		eval `$dbuslaunch --sh-syntax --exit-with-session`
	fi
fi

# Run xfce4-session if installed
xfcesm=`which xfce4-session`
case "x$xfcesm" in
	x|xno*)
		;;
	*)
		$xfcesm

		if test $kill_sshagent -eq 1; then
			eval `$sshagent -k`
		fi
		exit 0
		;;
esac

nvidia-settings -l
nvclock -fF 40
xgamma -gamma 1.7
azureus

##################
# IMPORTANT NOTE #
##################

# Everything below here ONLY gets executed if you are NOT using xfce4-session
# (Xfce's session manager).  If you are using the session manager, everything
# below is handled by it, and the code below is not executed at all.  If you're
# not sure if you're using the session manager, type 'ps -e|grep xfce4-session'
# in a terminal while Xfce is running.

##################


# this is only necessary when running w/o xfce4-session
xsetroot -solid black -cursor_name watch

# or use old-fashioned startup script otherwise

xfce-mcs-manager
xfwm4 --daemon

# start up stuff in $XDG_CONFIG_HOME/autostart/, as that looks to be
# the new standard.  if that directory doesn't exist, try the old
# ~/Desktop/Autostart method.  we're not going to do any migration here.
if test -d "$XDG_CONFIG_HOME/autostart"; then
  for i in ${XDG_CONFIG_HOME}/autostart/*.desktop; do
    grep -q -E "^Hidden=true" "$i" && continue
    if grep -q -E "^OnlyShowIn=" "$i"; then
      # need to test twice, as lack of the line entirely means we still run it
      grep -E "^OnlyShowIn=" "$i" | grep -q 'XFCE;' || continue
    fi
    grep -E "^NotShowIn=" "$i" | grep -q 'XFCE;' && continue
    
    # check for TryExec
    trycmd=`grep -E "^TryExec=" "$i" | cut -d'=' -f2`
    if test "$trycmd"; then
      type "$trycmd" >/dev/null 2>&1 || continue
    fi
    
    cmd=`grep -E "^Exec=" "$i" | cut -d'=' -f2`
    if test "$cmd" && type "$cmd" >/dev/null 2>&1; then
      $cmd &
    fi
  done
elif test -d "$HOME/Desktop/Autostart"; then
  for i in `ls -1 -L ${HOME}/Desktop/Autostart/ 2>/dev/null`; do
    if test -x $HOME/Desktop/Autostart/$i; then
      $HOME/Desktop/Autostart/$i &
    fi
  done
fi

xfdesktop&
orage &

panel=`which xfce4-panel`
case "x$panel" in
	x|xno*)
		;;
	*)
		$panel
		ret=$?
		while test $ret -ne 0; do
			xmessage -center -file - -timeout 20 -title Error <<EOF
A crash occured in the panel
Please report this to the xfce4-dev@xfce.org list
or on http://bugs.xfce.org
Meanwhile the panel will be restarted
EOF
			cat >&2 <<EOF
A crash occured in the panel
Please report this to the xfce4-dev@xfce.org list
or on http://bugs.xfce.org
Meanwhile the panel will be restarted
EOF
			$panel
			ret=$?
		done
		;;
esac

if test $kill_sshagent -eq 1; then
	eval `$sshagent -k`
fi

xsetroot -bg white -fg red  -solid black -cursor_name watch
 
Old 01-04-2008, 08:20 AM   #2
Zmyrgel
Senior Member
 
Registered: Dec 2005
Location: Finland
Distribution: Slackware, CentOS, RHEL, OpenBSD
Posts: 1,006

Rep: Reputation: 37
Try adding ambersand after the azureus at least. "azureus &".

If you boot straight to [XGK]DM it won't read .xinitrc and you need to edit .Xsession file IIRC.
 
Old 01-04-2008, 10:35 AM   #3
kryptobs2000
Member
 
Registered: Dec 2003
Distribution: Slackware
Posts: 306

Original Poster
Rep: Reputation: 30
I'm not sure what [XGK]DM is, but I've also tried adding the commands to the end of my .xession and it did not work either.
 
Old 01-04-2008, 12:32 PM   #4
mrclisdue
Senior Member
 
Registered: Dec 2005
Distribution: Slackware -current, 14.1
Posts: 1,075

Rep: Reputation: 189Reputation: 189
If you use xdm as your display manager, it doesn't read .xinitrc. It will read .xsession, but, in order to do so, the appropriate lines in /etc/X11/xdm/Xsession must be uncommented to allow xdm to read .xsession.

hth,

Last edited by mrclisdue; 01-04-2008 at 12:35 PM.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
xmodmap not working in .xinitrc kmeehl Slackware 1 12-03-2004 06:14 PM
Could I .xinitrc for this.... JROCK1980 Linux - Software 5 02-17-2004 06:57 PM
xinitrc not working and mozilla fails to download AlteZza2k2 Linux - Software 5 10-05-2003 02:57 AM
.xinitrc nakkaya Linux - Software 1 04-11-2003 04:12 PM
.xinitrc mrsolo Linux - Software 5 10-30-2002 11:16 AM


All times are GMT -5. The time now is 04:53 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration