Difference between revisions of "Awesome"

From ArchWiki
Jump to: navigation, search
(Applications menu: added new section)
m (Added some info on using rc.lua for keyboard switching.)
 
(181 intermediate revisions by 53 users not shown)
Line 1: Line 1:
 +
{{Lowercase title}}
 
[[Category:Dynamic WMs]]
 
[[Category:Dynamic WMs]]
 
[[Category:Tiling WMs]]
 
[[Category:Tiling WMs]]
Line 9: Line 10:
 
[[ru:Awesome]]
 
[[ru:Awesome]]
 
[[sv:Awesome]]
 
[[sv:Awesome]]
[[zh-CN:Awesome]]
+
[[zh-hans: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://awesomewm.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.
 
  
== Run awesome ==
 
 
=== Without login manager ===
 
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 session.
 
 
You can also start awesome as preferred user without even logging in. See [[Start X at Login]].
 
 
=== With login manager ===
 
To start awesome from a login manager, see [[Display Manager|this article]].
 
 
==== GDM, LightDM, others using /usr/share/xsessions/ ====
 
 
Awesome automatically installs a config file for these display managers. You don't need to do anything special to see awesome offered at login.
 
 
==== KDM ====
 
 
Create as root:
 
 
{{hc|/usr/share/apps/kdm/sessions/awesome.desktop|2=
 
{{hc|/usr/share/apps/kdm/sessions/awesome.desktop|2=
 
[Desktop Entry]
 
[Desktop Entry]
Line 56: Line 42:
 
}}
 
}}
  
==Configuration==
+
=== With GNOME ===
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===
+
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.
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:
+
=== XFCE ===
$ cp /etc/xdg/awesome/rc.lua ~/.config/awesome/
 
  
The syntax of the configuration often changes when awesome updates. So, remember to repeat the command above when you get something strange with awesome, or you'd like to modify the configuration.
+
See [[Xfce#Default window manager]].
  
For more information about configuring awesome, check out the [http://awesome.naquadah.org/wiki/Awesome_3_configuration configuration page at awesome wiki]
+
== Configuration ==
  
===More configuration resources===
+
The lua based configuration file is at {{Ic|~/.config/awesome/rc.lua}}.
{{Note|The syntax of 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:
+
=== Creating the configuration file ===
  
* http://git.sysphere.org/awesome-configs/tree/ - Awesome 3.4 configurations from Adrian C. (anrxc).
+
First, run the following to create the directory needed in the next step:
* http://pastebin.com/f6e4b064e - Darthlukan's awesome 3.4 configuration.
 
* http://www.ugolnik.info/downloads/awesome/rc.lua - Awesome 3.1 configuration with small titlebar and statusbar.
 
* https://github.com/setkeh/Awesome - [[User:Setkeh|Setkeh]]'s 3.4 Configuration.
 
* https://github.com/setkeh/Awesome-Laptop-3.5 - [[User:Setkeh|Setkeh]]'s 3.5 Configuration.
 
* http://awesome.naquadah.org/wiki/User_Configuration_Files - Collection of user configurations on the awesome homepage.
 
  
===Debugging rc.lua===
+
$ mkdir -p ~/.config/awesome/
  
====Using Xephyr====
+
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:
[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 &
+
  $ cp /etc/xdg/awesome/rc.lua ~/.config/awesome/
$ 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.
+
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.
  
====Using awmtt====
+
For more information about configuring awesome, check out the [https://awesomewm.org/apidoc/documentation/90-FAQ.md.html#Configuration configuration section at awesome docs]
{{aur|awmtt}} (Awesome WM Testing Tool) is an easy to use wrapper script around Xephyr. If you want to debug your rc.lua.new, just pass it as a parameter:
 
  
$ awmtt start --config=~/.config/awesome/rc.lua.new
+
==== Examples ====
  
When you are done testing, close the window with:
+
{{Note|The API for awesome configuration changes regularly, so you will likely have to modify any file you download.}}
  
$ awmtt stop
+
Some good examples of rc.lua would be as follows:
  
===Changing Keyboard Layout===
+
* https://github.com/setkeh/Awesome-3.5 - [[User:Setkeh|Setkeh]]'s 3.5 Configuration.
 +
* http://awesome.naquadah.org/wiki/User_Configuration_Files - Collection of user configurations on the awesome homepage.
 +
* https://github.com/copycat-killer/awesome-copycats - User configuration that supports different themes, including a status bar
  
If it were necessary for someone to need a different keyboard layout [qwerty -> dvorak] there are methods for such listed [http://awesome.naquadah.org/wiki/Change_keyboard_maps#Display.2Fchange_keyboard_map here on the awesome wiki].
+
=== Extensions ===
  
==Themes==
+
Several extensions are available for awesome (3.5+):
  
[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}}.
+
{| class="wikitable"
 +
! 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
 +
|-
 +
|
 +
* [https://awesomewm.org/apidoc/libraries/naughty.html 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
 +
|-
 +
|}
  
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}}.
+
=== Autorun programs ===
beautiful.init(awful.util.getdir("config") .. "/themes/default/theme.lua")
 
  
More details [http://awesome.naquadah.org/wiki/Beautiful here]
+
To autorun programs, create a shell script via
 +
$ touch ~/.config/awesome/autorun.sh
 +
and make it executable by
 +
$ chmod +x ~/.config/awesome/autorun.sh
 +
Open {{ic|autorun.sh}} in an editor and insert the following:
 +
{{hc|head=.config/awesome/autorun.sh|output=
 +
#!/usr/bin/env bash
  
A few sample [http://awesome.naquadah.org/wiki/Beautiful_themes themes]
+
function run {
 
+
  if ! pgrep $1 ;
===Setting up your wallpaper===
+
  then
 
+
    $@&
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.
+
  fi
 
+
}
====version <3.5 (out of date)====
+
}}
 
 
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.
 
 
 
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_cmd = { "awsetbg -f .config/awesome/themes/awesome-wallpaper.png" }
 
 
 
{{Note|For awsetbg to work you need to have a program that can manage desktop backgrounds installed. For example '''[[Feh]]'''.}}
 
 
 
====version >= 3.5====
 
  
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
+
To add programs to autostart, simply append {{ic|run program [some arguments]}} to {{ic|autorun.sh}}. The {{ic|run}} function checks whether there already is an instance of {{ic|program}} running and only runs {{ic|program}} if there is none. You can check your {{ic|autorun.sh}} by running it:
  
  theme.wallpaper = "~/.config/awesome/themes/awesome-wallpaper.png"
+
  $ ~/.config/awesome/autorun.sh
  
To load the wallpaper, make sure your {{ic|rc.lua}} contains
+
If everything is fine, add the following line to your {{ic|rc.lua}}:
  
beautiful.init("~/.config/awesome/themes/default/theme.lua")
+
{{hc|head=.config/awesome/rc.lua|output=
for s = 1, screen.count() do
+
...
gears.wallpaper.maximized(beautiful.wallpaper, s, true)
+
awful.spawn.with_shell("~/.config/awesome/autorun.sh")
end
+
...
 
 
====Random Background Image====
 
 
 
add this to your {{ic|rc.lua}}(for awesome >= 3.5 ):
 
{{bc|1=
 
-- configuration - edit to your liking
 
wp_index = 1
 
wp_timeout  = 10
 
wp_path = "/path/to/wallpapers/"
 
wp_files = { "01.jpg", "02.jpg", "03.jpg" }
 
 
-- setup the timer
 
wp_timer = timer { timeout = wp_timeout }
 
wp_timer:connect_signal("timeout", function()
 
 
  -- set wallpaper to current index for all screens
 
  for s = 1, screen.count() do
 
    gears.wallpaper.maximized(wp_path .. wp_files[wp_index], s, true)
 
  end
 
 
  -- stop the timer (we don't need multiple instances running at the same time)
 
  wp_timer:stop()
 
 
  -- get next random index
 
  wp_index = math.random( 1, #wp_files)
 
 
  --restart the timer
 
  wp_timer.timeout = wp_timeout
 
  wp_timer:start()
 
end)
 
 
-- initial start when rc.lua is first run
 
wp_timer:start()
 
 
}}
 
}}
  
to automatically fetch images from a given directory you might want instead to add this to your {{ic|rc.lua}}(for awesome >= 3.5 ):
+
=== Changing keyboard layout===
{{bc|1=
+
There is multiple ways to configure keyboard layers. In the default config awesome already has the layout widget activated - but it wont show up until there is a choice. To set multiple layers temporary, run
-- {{{ Function definitions
 
  
-- scan directory, and optionally filter outputs
+
$ setxkbmap -layout "us,de"
function scandir(directory, filter)
 
    local i, t, popen = 0, {}, io.popen
 
    if not filter then
 
        filter = function(s) return true end
 
    end
 
    print(filter)
 
    for filename in popen('ls -a "'..directory..'"'):lines() do
 
        if filter(filename) then
 
            i = i + 1
 
            t[i] = filename
 
        end
 
    end
 
    return t
 
end
 
  
-- }}}
+
The awesome keyboard widget should appear, clicking on it should toggle the layout. If you want a keycombo to change the layout, you may append {{ic|-option "grp:alt_shift_toggle"}}. This for example will let you change the layout by pressing {{ic|Shift+Alt}}. So the complete command would be:
  
-- configuration - edit to your liking
+
  $ setxkbmap -layout "us,de" -option "grp:alt_shift_toggle"
wp_index = 1
 
wp_timeout = 10
 
wp_path = "/path/to/wallpapers/"
 
wp_filter = function(s) return string.match(s,"%.png$") or string.match(s,"%.jpg$") end
 
wp_files = scandir(wp_path, wp_filter)
 
 
-- setup the timer
 
wp_timer = timer { timeout = wp_timeout }
 
wp_timer:connect_signal("timeout", function()
 
 
  -- set wallpaper to current index for all screens
 
  for s = 1, screen.count() do
 
    gears.wallpaper.maximized(wp_path .. wp_files[wp_index], s, true)
 
  end
 
 
  -- stop the timer (we don't need multiple instances running at the same time)
 
  wp_timer:stop()
 
 
  -- get next random index
 
  wp_index = math.random( 1, #wp_files)
 
 
  --restart the timer
 
  wp_timer.timeout = wp_timeout
 
  wp_timer:start()
 
end)
 
 
-- initial start when rc.lua is first run
 
wp_timer:start()
 
}}
 
  
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(for awesome <= 3.4 ):
+
Or you can use Awesome itself to switch(from v.4). Add the following line in the keybindings section of rc.lua:
{{bc|
 
while true;
 
do
 
  awsetbg -r <path/to/the/directory/of/your/wallpapers>
 
  sleep 15m
 
done &
 
}}
 
  
==Tips & Tricks==
+
aweful.key({ "Shift" }, "Alt_L", function ) mykeyboardlayout.next_layout(); end)
Feel free to add any tips or tricks that you would like to pass on to other awesome users.
+
aweful.key({ "Mod1" }, "Shift_L", function ) mykeyboardlayout.next_layout(); end)
  
===Use awesome as GNOME's window manager===
+
This require you to set up witch keyboard layouts you want to be able to switch between, either by the setxkbmap command or in xorg.
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 {{AUR|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===
+
Once you've found the appropiate comand to setup your layouts, add it to [[#Autorun programs]].
{{out of date | Revelation has been marked as deprecated in the awesome wiki and the repository may be deleted at any time.}}
 
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
+
Alternatively, see [[Keyboard configuration in Xorg]].
  
===Hide / show wibox in awesome 3===
+
=== Theming ===
  
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:
+
[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}}.
  
awful.key({ modkey }, "b", function ()
+
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}}.  
    mywibox[mouse.screen].visible = not mywibox[mouse.screen].visible
 
end),
 
  
===Enable printscreens===
+
beautiful.init(awful.util.getdir("config") .. "/themes/default/theme.lua")
  
To enable printscreens in awesome through the PrtScr button you need to have a screen capturing program, e.g. [[Taking_a_Screenshot#scrot|scrot]]. See [[Taking a Screenshot]] for more options.
+
See also [https://awesomewm.org/apidoc/libraries/beautiful.html] for additional theming options. To add a useless gap for example, add
  
Next of we need to get the key name for PrtScr, most often this is named "Print" but one can never be too sure.
+
beautiful.useless_gap = 5
  
So we can run xev (found in {{pkg|xorg-xev}}) to find out:
+
At the bottom of the theming section in your {{ic|rc.lua}}.
# xev
 
  
And press the PrtScr button, the output should be something like:
+
==== Wallpaper ====
  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.
+
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.
  
Now to the configuration of awesome!
+
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
  
Somewhere in your globalkeys array (doesn't matter where) type:
+
theme.wallpaper = "~/.config/awesome/themes/awesome-wallpaper.png"
  
Lua code:
+
To load the wallpaper, make sure your {{ic|rc.lua}} contains
  
  awful.key({ }, "Print", function () awful.util.spawn("scrot -e 'mv $f ~/screenshots/ 2>/dev/null'") end),
+
beautiful.init("~/.config/awesome/themes/default/theme.lua")
 +
for s = 1, screen.count() do
 +
gears.wallpaper.maximized(beautiful.wallpaper, s, true)
 +
end
  
Also, this function saves screenshots inside ~/screenshots/, edit this to fit your needs.
+
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.
  
===Dynamic tagging===
+
To simply specify the wallpaper in your {{ic|rc.lua}}, add the following line to the theming section:
  
[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.
+
beautiful.wallpaper = awful.util.get_configuration_dir() .. "path/to/wallpaper.png"
  
[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!
+
The optional {{ic|awful.util.get_configuration_dir()}} simply returns the path to your {{ic|rc.lua}}.
  
===Space Invaders===
+
== Tips and tricks ==
[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.
+
=== Hide / show wibox ===
  
===Naughty for popup notification===
+
For awesome 4.0:
See [http://awesome.naquadah.org/wiki/Naughty the awesome wiki page on naughty].
 
  
===Popup Menus===
+
awful.key({ modkey }, "b",
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]''.
+
          function ()
 +
              myscreen = awful.screen.focused()
 +
              myscreen.mywibox.visible = not myscreen.mywibox.visible
 +
          end,
 +
          {description = "toggle statusbar"}
 +
),
  
If you want a freedesktop.org menu, you could take a look at ''[https://github.com/terceiro/awesome-freedesktop awesome-freedesktop]'' .
+
=== Screenshot ===
  
An example for awesome3:
+
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]]
{{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 = {
+
Add to the {{ic|globalkeys}} array:
  { "pidgin", "pidgin" },
 
  { "OpenOffice", "soffice-dev" },
 
  { "Graphic", "gimp" }
 
}
 
  
mymainmenu = awful.menu.new({ items = {
+
  awful.key({ }, "Print", function () awful.util.spawn("scrot -e 'mv $f ~/screenshots/ 2>/dev/null'", false) end),
                                        { "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===
+
This function saves screenshots inside {{ic|~/screenshots/}}, edit as needed.
''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].
+
=== Removing window gaps ===
  
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].
+
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
  
===Transparency===
+
  size_hints_honor = false
Awesome has support for true transparency through a [[Xorg#Composite | compositing manager]] such as {{Pkg|xcompmgr}}({{AUR|xcompmgr-git}}), compton({{AUR|compton-git}}) or {{AUR|cairo-compmgr-git}}.
 
  
To use xcompmgr, add this to your {{ic|~/.xinitrc}}:
+
=== Transparency ===
xcompmgr &
 
See ''man xcompmgr'' or [[xcompmgr]] for more options.
 
  
{{Note|Some users have seen strange behavior such as windows not touching the bottom when enabling composite. To fix this issue, install {{AUR|unagi}} from the [[AUR]] and add this to your {{ic|~/.xinitrc}}:
+
See [[composite manager]].
unagi &
 
}}
 
  
{{out of date | Awesome 3.5 has come and add_signal API has changed to connect_signal}}
+
In awesome 3.5, window transparency can be set dynamically using signals. For example, {{ic|rc.lua}} could contain the following:
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)
+
  client.connect_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, use connect_signal instead.'''
 
  
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 370: Line 251:
 
  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 378: Line 261:
 
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 394: Line 277:
  
 
==== 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 {{AUR|dex-git}} 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 ===
 +
 
 +
You can easily send text to an awesome widget. Just create a new widget:
  
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:
+
mywidget = widget({ type = "textbox", name = "mywidget" })
 +
mywidget.text = "initial text"
  
do
+
To update the text from an external source, use awesome-client:
  local cmds =
 
  {
 
    "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.)
+
echo -e 'mywidget.text = "new text"' | 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:
+
Do not forget to add the widget to your wibox.
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:
+
=== Using a different panel with awesome ===
  
run_once("parcellite")
+
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}}.
  
===Passing content to widgets with awesome-client===
+
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:
  
You can easily send text to an awesome widget. Just create a new widget:
+
  $ awesome -k rc.lua
{{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===
+
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
+
=== Application directories in menubar ===
#Run the following command or add it to your {{ic|.xinitrc}}: {{bc|wmname LG3D}}
+
 
 +
{{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}}.
  
{{Note|
+
To change this, add the following line to {{ic|rc.lua}}, ideally, under ''Menubar configuration'':
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
+
app_folders = { "/usr/share/applications/", "~/.local/share/applications/" }
{{Ic|/etc/profile.d/jre.sh}}
 
}}
 
  
{{Note|
+
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.
As of Java 1.7 and Awesome 3.5 (as installed by the awesome-git package) the fixes described above may cause undesirable behaviour related to menus not receiving proper focus. Awesome is now, apparently, a reparenting window manager as of [http://git.naquadah.org/?p&#61;awesome.git;a&#61;commit;h&#61;102063dbbdfb0bc9f43268d98f7dcb5269547395 this commit].  
 
  
If you are experiencing problems having applied the 'wmname' and '_JAVA_AWT_WM_NONREPARENTING' fixes against a recent Java and Awesome, try removing both fixes.
+
=== Pop-up menus ===
}}
 
  
===Prevent Nautilus from displaying the desktop (Gnome3)===
+
{{Style|Duplicate section?}}
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.
+
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/copycat-killer/awesome-freedesktop awesome-freedesktop]''.
  
#!/bin/sh
+
=== Applications menu ===
/usr/bin/nautilus-real --no-desktop $@
 
  
===Transitioning away from Gnome3===
+
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:
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 [[SLiM|SLiM]]), but you can do things manually if you wish. That entails setting up your [[Udev|.xinitrc properly]] and installing something like {{AUR|devmon}}.
+
  xdg_menu --format awesome --root-menu /etc/xdg/menus/arch-applications.menu >~/.config/awesome/archmenu.lua
  
If you want to keep a few convenient systray applets and your GTK theme, append this to your rc.lua;
+
=== Titlebars ===
  function start_daemon(dae)
+
 
daeCheck = os.execute("ps -eF | grep -v grep | grep -w " .. dae)
+
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:
if (daeCheck ~= 0) then
+
 
os.execute(dae .. " &")
+
  awful.key({ modkey, "Control" }, "t",
end
+
    function (c)
end
+
        -- toggle titlebar
+
        awful.titlebar.toggle(c)
procs = {"gnome-settings-daemon", "nm-applet", "kupfer", "gnome-sound-applet", "gnome-power-manager"}
+
    end)
for k = 1, #procs do
 
start_daemon(procs[k])
 
end
 
  
===Prevent the mouse scroll wheel from changing tags===
+
Then you may want to initially hide the titlebars. To do that just add this immediately after the title bar is created:
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)))
 
-- }}}
 
  
===Application directories in menubar===
+
awful.titlebar.hide(c)
  
The awesome package in [community] includes [http://awesome.naquadah.org/wiki/Menubar/3.5 menubar] (by default, pressing modkey+p will open a dmenu-like applications menu at the top of the screen). However, it only searches for .desktop files in /usr/share/applications and /usr/local/share/applications (the latter of which may not exist on most Arch users' systems). To change this, add the following line to rc.lua (ideally, under the "Menubar configuration" section):
+
=== Battery notification ===
  
app_folders = { "/usr/share/applications/", "~/.local/share/applications/" }
+
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]
  
Note that the {{ic|.desktop}} files are re-read every time each time awesome starts, thereby slowing down the startup. If you prefer other means of launching programs, the menubar can be disabled via {{ic|rc.lua}} by removing {{ic|local menubar &#61; require("menubar")}} and other references to the {{ic|menubar}} variable.
+
=== Media Controls ===
  
===Applications menu===
+
It is possible to control both volume and media playback via a combination of amixer (available via the {{pkg|alsa-utils}} package) and {{Pkg|playerctl}}. The following can be added to the relevant key binding section of your rc.lua configuration file:
  
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:
+
    -- Volume Keys
  xdg_menu --format awesome --root-menu /etc/xdg/menus/arch-applications.menu >~/.config/awesome/archmenu.lua
+
    awful.key({}, "XF86AudioLowerVolume", function ()
 +
      awful.util.spawn("amixer -q -D pulse sset Master 5%-", false)
 +
    end),
 +
    awful.key({}, "XF86AudioRaiseVolume", function ()
 +
      awful.util.spawn("amixer -q -D pulse sset Master 5%+", false)
 +
    end),
 +
    awful.key({}, "XF86AudioMute", function ()
 +
      awful.util.spawn("amixer -D pulse set Master 1+ toggle", false)
 +
    end),
 +
    -- Media Keys
 +
    awful.key({}, "XF86AudioPlay", function()
 +
      awful.util.spawn("playerctl play-pause", false)
 +
    end),
 +
    awful.key({}, "XF86AudioNext", function()
 +
      awful.util.spawn("playerctl next", false)
 +
    end),
 +
    awful.key({}, "XF86AudioPrev", function()
 +
      awful.util.spawn("playerctl previous", false)
 +
    end)
  
 
==Troubleshooting==
 
==Troubleshooting==
  
===Grey Java GUIs===
+
=== Debugging rc.lua ===
Some Java Applications may render just grey, empty windows. This is related to nonreparenting.
+
 
 +
[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
  
A fix might be uncommenting the last line in /etc/profile.d/jre.sh or set this manually.
+
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.
  
export _JAVA_AWT_WM_NONREPARENTING=1
+
==== awmtt ====
  
other Methods could be found here: http://awesome.naquadah.org/wiki/Problems_with_Java
+
{{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:
  
===LibreOffice===
+
$ awmtt start -C ~/.config/awesome/rc.lua.new
If you encounter UI problems with libreoffice install libreoffice-gnome.
 
  
===Mod4 key===
+
When you are done testing, close the window with:
  
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
+
$ awmtt stop
  
$ xev
+
Or immediately see the changes you are doing to the configuration file by issuing:
  
It should be 115 for the left one. Then add this to your ~/.xinitrc
+
$ 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 ===
 +
 
 +
{{Merge|Configuring_keyboard_layouts_in_X}}
 +
 
 +
Awesome recommends to remap {{ic|mod4}}, which by default should be '''Win key'''. If for some reason it is not 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}}
  
 
  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 566: Line 439:
 
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
  
Line 574: Line 447:
 
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">.}}
+
{{Merge|Java}}
 +
 
 +
See [http://awesome.naquadah.org/wiki/Problems_with_Java awesome wiki] and [https://bbs.archlinux.org/viewtopic.php?pid=450870].
 +
 
 +
=== 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"
 +
 
 +
=== scrot: Cannot take a mouse selected screenshot with keyboard shortcuts===
 +
 
 +
When using [[w:Scrot|scrot]], you may have problems at assigning a keyboard shortcut to the mouse selection option (formally {{ic|scrot -s}}). To fix it, add the following line to your {{ic|rc.lua}}:
 +
 
 +
awful.key( { modkey, }, <shortcut>, function () awful.util.spawn_with_shell("sleep 0.5 && scrot -s") end)
  
===YouTube: fullscreen appears in background===
+
=== YouTube: fullscreen appears in background ===
[https://bbs.archlinux.org/viewtopic.php?pid=1085494#p1085494] If YouTube videos appear underneath your web browser when in fullscreen mode, or underneath the panel with controls hidden, add this to your rc.lua
 
  
    { rule = { instance = "plugin-container" },
+
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}}
      properties = { floating = true } },
+
 
 +
{ 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 ===
 +
 
 +
{{Accuracy|Useless without reasoning, probably related to instance names}}
 +
 
 +
It does not work when the console application is invoked from a GTK terminal (e.g. LXTerminal). [[URxvt]] is known to work.
 +
 
 +
=== Duplicate menu-entries generated by Xdg-menu  ===
 +
 
 +
Xdg-menu will generate duplicate entries if you copy desktop-files from /usr/share/applications to ~/.local/share/applications even though it might be preferable to simply override the originals, for example using a different theme for a specific application. One solution to the problem is to filter the generated output trough awk to remove entries with a name identical to the previous entry.
  
===Starting console clients on specific tags===
+
  xdg_menu --format awesome --root-menu /etc/xdg/menus/arch-applications.menu | awk -F, '{if (a!=$1) print $a; a=$1}' >~/.config/awesome/archmenu.lua
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===
+
=== Some Shortcuts not Working in Xfce4 overlapping Keys ===
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].
+
Check your
 +
$ xfce4-keyboard-settings
  
As example, let's redirect [[Luakit]] output to a temporary file:
+
for Overlapping keys like "Super L" or Key Combinations which should be run by Awesome 
  
awful.key({ modkey, }, "w", function () awful.util.spawn_with_shell("luakit 2>>/tmp/luakit.log") end),
+
== See also ==
  
==External Links==
+
* https://awesomewm.org/apidoc/documentation/90-FAQ.md.html - 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
+
* https://awesomewm.org/ - The official awesome website
* http://awesome.naquadah.org/wiki/Main_Page - the awesome wiki
 
* http://www.penguinsightings.org/desktop/awesome/ - A review
 
 
* 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 00:18, 8 October 2017

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.

XFCE

See Xfce#Default window manager.

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 section at awesome docs

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

To autorun programs, create a shell script via

$ touch ~/.config/awesome/autorun.sh

and make it executable by

$ chmod +x ~/.config/awesome/autorun.sh

Open autorun.sh in an editor and insert the following:

.config/awesome/autorun.sh
#!/usr/bin/env bash

function run {
  if ! pgrep $1 ;
  then
    $@&
  fi
}

To add programs to autostart, simply append run program [some arguments] to autorun.sh. The run function checks whether there already is an instance of program running and only runs program if there is none. You can check your autorun.sh by running it:

$ ~/.config/awesome/autorun.sh

If everything is fine, add the following line to your rc.lua:

.config/awesome/rc.lua
...
awful.spawn.with_shell("~/.config/awesome/autorun.sh")
...

Changing keyboard layout

There is multiple ways to configure keyboard layers. In the default config awesome already has the layout widget activated - but it wont show up until there is a choice. To set multiple layers temporary, run

$ setxkbmap -layout "us,de"

The awesome keyboard widget should appear, clicking on it should toggle the layout. If you want a keycombo to change the layout, you may append -option "grp:alt_shift_toggle". This for example will let you change the layout by pressing Shift+Alt. So the complete command would be:

$ setxkbmap -layout "us,de" -option "grp:alt_shift_toggle"

Or you can use Awesome itself to switch(from v.4). Add the following line in the keybindings section of rc.lua:

aweful.key({ "Shift" }, "Alt_L", function ) mykeyboardlayout.next_layout(); end) 
aweful.key({ "Mod1" }, "Shift_L", function ) mykeyboardlayout.next_layout(); end)

This require you to set up witch keyboard layouts you want to be able to switch between, either by the setxkbmap command or in xorg.

Once you've found the appropiate comand to setup your layouts, add it to #Autorun programs.

Alternatively, see 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] for additional theming options. To add a useless gap for example, add

beautiful.useless_gap = 5

At the bottom of the theming section in your rc.lua.

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 [2] to rc.lua (v3.5+). To automatically fetch images from a given directory use [3] instead.

To simply specify the wallpaper in your rc.lua, add the following line to the theming section:

beautiful.wallpaper = awful.util.get_configuration_dir() .. "path/to/wallpaper.png"

The optional awful.util.get_configuration_dir() simply returns the path to your rc.lua.

Tips and tricks

Hide / show wibox

For awesome 4.0:

awful.key({ modkey }, "b",
          function ()
              myscreen = awful.screen.focused()
              myscreen.mywibox.visible = not myscreen.mywibox.visible
          end,
          {description = "toggle statusbar"}
),

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'", false) 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. [4] If you want a freedesktop.org menu, you could take a look at awesome-freedesktop.

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 [5] 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

Media Controls

It is possible to control both volume and media playback via a combination of amixer (available via the alsa-utils package) and playerctl. The following can be added to the relevant key binding section of your rc.lua configuration file:

   -- Volume Keys
   awful.key({}, "XF86AudioLowerVolume", function ()
     awful.util.spawn("amixer -q -D pulse sset Master 5%-", false)
   end),
   awful.key({}, "XF86AudioRaiseVolume", function ()
     awful.util.spawn("amixer -q -D pulse sset Master 5%+", false)
   end),
   awful.key({}, "XF86AudioMute", function ()
     awful.util.spawn("amixer -D pulse set Master 1+ toggle", false)
   end),
   -- Media Keys
   awful.key({}, "XF86AudioPlay", function()
     awful.util.spawn("playerctl play-pause", false)
   end),
   awful.key({}, "XF86AudioNext", function()
     awful.util.spawn("playerctl next", false)
   end),
   awful.key({}, "XF86AudioPrev", function()
     awful.util.spawn("playerctl previous", false)
   end)

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 is not 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 [6].

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"

scrot: Cannot take a mouse selected screenshot with keyboard shortcuts

When using scrot, you may have problems at assigning a keyboard shortcut to the mouse selection option (formally scrot -s). To fix it, add the following line to your rc.lua:

awful.key( { modkey,	 }, <shortcut>, function () awful.util.spawn_with_shell("sleep 0.5 && scrot -s") end)

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 [7].

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.

Duplicate menu-entries generated by Xdg-menu

Xdg-menu will generate duplicate entries if you copy desktop-files from /usr/share/applications to ~/.local/share/applications even though it might be preferable to simply override the originals, for example using a different theme for a specific application. One solution to the problem is to filter the generated output trough awk to remove entries with a name identical to the previous entry.

 xdg_menu --format awesome --root-menu /etc/xdg/menus/arch-applications.menu | awk -F, '{if (a!=$1) print $a; a=$1}' >~/.config/awesome/archmenu.lua

Some Shortcuts not Working in Xfce4 overlapping Keys

Check your

$ xfce4-keyboard-settings

for Overlapping keys like "Super L" or Key Combinations which should be run by Awesome

See also