Difference between pages "Package:I3 (Window Manager)" and "Repository Configuration"

From Funtoo
(Difference between pages)
Jump to navigation Jump to search
 
 
Line 1: Line 1:
== Introduction ==
{{Warning|This article is a work-in-progress referring to a future Portage version. It does not apply to the current Funtoo Portage version. Please do not update your configuration yet.}}
i3 is a tiling window manager that is based upon experiences the developers shared while attempting to fix/hack wmii.  i3 has the ability for either floating windows, which you can resize and move, and tiling windows.  i3 uses a tree as a data structure to allow for more flexibility. i3 defaults with home-row key-bindings which are quick and easy to get beginners off the ground.


'''NOTE:  This wiki is made following the steps produced to get a working i3 using xrandr instead of xinerama, ATI proprietary drivers instead of radeon drivers, a dual-monitor setup, and no login manager. For Nvidia and Twinview users, a link is supplied in [[#X11 and xrandr|X11 and xrandr]]. Xinerama was initially used and worked in the dual-monitor setup so it possible to substitute xinerama for xrandr with minimal changes.''' 
Starting with Portage-2.3.8, a switch to a new repository configuration framework is complete and users may want to update their configuration files. This document aims to describe the goals for the new framework and how to use it.


== Installation ==
== Multiple repository layout ==
One of the most important changes is the switch from the old ''overlay'' layout to a new cleaner ''repository'' system. The new layout is more flexible and more predictable. For example, repositories can now use resources (eclasses, for example) provided by other repositories.


=== Portage ===
The old layout was based on the concept of one ''main tree'' and optionally a number of overlays. The main tree provided base system ebuilds, eclasses, profiles, while overlays mostly were able to provide their own ebuilds. The ebuild provided by overlays overrode the ebuilds in main tree to the extend of making it impossible to install the main tree version. Overlays could also provide eclasses for their own ebuilds and package.* entries that applied to all overlays and to the main tree. The Package Manager is responsible for updating the main tree, while overlays are managed externally.


The easiest and quickest way:
The new layout is based on the concept of one or more configurable repositories. Each repository can either be stand-alone or depend upon other repositories. The distribution provides a repository called ''funtoo'' (a drop-in replacement for Gentoo's ''gentoo'' repository). Users can install more repositories at they will, the repositories providing their own ebuilds, eclasses and profiles as necessary and/or using them from other repositories. Users can explicitly choose the repository they want to install packages from. The Package Manager can update all repositories.
<console>
###i## emerge -avt x11-wm/i3
</console>


=== Manual ===
== Portage configuration ==
=== New repository layout ===
The repository configuration should be stored in <code>/etc/portage/repos.conf</code>. It can be either a single file or a directory containing one or more ''.conf'' files.


==== Tarball ====
The default configuration is installed as <code>/usr/share/portage/config/repos.conf</code>. This file is internal configuration file installed with portage ebuild and should '''not''' be modified. Instead, the configuration in <code>/etc/portage/repos.conf</code> can override the defaults specified there.


Download the latest version from the i3 website.
The configuration uses format similar to Windows .ini files. Each section heading (repository name in square brackets) signifies a single repository, followed by one or more key-value option pairs. For example, the following file copies default configuration for Funtoo repository:
[http://i3wm.org/downloads/i3-4.8.tar.bz2 i3-4.8]


<console>
{{file|name=/etc/portage/repos.conf/funtoo.conf|desc=Example configuration override for Funtoo repository|body=
###i## cd /PATH/TO/TARBALL
[funtoo]
###i## make
# moved to non-default location!
###i## sudo make install
location = /var/db/repos/funtoo
</console>
sync-type = git
sync-uri = git://github.com/funtoo/ports-2015.git
auto-sync = yes
}}
Location variable is now what used to be a PORTDIR, when using old-fashioned <code>/etc/portage/make.conf</code>.  <code>/var/db/repos/funtoo</code> is a dummy location example. Default location in Funtoo is  set to <code>/usr/portage</code>. Users are free to choose a location of their suits. sync-type is a CVS tree used for portage tree, git is a default in Funtoo. sync-uri is what used to be a SYNC variable, when using old-fashioned configuration through <code>/etc/portage/make.conf</code>
The most useful repository configuration options are listed below:
;location: ''Obligatory.'' Specifies the directory where repository is/will be stored. If Portage knows how to sync the repository and the location does not exist, it will be created on next ''emerge --sync''. Otherwise, the directory must exist.
;priority: Specifies the priority used for ordering ebuilds from different repositories. If two repositories provide an ebuild with matching versions, the repository with higher priority will be used.
;auto-sync: Specifies whether ''emerge --sync'' should update the repository. Defaults to ''yes'' if ''sync-type'' is specified, ''no'' otherwise.
;sync-depth: Specifies ''--depth'' for git clone. Used only on initial sync. Defaults to 1. Can be set to 0 to force full clone (not pass ''--depth'' at all).
;sync-type: Specifies syncing/update method. Can be one of: ''cvs'', ''git'', ''rsync'', ''svn''.
;sync-umask: Specifies the umask used when updating/syncing the repository.
;sync-uri: Specifies remote URI from which the repository will be cloned/synced. Can use any syntax valid for a particular syncing method.
;sync-user: Specifies the user[:group] used to update/sync the repository. If ''FEATURES=usersync'' is used, defaults to the credentials of directory owner.


==== Git ====
[[Category:Portage]]
 
<console>
###i## git clone git://code.i3wm.org/i3
###i## cd i3
###i## make
###i## sudo make install
</console>
 
== Setup ==
 
=== xinitrc ===
 
Edit <tt>~/.xinitrc</tt>:
 
<pre>
exec i3
</pre>
 
 
For i3 logging, edit <tt>~/.xinitrc</tt>:
 
<pre>
exec i3 -V -d all >~/.i3/i3log-$(date +'%F-%k-%M-%S') 2>&1
</pre>
 
If you are using Nvidia or for some reason don't use xrandr, edit ~/.xinitrc
<pre style="color:green">exec i3 --force-xinerama</pre>
and nvidia with logging:
<pre style="color:green">exec i3 --force-xinerama -V -d all >~/.i3/i3log-$(date +'%F-%k-%M-%S') 2>&1</pre>
Example ~/.xinitrc that uses consolekit and dbus in launch and also logs on exit.
<pre style="color:purple">#!/bin/zsh
xrdb -merge ~/.Xresources
xcompmgr &
 
if [[ $1 == "i3" ]]; then
    exec ck-launch-session dbus-launch --sh-syntax --exit-with-session i3 -V -d all > ~/.i3/i3log-$(date +'%F-%k-%M-%S') 2>&1
elif [[ $1 == "razor" ]]; then
    exec ck-launch-session dbus-launch startrazor
elif [[ $1 == "awesome" ]]; then
    exec ck-launch-session dbus-launch awesome
elif [[ $1 == "qtile" ]]; then
    exec ck-launch-session dbus-launch ~/.qtile-session
else
    echo "Choose a window manager"
fi</pre>
 
<div id="X11 and xrandr"></div>
 
=== X11 and xrandr ===
 
=== X and RandR ===
'''NOTE: RandR and Xinerama do not play together.  Use one or the other.'''
 
I use an AMD HD 6870 with 3 monitors (2 DVI and 1 with an AMD validated Mini DisplayPort™ to DVI dongle).
 
Install {{Package|x11-apps/xrandr}}:
<console>
###i## emerge x11-apps/xrandr
</console>
and if you want a GUI with xrandr:
<console>
###i## emerge x11-misc/arandr
</console>
 
If you do not have X configured yet, follow the link on the [http://en.gentoo-wiki.com/wiki/X.Org Gentoo Wiki]
 
My xorg.conf.d folder for example: [https://github.com/akiress/dotfiles/blob/master/etc/X11/xorg.conf.d/30-screen.conf 30-screen.conf]
 
Since the names of the monitors are already known in xrandr, I just use those names in my 30-screen.conf configuration. It doesn't matter what you use in your X configuration however.
 
Once you have X configured however you like, start qtile with either:
<console>
###i## startx
</console>
or, in a case similar to mine:
<console>
###i## xinit qtile
</console>
 
=== i3 config ===
The i3 configuration file can be found in /etc/i3/config, but I suggest that you copy the file into a local ~/.i3 directory.
<pre># mkdir -p ~/.i3 && cp /etc/i3/config ~/.i3/config</pre>
Open up ~/i3/config in your editor of choice.
<code style="color:green">set $mod Mod1</code> assigns the variable $mod to be Mod1.  In i3, Mod1 is the Alt key.  If you wish to use the Windows key then use <code style="color:green">set $mod Mod4</code>  In the keybinding section, $mod is used in place of Mod1 in the case that you do wish to change the modifier.  In the workspace key, the keybindings are set with Mod1 instead of the variable, so remember to change those bindings manually if you are replacing the Mod1 modifier.  Else you can change Mod1 in those sections to $mod and change all the keybindings at the same time by setting the $mod variable.
<pre style="color:green">set $mod Mod1</pre>
To have programs start automatically in i3, use the command <code style="color:green">exec APPLICATION</code>.  This is the section that the xrandr screen layout bash file created earlier will be placed.  The i3bar is a tray and status bar combination.  If you have applications that run in the system tray that you want to autostart, call those applications with exec.
<pre style="color:green">exec /PATH/TO/XRANDR-BASH-FILE
exec NAME OF BROWSER
exec NAME OF EDITOR
exec volumeicon
exec dropbox</pre>
In the workspace section, you have the opportunity to name the workspaces by setting either the number of the workspace, the name of the workspace, or the number and name of the workspace.  <code style="color:green">bindsym KEYBIND workspace NAME/NUMBER OF WORKSPACE</code>.  Remember to use quotes when naming a workspace.
<pre style="color:green">bindsym Mod1+1 workspace 1
bindsym Mod1+1 workspace "my first workspace"
bindsym Mod1+1 workspace "1: my first workspace"</pre>
To assign a workspace to a certain output you will need the output from running xrandr again if you do not remember which connections are being used.  In the example from [#X11 and xrandr|X11 and xrandr], the connected outputs are DFP3 and DFP4.  To assign the workspace, you need to add <code style="color:green">workspace NAME OF WORKSPACE or NUMBER output CONNECTED OUTPUT</code>.  There are several types of outputs so make sure that you are using the connected outputs from xrandr when assigning workspaces, else the workspace will not show up.
<pre style="color:green">workspace 1 output DFP3
workspace "my first workspace" output DFP3
workspace "1: my first workspace" output DFP3
workspace "2: my second workspace" output DFP4</pre>
To assign a program to a certain workspace, you will need to run xprop.  If you do not have xprop, emerge it.
<pre># emerge -avt x11-apps/xprop</pre>
To run xprop, open a terminal and run <pre># xprop</pre>  Your mouse cursor should become a crosshair and you will want to mouse over the window that contains the running application.  Click on that window and xprop will then output the window information.  The easiest way to assign a program is to look for <pre style="color:green">WM_CLASS(STRING) = "INSTANCE", "CLASS"</pre>  Be sure to note that the window INSTANCE is before the window CLASS.  In the config file, add <code style="color:green">assign [class="^INSTANCE$" instance="^CLASS$] NAME OF WORKSPACE</code>.  For aesthetic purposes, you can add → before NAME OF WORKSPACE, but mind that the → is a UTF-8 character and not <code>-></code>.  For the assignments, do not put the workspace name within quotes as you do when naming them and setting their output.
<pre style="color:green">
assign [class="^Chromium-browser$" instance="^chromium-browser$"] 1
assign [class="^Chromium-browser$" instance="^chromium-browser$"] web
assign [class="^Chromium-browser$" instance="^chromium-browser$"] 1: web
assign [class="^Chromium-browser$" instance="^chromium-browser$"] → 1
assign [class="^Chromium-browser$" instance="^chromium-browser$"] → web
assign [class="^Chromium-browser$" instance="^chromium-browser$"] → 1: web</pre>
For aesthetic purposes, their are three types of borders for the windows.  This can be set by adding <code style="color:green">new_window <normal|1pixel|none></code>.  There are also keybindings that allow you to switch between the 3 border styles.
<pre style="color:green">new_window 1pixel
bindsym $mod+t border normal
bindsym $mod+y border 1pixel
bindsym $mod+u border none</pre>
The orientation for new workspaces can be set by adding <code style="color:green">default_orientation <horizontal|vertical|auto></code>
<pre style="color:green">default_orientation horizontal</pre>
 
A sample ~/.i3/config:
<div style="height:250px;overflow:scroll;color:green"><pre>
set $mod Mod1
 
########################################################
######## Autostart ########
########################################################
exec ~/.screenlayout/dualdtop.sh
exec chromium-browser
exec gvim
exec volumeicon
exec parcellite
exec dropbox
 
########################################################
######## Workspaces ########
########################################################
# switch to workspace
bindsym Mod1+1 workspace "1: web"
bindsym Mod1+2 workspace "2: irc"
bindsym Mod1+3 workspace "3: gvim"
bindsym Mod1+4 workspace "4: ranger"
bindsym Mod1+5 workspace "5: terms"
bindsym Mod1+6 workspace "6: mplayer"
bindsym Mod1+7 workspace "7: mail"
bindsym Mod1+8 workspace "8: firefox"
bindsym Mod1+9 workspace "9: music"
bindsym Mod1+0 workspace "10: office"
 
## Output certain workspaces
workspace "1: web" output DFP3
workspace "2: irc" output DFP4
workspace "3: gvim" output DFP4
workspace "4: ranger" output DFP3
workspace "5: terms" output DFP4
workspace "6: mplayer" output DFP3
workspace "7: mail" output DFP3
workspace "8: firefox" output DFP3
workspace "9: music" output DFP3
workspace "10: office" output DFP4
 
## Assign workspaces to programs
assign [class="^Chromium-browser$" instance="^chromium-browser$"] → 1: web
assign [class="^Gvim$" instance="^gvim$"] → 3: gvim
assign [class="^MPlayer$" instance="^gl$"] → 6: mplayer
assign [class="^Firefox$" instance="^Navigator$"] → 8: firefox
assign [class="^Emacs$" instance="^emacs$"] → 9: emacs
assign [class="^libreoffice-startcenter$" instance="^VCLSalFrame.DocumentWindow$"] 10: office
 
# move focused container to workspace
bindsym Mod1+Shift+1 move workspace 1
bindsym Mod1+Shift+2 move workspace 2
bindsym Mod1+Shift+3 move workspace 3
bindsym Mod1+Shift+4 move workspace 4
bindsym Mod1+Shift+5 move workspace 5
bindsym Mod1+Shift+6 move workspace 6
bindsym Mod1+Shift+7 move workspace 7
bindsym Mod1+Shift+8 move workspace 8
bindsym Mod1+Shift+9 move workspace 9
bindsym Mod1+Shift+0 move workspace 10
 
########################################################
######## Aesthetics ########
########################################################
# Window border style: normal: border normal, with window title bar;
# none: no border or window title bar; 1pixel: 1 pixel border.
new_window 1pixel
bindsym $mod+t border normal
bindsym $mod+y border 1pixel
bindsym $mod+u border none
 
# font for window titles. ISO 10646 = Unicode
font -misc-fixed-medium-r-normal--13-120-75-75-C-70-iso10646-1
 
# Orientation for new workspaces
# Can be set <horizontal|vertical|auto>
default_orientation horizontal
 
# Layout for new containers
# Can be set <default|stacking|tabbed>
workspace_layout default
 
# Use Mouse+$mod to drag floating windows to their wanted position
floating_modifier $mod
 
########################################################
######## Keybindings ########
########################################################
 
# start a terminal
bindsym $mod+Return exec i3-sensible-terminal
 
# kill focused window
bindsym $mod+Shift+Q kill
 
# start dmenu (a program launcher)
bindsym $mod+d exec dmenu_run
 
# change focus
bindsym $mod+j focus left
bindsym $mod+k focus down
bindsym $mod+l focus up
bindsym $mod+semicolon focus right
 
# alternatively, you can use the cursor keys:
bindsym $mod+Left focus left
bindsym $mod+Down focus down
bindsym $mod+Up focus up
bindsym $mod+Right focus right
 
# move focused window
bindsym $mod+Shift+J move left
bindsym $mod+Shift+K move down
bindsym $mod+Shift+L move up
bindsym $mod+Shift+colon move right
 
# alternatively, you can use the cursor keys:
bindsym $mod+Shift+Left move left
bindsym $mod+Shift+Down move down
bindsym $mod+Shift+Up move up
bindsym $mod+Shift+Right move right
 
# split in horizontal orientation
bindsym $mod+h split h
 
# split in vertical orientation
bindsym $mod+v split v
 
# enter fullscreen mode for the focused container
bindsym $mod+f fullscreen
 
# change container layout (stacked, tabbed, default)
bindsym $mod+s layout stacking
bindsym $mod+w layout tabbed
bindsym $mod+e layout default
 
# toggle tiling / floating
bindsym $mod+Shift+space floating toggle
 
# change focus between tiling / floating windows
bindsym $mod+space focus mode_toggle
 
# focus the parent container
bindsym $mod+a focus parent
 
# focus the child container
#bindcode $mod+d focus child
 
# reload the configuration file
bindsym $mod+Shift+C reload
# restart i3 inplace (preserves your layout/session, can be used to upgrade i3)
bindsym $mod+Shift+R restart
# exit i3 (logs you out of your X session)
bindsym $mod+Shift+E exit
 
# resize window (you can also use the mouse for that)
mode "resize" {
        # These bindings trigger as soon as you enter the resize mode
        # They resize the border in the direction you pressed, e.g.
        # when pressing left, the window is resized so that it has
        # more space on its left
 
bindsym j resize shrink left 10 px or 10 ppt
bindsym Shift+J resize grow left 10 px or 10 ppt
 
bindsym k resize shrink down 10 px or 10 ppt
bindsym Shift+K resize grow down 10 px or 10 ppt
 
bindsym l resize shrink up 10 px or 10 ppt
bindsym Shift+L resize grow up 10 px or 10 ppt
 
bindsym semicolon resize shrink right 10 px or 10 ppt
bindsym Shift+colon resize grow right 10 px or 10 ppt
 
        # same bindings, but for the arrow keys
bindsym Left resize shrink left 10 px or 10 ppt
bindsym Shift+Left resize grow left 10 px or 10 ppt
 
bindsym Down resize shrink down 10 px or 10 ppt
bindsym Shift+Down resize grow down 10 px or 10 ppt
 
bindsym Up resize shrink up 10 px or 10 ppt
bindsym Shift+Up resize grow up 10 px or 10 ppt
 
bindsym Right resize shrink right 10 px or 10 ppt
bindsym Shift+Right resize grow right 10 px or 10 ppt
 
        # back to normal: Enter or Escape
bindsym Return mode "default"
bindsym Escape mode "default"
}
 
bindsym $mod+r mode "resize"
 
########################################################
######## i3bar ########
########################################################
 
# Start i3bar to display a workspace bar (plus the system information i3status
# finds out, if available)
bar {
    output            DFP3
    output       DFP4
    status_command    i3status -c ~/.i3status.conf
    position          top
    mode              dock
    workspace_buttons yes
    tray_output      DFP3
   
    font -misc-fixed-medium-r-normal--13-120-75-75-C-70-iso10646-1
 
    colors {
        background #000000
        statusline #FFFFFF
 
        focused_workspace  #ffffff #9932CC
        active_workspace  #ffffff #DA70D6
        inactive_workspace #888888 #242424
        urgent_workspace  #ffffff #32CD32
    }
} </pre></div>
 
These scripts can be found in /usr/bin/
 
=== i3nagbar ===
 
The i3nagbar is the error bar that pops up on top of the screen when there is an error in the i3 configuration.
 
=== i3-sensible-editor ===
 
i3-sensible-editor is callen when the user presses the edit button on the i3nagbar.  If $EDITOR is set, that editor will be used, else i3-sensible-editor will open the first editor that is installed according to the order in i3-sensible-editor.  If the user has a preference, he will set $EDITOR.
 
=== i3-sensible-terminal ===
 
i3-sensible-terminal is called when the user opens a terminal.  If $TERMINAL is set, that terminal will be used, else i3-sensible-terminal will open the first terminal that is installed according to the order in i3-sensible-terminal.  If the user has a preference, he will set $TERMINAL.
 
=== i3-sensible-pager ===
 
i3-sensible-pager is called when the user presses the view button on the i3nagbar.  If $PAGER is set, that pager will be used, else i3-sensible-pager will open the first pager that is installed accordding to the order in i3-sensible-pager.  If the user has a preference, he will set $PAGER.
 
=== i3status ===
 
i3status generates a status bar similar to conky in i3.  i3status replaces dzen2, xmobar, and other similar applications used in older versions of i3.  It is suggested to create an <tt>~/.i3status.conf</tt> file to configure the i3status bar locally. 
A sample <tt>~/.i3status.conf</tt>:
 
<pre>
general {
        colors = true
        interval = 5
}
 
order = "disk /"
order += "disk /home"
order += "ethernet eth0"
order += "cpu_temperature 0"
order += "cpu_temperature 1"
order += "cpu_temperature 2"
order += "cpu_temperature 3"
order += "load"
order += "time"
 
ethernet eth0 {
        # if you use %speed, i3status requires the cap_net_admin capability
        format_up = "Eth0: %ip (%speed)"
        format_down = "Eth0: down"
}
 
time {
        format = "%a:%d-%b-%Y %I:%M:%S %p"
}
 
load {
        format = "Load: %5min"
}
 
cpu_temperature 0 {
format = "T1: %degrees °C"
path = "/sys/devices/platform/coretemp.0/temp2_input"
}
 
cpu_temperature 1 {
format = "T2: %degrees °C"
path = "/sys/devices/platform/coretemp.0/temp3_input"
}
 
cpu_temperature 2 {
format = "T3: %degrees °C"
path = "/sys/devices/platform/coretemp.0/temp4_input"
}
 
cpu_temperature 3 {
format = "T4: %degrees °C"
path = "/sys/devices/platform/coretemp.0/temp5_input"
}
 
disk "/" {
        format = "/: %free"
}
 
disk "/home" {
format = "/home: %free"
}
</pre>
 
== dmenu ==
 
i3 uses {{Package|x11-misc/dmenu}} as the application launcher. To install it, run the following:
 
<console>
###i## emerge dmenu
</console>
 
{{fancynote| The default key-binding for dmenu is Mod1+d.}}
 
== Default Keybindings ==
 
{| class="wikitable" border="2" style="text-align:center;"
|Alt + Enter
|Open terminal
|-
|Alt + A
|Focus Parent
|-
|Alt + S
|Stacked Layout
|-Advanced SearchSearch…
|Alt + W
|Tabbed Layout
|-
|Alt + E
|Default Layout
|-
|Alt + SpaceBar
|Focus tiling/floating
|-
|Alt + D
|dmenu
|-
|Alt + H
|Split Horizontal
|-
|Alt + V
|Split Vertically
|-
|Alt + J
|Left
|-
|Alt + K
|Down
|-
|Alt + J
|Up
|-
|Alt + ;
|Right
|-
|Alt + Shift + Q
|Kill window
|-
|Alt + Shift + E
|Exit i3
|-
|Alt + Shift + C
|Reload i3config without restarting
|-
|Alt + Shift + R
|Restart i3 (reloads i3config without exiting i3)
|-
|Alt + Shift + J
|Move left
|-
|Alt + Shift + K
|Move down
|-
|Alt + Shift + L
|Move up
|-
|Alt + Shift + :
|Move right
|-
|Alt + Shift + SpaceBar
|Toggle tiling/floating
|}
 
== Troubleshooting ==
 
=== i3status ===
 
{{fancynote| i3status may not work out of box}} The permissions may be set to: <tt>-r-xr-x---</tt>: when run as non-root, sh would return with "permission denied".
If i3status does not work for you, this can be easily corrected by changing the permissions.
<console>
###i## sudo chmod 755 /usr/bin/i3status
</console>
 
=== Documentation ===
 
==== Websites ====
 
[http://i3wm.org/ i3]
 
[http://i3wm.org/docs/userguide.html User Guide]
 
[http://i3wm.org/docs/ More Documentation]
 
==== Man pages ====
 
* i3
* i3-config-wizard
* i3-input
* i3-migrate-config-to-v4
* i3-msg
* i3-nagbar
* i3-sensible-editor
* i3-sensible-pager
* i3-sensible-terminal
* i3-wsbar
* i3bar
* i3lock
* i3status
 
[[Category:Desktop]]

Revision as of 13:52, February 14, 2015

   Warning

This article is a work-in-progress referring to a future Portage version. It does not apply to the current Funtoo Portage version. Please do not update your configuration yet.

Starting with Portage-2.3.8, a switch to a new repository configuration framework is complete and users may want to update their configuration files. This document aims to describe the goals for the new framework and how to use it.

Multiple repository layout

One of the most important changes is the switch from the old overlay layout to a new cleaner repository system. The new layout is more flexible and more predictable. For example, repositories can now use resources (eclasses, for example) provided by other repositories.

The old layout was based on the concept of one main tree and optionally a number of overlays. The main tree provided base system ebuilds, eclasses, profiles, while overlays mostly were able to provide their own ebuilds. The ebuild provided by overlays overrode the ebuilds in main tree to the extend of making it impossible to install the main tree version. Overlays could also provide eclasses for their own ebuilds and package.* entries that applied to all overlays and to the main tree. The Package Manager is responsible for updating the main tree, while overlays are managed externally.

The new layout is based on the concept of one or more configurable repositories. Each repository can either be stand-alone or depend upon other repositories. The distribution provides a repository called funtoo (a drop-in replacement for Gentoo's gentoo repository). Users can install more repositories at they will, the repositories providing their own ebuilds, eclasses and profiles as necessary and/or using them from other repositories. Users can explicitly choose the repository they want to install packages from. The Package Manager can update all repositories.

Portage configuration

New repository layout

The repository configuration should be stored in /etc/portage/repos.conf. It can be either a single file or a directory containing one or more .conf files.

The default configuration is installed as /usr/share/portage/config/repos.conf. This file is internal configuration file installed with portage ebuild and should not be modified. Instead, the configuration in /etc/portage/repos.conf can override the defaults specified there.

The configuration uses format similar to Windows .ini files. Each section heading (repository name in square brackets) signifies a single repository, followed by one or more key-value option pairs. For example, the following file copies default configuration for Funtoo repository:

   /etc/portage/repos.conf/funtoo.conf - Example configuration override for Funtoo repository
[funtoo]
# moved to non-default location!
location = /var/db/repos/funtoo
sync-type = git
sync-uri = git://github.com/funtoo/ports-2015.git
auto-sync = yes

Location variable is now what used to be a PORTDIR, when using old-fashioned /etc/portage/make.conf. /var/db/repos/funtoo is a dummy location example. Default location in Funtoo is set to /usr/portage. Users are free to choose a location of their suits. sync-type is a CVS tree used for portage tree, git is a default in Funtoo. sync-uri is what used to be a SYNC variable, when using old-fashioned configuration through /etc/portage/make.conf The most useful repository configuration options are listed below:

location
Obligatory. Specifies the directory where repository is/will be stored. If Portage knows how to sync the repository and the location does not exist, it will be created on next emerge --sync. Otherwise, the directory must exist.
priority
Specifies the priority used for ordering ebuilds from different repositories. If two repositories provide an ebuild with matching versions, the repository with higher priority will be used.
auto-sync
Specifies whether emerge --sync should update the repository. Defaults to yes if sync-type is specified, no otherwise.
sync-depth
Specifies --depth for git clone. Used only on initial sync. Defaults to 1. Can be set to 0 to force full clone (not pass --depth at all).
sync-type
Specifies syncing/update method. Can be one of: cvs, git, rsync, svn.
sync-umask
Specifies the umask used when updating/syncing the repository.
sync-uri
Specifies remote URI from which the repository will be cloned/synced. Can use any syntax valid for a particular syncing method.
sync-user
Specifies the user[:group] used to update/sync the repository. If FEATURES=usersync is used, defaults to the credentials of directory owner.