Results 1 to 10 of 50

Thread: AwesomeWM - A Brief Introduction

Threaded View

  1. #1
    Join Date
    Jul 2006
    Location
    Marlborough, UK
    Beans
    519
    Distro
    Ubuntu 10.04 Lucid Lynx

    AwesomeWM - A Brief Introduction

    UPDATE - 1st July 2008 This guide is terribly out of date... I'll try and update it soon - the awesomerc syntax has changed completely, but i'm not sure how long it will be before they release awesome-3, which will ruin this guide yet again... for now, post in one of the threads [link], [link], or the Arch subforums (where most of the awesome users are).

    UPDATE 24/01: The guide has now been changed for 2.1. It should cover mostly everything - if there's something i missed out, just post at the end.

    This guide has been written due to the increase of interest in tiling window managers such as Awesome, WMII, DWM, etc. It does not aim to be definitive, merely a starting point. PM me with questions, or post below. There are a number of other users of WMs like awesome on the forums, so a posted question in the right section should eventually get an answer!

    This guide is based on the awesomeWM, but as awesome is a derivative of DWM, it should bear some relevance to both DWM and wmii.

    Contents
    1. Introduction
    2. Disclaimer
    3. Install
    4. A brief tour
    5. Autostarting
    6. awesomerc
    7. Statusbar scripts
    8. Links


    1. Introduction

    Introduction to Tiling Window Managers

    The window manager you're currently using (most likely gnome, or perhaps xfce or openbox. Or kde. Any of those) will probably be a floating window manager. This means that when a window is created (eg, opening nautilus/thunar), it is either maximised, or it "floats" on the desktop. It can be resized and moved freely. In a tiling window manager (twm), the windows are tiled on the desktop. For example, if I open my terminal program (urxvt), it opens fullscreen. If I open another one, they take up half the screen each. If I open a third, one will take half the screen, and the other two share the remaining space. This is the essence of a twm.

    Why awesome is awesome
    Awesome is a tiling window manager, but (in my opinion, among other things) one of the reasons it is my favourite is that you can set it to run as a normal floating window manager, albeit one whose windows have no borders. This, coupled with its very small size (114kb according to pacman on my system), make it a great choice for someone who doesn't need eye candy, and wants a fast system.

    2. Disclaimer
    A word of warning
    The howto that follows should be totally safe, and in no way harm your system. However, I cannot be held responsible for anything that happens to your system.

    3. Install

    So, onto the guide!
    NB - all entries in "code" tags should be entered into a terminal, like gnome-terminal or xterm.

    Get awesome...

    1. Install dependencies:
    Code:
    sudo apt-get install build-essential libxinerama-dev libxrandr-dev libcairo2-dev libxft-dev libconfuse-dev asciidoc xmlto doxygen
    Download and compile confuse 2.6 (thanks mali2297:
    Code:
    cd
    wget http://bzero.se/confuse/confuse-2.6.tar.gz
    tar xf confuse-2.6.tar.gz
    cd confuse-2.6
    ./configure
    make
    sudo make install
    2. Download/install awesome:
    Code:
    cd
    wget http://awesome.naquadah.org/download/awesome-2.1.tar.gz
    tar xf awesome-2.1.tar.gz
    cd awesome-2.1
    ./configure
    make
    sudo make install
    cp awesomerc ~/.awesomerc

    3. To add an entry to GDM, do the following (thanks to Gigamo):

    "Just to help you, here is my GDM desktop entry (from when I was still running with GDM, ditched it now ) (this should be named awesome.desktop and put in /usr/share/xsessions)

    Code:
    [Desktop Entry]
    Encoding=UTF-8
    Name=Awesome
    Comment=Log in using the Awesome window manager
    Exec=/home/<username>/awesome.sh
    Icon=
    Type=Application
    where awesome.sh is the file that exec'd all the autostarted applications AND awesome on the end:
    Code:
    #!/bin/bash
    #AUTOSTARTED APPS AND SETTINGS
    
    #STATUSBAR TEXT
    
    #Launch awesome
    sleep 1 && exec awesome
    Then, make this file executable:
    Code:
    chmod +x awesome.sh
    You can put awesome.sh anywhere you like, but make sure you change the "Exec" line in awesome.desktop to match it.
    NB - Gigamo's original code is below, i've simply edited it to save space. He has a nice script for the statusbar which includes a battery level for laptops etc.

    If you're not running gdm, then you just need to edit your ~/.xinitrc file (backup first!):
    Code:
    cp .xinitrc .xinitrc.old
    nano .xinitrc
    #remove/comment out any entries for other WMs, and add:
    exec awesome
    4. Restart X, and then use "startx" to launch awesome.
    For GDM, simply logout, select awesome from the "sessions", and log back in.

    5. Congratulations! Awesome should be sitting on your desktop! Now we'll move onto customising it, and making it really useable.
    NB - this section was written with awesome-2.0. When i've had a chance to play with awesome-2.1, i'll rewrite it.

    4. A brief tour
    Welcome! The bar at the top of the screen is the "status bar", and contains tags (like workspaces), numbered 1 to 9. Next to these is the icon representing what layout you are currently using. Then is a space for the window title, then the status-text at the top right.

    Tags
    Tags are like workspaces, only better! In the awesome configuration file (more info later), you can assign tags to a program, so that it appears on 1, 2, or any number of different tags. So if you open xchat, you could get it to open on its own tag, and on an "internet" tag. Or whatever. They're much more powerful than workspaces.

    Layouts
    Awesome comes with 4 layouts - Right-tile, Left-tile, Maximised, and Floating. Right-tile means that it's in tiling mode, and the right-hand side is the secondary section, where windows that you're not focused on stack. Left-tile is the opposite, so they stack on the left. Maximised is maximised, and Floating is floating! You can also set different tags to be different layouts by default, so you could have a terminal tag which is tiled, a browser tag which is maximised, and an IM tag which is floating.

    Status
    At the moment your status-text won't say anything. Not very helpful. I'll show you how to change it a bit later.


    5. Autostarting
    Awesome has no autostart capabilities, so the easiest thing to do is make your own autostart script, call it something like autostart.sh, and add the following to it:
    Code:
    #!/bin/bash
    sleep 1
    conky &
    nitrogen --restore
    Or whatever. I put the "sleep" command in there to make sure that awesome has time to load before anything starts trying to use the desktop etc. I use nitrogen for my wallpapers, you may use something like feh instead, for which replace the nitrogen command with
    Code:
    ~/.fehbg &
    Then, to make awesome use your script, edit ~/.xinitrc again, and add this before "exec awesome":
    Code:
    /home/user/path/to/script &
    That should make awesome launch and run all your stuff (conky, feh, etc.)


    6. .awesomerc
    All awesome-specific settings are controlled by ~/.awesomerc, which has a number of different sections.

    general
    This is general settings - in 2.1, you'll need to add the "general" and "colour" sections : mine are included.

    border is whether or not to show a border around the windows. snap is (I think) the number of pixels within which windows will "snap" to edges when floating. I'm not sure what resize_hints does. opacity_unfocused is used in conjunction with xcompmgr to make unfocused windows truely transparent, and the number following it is the percentage. focus_move_pointer is to make the mouse follow the window focus. allow_lower_floats is to dis/allow windows to be floating underneath other, non-floating windows. font is the statusbar font.
    Code:
      general
        {
            border = 1
            snap = 8
            resize_hints = true
            focus_move_pointer = false
            allow_lower_floats = false
            new_become_master = true
            new_get_focus = true
            font = "gelly-8"
        }
    colors
    Again, in 2.1, you need to add these:
    Fairly self-explanatory, focused/unfocused window default colours, and border colours.
    Code:
        colors
        {
            normal_border = "#000000"
            normal_bg = "#000000"
            normal_fg = "#ffffff"
            focus_border = "#e71b3c"
            focus_bg = "#000000"
            focus_fg = "#e71b3c"
        }
    tags
    This is an important section - it controls the names and layouts of the tags along the top left. I have this in my file:
    Code:
    tags{ 
    	tag term {layout = "tile"} 
    	tag opera {layout = "max"} 
    	tag max {layout = "max"} 
    	tag floats {layout = "floating"}
        }
    Layout can be "tile","max", "floating", and "tileleft". In 2.1, they have also added "spiral" and "dwindle". Spiral is each window getting smaller, in a fibonacci spiral, dwindle is each window getting smaller towards the corner.

    layouts
    These are simply the icons for the different layouts. You can set them to what you like, but you'll have to make .png files for them.

    statusbar
    position - again, self-explanatory. You can also add "height = <value>" and "width = <value>", if you want a specific h/w.

    taglist
    These are the mouse controls for interaction with the tag list in the top left. Leave them as they are, but read through so you know what they do.
    The "Mod4" key is the windows, or super, key. Mouse1 is left click, Mouse2 is right, Mouse3 is middle, mouse4 is wheel-up, mouse5 is wheel-down.

    tasklist
    the same as taglist - the mouse controls for interaction with the taskbar section.

    textboxes
    This section isn't in there by default, but if you want the status-text to say anything (top right), then add entries here. Each entry is a "widget" which text can be piped to. Loke has a post on it in this thread, a few posts down. I've covered it briefly a bit further down in the "status-text" section.
    A typical entry is:
    Code:
    textbox mpd
          { text = "mpd" #gets changed by script }
    rules
    This is another important section - this is where you "tag" programs, and a typical entry looks like this:
    Code:
    rules{
    	rule {name="xterm" tags="term"}
    	rule {name="firefox" tags="internet"}
    }

    The other two sections are mouse and keys. These contain all the keybindings that are set by default, so the easiest way to start learning is to read through. There are A LOT of keybindings in there, and the thing to do is try and find the most useful ones and learn them first.
    All mouse related bindings go in mouse, and keyboard shortcuts go in keys.
    As an example, if you put the mouse in the tags section of the status bar and spin the wheel up, you'll flick through the tags. It doesn't work anywhere else.

    You'll want to add some shortcuts for programs here, and the ones i use most regularly are here:
    Code:
    keys
    {
        key
        {
            modkey = {"Mod4"}
            key = "t"
            command = "spawn"
            arg = "exec urxvt"
        }
        key
        {
            modkey = {"Mod4"}
            key = "o"
            command = "spawn"
            arg = "exec opera"
        }
        key
        {
            modkey = {"Mod4"}
            key = "f"
            command = "spawn"
            arg = "exec thunar"
        }
        key
        {
            modkey = {"Mod4"}
            key = "p"
            command = "spawn"
            arg = "exec pidgin"
        }
    #MPC COMMANDS
        key
        {
            modkey = {"Mod4", "Control"}
            key = "space"
            command = "spawn"
            arg = "exec mpc toggle"
        }
        key
        {
            modkey = {"Mod4", "Control"}
            key = "Left"
            command = "spawn"
            arg = "exec mpc prev"
        }
        key
        {
            modkey = {"Mod4", "Control"}
            key = "Right"
            command = "spawn"
            arg = "exec mpc next"
        }
        key
        {
            modkey = {"Mod4", "Control"}
            key = "Up"
            command = "spawn"
            arg = "exec mpc volume +1"
        }
        key
        {
            modkey = {"Mod4", "Control"}
            key = "Down"
            command = "spawn"
            arg = "exec mpc volume -1"
        }
    #END MPC
    The mpc commands are especially useful.
    You may find that occaisonally some bindings don't work, or conflict with a program. The only way round it is to change the keybindings. Also, as a note, never launch a program without the "exec" command, as it messes up and you have to log out and edit the .awesomerc file from the console to get it back to normal...


    7. Statusbar scripts
    My section looks like the following:
    Code:
      textbox mpd
                {
                    text = "mpd " #to be changed
                }
            textbox gmail
                {
                    text = " gmail" #to be changed
                }
    And the script that pipes text to it:
    Code:
    #!/bin/bash
    while true
    do
    echo 0 widget_tell mpd "[mpd: `mpc | head -n1` @ `mpc | grep volume | cut -b8-11`] " | awesome-client
    echo 0 widget_tell gmail " [`check_gmail`]" | awesome-client
    sleep 10
    done
    This basically goes "echo <screen number> widget_tell <widget name> "text" | awesome-client".
    Any script can be used to output to it. The awesome wiki has a few scripts that you can use.

    8. Links
    The website has more info, and a brief guided tour. They also have a link to their wiki, which is good for a few FAQs.
    For menus and such, see the awesome wiki.
    Last edited by shearn89; July 6th, 2008 at 01:31 PM.
    Ubuntu user #11075
    Howto: AwesomeWM (OUTDATED) || My BitBucket Page || My deviantArt page
    If you find a post helpful, click the medal icon to give thanks!
    Quote Originally Posted by chucky chuckaluck View Post
    ... wallpaper is a tiling of the opera icons.

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •