Difference between revisions of "Awesome"

From ArchWiki
Jump to: navigation, search
m
m (Mod4 key: fix template)
 
(180 intermediate revisions by 60 users not shown)
Line 1: Line 1:
 +
{{Lowercase title}}
 
[[Category:Dynamic WMs]]
 
[[Category:Dynamic WMs]]
 +
[[Category:Tiling WMs]]
 
[[cs:Awesome]]
 
[[cs:Awesome]]
 
[[es:Awesome]]
 
[[es:Awesome]]
Line 9: Line 11:
 
[[sv:Awesome]]
 
[[sv:Awesome]]
 
[[zh-CN:Awesome]]
 
[[zh-CN:Awesome]]
{{Lowercase title}}
+
{{Related articles start}}
 +
{{Related|Window manager}}
 +
{{Related|Comparison of tiling window managers}}
 +
{{Related|Desktop environment}}
 +
{{Related|Display manager}}
 +
{{Related|File manager functionality}}
 +
{{Related|Xdg-menu}}
 +
{{Related articles end}}
 +
From the [https://awesome.naquadah.org/ awesome website]:
  
{{Article summary start}}
+
:''[[Wikipedia:awesome (window manager)|awesome]] is a highly configurable, next generation framework window manager for X. It is very fast, extensible and licensed under the GNU GPLv2 license. It is primarily targeted at power users, developers and any people dealing with every day computing tasks and who want to have fine-grained control on its graphical environment.''
{{Article summary text|A guide on how to install, use, configure, and customize awesome window manager.}}
+
{{Article summary end}}
+
  
From the [[Wikipedia:awesome (window manager)|awesome]] website:
+
== Installation ==
  
"''[http://awesome.naquadah.org/ awesome] is a highly configurable, next generation framework window manager for X. It is very fast, extensible and licensed under the GNU GPLv2 license.''
+
[[Install]] {{pkg|awesome}}. The development version is {{AUR|awesome-git}}, which is considered unstable and may have a different configuration API.
  
''It is primarly targeted at power users, developers and any people dealing with every day computing tasks and who want to have fine-grained control on its graphical environment.''"
+
To run awesome from [[Xinitrc]], add {{Ic|exec awesome}} to {{ic|~/.xinitrc}}. To use the included [[xsession]] file, see [[Display manager]].
  
==Installation==
+
=== KDM ===
  
Install {{pkg|awesome}} from the [[official repositories]].
+
Create as root:
  
For pre-release versions, an {{aur|awesome-git}} build is in the [[Arch User Repository|AUR]].  These versions are not considered stable and may have a different configuration syntax.
+
{{hc|/usr/share/apps/kdm/sessions/awesome.desktop|2=
 +
[Desktop Entry]
 +
Name=Awesome
 +
Comment=Tiling Window Manager
 +
Type=Application
 +
Exec=/usr/bin/awesome
 +
TryExec=/usr/bin/awesome
 +
}}
  
== Run awesome ==
+
=== With GNOME ===
  
=== Without login manager ===
+
You can set up [[GNOME]] to use awesome as the visual interface, but have GNOME work in the background. See [http://awesome.naquadah.org/wiki/Quickly_Setting_up_Awesome_with_Gnome awesome wiki] for details.
To run awesome without a login manager, simply add {{Ic|exec awesome}} to the startup script of your choice (e.g. ~/.xinitrc.)
+
  
See [[xinitrc]] for details, such as preserving the logind (and/or consolekit) session.
+
== Configuration ==
  
You can also start awesome as preferred user without even logging in. See [[Start X at Login]].
+
The lua based configuration file is at {{Ic|~/.config/awesome/rc.lua}}.
  
=== With login manager ===
+
=== Creating the configuration file ===
To start awesome from a login manager, see [[Display Manager|this article]].
+
  
==Configuration==
 
Awesome includes some good default settings right out of the box, but sooner or later you'll want to change something. The lua based configuration file is at {{Ic|~/.config/awesome/rc.lua}}.
 
 
===Creating the configuration file===
 
 
First, run the following to create the directory needed in the next step:
 
First, run the following to create the directory needed in the next step:
 +
 
  $ mkdir -p ~/.config/awesome/
 
  $ mkdir -p ~/.config/awesome/
  
 
Whenever compiled, awesome will attempt to use whatever custom settings are contained in ~/.config/awesome/rc.lua. This file is not created by default, so we must copy the template file first:
 
Whenever compiled, awesome will attempt to use whatever custom settings are contained in ~/.config/awesome/rc.lua. This file is not created by default, so we must copy the template file first:
 +
 
  $ cp /etc/xdg/awesome/rc.lua ~/.config/awesome/
 
  $ cp /etc/xdg/awesome/rc.lua ~/.config/awesome/
  
The syntax of the configuration often changes when awesome updates. So, remember to repeate the command above when you get something strange with awesome, or you'd like to modify the configuration.
+
The API for the configuration often changes when awesome updates. So, remember to repeat the command above when you get something strange with awesome, or you want to modify the configuration.
  
 
For more information about configuring awesome, check out the [http://awesome.naquadah.org/wiki/Awesome_3_configuration configuration page at awesome wiki]
 
For more information about configuring awesome, check out the [http://awesome.naquadah.org/wiki/Awesome_3_configuration configuration page at awesome wiki]
  
===More configuration resources===
+
==== Examples ====
{{Note|The syntax of awesome configuration changes regularly, so you will likely have to modify any file you download.}}
+
 
 +
{{Note|The API for awesome configuration changes regularly, so you will likely have to modify any file you download.}}
  
 
Some good examples of rc.lua would be as follows:
 
Some good examples of rc.lua would be as follows:
  
* http://git.sysphere.org/awesome-configs/tree/ - Awesome 3.4 configurations from Adrian C. (anrxc)
+
* https://github.com/setkeh/Awesome-3.5 - [[User:Setkeh|Setkeh]]'s 3.5 Configuration.
* http://pastebin.com/f6e4b064e - Darthlukan's awesome 3.4 configuration.
+
* http://awesome.naquadah.org/wiki/User_Configuration_Files - Collection of user configurations on the awesome homepage.
* http://www.calmar.ws/dotfiles/dotfiledir/dot_awesomerc.lua
+
* http://www.ugolnik.info/downloads/awesome/rc.lua (screen) - Awesome 3 with small titlebar and statusbar.
+
* http://github.com/nblock/config/blob/master/.config/awesome/rc.lua
+
* https://github.com/setkeh/Awesome - [[User:Setkeh|Setkeh]]'s 3.4 Configuration
+
* User Configuration Files  http://awesome.naquadah.org/wiki/User_Configuration_Files
+
  
===Debug rc.lua using Xephyr===
+
=== Extensions ===
  
This is my prefered way to debug rc.lua, without breaking my current desktop. I first copy my rc.lua into a new file, rc.lua.new, and modify it as needed. Then, I run new instance of awesome in Xephyr (allows you to run X nested in another X's client window, supplying rc.lua.new as a config file like this:
+
Several extensions are available for awesome (3.5+):
  
$ Xephyr :1 -ac -br -noreset -screen 1152x720 &
+
{| class="wikitable"
$ DISPLAY=:1.0 awesome -c ~/.config/awesome/rc.lua.new
+
! style="font-weight: bold;" | Extension
 +
! style="font-weight: bold;" | Functionality
 +
|-
 +
|
 +
* [http://awesome.naquadah.org/wiki/Revelation Revelation]
 +
| Bring up a view of all opened clients
 +
|-
 +
|
 +
* [http://awesome.naquadah.org/wiki/Shifty Shifty]
 +
| Dynamic tagging
 +
|-
 +
|
 +
* [http://awesome.naquadah.org/wiki/Naughty Naughty]
 +
| Pop-up notifications
 +
|-
 +
|
 +
* [http://awesome.naquadah.org/wiki/Vicious Vicious] ([http://git.sysphere.org/vicious/tree/README README])
 +
* [http://awesome.naquadah.org/wiki/Obvious Obvious]
 +
* [http://awesome.naquadah.org/wiki/Bashets Bashets]
 +
| Additional [http://awesome.naquadah.org/wiki/Widgets_in_awesome widgets]
 +
|-
 +
|
 +
* [http://awesome.naquadah.org/wiki/Run_or_raise Run or raise]
 +
| Start a program if no instance exists, else jump to it
 +
|-
 +
|}
  
Big advantage of this approach is that if I break rc.lua.new, I do not break my current awesome desktop (and possibly crash all my X apps, lose all unsaved things and so on...). Once I'm happy with my new settings, I move rc.lua.new to rc.lua and restart awesome. And I can be sure it will work and restarting with new config won't mess up things.
+
=== Autorun programs ===
  
As of July 2011, there is also {{aur|awmtt}} which provides the above functionality and more.
+
See [http://awesome.naquadah.org/wiki/Autostart awesome wiki] and [[Autostart]].
  
==Themes==
+
=== Changing keyboard layout===
 +
 
 +
See [http://awesome.naquadah.org/wiki/Change_keyboard_maps#Display.2Fchange_keyboard_map awesome wiki] and [[Keyboard configuration in Xorg]].
 +
 
 +
=== Theming ===
  
 
[http://awesome.naquadah.org/wiki/Beautiful Beautiful] is a lua library that allows you to theme awesome using an external file, it becomes very easy to dynamically change your whole awesome colours and wallpaper without changing your {{ic|rc.lua}}.  
 
[http://awesome.naquadah.org/wiki/Beautiful Beautiful] is a lua library that allows you to theme awesome using an external file, it becomes very easy to dynamically change your whole awesome colours and wallpaper without changing your {{ic|rc.lua}}.  
  
 
The default theme is at {{ic|/usr/share/awesome/themes/default}}. Copy it to {{ic|~/.config/awesome/themes/default}} and change {{ic|theme_path}} in {{ic|rc.lua}}.  
 
The default theme is at {{ic|/usr/share/awesome/themes/default}}. Copy it to {{ic|~/.config/awesome/themes/default}} and change {{ic|theme_path}} in {{ic|rc.lua}}.  
 +
 
  beautiful.init(awful.util.getdir("config") .. "/themes/default/theme.lua")
 
  beautiful.init(awful.util.getdir("config") .. "/themes/default/theme.lua")
  
More details [http://awesome.naquadah.org/wiki/Beautiful here]
+
See also [http://awesome.naquadah.org/wiki/Beautiful] and [http://awesome.naquadah.org/wiki/Beautiful_themes].
  
A few sample [http://awesome.naquadah.org/wiki/Beautiful_themes themes]
+
==== Wallpaper ====
  
===Setting up your wallpaper===
+
Beautiful can handle your wallpaper, thus you do not need to set it up in your {{ic|.xinitrc}} or {{ic|.xsession}} files. This allows you to have a specific wallpaper for each theme.
  
Beautiful can handle your wallpaper, thus you do not need to set it up in your {{ic|.xinitrc}} or {{ic|.xsession}} files. This allows you to have a specific wallpaper for each theme. If you take a look at the default theme file you'll see a wallpaper_cmd key, the given command is executed when {{ic|beautiful.init}}("path_to_theme_file") is run. You can put here you own command or remove/comment the key if you do not want Beautiful to interfere with your wallpaper business.
+
With version 3.5 Awesome no longer provides a awsetbg command, instead it has a gears module. You can set your wallpaper inside {{ic|theme.lua}} with  
  
For instance, if you use {{ic|awsetbg}} to set your wallpaper, you can write in the {{ic|theme.lua}} page that you just selected:
+
theme.wallpaper = "~/.config/awesome/themes/awesome-wallpaper.png"
  
theme.wallpaper_cmd = { "awsetbg -f .config/awesome/themes/awesome-wallpaper.png" }
+
To load the wallpaper, make sure your {{ic|rc.lua}} contains
  
{{Note|For awsetbg to work you need to have a program that can manage desktop backgrounds installed. For example '''[[Feh]]'''.}}
+
beautiful.init("~/.config/awesome/themes/default/theme.lua")
 +
for s = 1, screen.count() do
 +
gears.wallpaper.maximized(beautiful.wallpaper, s, true)
 +
end
  
====Random Background Image====
+
For a random background image, add [https://gist.github.com/anonymous/37f3b1c58d6616cab756] to {{ic|rc.lua}} (v3.5+). To automatically fetch images from a given directory use [https://gist.github.com/anonymous/9072154f03247ab6e28c] instead.
To rotate the wallpapers randomly, just comment the {{ic|wallpaper_cmd}} line above, and add a script into your {{ic|.xinitrc}} with the codes below:
+
{{bc|
+
while true;
+
do
+
  awsetbg -r <path/to/the/directory/of/your/wallpapers>
+
  sleep 15m
+
done &
+
}}
+
  
==Tips & Tricks==
+
== Tips and tricks ==
Feel free to add any tips or tricks that you would like to pass on to other awesome users.
+
  
===Use awesome as GNOME's window manager===
+
=== Hide / show wibox ===
GNOME has the advantage of being very "ready to use" and integrating. You can set up GNOME to use awesome as the visual interface, but have GNOME work in the background for your pleasure. If you are using GNOME 3, you can simply install the [https://aur.archlinux.org/packages.php?ID=53096 awesome-gnome] package, then when logging in with GDM, choose the session type "Awesome GNOME". See the [http://awesome.naquadah.org/wiki/Quickly_Setting_up_Awesome_with_Gnome awesome wiki] for details.
+
 
+
===Expose effect like compiz===
+
 
+
Revelation brings up a view of all your open clients; left-clicking a client pops to the first tag that client is visible on and raises/focuses the client. In addition, the Enter key pops to the currently focused client, and Escape aborts.
+
 
+
http://awesome.naquadah.org/wiki/Revelation
+
 
+
===Hide / show wibox in awesome 3===
+
  
 
To map Modkey-b to hide/show default statusbar on active screen (as default in awesome 2.3), add to your ''globalkeys'' in rc.lua:
 
To map Modkey-b to hide/show default statusbar on active screen (as default in awesome 2.3), add to your ''globalkeys'' in rc.lua:
Line 128: Line 150:
 
  end),
 
  end),
  
===Enable printscreens===
+
=== Screenshot ===
 
+
To enable printscreens in awesome through the PrtScr button you need to have a screen capturing program.
+
Scrot is a easy to use utility for this purpose and is available in Arch repositories.
+
 
+
Just type:
+
# pacman -S scrot
+
 
+
and install optional dependencies if you feel that you need them.
+
 
+
Next of we need to get the key name for PrtScr, most often this is named "Print" but one can never be too sure.
+
 
+
Start up:
+
# xev
+
 
+
And press the PrtScr button, the output should be something like:
+
  KeyPress event ....
+
      root 0x25c, subw 0x0, ...
+
      state 0x0, keycode 107 (keysym 0xff61, '''Print'''), same_screen YES,
+
      ....
+
 
+
In my case as you see, the keyname is Print.
+
 
+
Now to the configuration of awesome!
+
  
Somewhere in your globalkeys array (doesn't matter where) type:
+
See [[Extra keyboard keys]] to ensure the {{ic|PrtSc}} button is assigned correctly. Then install a [[Taking a screenshot|screen capturing program]] such as [[Taking a screenshot#scrot|scrot]]
  
Lua code:
+
Add to the {{ic|globalkeys}} array:
  
 
   awful.key({ }, "Print", function () awful.util.spawn("scrot -e 'mv $f ~/screenshots/ 2>/dev/null'") end),
 
   awful.key({ }, "Print", function () awful.util.spawn("scrot -e 'mv $f ~/screenshots/ 2>/dev/null'") end),
  
Also, this function saves screenshots inside ~/screenshots/, edit this to fit your needs.
+
This function saves screenshots inside {{ic|~/screenshots/}}, edit as needed.
  
===Dynamic tagging===
+
=== Removing window gaps ===
  
[http://awesome.naquadah.org/wiki/Eminent Eminent] is a small lua library that monkey-patches awful to provide you with effortless and quick wmii-style dynamic tagging. Unlike shifty, eminent does not aim to provide a comprehensive tagging system, but tries to make dynamic tagging as simple as possible. In fact, besides importing the eminent library, you do not have to change your rc.lua at all, eminent does all the work for you.
+
As of awesome 3.4, it is possible to remove the small gaps between windows; in the ''awful.rules.rules'' table there is a ''properties'' section, add to it
  
[http://awesome.naquadah.org/wiki/Shifty Shifty] is an Awesome 3 extension that implements dynamic tagging. It also implements fine client matching configuration allowing YOU to be the master of YOUR desktop only by setting two simple config variables and some keybindings!
+
  size_hints_honor = false
  
===Space Invaders===
+
=== Transparency ===
[http://awesome.naquadah.org/wiki/Space_Invaders Space Invaders] is a demo to show the possibilities of the Awesome Lua API.
+
  
Please note that it is no longer included in the Awesome package since the 3.4-rc1 release.
+
See [[composite manager]].
  
===Naughty for popup notification===
+
In awesome 3.5, window transparency can be set dynamically using signals. For example, {{ic|rc.lua}} could contain the following:
See [http://awesome.naquadah.org/wiki/Naughty the awesome wiki page on naughty].
+
  
===Popup Menus===
+
  client.connect_signal("focus", function(c)
There's a simple menu by default in awesome3, and customed menus seem very easy now. However, if you're using 2.x awesome, have a look at ''[http://awesome.naquadah.org/wiki/Awful.menu awful.menu]''.
+
 
+
If you want a freedesktop.org menu, you could take a look at ''[https://github.com/terceiro/awesome-freedesktop awesome-freedesktop]'' .
+
 
+
An example for awesome3:
+
{{bc|1=
+
myawesomemenu = {
+
  { "lock", "xscreensaver-command -activate" },
+
  { "manual", terminal .. " -e man awesome" },
+
  { "edit config", editor_cmd .. " " .. awful.util.getdir("config") .. "/rc.lua" },
+
  { "restart", awesome.restart },
+
  { "quit", awesome.quit }
+
}
+
 
+
mycommons = {
+
  { "pidgin", "pidgin" },
+
  { "OpenOffice", "soffice-dev" },
+
  { "Graphic", "gimp" }
+
}
+
 
+
mymainmenu = awful.menu.new({ items = {
+
                                        { "terminal", terminal },
+
                                        { "icecat", "icecat" },
+
                                        { "Editor", "gvim" },
+
                                        { "File Manager", "pcmanfm" },
+
                                        { "VirtualBox", "VirtualBox" },
+
                                        { "Common App", mycommons, beautiful.awesome_icon },
+
                                        { "awesome", myawesomemenu, beautiful.awesome_icon }
+
                                      }
+
                            })
+
}}
+
 
+
===More Widgets in awesome===
+
''Widgets in awesome are objects that you can add to any widget-box (statusbars and titlebars), they can provide various information about your system, and are useful for having access to this information, right from your window manager. Widgets are simple to use and offer a great deal of flexibility.'' -- Source [http://awesome.naquadah.org/wiki/Widgets_in_awesome Awesome Wiki: Widgets].
+
 
+
There's a widely used widget library called '''Wicked''' (compatible with awesome versions '''prior to 3.4'''), that provides more widgets, like MPD widget, CPU usage, memory usage, etc. For more details see the [http://awesome.naquadah.org/wiki/Wicked Wicked page].
+
 
+
As a replacement for Wicked in awesome v3.4 check '''[http://awesome.naquadah.org/wiki/Vicious Vicious]''', '''[http://awesome.naquadah.org/wiki/Obvious Obvious]''' and '''[http://awesome.naquadah.org/wiki/Bashets Bashets]'''. If you pick vicious, you should also take a good look at [http://git.sysphere.org/vicious/tree/README vicious documentation].
+
 
+
===Transparency===
+
Awesome has support for true transparency through xcompmgr.  Note that you'll probably want the git version of xcompmgr, which is [https://aur.archlinux.org/packages.php?ID=16554 available in AUR]. 
+
 
+
Add this to your ~/.xinitrc:
+
xcompmgr &
+
See ''man xcompmgr'' or [[xcompmgr]] for more options.
+
 
+
In awesome 3.4, window transparency can be set dynamically using signals. For example, your rc.lua could contain the following:
+
 
+
  client.add_signal("focus", function(c)
+
 
                               c.border_color = beautiful.border_focus
 
                               c.border_color = beautiful.border_focus
 
                               c.opacity = 1
 
                               c.opacity = 1
 
                             end)
 
                             end)
  client.add_signal("unfocus", function(c)
+
  client.connect_signal("unfocus", function(c)
 
                                 c.border_color = beautiful.border_normal
 
                                 c.border_color = beautiful.border_normal
 
                                 c.opacity = 0.7
 
                                 c.opacity = 0.7
 
                               end)
 
                               end)
'''If you got error messages about add_signal, using connect_signal insteaded.'''
 
  
Note that if you are using conky, you must set it to create its own window instead of using the desktop. To do so, edit ~/.conkyrc to contain:
+
==== Conky ====
 +
{{Merge|Conky}}
 +
 
 +
If using conky, you must set it to create its own window instead of using the desktop. To do so, edit {{ic|~/.conkyrc}} to contain
  
 
  own_window yes
 
  own_window yes
Line 240: Line 190:
 
  own_window_type desktop
 
  own_window_type desktop
  
Otherwise strange behavior may be observed, such as all windows becoming fully transparent. Note also that since conky will be creating a transparent window on your desktop, any actions defined in awesome's rc.lua for the desktop will not work where conky is.
+
Otherwise strange behavior may be observed, such as all windows becoming fully transparent. Note also that since conky will be creating a transparent window on your desktop, any actions defined in awesome's {{ic|rc.lua}} for the desktop will not work where conky is.
 +
 
 +
==== wiboxes ====
  
As of Awesome 3.1, there is built-in pseudo-transparency for wiboxes. To enable it, append 2 hexadecimal digits to the colors in your theme file (~/.config/awesome/themes/default, which is usually a copy of /usr/share/awesome/themes/default), like shown here:
+
As of Awesome 3.1, there is built-in pseudo-transparency for wiboxes. To enable it, append 2 hexadecimal digits to the colors in your theme file ({{ic|~/.config/awesome/themes/default}}, which is usually a copy of {{ic|/usr/share/awesome/themes/default}}), like shown here:
  
 
  bg_normal = #000000AA
 
  bg_normal = #000000AA
Line 248: Line 200:
 
where "AA" is the transparency value.
 
where "AA" is the transparency value.
  
To change transparency for the actual selected window by pressing Modkey + PageUp/PageDown you can also use tansset-df available through the community package repository and the following modification to your rc.lua:
+
To change transparency for the actual selected window by pressing {{ic|Modkey + PgUp/PgDown}} you can also use {{Pkg|transset-df}} and the following modification to your {{ic|rc.lua}}:
 
   
 
   
 
  globalkeys = awful.util.table.join(
 
  globalkeys = awful.util.table.join(
Line 264: Line 216:
  
 
==== ImageMagick ====
 
==== ImageMagick ====
You may have problems if you set your wallpaper with imagemagick's ''display'' command, it doesn't work well with xcompmgr. Please note that awsetbg may be using ''display'' if it doesn't have any other options. Installing habak, feh, hsetroot or whatever should fix the problem (''grep -A 1 wpsetters /usr/bin/awsetbg'' to see your options).
 
  
===Autorun programs===
+
{{Merge|Composite manager}}
''See also [https://awesome.naquadah.org/wiki/Autostart the Autostart page on the Awesome wiki].''
+
  
awesome doesn't run programs set to autostart by the Freedesktop specification like GNOME or KDE. However, awesome does provide a few functions for starting programs (in addition to the Lua standard library function {{Ic|os.execute}}). To run the same programs on startup as GNOME or KDE, you can install [https://aur.archlinux.org/packages.php?ID=41099 dex] from the [[AUR]] and then run that in your rc.lua:
+
You may have problems if you set your wallpaper with imagemagick's ''display'' command. It does not work well with xcompmgr. Please note that awsetbg may be using ''display'' if it does not have any other options. Installing habak, feh, hsetroot or whatever should fix the problem (''grep -A 1 wpsetters /usr/bin/awsetbg'' to see your options).
  
os.execute"dex -a -e Awesome"
+
=== Passing content to widgets with awesome-client ===
  
If you just want to set up a list of apps for awesome to launch at startup, you can create a table of all the commands you want to spawn and loop through it:
+
You can easily send text to an awesome widget. Just create a new widget:
  
  do
+
  mywidget = widget({ type = "textbox", name = "mywidget" })
  local cmds =  
+
  mywidget.text = "initial text"
  {  
+
    "swiftfox",
+
    "mutt",
+
    "consonance",
+
    "linux-fetion",
+
    "weechat-curses",
+
    --and so on...
+
  }
+
   
+
  for _,i in pairs(cmds) do
+
    awful.util.spawn(i)
+
  end
+
end
+
  
(You could also run calls to {{Ic|os.execute}} with commands ending in '{{Ic|&}}', but it's probably a better idea to stick to the proper spawn function.)
+
To update the text from an external source, use awesome-client:
  
To run a program only if it is not currently running, you can spawn it with a shell command that runs the program only if {{Ic|pgrep}} doesn't find a running process with the same name:
+
echo -e 'mywidget.text = "new text"' | awesome-client
function run_once(prg)
+
  awful.util.spawn_with_shell("pgrep -u $USER -x " .. prg .. " || (" .. prg .. ")")
+
end
+
  
So, for example, to run {{Ic|parcellite}} only if there is not a {{Ic|parcellite}} process already running:
+
Do not forget to add the widget to your wibox.
  
run_once("parcellite")
+
=== Using a different panel with awesome ===
  
===Passing content to widgets with awesome-client===
+
If you like awesome's lightweightness and functionality but do not like the way its default panel looks, you can install a different panel, for example {{Pkg|xfce4-panel}}.
  
You can easily send text to an awesome widget. Just create a new widget:
+
Then add it to the [[#Autorun_programs|autorun section]] of your {{ic|rc.lua}}. You may also comment out the section which creates wiboxes for each screen (starting from {{ic|1=mywibox[s] = awful.wibox({ position = "top", screen = s })}}) but it is not necessary. Do not forget to check your {{ic|rc.lua}} for errors by typing:
{{bc|<nowiki>
+
mywidget = widget({ type = "textbox", name = "mywidget" })
+
mywidget.text = "initial text"
+
</nowiki>}}
+
To update the text from an external source, use awesome-client:
+
{{bc|<nowiki>
+
echo -e 'mywidget.text = "new text"' | awesome-client
+
</nowiki>}}
+
Don't forget to add the widget to your wibox.
+
  
===Using a different panel with awesome===
+
$ awesome -k rc.lua
 +
 
 +
You should also change your {{ic|''modkey''+R}} keybinding, in order to start some other application launcher instead of built in awesome. See [[List of applications#Application launchers]] for  examples. Do not forget to add:
  
If you like awesome's lightweightness and functionality but do not like the way its default panel looks, you can install a different panel. Just install xfce4-panel by issuing:
 
{{bc|
 
sudo pacman -S xfce4-panel
 
}}
 
Of course any other panel will do as well.
 
Then add it to autorun section of your rc.lua (how to do that is written elsewhere on this wiki). You can also comment out the section which creates wiboxes for each screen (starting from "mywibox[s] = awful.wibox({ position = "top", screen = s })" ) but it isn't necessary. Any way do not forget to check your rc.lua for errors by typing
 
{{bc|
 
awesome -k rc.lua
 
}}
 
Also you should change your "modkey+R" keybinding, in order to start some other application launcher instead of built in awesome. Xfrun4, bashrun, etc. Check the Application launchers section of [[Openbox_Themes_and_Apps#Application_launchers|Openbox]] article for  examples. Don't forget to add
 
 
{{bc|<nowiki>
 
{{bc|<nowiki>
 
       properties = { floating = true } },
 
       properties = { floating = true } },
 
     { rule = { instance = "$yourapplicationlauncher" },
 
     { rule = { instance = "$yourapplicationlauncher" },
 
</nowiki>}}
 
</nowiki>}}
to your rc.lua.
 
  
===Fix Java (GUI appears gray only)===
+
to your {{ic|rc.lua}}.
Guide taken from [https://bbs.archlinux.org/viewtopic.php?pid=450870].
+
#Install {{Pkg|wmname}} from community
+
#Run the following command or add it to your {{ic|.xinitrc}}: {{bc|wmname LG3D}}
+
  
{{Note|
+
=== Application directories in menubar ===
If you use a non-reparenting window manager and Java 6, you should uncomment the corresponding line in {{Ic|/etc/profile.d/openjdk6.sh}}
+
  
If you use a non-reparenting window manager and Java 7, you should uncomment the corresponding line in  
+
{{Pkg|awesome}} includes [http://awesome.naquadah.org/wiki/Menubar/3.5 menubar]. By default, pressing {{ic|''Mod''+p}} will open a dmenu-like applications menu at the top of the screen. However, this menu only searches for {{ic|.desktop}} files in {{ic|/usr/share/applications}} and {{ic|/usr/local/share/applications}}.
{{Ic|/etc/profile.d/jre.sh}}  
+
}}
+
  
===Prevent Nautilus from displaying the desktop (Gnome3)===
+
To change this, add the following line to {{ic|rc.lua}}, ideally, under ''Menubar configuration'':
Run dconf-editor. Navigate to org->gnome->desktop->background and uncheck "draw-background" as well as "show-desktop-icons" for good measure. That's it!
+
  
Another option is moving /usr/bin/nautilus to a new location and replacing it with a script that runs 'nautilus --no-desktop' passing any arguments it receives along.
+
app_folders = { "/usr/share/applications/", "~/.local/share/applications/" }
  
  #!/bin/sh
+
Note that the {{ic|.desktop}} files are re-read each time awesome starts, thereby slowing down the startup. If you prefer other means of launching programs, the menubar can be disabled in {{ic|rc.lua}} by removing {{ic|local menubar &#61; require("menubar")}} and other references to the {{ic|menubar}} variable.
/usr/bin/nautilus-real --no-desktop $@
+
  
===Transitioning away from Gnome3===
+
=== Pop-up menus ===
Run 'gnome-session-properties' and remove programs that you won't be needing anymore (e.g Bluetooth Manager, Login Sounds, etc).
+
  
If you'd like to get rid of GDM, make sure that your rc.conf DAEMONS list includes "dbus" (and "cupsd" if you have a printer). It's advisable to get a different login manager (like [https://wiki.archlinux.org/index.php/SLiM SLiM]), but you can do things manually if you wish. That entails setting up your [https://wiki.archlinux.org/index.php/Udev .xinitrc properly] and installing something like devmon ([https://aur.archlinux.org/packages.php?ID=45842 AUR]).
+
{{Style|Duplicate section?}}
  
If you wan't to keep a few convenient systray applets and your GTK theme, append this to your rc.lua;
+
There is a simple menu by default in awesome 3, simplifying custom menus. [http://awesome.naquadah.org/wiki/Awful.menu] If you want a freedesktop.org menu, you could take a look at ''[https://github.com/terceiro/awesome-freedesktop awesome-freedesktop]''. See [https://gist.github.com/anonymous/5a5ea49638662cefdb3b] for an example for awesome3.
function start_daemon(dae)
+
daeCheck = os.execute("ps -eF | grep -v grep | grep -w " .. dae)
+
if (daeCheck ~= 0) then
+
os.execute(dae .. " &")
+
end
+
end
+
+
procs = {"gnome-settings-daemon", "nm-applet", "kupfer", "gnome-sound-applet", "gnome-power-manager"}
+
for k = 1, #procs do
+
start_daemon(procs[k])
+
end
+
  
===Prevent the mouse scroll wheel from changing tags===
+
=== Applications menu ===
In your rc.lua, change the Mouse Bindings section to the following;
+
 
-- {{{ Mouse bindings
+
If you prefer to see a more traditional applications menu when you click on the Awesome icon, or right-click on an empty area of the desktop, you can follow the instructions in [[Xdg-menu#Awesome]]. However this menu is not updated when you add or remove programs. So, be sure to run the command to update your menu. It may look something like:
root.buttons(awful.util.table.join(
+
 
    awful.button({ }, 3, function () mymainmenu:toggle() end)))
+
  xdg_menu --format awesome --root-menu /etc/xdg/menus/arch-applications.menu >~/.config/awesome/archmenu.lua
  -- }}}
+
 
 +
=== Titlebars ===
 +
 
 +
It is easy to enable titlebars in awesome by simply setting the variable titlebars_enabled to true in the config file. However, you may want to be able to toggle the titlebar on or off. You can do this by simply adding something like this to your key bindings:
 +
 
 +
awful.key({ modkey, "Control" }, "t",
 +
    function (c)
 +
        -- toggle titlebar
 +
        awful.titlebar.toggle(c)
 +
    end)
 +
 
 +
Then you may want to initially hide the titlebars. To do that just add this immediately after the title bar is created:
 +
 
 +
  awful.titlebar.hide(c)
 +
 
 +
=== Battery notification ===
 +
 
 +
See [http://bpdp.blogspot.be/2013/06/battery-warning-notification-for.html] for a simple battery notification to add to {{ic|rc.lua}}. Note that its needs ''naughty'' for the notifications (installed by default in version 3.5). Other examples are available at [https://awesome.naquadah.org/wiki/Gigamo_Battery_Widget#Simple_modular_version_for_3.4 awesome wiki]
  
 
==Troubleshooting==
 
==Troubleshooting==
  
===LibreOffice===
+
=== Debugging rc.lua ===
If you encounter UI problems with libreoffice install libreoffice-gnome.
+
 
 +
[https://www.archlinux.org/packages/?q=xephyr Xephyr] allows you to run X nested in another X's client window. This allows you to debug rc.lua without breaking your current desktop. Start by copying rc.lua into a new file (e.g. rc.lua.new), and modify it as needed. Then run new instance of awesome in Xephyr, supplying rc.lua.new as a config file like this:
 +
 
 +
$ Xephyr :1 -ac -br -noreset -screen 1152x720 &
 +
$ DISPLAY=:1.0 awesome -c ~/.config/awesome/rc.lua.new
 +
 
 +
The advantage of this approach is that if you introduce bugs you do not break your current awesome desktop, potentially crashing X apps and losing work. Once you are happy with the new configuration, copy rc.lua.new to rc.lua and restart awesome.
 +
 
 +
==== awmtt ====
 +
 
 +
{{AUR|awmtt}} (Awesome WM Testing Tool) is an easy to use wrapper script around Xephyr. By default, it will use ~/.config/awesome/rc.lua.test. If it cannot find that test file, it will use your actual rc.lua. You can also specify the location of the configuration file you want to test:
 +
 
 +
$ awmtt start -C ~/.config/awesome/rc.lua.new
 +
 
 +
When you are done testing, close the window with:
 +
 
 +
$ awmtt stop
 +
 
 +
Or immediately see the changes you are doing to the configuration file by issuing:
 +
 
 +
$ awmtt restart
 +
 
 +
=== Log Files ===
 +
 
 +
If you are using [[LightDM]], awesome will log errors to `$HOME/.xsession-errors`. If you use {{ic|.xinitrc}} to start awesome, this [http://awesome.naquadah.org/wiki/FAQ#Where_are_logs.2C_error_messages_or_something.3F FAQ entry] may be a helpful resource.
  
===Mod4 key===
+
=== Mod4 key ===
  
The Mod4 is by default the '''Win key'''. If it's not mapped by default, for some reason, you can check the keycode of your Mod4 key with
+
{{Merge|Configuring_keyboard_layouts_in_X}}
  
  $ xev
+
Awesome recommends to remap {{ic|mod4}}, which by default should be '''Win key'''. If for some reason it isn't mapped to {{ic|mod4}}, use [[xmodmap]] to find out what is. To change the mapping, use {{ic|xev}} to find the keycode and name of the key to be mapped.  Then add something like the following to {{ic|~/.xinitrc}}
  
It should be 115 for the left one. Then add this to your ~/.xinitrc
 
  
 
  xmodmap -e "keycode 115 = Super_L" -e "add mod4 = Super_L"
 
  xmodmap -e "keycode 115 = Super_L" -e "add mod4 = Super_L"
 
  exec awesome
 
  exec awesome
  
The problem in this case is that some xorg installations recognize keycode 115, but incorrectly as the 'Select' key. The above command explictly remaps keycode 115 to the correct 'Super_L' key.
+
The problem in this case is that some xorg installations recognize keycode 115, but incorrectly as the 'Select' key. The above command explictly remaps keycode 115 to the correct 'Super_L' key.
  
====Mod4 key vs. IBM ThinkPad users====
+
To remap {{ic|mod4}} with {{ic|setxkbmap}} (conflict with {{ic|xmodmap}}) see:
  
IBM ThinkPads do not come equipped with a Window key (although Lenovo have changed this tradition on their ThinkPads). As of writing, the Alt key is not used in command combinations by the default rc.lua (refer to the Awesome wiki for a table of commands), which allows it be used as a replacement for the Super/Mod4/Win key. To do this, edit your rc.lua and replace:
+
tail -50 /usr/share/X11/xkb/rules/evdev
 +
 
 +
To set the caps lock key as {{ic|mod4}} add the following to {{ic|~/.xinitrc}}:
 +
 
 +
setxkbmap -option caps:hyper
 +
 
 +
 
 +
 
 +
==== Mod4 key vs. IBM ThinkPad users ====
 +
 
 +
{{Poor writing|Duplicate section}}
 +
 
 +
IBM ThinkPads, IBM Model M's and Chromebooks do not come equipped with a Window key (although Lenovo have changed this tradition on their ThinkPads). As of writing, the Alt key is not used in command combinations by the default rc.lua (refer to the Awesome wiki for a table of commands), which allows it be used as a replacement for the Super/Mod4/Win key. To do this, edit your rc.lua and replace:
  
 
  modkey = "Mod4"
 
  modkey = "Mod4"
Line 408: Line 356:
 
Note: Awesome does a have a few commands that make use of Mod4 plus a single letter. Changing Mod4 to Mod1/Alt could cause overlaps for some key combinations. The small amount of instances where this happens can be changed in the rc.lua file.
 
Note: Awesome does a have a few commands that make use of Mod4 plus a single letter. Changing Mod4 to Mod1/Alt could cause overlaps for some key combinations. The small amount of instances where this happens can be changed in the rc.lua file.
  
If you do not like to change the awesome standards, you might like to remap a key. For instance the caps lock key is rather useless (for me) adding the following contents to ~/.Xmodmap  
+
If you have a Chromebook or do not like to change the Awesome standards, you might like to remap a key. For instance the caps lock key is rather useless (for me) adding the following contents to ~/.Xmodmap
  
  clear lock  
+
  clear lock
 
  add mod4 = Caps_Lock
 
  add mod4 = Caps_Lock
  
and [[Extra Keyboard Keys in Xorg#Step 2: Testing|(re)load]] the file.
+
and run {{ic|xmodmap ~/.Xmodmap}} to (re)load the file.
 
This will change the caps lock key into the mod4 key and works nicely with the standard awesome settings. In addition, if needed, it provides the mod4 key to other X-programs as well.
 
This will change the caps lock key into the mod4 key and works nicely with the standard awesome settings. In addition, if needed, it provides the mod4 key to other X-programs as well.
  
Not confirmed, but if recent updates of xorg related packages break mentioned remapping the second line can be replaced by (tested on a DasKeyboard with no left Super key):
+
Recent updates of xorg related packages break mentioned remapping the second line can be replaced by (tested on a DasKeyboard and IBM Model M and xorg-server 1.14.5-2):
  
 
  keysym Caps_Lock = Super_L Caps_Lock
 
  keysym Caps_Lock = Super_L Caps_Lock
  
===Eclipse: cannot resize/move main window===
+
=== Fix Java (GUI appears gray only) ===
If you get stuck and cannot move or resize the main window (using mod4 + left/right mouse button) edit the workbench.xml and set fullscreen/maximized to false (if set) and reduce the width and height to numbers smaller than your single screen desktop area.
+
{{Note|workbench.xml can be found in: <eclipse_workspace>/.metadata/.plugins/org.eclipse.ui.workbench/ and the line to edit is <window height&#61;"xx" maximized&#61;"true" width&#61;"xx" x&#61;"xx" y&#61;"xx">.}}
+
  
===YouTube: fullscreen appears in background===
+
{{Merge|Java}}
[https://bbs.archlinux.org/viewtopic.php?pid=1085494#p1085494] If YouTube videos appear underneath your web browser when in fullscreen mode, add this to your rc.lua
+
  
    { rule = { instance = "plugin-container" },
+
See [http://awesome.naquadah.org/wiki/Problems_with_Java awesome wiki] and [https://bbs.archlinux.org/viewtopic.php?pid=450870].
      properties = { floating = true } },
+
 
 +
=== Eclipse: cannot resize/move main window ===
 +
 
 +
If you get stuck and cannot move or resize the main window (using mod4 + left/right mouse button) edit the {{ic|workbench.xml}} and set fullscreen/maximized to false (if set) and reduce the width and height to numbers smaller than your single screen desktop area.
 +
 
 +
{{ic|workbench.xml}} can be found in {{ic|''eclipse_workspace''/.metadata/.plugins/org.eclipse.ui.workbench/}}. Edit the line:
 +
 
 +
<window height&#61;"xx" maximized&#61;"true" width&#61;"xx" x&#61;"xx" y&#61;"xx"
 +
 
 +
=== YouTube: fullscreen appears in background ===
 +
 
 +
If YouTube videos appear underneath your web browser when in fullscreen mode, or underneath the panel with controls hidden, add this to {{ic|rc.lua}}
 +
 
 +
{ rule = { instance = "plugin-container" },
 +
  properties = { floating = true } },
  
 
With Chromium add
 
With Chromium add
  
    { rule = { instance = "exe" },
+
{ rule = { instance = "exe" },
      properties = { floating = true } },
+
  properties = { floating = true } },
 +
 
 +
or:
 +
 
 +
{ rule = { role = "_NET_WM_STATE_FULLSCREEN" },
 +
  properties = { floating = true } },
 +
 
 +
See [https://bbs.archlinux.org/viewtopic.php?pid=1085494#p1085494].
 +
 
 +
=== Prevent the mouse scroll wheel from changing tags ===
 +
In your rc.lua, change the Mouse Bindings section to the following;
 +
-- {{{ Mouse bindings
 +
root.buttons(awful.util.table.join(
 +
    awful.button({ }, 3, function () mymainmenu:toggle() end)))
 +
-- }}}
  
===Starting console clients on specific tags===
+
=== Starting console clients on specific tags ===
It does not work when the console application is invoked from a GTK terminal (e.g. LXTerminal). [[URxvt]] is known to work.
+
  
===Redirecting console output to a file===
+
{{Accuracy|Useless without reasoning, probably related to instance names}}
Some GUI application are very verbose when launched from a terminal. As a consequence, when started from Awesome, they output everything to the TTY from where Awesome was started, which tend to get messy. To remove the garbage output, you have to redirect it. However, the {{ic|awful.util.spawn}} function does not handle pipes and redirections very well as stated in [http://awesome.naquadah.org/wiki/FAQ#How_to_execute_a_shell_command.3F the official FAQ].
+
  
As example, let's redirect [[Luakit]] output to a temporary file:
+
It does not work when the console application is invoked from a GTK terminal (e.g. LXTerminal). [[URxvt]] is known to work.
  
awful.key({ modkey, }, "w", function () awful.util.spawn_with_shell("luakit 2>>/tmp/luakit.log") end),
+
== See also ==
  
==External Links==
 
 
* http://awesome.naquadah.org/wiki/FAQ - FAQ
 
* http://awesome.naquadah.org/wiki/FAQ - FAQ
 
* http://www.lua.org/pil/ - Programming in Lua (first edition)
 
* http://www.lua.org/pil/ - Programming in Lua (first edition)
 
* http://awesome.naquadah.org/ - The official awesome website
 
* http://awesome.naquadah.org/ - The official awesome website
 
* http://awesome.naquadah.org/wiki/Main_Page - the awesome wiki
 
* http://awesome.naquadah.org/wiki/Main_Page - the awesome wiki
* http://www.penguinsightings.org/desktop/awesome/ - A review
 
* http://compsoc.tardis.ed.ac.uk/wiki/AwesomeWM_guide - Awesome guide
 
 
* https://bbs.archlinux.org/viewtopic.php?id=88926 - share your awesome!
 
* https://bbs.archlinux.org/viewtopic.php?id=88926 - share your awesome!

Latest revision as of 18:26, 25 July 2016

From the awesome website:

awesome is a highly configurable, next generation framework window manager for X. It is very fast, extensible and licensed under the GNU GPLv2 license. It is primarily targeted at power users, developers and any people dealing with every day computing tasks and who want to have fine-grained control on its graphical environment.

Installation

Install awesome. The development version is awesome-gitAUR, which is considered unstable and may have a different configuration API.

To run awesome from Xinitrc, add exec awesome to ~/.xinitrc. To use the included xsession file, see Display manager.

KDM

Create as root:

/usr/share/apps/kdm/sessions/awesome.desktop
[Desktop Entry]
Name=Awesome
Comment=Tiling Window Manager
Type=Application
Exec=/usr/bin/awesome
TryExec=/usr/bin/awesome

With GNOME

You can set up GNOME to use awesome as the visual interface, but have GNOME work in the background. See awesome wiki for details.

Configuration

The lua based configuration file is at ~/.config/awesome/rc.lua.

Creating the configuration file

First, run the following to create the directory needed in the next step:

$ mkdir -p ~/.config/awesome/

Whenever compiled, awesome will attempt to use whatever custom settings are contained in ~/.config/awesome/rc.lua. This file is not created by default, so we must copy the template file first:

$ cp /etc/xdg/awesome/rc.lua ~/.config/awesome/

The API for the configuration often changes when awesome updates. So, remember to repeat the command above when you get something strange with awesome, or you want to modify the configuration.

For more information about configuring awesome, check out the configuration page at awesome wiki

Examples

Note: The API for awesome configuration changes regularly, so you will likely have to modify any file you download.

Some good examples of rc.lua would be as follows:

Extensions

Several extensions are available for awesome (3.5+):

Extension Functionality
Bring up a view of all opened clients
Dynamic tagging
Pop-up notifications
Additional widgets
Start a program if no instance exists, else jump to it

Autorun programs

See awesome wiki and Autostart.

Changing keyboard layout

See awesome wiki and Keyboard configuration in Xorg.

Theming

Beautiful is a lua library that allows you to theme awesome using an external file, it becomes very easy to dynamically change your whole awesome colours and wallpaper without changing your rc.lua.

The default theme is at /usr/share/awesome/themes/default. Copy it to ~/.config/awesome/themes/default and change theme_path in rc.lua.

beautiful.init(awful.util.getdir("config") .. "/themes/default/theme.lua")

See also [1] and [2].

Wallpaper

Beautiful can handle your wallpaper, thus you do not need to set it up in your .xinitrc or .xsession files. This allows you to have a specific wallpaper for each theme.

With version 3.5 Awesome no longer provides a awsetbg command, instead it has a gears module. You can set your wallpaper inside theme.lua with

theme.wallpaper = "~/.config/awesome/themes/awesome-wallpaper.png" 

To load the wallpaper, make sure your rc.lua contains

beautiful.init("~/.config/awesome/themes/default/theme.lua")
for s = 1, screen.count() do
	gears.wallpaper.maximized(beautiful.wallpaper, s, true)
end

For a random background image, add [3] to rc.lua (v3.5+). To automatically fetch images from a given directory use [4] instead.

Tips and tricks

Hide / show wibox

To map Modkey-b to hide/show default statusbar on active screen (as default in awesome 2.3), add to your globalkeys in rc.lua:

awful.key({ modkey }, "b", function ()
    mywibox[mouse.screen].visible = not mywibox[mouse.screen].visible
end),

Screenshot

See Extra keyboard keys to ensure the PrtSc button is assigned correctly. Then install a screen capturing program such as scrot

Add to the globalkeys array:

 awful.key({ }, "Print", function () awful.util.spawn("scrot -e 'mv $f ~/screenshots/ 2>/dev/null'") end),

This function saves screenshots inside ~/screenshots/, edit as needed.

Removing window gaps

As of awesome 3.4, it is possible to remove the small gaps between windows; in the awful.rules.rules table there is a properties section, add to it

 size_hints_honor = false

Transparency

See composite manager.

In awesome 3.5, window transparency can be set dynamically using signals. For example, rc.lua could contain the following:

client.connect_signal("focus", function(c)
                              c.border_color = beautiful.border_focus
                              c.opacity = 1
                           end)
client.connect_signal("unfocus", function(c)
                                c.border_color = beautiful.border_normal
                                c.opacity = 0.7
                             end)

Conky

Merge-arrows-2.pngThis article or section is a candidate for merging with Conky.Merge-arrows-2.png

Notes: please use the second argument of the template to provide more detailed indications. (Discuss in Talk:Awesome#)

If using conky, you must set it to create its own window instead of using the desktop. To do so, edit ~/.conkyrc to contain

own_window yes
own_window_transparent yes
own_window_type desktop

Otherwise strange behavior may be observed, such as all windows becoming fully transparent. Note also that since conky will be creating a transparent window on your desktop, any actions defined in awesome's rc.lua for the desktop will not work where conky is.

wiboxes

As of Awesome 3.1, there is built-in pseudo-transparency for wiboxes. To enable it, append 2 hexadecimal digits to the colors in your theme file (~/.config/awesome/themes/default, which is usually a copy of /usr/share/awesome/themes/default), like shown here:

bg_normal = #000000AA

where "AA" is the transparency value.

To change transparency for the actual selected window by pressing Modkey + PgUp/PgDown you can also use transset-df and the following modification to your rc.lua:

globalkeys = awful.util.table.join(
    -- your keybindings
    [...]
    awful.key({ modkey }, "Next", function (c)
        awful.util.spawn("transset-df --actual --inc 0.1")
    end),
    awful.key({ modkey }, "Prior", function (c)
        awful.util.spawn("transset-df --actual --dec 0.1")
    end),
    -- Your other key bindings
    [...]
)

ImageMagick

Merge-arrows-2.pngThis article or section is a candidate for merging with Composite manager.Merge-arrows-2.png

Notes: please use the second argument of the template to provide more detailed indications. (Discuss in Talk:Awesome#)

You may have problems if you set your wallpaper with imagemagick's display command. It does not work well with xcompmgr. Please note that awsetbg may be using display if it does not have any other options. Installing habak, feh, hsetroot or whatever should fix the problem (grep -A 1 wpsetters /usr/bin/awsetbg to see your options).

Passing content to widgets with awesome-client

You can easily send text to an awesome widget. Just create a new widget:

mywidget = widget({ type = "textbox", name = "mywidget" })
mywidget.text = "initial text"

To update the text from an external source, use awesome-client:

echo -e 'mywidget.text = "new text"' | awesome-client

Do not forget to add the widget to your wibox.

Using a different panel with awesome

If you like awesome's lightweightness and functionality but do not like the way its default panel looks, you can install a different panel, for example xfce4-panel.

Then add it to the autorun section of your rc.lua. You may also comment out the section which creates wiboxes for each screen (starting from mywibox[s] = awful.wibox({ position = "top", screen = s })) but it is not necessary. Do not forget to check your rc.lua for errors by typing:

$ awesome -k rc.lua

You should also change your modkey+R keybinding, in order to start some other application launcher instead of built in awesome. See List of applications#Application launchers for examples. Do not forget to add:

      properties = { floating = true } },
    { rule = { instance = "$yourapplicationlauncher" },

to your rc.lua.

Application directories in menubar

awesome includes menubar. By default, pressing Mod+p will open a dmenu-like applications menu at the top of the screen. However, this menu only searches for .desktop files in /usr/share/applications and /usr/local/share/applications.

To change this, add the following line to rc.lua, ideally, under Menubar configuration:

app_folders = { "/usr/share/applications/", "~/.local/share/applications/" }

Note that the .desktop files are re-read each time awesome starts, thereby slowing down the startup. If you prefer other means of launching programs, the menubar can be disabled in rc.lua by removing local menubar = require("menubar") and other references to the menubar variable.

Pop-up menus

Tango-edit-clear.pngThis article or section needs language, wiki syntax or style improvements.Tango-edit-clear.png

Reason: Duplicate section? (Discuss in Talk:Awesome#)

There is a simple menu by default in awesome 3, simplifying custom menus. [5] If you want a freedesktop.org menu, you could take a look at awesome-freedesktop. See [6] for an example for awesome3.

Applications menu

If you prefer to see a more traditional applications menu when you click on the Awesome icon, or right-click on an empty area of the desktop, you can follow the instructions in Xdg-menu#Awesome. However this menu is not updated when you add or remove programs. So, be sure to run the command to update your menu. It may look something like:

 xdg_menu --format awesome --root-menu /etc/xdg/menus/arch-applications.menu >~/.config/awesome/archmenu.lua

Titlebars

It is easy to enable titlebars in awesome by simply setting the variable titlebars_enabled to true in the config file. However, you may want to be able to toggle the titlebar on or off. You can do this by simply adding something like this to your key bindings:

awful.key({ modkey, "Control" }, "t",
   function (c)
       -- toggle titlebar
       awful.titlebar.toggle(c)
   end)

Then you may want to initially hide the titlebars. To do that just add this immediately after the title bar is created:

awful.titlebar.hide(c)

Battery notification

See [7] for a simple battery notification to add to rc.lua. Note that its needs naughty for the notifications (installed by default in version 3.5). Other examples are available at awesome wiki

Troubleshooting

Debugging rc.lua

Xephyr allows you to run X nested in another X's client window. This allows you to debug rc.lua without breaking your current desktop. Start by copying rc.lua into a new file (e.g. rc.lua.new), and modify it as needed. Then run new instance of awesome in Xephyr, supplying rc.lua.new as a config file like this:

$ Xephyr :1 -ac -br -noreset -screen 1152x720 &
$ DISPLAY=:1.0 awesome -c ~/.config/awesome/rc.lua.new

The advantage of this approach is that if you introduce bugs you do not break your current awesome desktop, potentially crashing X apps and losing work. Once you are happy with the new configuration, copy rc.lua.new to rc.lua and restart awesome.

awmtt

awmttAUR (Awesome WM Testing Tool) is an easy to use wrapper script around Xephyr. By default, it will use ~/.config/awesome/rc.lua.test. If it cannot find that test file, it will use your actual rc.lua. You can also specify the location of the configuration file you want to test:

$ awmtt start -C ~/.config/awesome/rc.lua.new

When you are done testing, close the window with:

$ awmtt stop

Or immediately see the changes you are doing to the configuration file by issuing:

$ awmtt restart

Log Files

If you are using LightDM, awesome will log errors to `$HOME/.xsession-errors`. If you use .xinitrc to start awesome, this FAQ entry may be a helpful resource.

Mod4 key

Merge-arrows-2.pngThis article or section is a candidate for merging with Configuring_keyboard_layouts_in_X.Merge-arrows-2.png

Notes: please use the second argument of the template to provide more detailed indications. (Discuss in Talk:Awesome#)

Awesome recommends to remap mod4, which by default should be Win key. If for some reason it isn't mapped to mod4, use xmodmap to find out what is. To change the mapping, use xev to find the keycode and name of the key to be mapped. Then add something like the following to ~/.xinitrc


xmodmap -e "keycode 115 = Super_L" -e "add mod4 = Super_L"
exec awesome

The problem in this case is that some xorg installations recognize keycode 115, but incorrectly as the 'Select' key. The above command explictly remaps keycode 115 to the correct 'Super_L' key.

To remap mod4 with setxkbmap (conflict with xmodmap) see:

tail -50 /usr/share/X11/xkb/rules/evdev

To set the caps lock key as mod4 add the following to ~/.xinitrc:

setxkbmap -option caps:hyper


Mod4 key vs. IBM ThinkPad users

Tango-edit-clear.pngThis article or section needs language, wiki syntax or style improvements.Tango-edit-clear.png

Reason: Duplicate section (Discuss in Talk:Awesome#)

IBM ThinkPads, IBM Model M's and Chromebooks do not come equipped with a Window key (although Lenovo have changed this tradition on their ThinkPads). As of writing, the Alt key is not used in command combinations by the default rc.lua (refer to the Awesome wiki for a table of commands), which allows it be used as a replacement for the Super/Mod4/Win key. To do this, edit your rc.lua and replace:

modkey = "Mod4"

by:

modkey = "Mod1"

Note: Awesome does a have a few commands that make use of Mod4 plus a single letter. Changing Mod4 to Mod1/Alt could cause overlaps for some key combinations. The small amount of instances where this happens can be changed in the rc.lua file.

If you have a Chromebook or do not like to change the Awesome standards, you might like to remap a key. For instance the caps lock key is rather useless (for me) adding the following contents to ~/.Xmodmap

clear lock
add mod4 = Caps_Lock

and run xmodmap ~/.Xmodmap to (re)load the file. This will change the caps lock key into the mod4 key and works nicely with the standard awesome settings. In addition, if needed, it provides the mod4 key to other X-programs as well.

Recent updates of xorg related packages break mentioned remapping the second line can be replaced by (tested on a DasKeyboard and IBM Model M and xorg-server 1.14.5-2):

keysym Caps_Lock = Super_L Caps_Lock

Fix Java (GUI appears gray only)

Merge-arrows-2.pngThis article or section is a candidate for merging with Java.Merge-arrows-2.png

Notes: please use the second argument of the template to provide more detailed indications. (Discuss in Talk:Awesome#)

See awesome wiki and [8].

Eclipse: cannot resize/move main window

If you get stuck and cannot move or resize the main window (using mod4 + left/right mouse button) edit the workbench.xml and set fullscreen/maximized to false (if set) and reduce the width and height to numbers smaller than your single screen desktop area.

workbench.xml can be found in eclipse_workspace/.metadata/.plugins/org.eclipse.ui.workbench/. Edit the line:

<window height="xx" maximized="true" width="xx" x="xx" y="xx"

YouTube: fullscreen appears in background

If YouTube videos appear underneath your web browser when in fullscreen mode, or underneath the panel with controls hidden, add this to rc.lua

{ rule = { instance = "plugin-container" },
  properties = { floating = true } },

With Chromium add

{ rule = { instance = "exe" },
  properties = { floating = true } },

or:

{ rule = { role = "_NET_WM_STATE_FULLSCREEN" },
  properties = { floating = true } },

See [9].

Prevent the mouse scroll wheel from changing tags

In your rc.lua, change the Mouse Bindings section to the following;

-- {{{ Mouse bindings
root.buttons(awful.util.table.join(
    awful.button({ }, 3, function () mymainmenu:toggle() end)))
-- }}}

Starting console clients on specific tags

Tango-inaccurate.pngThe factual accuracy of this article or section is disputed.Tango-inaccurate.png

Reason: Useless without reasoning, probably related to instance names (Discuss in Talk:Awesome#)

It does not work when the console application is invoked from a GTK terminal (e.g. LXTerminal). URxvt is known to work.

See also