Difference between revisions of "SLiM Configuration"

no edit summary
imported>Verityproductions
imported>Verityproductions
(One intermediate revision by the same user not shown)
Line 28: Line 28:




For example, if you wish to edit the file using Geany (provided with the Openbox flavour) then enter:
For example, if you wish to edit the file using ''Geany'' (provided with the Openbox flavour) then enter:


  gksu geany /etc/slim.conf
  gksu geany /etc/slim.conf




Otherwise, if you wish to edit the file using Gedit (provided with the XFCE flavour) then enter:
Otherwise, if you wish to edit the file using ''Gedit'' (provided with the XFCE flavour) then enter:


  sudo gedit /etc/slim.conf
  sudo gedit /etc/slim.conf
Line 69: Line 69:
==Open the X-Windows Initialisation File==
==Open the X-Windows Initialisation File==


The .xinitrc is responsible for actually starting your installed desktop environment(s). In essence, the .xinitrc file will take the name of your chosen (or only) desktop environment from SLiM, and then use that to determine which command to use to actually start it. You will need to first open your terminal in order to edit the '''X-Windows initialisation file'''. The syntax of the command to do this is:
{{tip|The ''.xinitrc'' file is already owned by you, so there is no need to use the 'sudo' or 'gksu' commands to edit it.}}
 
 
The .xinitrc is responsible for actually starting your installed desktop environment(s). You will need to first open your terminal in order to edit the '''X-Windows initialisation file'''. The syntax of the command to do this is:


  sudo [text editor] ~/.xinitrc
  sudo [text editor] ~/.xinitrc




'''Don't forget the dot'''. For example, if you wish to edit the file within the terminal using nano, then enter:
'''Don't forget the dot'''. For example, if you wish to edit the file using ''Geany'', then enter:
 
geany ~/.xinitrc
 
 
Otherwise you could use the ''Gedit'' text editor instead, by entering the command:
 
gedit ~/.xinitrc
 
 
==Ensure the X-Windows Initialisation File Runs Installed Environments==
 
{{warning|SLiM no longer seems to support a default session. It will therefore be necessary to select what desktop environment or window manager you wish to use by first pressing the '''<F1>''' key, prior to entering your username and password.}}
 
 
Once the .xinitrc configuration file has been opened, it will be necessary to ensure that the following line is present <u>at the very end of the configuration file</u>:


  sudo nano ~/.xinitrc
  exec $1




Otherwise you could use the ''gedit'' text editor instead, by entering the command:
'''Users who had a previous version of SLiM installed''' must completely replace both the previous '''case "$1"''' and '''DEFAULTSESSION=''' commands listed below with the '''exec $1''' command. For example, '''users who installed Manjaro Openbox 0.8.7.1 or earlier''' should first find the following section:


  sudo gedit ~/.xinitrc
 
  DEFAULTSESSION=openbox-session
case "$1" in
    openbox) exec openbox-session ;;
      xfce) exec xfce4-session ;;
      gnome3) exec gnome-session ;;
      kde) exec startkde ;;
      cinnamon) exec gnome-session-cinnamon ;;
      razor-qt) exec razor-session ;;
      lxde) exec lxsession ;;
      mate) exec mate-session ;;
      *) exec $DEFAULTSESSION ;;
esac




==Add Desktop Environments to the X-Windows Initialisation File==
And make the necessary amendment so that it now looks like this:


Again, the purpose of editing this file is to:
exec $1


* list the name(s) (or labels) of your installed desktop environment(s) from the SLiM configuration file, and
* match those name(s) with the command(s) necessary to actually start the desktop environment(s)


To clarify for newer users, the entire ''.xinitrc'' file should now look like this:


The key point to keep in mind is that the name(s) of the desktop(s) listed in the SLiM configuration file must be matched with those listed in the X-Windows Initialisation file. As such, it is therefore '''<u>vitally important</u>''' that the name of any given desktop environment is listed '''EXACTLY''' the same way in both files. This includes the use of captial and lower-case letters. Should there by any difference at all, then there will not be a match, and your chosen desktop environment will not be started. The names and commands themselves must be added after the '''DEFAULTSESSION=''' command. All the names used in the SLiM configuration file above have been listed exactly the same way here, and have been '''<font color="green">colured in green</font color>''' for illustrative purposes.


  #!/bin/sh
  #!/bin/sh
Line 101: Line 130:
  # Executed by startx (run your window manager from here)
  # Executed by startx (run your window manager from here)
  #
  #
## Ensure that the D-Bus Communication System is running properly to fix
## File management, authentication, and other essential system processes
if which dbus-launch >/dev/null && test -z "$DBUS_SESSION_BUS_ADDRESS"; then
    eval "$(dbus-launch --sh-syntax --exit-with-session)"
fi
## Ensure that GTK themes are applied uniformly in the Desktop Environment
   
   
  export GTK2_RC_FILES="$HOME/.gtkrc-2.0"
  export GTK2_RC_FILES="$HOME/.gtkrc-2.0"
   
   
'''DEFAULTSESSION=xfce4-session'''
   
   
  case "$1" in
  ## Where the default Home folders have not already been created, generate them
      '''<font color="green">xfce</font color>''') exec xfce4-session ;;
      '''<font color="green">gnome3</font color>''') exec gnome-session ;;
if [ -x /usr/bin/xdg-user-dirs-update ]; then
      '''<font color="green">kde</font color>''') exec startkde ;;
    /usr/bin/xdg-user-dirs-update
      '''<font color="green">cinnamon</font color>''') exec gnome-session-cinnamon ;;
fi
      '''<font color="green">razor-qt</font color>''') exec razor-session ;;
   
      '''<font color="green">openbox</font color>''') exec openbox-session ;;
## Ensure that obmenu-generator (a pipe menu) is set to the user.
      '''<font color="green">lxde</font color>''') exec lxsession ;;
## Needs only to be run once, so last sed command hashes the sed
      '''<font color="green">mate</font color>''') exec mate-session ;;
## commands!
      *) exec $DEFAULTSESSION ;;
  esac
  sed 's/_user_/'$(whoami)'/' ~/.config/obmenu-generator/schema.pl -i
 
sed 's/_user_/'$(whoami)'/' ~/.config/obmenu-generator/config.pl -i
 
The '''default session''' has been set to xfce4 in this instance as the author's Manjaro installation came with that desktop environment pre-installed. Yours may be different, and you are entirely free to change it if you wish. Note that each line starting with green text:
 
exec $1
'''1.''' starts with the '''<font color="green">''name'' of the desktop environment</font color>'''
 
'''2.''' uses the command ''exec'' which means ''execute'' (i.e. start), and
 
'''3.''' ends with the actual ''command'' necessary to start a desktop environment appropriate to the name
 
 
The exception is the last line which begins with an asterisk ('*' - a wildcard). This is to ensure that if a match is not found, then the default session will be started instead - which in this instance, is xfce4. Again, if the name of a desktop environment listed in this file does not exactly match a name passed to it by the SLiM configuration file, then the actual command to start that desktop cannot be executed.
 
If you wish, you are free to use the entire example provided in your own .xinitrc file, even if you do not have all of these desktop environments installed. Doing so will not cause any problems, and can make life much easier if you decide to install any new desktops at a future point (i.e. it will only be necessary to edit the SLiM configuration file). '''Otherwise you may just delete the lines for any desktop environments that you do not have installed'''.
 
 
Once your amendments have been completed, save your changes and close the configuration file by:


* '''nano''': Press CTRL and 'x' to exit, 'y' to save, and <enter> to finish, or
* '''gedit''': Select the 'save' option and then close the window.




Now reboot the system for the changes to take effect.
Once satisfied that the ''exec $1'' command is present and/or has replaced the old ''case "$1'' and ''DEFAULTSESSION='' commands, save and close the file. Now reboot the system for the changes to take effect.




Line 147: Line 170:




{{tip|The desktop environments shown will be listed in both the order and manner they were listed in the SLiM configuration file.}}
{{Note|Again, there is no longer a 'default session', so you will have to manually pick the installed desktop you wish. This includes even where only Openbox has been installed, as it is possible to use this window manager with the KDE desktop environment.}}




Where two or more desktop environments have be installed - and consequently enabled by editing the above files - then they can be cycled and selected by pressing the '''F1''' key on the SLiM login screen.
Where two or more desktop environments have be installed (or at least just Openbox), then they can be cycled and selected by pressing the '''F1''' key on the SLiM login screen.
<br clear="all" />
<br clear="all" />