![]() |
ubuntu.com - launchpad.net - ubuntu help
|
|
|||||||
|
Tutorials & Tips The place to find Ubuntu related Tips & Tricks. |
|
|
Thread Tools | Display Modes |
|
|
#1 |
|
Quad Shot of Ubuntu
![]() Join Date: Jul 2006
Location: Marlborough, UK
Beans: 513
Ubuntu 8.04 Hardy Heron
|
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 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 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 Code:
[Desktop Entry] Encoding=UTF-8 Name=Awesome Comment=Log in using the Awesome window manager Exec=/home/<username>/awesome.sh Icon= Type=Application Code:
#!/bin/bash #AUTOSTARTED APPS AND SETTINGS #STATUSBAR TEXT #Launch awesome sleep 1 && exec awesome Code:
chmod +x awesome.sh 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 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 Code:
~/.fehbg & Code:
/home/user/path/to/script & 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"
}
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"
}
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"}
}
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 }
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
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
}
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 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.
__________________
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! Last edited by shearn89; July 6th, 2008 at 08:31 AM.. |
|
|
|
|
|
#2 |
|
Dark Roasted Ubuntu
![]() Join Date: Jul 2006
Beans: 1,015
|
Re: AwesomeWM - A Brief Introduction
It seems awesome is only in the Hardy repos, not in the Dapper, Edgy, Feisty or Gutsy repos, shearn89. On Gutsy etc. you'll have to compile from source.
This looks like a decent guide, otherwise. I've never been fond of tiling window managers (I want most of my windows fullscreen), but perhaps I'll give this another try. Last edited by urukrama; January 22nd, 2008 at 10:57 PM.. |
|
|
|
|
|
#3 |
|
Gee! These Aren't Roasted!
![]() Join Date: Dec 2007
Location: Belgium
Beans: 185
|
Re: AwesomeWM - A Brief Introduction
Great guide already. Also, thanks for the MPC binds. Those are extremely useful indeed
|
|
|
|
|
|
#4 | |
|
Quad Shot of Ubuntu
![]() Join Date: Jul 2006
Location: Marlborough, UK
Beans: 513
Ubuntu 8.04 Hardy Heron
|
Re: AwesomeWM - A Brief Introduction
Quote:
EDIT: changes made, just need to check the dependencies... And run it through myself! Maybe i'll set up an "AweBuntu" machine...
__________________
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! Last edited by shearn89; January 23rd, 2008 at 08:10 AM.. |
|
|
|
|
|
|
#5 | |
|
Gee! These Aren't Roasted!
![]() Join Date: Dec 2007
Location: Belgium
Beans: 185
|
Re: AwesomeWM - A Brief Introduction
Quote:
Code:
[Desktop Entry] Encoding=UTF-8 Name=Awesome Comment=Log in using the Awesome window manager Exec=/home/gig/awesome.sh Icon= Type=Application Code:
#!/bin/bash
xsetroot -bg black
export OOO_FORCE_DESKTOP="gnome"
if which dbus-launch >/dev/null && test -z "$DBUS_SESSION_BUS_ADDRESS"; then
eval `dbus-launch --sh-syntax --exit-with-session`
fi
xcompmgr -cC -t-3 -l-5 -r5 &
urxvtd -o -q -f &
thunar --daemon &
gnome-settings-daemon &
update-notifier &
nitrogen --restore &
restricted-manager --check &
trayer --expand true --widthtype request --transparent true --alpha 255 --edge bottom --align right &
/opt/wicd/tray.py &
(sleep 7 && urxvt -e screen) &
while true
do
sleep 10
echo "0 setstatustext [MPD: `mpc | sed -n '1p'`] :: `mpc | grep "#" | cut -c 1-9` :: [Bat: `sh 'readbattery.sh'`] :: [`date '+%A %d/%m/%Y %H:%M'`]"
done | awesome-client &
sleep 1 && exec awesome
Last edited by Gigamo; January 23rd, 2008 at 08:56 AM.. |
|
|
|
|
|
|
#6 |
|
Quad Shot of Ubuntu
![]() Join Date: Jul 2006
Location: Marlborough, UK
Beans: 513
Ubuntu 8.04 Hardy Heron
|
Re: AwesomeWM - A Brief Introduction
excellent - thanks a lot Gigamo. I'm also putting a warning about 2.1 on here, as it could scare people away from awesome given how tricky it is...
__________________
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! |
|
|
|
|
|
#7 |
|
Chocolate Ubuntu Mocha Blend
![]() |
Re: AwesomeWM - A Brief Introduction
In Awesome 2.1m, which you linked to, the ~/.awesomerc is completely different. Also, I feel I should make a note on the subject of setstatustext. Well, it's gone.
This is how you'd do it now: Code:
while true do echo 0 widget_tell mpd "[MPD: `mpc | sed -n '1p'`] :: `mpc | grep "#" | cut -c 1-9`" | awesome-client echo 1 widget_tell clock "[`date '+%a %b %d %r'`]" | awesome-client sleep 1 done Code:
screen "0"
{
general
{
# gen section
}
statusbar "mystatusbar"
{
#statusbar properties
{
#mousebinds and whatnot
}
textbox mpd #<-- The money
{
text = "-" #the - will be replaced by mpd playing
}
}
tags
{
#tags
}
colors
{
#colors
}
layouts
{
layout "tile" {image = "/usr/local/share/awesome/icons/layouts/tile.png"}
layout "tileleft" {image = "/usr/local/share/awesome/icons/layouts/tileleft.png"}
layout "max" {image = "/usr/local/share/awesome/icons/layouts/max.png"}
layout "spiral" {image = "/usr/local/share/awesome/icons/layouts/spiral.png"}
layout "dwindle" {image = "/usr/local/share/awesome/icons/layouts/dwindle.png"}
layout "floating" {image = "/usr/local/share/awesome/icons/layouts/floating.png"}
}
}
Last edited by ~LoKe; January 23rd, 2008 at 11:02 AM.. |
|
|
|
|
|
#8 |
|
Gee! These Aren't Roasted!
![]() Join Date: Dec 2007
Location: Belgium
Beans: 185
|
Re: AwesomeWM - A Brief Introduction
LoKe, could I have a look at your awesome 2.1 awesomerc? I'm thinking of upgrading too... But then I'm going to convert my awesomerc beforehand
|
|
|
|
|
|
#9 | |
|
Ubuntu Extra Shot
![]() |
Re: AwesomeWM - A Brief Introduction
I am going through on a xubuntu testbed and it says I need CAIRO What cairo do I need? A complete list of dependencies should be made and the different version.
Edit: I got it not sure what it is though but now it needs confuse 2.6+ gutsy repositories only have 2.5
__________________
Quote:
Last edited by Lostincyberspace; January 23rd, 2008 at 01:25 PM.. |
|
|
|
|
|
|
#10 |
|
Gee! These Aren't Roasted!
![]() Join Date: Dec 2007
Location: Belgium
Beans: 185
|
Re: AwesomeWM - A Brief Introduction
Code:
sudo apt-get install libcairo2-dev |
|
|
|
| Bookmarks |
| Thread Tools | |
| Display Modes | |
|
|