Manjaro Difference between pages "Manjaro-tools" and "SLiM Configuration"

Difference between pages "Manjaro-tools" and "SLiM Configuration"

From Manjaro
(Difference between pages)
imported>Dalto
m (Updated link)
 
imported>Verityproductions
 
Line 1: Line 1:
=Overview=


__TOC__
{{note|It will be necessary to manually edit the SLiM configuration file and the X-Windows initialisation file whenever a new desktop is added or an old one is removed.}}


Once SLiM has been '''[[Install_Display_Managers#SLiM|installed and enabled]]''', it will be necessary to manually edit both the ''SLiM configuration file'', as well as the ''X-Windows initialisation file'', in order to actually start your installed desktop environment(s). '''If these files are not edited - or not edited properly - then it is likely that you will not be able to proceed any further than the login screen itself.'''


= Introduction =


''manjaro-tools'' consists of a lot of different tools aimed at Manjaro developers. It is splitted into 3 different packages:
=Editing the SLiM Configuration File=
* ''manjaro-tools-base'' contains basic tools, different chroot tools, and ''buildset''
* ''manjaro-tools-pkg'' contains small helper tools, ''buildpkg'', and ''buildtree''
* ''manjaro-tools-iso'' contains small helper tools and ''buildiso''


The purpose of editing this file is to add the name(s) of your installed desktop environment(s). SLiM will then pass these name(s) to the X-Windows initialisation file (.xinitrc), which in turn will actually start your desired desktop environment(s).


All of these ''manjaro-tools'' packages are replacements for '''devtools''' and '''manjaroiso'''.


A detailed user manual is available at [https://gitlab.manjaro.org/tools/development-tools/manjaro-tools gitlab].
==Open slim.conf==


= Configuration =
You will need to first open your terminal in order to edit the '''SLiM configuration file'''. The syntax of the command to do this is:


manjaro-tools can be configured by copying the folder ''/etc/manjaro-tools'' to your home in ''~/.config'' folder and then edit the file {{ic|''./config/manjaro-tools/manjaro-tools.conf''}}
sudo [text editor] /etc/slim.conf


= Files =


These are the new names for renamed scripts.
For example, if you wish to edit the file within the terminal using nano (a standard terminal-based text editor) then enter:


*    mkmanjaroroot --> mkchroot
sudo nano /etc/slim.conf
*    manjarobuild --> buildpkg
*    mkset --> buildset
*    pacstrap --> basestrap
*    genfstab --> fstabgen
*    arch-chroot --> manjaro-chroot




= buildset =
Otherwise - if you have installed the full version of Manjaro (i.e. not the NET-Edition) - you may find it easier to use the pre-installed ''gedit'' text editor instead. This will open the configuration file up as a document, making it easier to read and edit. To use gedit instead, the command is:


buildset is used to create build lists. Build lists can be defined in {{ic|/etc/manjaro-tools/sets/<buildlistname>.set}}
sudo gedit /etc/slim.conf


The help looks like the following:


$ buildset -h
==Add Desktop Environment Names to slim.conf==
Usage: buildset [options]
    -c <name>  Create set
    -r <name>  Remove set
    -s <name>  Show set
    -i          Iso mode
    -q          Query sets
    -h          This help


{{Note|The set name should be different from a directory name in pkgbuilds dir. Anything else should work, eg adding a date to the name.}}
Once the SLiM configuration file has been opened, it will be necessary to add the name(s) of your installed desktop(s) in order to:


= buildpkg =
* display the name(s) of your desktop(s) on the login screen - which is helpful if you want to know which one you are switching to, and
* to tell the .xinitrc file which desktop it is to start


buildpkg is used to build a particular package or a set. In the following chapter all functions of buildpkg get explained.  
This is undertaken in the '''# Available Sessions''' section, located towards the middle of the file. In the example below, all the available desktops have been added. The text itself has been '''<font color="green">colured in green</font color>''' for illustrative purposes.


If you want a detailed example how to use buildpkg to build packages for a local repository, please look [https://wiki.manjaro.org/index.php?title=Buildiso_with_AUR_packages:_Using_buildpkg here].
'''# Available sessions (first one is the default).'''
# The current chosen session name is replaced in the login_cmd
# above, so your login command can handle different sessions.
# see the xinitrc.sample file shipped with slim sources
'''<font color="green">sessions            xfce,gnome3,kde,cinnamon,razor-qt,openbox</font color>'''




The help looks like the following:
As illustrated, if two or more desktops are listed, they must be seperated with a comma (''','''). In addition, as stated, the first desktop listed will be the default. This means that if you do not choose which desktop you want on the login screen, the name of the default one will be automatically sent to the .xinitrc file. If you have also listed a name for one or more desktops that have not actually been installed, the default one will also be sent instead.


Usage: buildpkg [options]
Once your amendments have been completed, save your changes and close the configuration file by:
    -a <arch>          Arch [default: x86_64]
    -b <branch>        Branch [default: stable]
    -c                Recreate chroot
    -h                This help
    -i <pkg>          Install a package into the working copy of the chroot
    -n                Install and run namcap check
    -p <pkg>          Build list or pkg [default: default]
    -q                Query settings and pretend build
    -r <dir>          Chroots directory
                      [default: /var/lib/manjaro-tools/buildpkg]
    -s                Sign packages
    -w                Clean up cache and sources


To build a single package, go into the directory which is one above the package build directory (which contains the PKGBUILD), and run it as:
* '''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.


buildpkg -p <package-name>


To build a set the name of the set can be used. The current sets can be queried with the {{ic|-q}} option.
=Editing the X-Windows Initialisation File=


= buildtree =
The .xinitrc is responsible for actually starting your installed desktop environment(s). In essence, the .xinitrc will take the name of your chosen (or only) desktop environment from SLiM, and then use it to determine which command to use in order to actually start it.


buildtree is a little tools to sync arch abs and manjaro packages git repos.


The arguments are:
==Open .xinitrc==


$ buildtree -h
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:
Usage: buildtree [options]
    -s            Sync manjaro tree
    -a            Sync arch abs
    -c            Clean package tree
    -q            Query settings
    -h            This help[/code]


To sync Arch and Manjaro trees:
sudo [text editor] ~/.xinitrc


buildtree -as


'''Don't forget the dot'''. For example, if you wish to edit the file within the terminal using nano, then enter:


= buildiso =
sudo nano ~/.xinitrc


buildiso is used to build a particular ISO or a set of ISOs. All functions of buildiso will be explained in the following chapters.


If you want a detailed guide how to use buildiso to build your own Manjaro ISOs from scatch, please look [https://wiki.manjaro.org/index.php?title=Build_Manjaro_ISOs_with_buildiso here].
Otherwise you could use the ''gedit'' text editor instead, by entering the command:


sudo gedit ~/.xinitrc


== Overview ==


The help looks like the following for x86_64:
==Add Desktop Environment Names and Commands to .xinitrc==


$ buildiso -h
Again, the purpose of editing this file is to:
Usage: buildiso [options]
    -p <profile>      Buildset or profile [default: default]
    -a <arch>          Arch [default: x86_64]
    -b <branch>        Branch [default: stable]
    -r <dir>          Chroots directory
                        [default: /var/lib/manjaro-tools/buildiso]
    -c                Disable clean work dir
    -x                Clean xorg cache
    -l                Clean lng cache
    -i                Build images only
    -s                Generate iso only
                        Requires pre built images (-i)
    -v                Verbose output, show profies detail (-q)
    -q                Query settings and pretend build
    -h                This help


== Query Building ==
* 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 query build an ISO ('''-q''' option), for example the xfce-openbox-openrc profile, the following command can be used:
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.


<pre>
The names and commands themselves are added after the '''DEFAULTSESSION=''' command. In the example below, notice that each desktop name is followed by the appropriate command to actually start a desktop environment (e.g. the name 'kde' is followed by the command 'startkde'). All the names used in the SLiM configuration file have been listed exactly the same way here, and have been '''<font color="green">colured in green</font color>''' for illustrative purposes.
~ >>> buildiso -p xfce -qv                                                         
[sudo] password for fh:
==> manjaro-tools
  -> version: 0.15.9
  -> config: ~/.config/manjaro-tools/manjaro-tools.conf
==> PROFILE:
  -> build_lists: community|default|manjaro|sonar|v17-release
  -> build_list_iso: xfce
  -> is_build_list: false
==> OPTIONS:
  -> arch: x86_64
  -> branch: unstable
  -> kernel: linux419
==> ARGS:
  -> clean_first: true
  -> images_only: false
  -> iso_only: false
  -> persist: false
==> DIST SETTINGS:
  -> dist_name: Manjaro
  -> dist_release: 18.0
  -> dist_codename: Illyria
==> ISO INFO:
  -> iso_label: MJRO180
  -> iso_compression: xz
==> BUILD QUEUE:
--> Profile: [xfce]
  -> iso_file: manjaro-xfce-18.0-unstable-minimal-x86_64.iso
  -> autologin: true
  -> nonfree_mhwd: true
  -> multilib: true
  -> extra: false
  -> netinstall: false
  -> chrootcfg: false
  -> geoip: true
  -> efi_boot_loader: grub
  -> hostname: manjaro
  -> username: manjaro
  -> password: manjaro
  -> login_shell: /bin/bash
  -> addgroups: lp,network,power,sys,wheel
  -> enable_systemd: avahi-daemon bluetooth cronie ModemManager NetworkManager org.cups.cupsd tlp tlp-sleep ufw lightdm
  -> enable_systemd_live: manjaro-live mhwd-live pacman-init mirrors-live
  -> disable_systemd: pacman-init
</pre>


== Building ==
  '''DEFAULTSESSION=xfce4-session'''
 
To actually build the ISO:
 
  $ buildiso -p xfce -b stable
 
== Building with predownloaded Xorg packages ==
 
To build an ISO while retaining the previously downloaded cache of Xorg packages, the '''-x''' option can be used:
 
$ buildiso -p xfce-openbox-openrc/ -b stable -x
 
== Building with a small config change ==
 
{{Note| It is to be verified if the procedure given below works or not.}}
 
Supposing something only changed in config, like a setting, instead of building the whole ISO from scratch, the ISO build directory can be modified and the ISO can be rebuilt. For example, supposing one changed ''xfce-overlay/etc/skel/.conkyrc'' in the config, one can go into the work directory, modify the said file, and rebuild the ISO using the '''-cs''' option.
 
The work directory can be found using the '''-''' option:
 
~ >>> buildiso -h                                                                                 
Usage: buildiso [options]
    -p <profile>      Buildset or profile [default: default]
    -a <arch>          Arch [default: x86_64]
    -b <branch>        Branch [default: unstable]
    -r <dir>          Chroots directory
                        [default: '''/var/lib/manjaro-tools/buildiso''']
    -t <dir>          Target directory
                        [default: /home/fh/Data/build/iso]
    -k <name>          Kernel to use
                        [default: linux419]
    -g <key>          The gpg key for sfs signing
                        [default: ]
    -m                Set SquashFS image mode to persistence
    -c                Disable clean work dir
    -f                Build full ISO (extra=true)
    -d <comp>          Compression used for build ISO: xz, gzip, lzma, lzo, lz4
                        [default: xz]
    -x                Build images only
    -z                Generate iso only
                        Requires pre built images (-x)
    -v                Verbose output to log file, show profile detail (-q)
    -q                Query settings and pretend build
    -h                This help
   
   
case "$1" in
      '''<font color="green">xfce</font color>''') exec xfce4-session ;;
      '''<font color="green">gnome3</font color>''') exec gnome-session ;;
      '''<font color="green">kde</font color>''') exec startkde ;;
      '''<font color="green">cinnamon</font color>''') exec gnome-session-cinnamon ;;
      '''<font color="green">razor-qt</font color>''') exec razor-session ;;
      '''<font color="green">openbox</font color>''') exec openbox ;;
      *) exec $DEFAULTSESSION ;;
esac


(work directory highlighted in bold)
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. The word '''exec''' means ''execute''. Note that between the lines 'case "$1" in' and 'esac', each line starts with the name of a desktop environment, followed by the command to ''execute'' a particular desktop environment. The exception is the last line which begins with an asterisk ('*'). This is to ensure that if a match is not found, then the default session will be started instead - in this instance, the command to start xfce.
 
The required file can be edited as root, for example:
$ sudo nano /var/lib/manjaro-tools/buildiso/xfce/x86_64/desktopfs/etc/skel/.conkyrc
 
There is a catch involved here though; the file one wants to edit may be present in multiple images, like rootfs, livefs, desktopfs), and would need to be edited in the respective image directories.
 
 
Then the ISO then can be rebuilt as:
$ buildiso -p xfce -cs
 
=== Alternative ===
 
First only the chroot for the ISO could be created, using the {{ic|-i}} option, then the changes can be made, and finally an ISO can be built with the {{ic|-sc}} option.
 
For example:
 
$ buildiso -p xfce -b stable -x
==> Start building [xfce]
==> Cleaning up ...
  -> Deleting chroot [rootfs] (x86_64) ...
  -> Deleting isoroot [iso] ...
...
...
 
After this the changes in the work directory can be made, and the ISO can be generated with:


$ buildiso -p xfce/ -cz
'''You can use all of the lines between 'case "$1" in' and 'esac' in the above example if you wish, 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 in future if you decide to install a new desktop (i.e. it will only be necessary to edit the SLiM configuration file). Otherwise, delete the approptiate lines for any desktops you do not have installed.


= Further reading =
Once your amendments have been completed, save your changes and close the configuration file by:


* [https://gitlab.manjaro.org/tools/development-tools/manjaro-tools Manjaro Gitlab]
* '''nano''': Press CTRL and 'x' to exit, 'y' to save, and <enter> to finish, or
* [[Build Manjaro ISOs with buildiso]]
* '''gedit''': Select the 'save' option and then close the window.




[[Category:Contents Page]]
Now reboot the system for the changes to take effect.

Revision as of 22:03, 2 November 2012

Overview

Note
It will be necessary to manually edit the SLiM configuration file and the X-Windows initialisation file whenever a new desktop is added or an old one is removed.

Once SLiM has been installed and enabled, it will be necessary to manually edit both the SLiM configuration file, as well as the X-Windows initialisation file, in order to actually start your installed desktop environment(s). If these files are not edited - or not edited properly - then it is likely that you will not be able to proceed any further than the login screen itself.


Editing the SLiM Configuration File

The purpose of editing this file is to add the name(s) of your installed desktop environment(s). SLiM will then pass these name(s) to the X-Windows initialisation file (.xinitrc), which in turn will actually start your desired desktop environment(s).


Open slim.conf

You will need to first open your terminal in order to edit the SLiM configuration file. The syntax of the command to do this is:

sudo [text editor] /etc/slim.conf


For example, if you wish to edit the file within the terminal using nano (a standard terminal-based text editor) then enter:

sudo nano /etc/slim.conf


Otherwise - if you have installed the full version of Manjaro (i.e. not the NET-Edition) - you may find it easier to use the pre-installed gedit text editor instead. This will open the configuration file up as a document, making it easier to read and edit. To use gedit instead, the command is:

sudo gedit /etc/slim.conf


Add Desktop Environment Names to slim.conf

Once the SLiM configuration file has been opened, it will be necessary to add the name(s) of your installed desktop(s) in order to:

  • display the name(s) of your desktop(s) on the login screen - which is helpful if you want to know which one you are switching to, and
  • to tell the .xinitrc file which desktop it is to start

This is undertaken in the # Available Sessions section, located towards the middle of the file. In the example below, all the available desktops have been added. The text itself has been colured in green for illustrative purposes.

# Available sessions (first one is the default).
# The current chosen session name is replaced in the login_cmd
# above, so your login command can handle different sessions.
# see the xinitrc.sample file shipped with slim sources
sessions            xfce,gnome3,kde,cinnamon,razor-qt,openbox


As illustrated, if two or more desktops are listed, they must be seperated with a comma (,). In addition, as stated, the first desktop listed will be the default. This means that if you do not choose which desktop you want on the login screen, the name of the default one will be automatically sent to the .xinitrc file. If you have also listed a name for one or more desktops that have not actually been installed, the default one will also be sent instead.

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.


Editing the X-Windows Initialisation File

The .xinitrc is responsible for actually starting your installed desktop environment(s). In essence, the .xinitrc will take the name of your chosen (or only) desktop environment from SLiM, and then use it to determine which command to use in order to actually start it.


Open .xinitrc

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


Don't forget the dot. For example, if you wish to edit the file within the terminal using nano, then enter:

sudo nano ~/.xinitrc


Otherwise you could use the gedit text editor instead, by entering the command:

sudo gedit ~/.xinitrc


Add Desktop Environment Names and Commands to .xinitrc

Again, the purpose of editing this file is to:

  • 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)

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 vitally important 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 are added after the DEFAULTSESSION= command. In the example below, notice that each desktop name is followed by the appropriate command to actually start a desktop environment (e.g. the name 'kde' is followed by the command 'startkde'). All the names used in the SLiM configuration file have been listed exactly the same way here, and have been colured in green for illustrative purposes.

DEFAULTSESSION=xfce4-session

case "$1" in
     xfce) exec xfce4-session ;;
     gnome3) exec gnome-session ;;
     kde) exec startkde ;;
     cinnamon) exec gnome-session-cinnamon ;;
     razor-qt) exec razor-session ;;
     openbox) exec openbox ;;
     *) exec $DEFAULTSESSION ;;
esac

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. The word exec means execute. Note that between the lines 'case "$1" in' and 'esac', each line starts with the name of a desktop environment, followed by the command to execute a particular desktop environment. The exception is the last line which begins with an asterisk ('*'). This is to ensure that if a match is not found, then the default session will be started instead - in this instance, the command to start xfce.

You can use all of the lines between 'case "$1" in' and 'esac' in the above example if you wish, 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 in future if you decide to install a new desktop (i.e. it will only be necessary to edit the SLiM configuration file). Otherwise, delete the approptiate lines for any desktops 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.

Cookies help us deliver our services. By using our services, you agree to our use of cookies.