Difference between pages "Creating Profiles" and "Qtile"

From Funtoo
(Difference between pages)
Jump to: navigation, search
 
(Edited to add installation using portage.)
 
Line 1: Line 1:
Want to create your own custom profiles? Thought up a mix-in that's not currently in the Funtoo profiles? Have an overlay with profiles and want to make it easy for people to use them? Well you've come to the right place. This article will show you how to easily add you own profiles. No more ugly hacking of parent files and other nonsense. Once you follow this guide, not only will portage easily recognize your profiles, they will also show up in eselect right along with the ones from the main tree.
+
= Introduction =
 +
This wiki is a work in progress.
  
== How to do it ==
+
Python3 will cause errors. Use '''Python2''' as default or '''at the very least''', pass PYTHON=python2.7 to py2cairo and xpyb before configuring them.  
=== Rules to follow ===
+
#For eselect support you will need the new version from funtoo. Currently >=eselect-1.3.7. ({{Package|app-admin/eselect}})
+
#Your overlay must have a profiles directory. It must include a repo_name file with the name of your overlay.
+
#Your profiles must be inside of the profiles directory
+
#You need a profiles.eselect.desc file inside the profiles directory. See profiles.eselect.example in your funtoo portage tree for instructions
+
#If your creating profiles of types arch, build, flavor, or mix-ins, your profile must be inside a directory with same name. Ex profiles/my_profile/flavor/new_profile, profiles/my_profile/mix-ins/subdir/profile.
+
# Currently NoMix (see profiles.eselect.example) is only supported for profiles in the same tree.
+
# If your not using a standard funtoo tree, you must insure that your main portage tree has 'profile-formats = portage-2' set in metadata/layout.conf in order for portage to interpret the <repo_name>:<profile> syntax.
+
+
=== Example of how to set up ===
+
For our example we will create a mix-ins profile called 'fake_pro' in a local overlay called 'local_overlay'. fake_pro will set the 'dummy' USE flag globally and also set the 'fake' USE flag on sys-apps/not-exist. We will then add the profile to eselect so it's visible when running 'eselect profile'.
+
  
==== Creating the profile ====
+
"Qtile is a full-featured, hackable tiling window manager written in Python.
We will use ''<code>${OVERLAY_DIR}</code>'' as the path to local_overlay. These instructions assume the overlay exists.
+
If you haven't set a name for your overlay, do that first:
+
<console>
+
###i## echo "local_overlay" > ${OVERLAY_DIR}/profiles/repo_name
+
</console>
+
  
Next lets create a directory to store our profile. Since we're creating a 'mix-ins' profile we need to make sure our profile is inside a 'mix-ins' subdirectory. This is a requirement in order to ensure that the profile will show up in eselect. If your not planning on using eselect then there's no requirement to use 'mix-ins'
+
Qtile is simple, small, and extensible. It's easy to write your own layouts, widgets, and built-in commands.
<console>
+
###i## install -d ${OVERLAY_DIR}/profiles/my_profiles/mix-ins/fake_pro
+
</console>
+
  
Now that we have a directory for our profile, lets go ahead and add our settings. Global USE settings go in ''<code>make.defaults</code>'', package specific USE settings go in ''<code>package.use</code>'':
+
Qtile is written and configured entirely in Python, which means you can leverage the full power and flexibility of the language to make it fit your needs.
<console>
+
###i## cd ${OVERLAY_DIR}/profiles/my_profiles/mix-ins/fake_pro
+
###i## echo 'USE="$USE dummy"' >> make.defaults
+
###i## echo 'sys-apps/not-exist fake' >> package.use
+
</console>
+
Note that no matter if your using funtoo or gentoo, profile settings all work the same. For more information please check the portage man page.
+
  
==== Adding to eselect ====
+
The Qtile community is active and growing, so there's always someone to lend a hand when you need help.
eselect reads from the file ''<code>profiles.eselect.desc</code>'' in your profiles/ directory. Format is "Type Name Status NoMix" space-separated. For more information look in ''<code>/usr/portage/profiles/profiles.eselect.example</code>'':
+
<console>
+
###i## echo 'mix-ins my_profiles/mix-ins/fake_pro testing' >> ${OVERLAY_DIR}/profiles/profiles.eselect.desc
+
</console>
+
Watch the result:
+
<console>
+
###i## eselect profile list
+
</console>
+
  
[[Category:Portage]]
+
Qtile is free and open-source software, distributed under the permissive MIT license"<ref>[http://qtile.org Qtile]</ref><ref>[http://docs.qtile.org/en/latest/manual/license.html License]</ref>
[[Category:Labs]]
+
 
[[Category:HOWTO]]
+
== The Qtile Community ==
[[Category:Featured]]
+
 
 +
=== IRC ===
 +
[irc://irc.oftc.net:6667/qtile irc://irc.oftc.net:6667/qtile]
 +
 
 +
=== Mailing List ===
 +
qtile-dev on Google Groups
 +
 
 +
=== Twitter ===
 +
@qtile on Twitter
 +
 
 +
===Forum ===
 +
[kobraz.org.ua/qforum]
 +
 
 +
After on people begin used this forum, we move it to qtile.org
 +
 
 +
== Troubleshooting ==
 +
[https://github.com/qtile/qtile/issues Issues]
 +
 
 +
== Documentation ==
 +
[http://docs.qtile.org/en/latest/index.html# Qtile Documentation]
 +
 
 +
= Installation =
 +
 
 +
== Portage ==
 +
<pre style="color:green"># emerge qtile</pre>
 +
 
 +
== Manual (Github) ==
 +
This section is taken from the documents from Qtile.<ref>[http://docs.qtile.org/en/latest/manual/install/gentoo.html Installation on Gentoo]</ref>
 +
 
 +
=== Dependencies ===
 +
USE flags and keyword changes may have to be made for the packages taken from portage.
 +
 
 +
==== libxcb ====
 +
libxcb can be emerged from portage.
 +
 
 +
<pre style="color:green"># emerge libxcb</pre>
 +
 
 +
==== xpyb ====
 +
xpyb can be emerge from portage. Make sure that you are emerging xpyb-1.3.1
 +
 
 +
<pre style="color:green"># emerge xpyb</pre>
 +
 
 +
==== cairo ====
 +
cairo can be emerged from portage.
 +
 
 +
Have USE flags set to <pre style="color:purple">X glib opengl svg xcb</pre>
 +
 
 +
and then:
 +
 
 +
<pre style="color:green"># emerge cairo</pre>
 +
 
 +
==== pygtk ====
 +
pygtk can be emerge from portage.
 +
 
 +
<pre style="color:green"># emerge pygtk</pre>
 +
 
 +
==== py2cairo ====
 +
<pre style="color:green"># git clone git://git.cairographics.org/git/py2cairo
 +
# cd py2cairo
 +
# ./autogen.sh --enable-xcb
 +
# ./configure --prefix=/path/to/virtualenv
 +
# make
 +
# sudo make install</pre>
 +
 
 +
As an alternative to virtualenv, you can
 +
<pre style="color:green"># ./configure --prefix=/usr</pre>
 +
But the virtualenv is the recommended option in installation.
 +
 
 +
==== qtile ====
 +
<pre style="color:green"># git clone git://github.com/qtile/qtile
 +
# cd qtile
 +
# sudo python setup.py install --record files_uninstall.txt</pre>
 +
 
 +
= Setup =
 +
'''Copy''' either a config from the examples directory in the cloned qtile '''(including a default config)''', a config you have found elsewhere, or create your own config.
 +
<pre style="color:green"># cp /path/to/cloned-qtile/examples/config/cortesi-config.py ~/.config/qtile/config.py
 +
# cp /path/to/cloned-qtile/examples/config/dgroups.py ~/.config/qtile/config.py
 +
# cp /path/to/cloned-qtile/examples/config/roger-config.py ~/.config/qtile/config.py
 +
# cp /path/to/cloned-qtile/examples/config/tailhook-config.py ~/.config/qtile/config.py</pre>
 +
 
 +
My config is [https://github.com/akiress/dotfiles/blob/master/qtile/config.py config.py]
 +
 
 +
The config I have based mine off of is [https://github.com/dmpayton/dotfiles/blob/master/qtile/config.py dmpayton's config.py]
 +
 
 +
= Testing Qtile Installation =
 +
You can test your installation of Qtile while within another WM instance using Xephyr.
 +
 
 +
Examples:
 +
<pre style="color:green"># Xephyr :1 -screen 800x600 -a -v -noreset
 +
# DISPLAY=:1
 +
# /path/to/qtile/qtile</pre>
 +
or using built in code:<ref>[[ https: // groups.google.com/group/qtile-dev/browse_thread/thread/26191253a8190568 qtile-dev Google Group ]]</ref>
 +
<pre style="color:green"># echo "exec qtile" > .start_qtile ; xinit .start_qtile -- :1</pre>
 +
 
 +
For further information, see the Documentation section.
 +
 
 +
== dmenu ==
 +
Qtile uses dmenu as the application launcher.
 +
<pre style="color:green"># emerge dmenu</pre>
 +
You can run dmenu from a keybind in the config.py.
 +
 
 +
== xinitrc ==
 +
An example of preparing Qtile to start with a startup-session script for autostarting apps.
 +
My ~/.xinitrc
 +
<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>
 +
My ~/.qtile-session
 +
<pre style="color:purple">conky -c ~/.conky/conkyrc_grey &
 +
sh ~/.fehbg &
 +
dropbox &</pre>
 +
 
 +
== 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 xrandr:
 +
<pre style="color:green"># emerge x11-apps/xrandr</pre>
 +
and if you want a GUI with xrandr:
 +
<pre style="color:green"># emerge x11-misc/arandr</pre>
 +
 
 +
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:
 +
<pre style="color:green"># startx</pre>
 +
or, in a case similar to mine,
 +
<pre style="color:green"># xinit qtile</pre>
 +
 
 +
== Starting with CDM ==
 +
Another good tool for starting qtile is '''CDM''' (short for Console Display Manager). To make it work, just merge cdm
 +
<pre style="color:green"># emerge -avt cdm</pre>
 +
and add it to autostart with
 +
<pre style="color:green"># cp /usr/share/cdm/zzz-cdm-profile.sh /etc/profile.d/zzz-cdm-profile.sh</pre>
 +
Now add to /etc/X11/cdm/cdmrc the following lines:
 +
<pre style="color:purple">binlist=(
 +
    "/usr/bin/xinit ${HOME}/.start_qtile --:0"
 +
    "/bin/bash --login"
 +
    "/bin/zsh"
 +
)
 +
namelist=(qtile "Console bash" "Console zsh")
 +
flaglist=(C C C)
 +
consolekit=no</pre>
 +
and check that ${HOME}/.start_qtile contains just the following
 +
<pre style="color:purple">exec qtile</pre>
 +
 
 +
= Notes =
 +
<references/>
 +
 
 +
= Resources =
 +
[https://github.com/qtile/qtile Qtile on Github]
 +
 
 +
[https://github.com/qtile/qtile/tree/master/examples/config Sample Configurations]
 +
 
 +
[http://docs.qtile.org/en/latest/manual/hacking.html Hacking Qtile]
 +
 
 +
[[Category:Desktop]]

Latest revision as of 00:12, 17 June 2013

Introduction

This wiki is a work in progress.

Python3 will cause errors. Use Python2 as default or at the very least, pass PYTHON=python2.7 to py2cairo and xpyb before configuring them.

"Qtile is a full-featured, hackable tiling window manager written in Python.

Qtile is simple, small, and extensible. It's easy to write your own layouts, widgets, and built-in commands.

Qtile is written and configured entirely in Python, which means you can leverage the full power and flexibility of the language to make it fit your needs.

The Qtile community is active and growing, so there's always someone to lend a hand when you need help.

Qtile is free and open-source software, distributed under the permissive MIT license"[1][2]

The Qtile Community

IRC

irc://irc.oftc.net:6667/qtile

Mailing List

qtile-dev on Google Groups

Twitter

@qtile on Twitter

Forum

[kobraz.org.ua/qforum]

After on people begin used this forum, we move it to qtile.org

Troubleshooting

Issues

Documentation

Qtile Documentation

Installation

Portage

# emerge qtile

Manual (Github)

This section is taken from the documents from Qtile.[3]

Dependencies

USE flags and keyword changes may have to be made for the packages taken from portage.

libxcb

libxcb can be emerged from portage.

# emerge libxcb

xpyb

xpyb can be emerge from portage. Make sure that you are emerging xpyb-1.3.1

# emerge xpyb

cairo

cairo can be emerged from portage.

Have USE flags set to
X glib opengl svg xcb

and then:

# emerge cairo

pygtk

pygtk can be emerge from portage.

# emerge pygtk

py2cairo

# git clone git://git.cairographics.org/git/py2cairo
# cd py2cairo
# ./autogen.sh --enable-xcb
# ./configure --prefix=/path/to/virtualenv
# make
# sudo make install

As an alternative to virtualenv, you can

# ./configure --prefix=/usr

But the virtualenv is the recommended option in installation.

qtile

# git clone git://github.com/qtile/qtile
# cd qtile
# sudo python setup.py install --record files_uninstall.txt

Setup

Copy either a config from the examples directory in the cloned qtile (including a default config), a config you have found elsewhere, or create your own config.

# cp /path/to/cloned-qtile/examples/config/cortesi-config.py ~/.config/qtile/config.py
# cp /path/to/cloned-qtile/examples/config/dgroups.py ~/.config/qtile/config.py
# cp /path/to/cloned-qtile/examples/config/roger-config.py ~/.config/qtile/config.py
# cp /path/to/cloned-qtile/examples/config/tailhook-config.py ~/.config/qtile/config.py

My config is config.py

The config I have based mine off of is dmpayton's config.py

Testing Qtile Installation

You can test your installation of Qtile while within another WM instance using Xephyr.

Examples:

# Xephyr :1 -screen 800x600 -a -v -noreset
# DISPLAY=:1
# /path/to/qtile/qtile

or using built in code:[4]

# echo "exec qtile" > .start_qtile ; xinit .start_qtile -- :1

For further information, see the Documentation section.

dmenu

Qtile uses dmenu as the application launcher.

# emerge dmenu

You can run dmenu from a keybind in the config.py.

xinitrc

An example of preparing Qtile to start with a startup-session script for autostarting apps. My ~/.xinitrc

#!/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

My ~/.qtile-session

conky -c ~/.conky/conkyrc_grey &
sh ~/.fehbg &
dropbox &

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 xrandr:

# emerge x11-apps/xrandr

and if you want a GUI with xrandr:

# emerge x11-misc/arandr

If you do not have X configured yet, follow the link on the Gentoo Wiki

My xorg.conf.d folder for example: 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:

# startx

or, in a case similar to mine,

# xinit qtile

Starting with CDM

Another good tool for starting qtile is CDM (short for Console Display Manager). To make it work, just merge cdm

# emerge -avt cdm

and add it to autostart with

# cp /usr/share/cdm/zzz-cdm-profile.sh /etc/profile.d/zzz-cdm-profile.sh

Now add to /etc/X11/cdm/cdmrc the following lines:

binlist=(
    "/usr/bin/xinit ${HOME}/.start_qtile --:0"
    "/bin/bash --login"
    "/bin/zsh"
)
namelist=(qtile "Console bash" "Console zsh")
flaglist=(C C C)
consolekit=no

and check that ${HOME}/.start_qtile contains just the following

exec qtile

Notes

  1. Qtile
  2. License
  3. Installation on Gentoo
  4. https: // groups.google.com/group/qtile-dev/browse_thread/thread/26191253a8190568 qtile-dev Google Group

Resources

Qtile on Github

Sample Configurations

Hacking Qtile