2013-01-02

Created page with "Category:Dynamic WMs (日本語) cs:Awesome en:Awesome es:Awesome fr:Awesome3 it:Awesome ko:Awesome ru:Awesome sv:Awesome zh-CN:Awesome..."

New page

[[Category:Dynamic WMs (日本語)]]

[[cs:Awesome]]

[[en:Awesome]]

[[es:Awesome]]

[[fr:Awesome3]]

[[it:Awesome]]

[[ko:Awesome]]

[[ru:Awesome]]

[[sv:Awesome]]

[[zh-CN:Awesome]]

{{Lowercase title}}

{{Article summary start|概要}}

{{Article summary text|awesome ウィンドウマネージャのインストール・使用方法・設定とカスタマイズについてのガイド。}}

{{Article summary end}}

[[Wikipedia:awesome (window manager)|awesome]] ウェブサイトより:

"''[http://awesome.naquadah.org/ awesome] は高度に設定可能な、次世代の X フレームワークウィンドウマネージャです。高速に動作し、拡張しやすく、GNU GPLv2 ライセンスを使っています。''

''パワーユーザーや開発者など、日常的に PC を使い、きめ細かいグラフィカル環境を求めている全ての人をターゲットにしています。''"

==インストール==

{{pkg|awesome}} は [[Official Repositories (日本語)|公式リポジトリ]]からインストールします。

プレリリース版を使うには、[[Arch User Repository (日本語)|AUR]] の {{aur|awesome-git}} を使って下さい。安定していないと考えられるバージョンで、設定構文が異なっているかもしれません。

== awesome を起動 ==

=== ログインマネージャを使わずに起動 ===

ログインマネージャを使わずに awesome を起動するには、シンプルにスタートアップスクリプト (例: ~/.xinitrc) に {{Ic|exec awesome}} を追加してください。

logind (または consolekit) セッションを維持する方法などについては [[xinitrc]] を見て下さい。

ログインさえせずに awesome を起動させることも可能です。[[Start X at Login (日本語)]] を見て下さい。

=== ログインマネージャで起動 ===

ログインマネージャから awesome を起動するには、[[Display Manager (日本語)|この記事]]を見て下さい。

==設定==

Awesome にはすぐに使えるデフォルト設定がありますが、遅かれ早かれあなたは設定を変更したくなるでしょう。lua ベースの設定ファイルが {{Ic|~/.config/awesome/rc.lua}} にあります。

===設定ファイルを作成===

まず、以下を実行して次のステップで必要なディレクトリを作成します:

$ mkdir -p ~/.config/awesome/

コンパイルした時はいつでも、awesome は ~/.config/awesome/rc.lua に含まれている全てのカスタム設定を使おうとします。デフォルトではこのファイルは作られないので、最初にテンプレートファイルからコピーしてくる必要があります:

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

awesome がアップデートされると設定ファイルのシンタックスはしばしば変更されます。よって、awesome に問題が起こったり、設定を変更しようとする時は、上のコマンドを繰り返すことを覚えておいて下さい。

awesome の設定について詳しくは、[http://awesome.naquadah.org/wiki/Awesome_3_configuration awesome wiki のコンフィグレーションページ]を見て下さい。

===設定のサンプル===

{{Note|awesome の設定構文は定期的に変わるので、ダウンロードしたファイルに修正を入れる必要があるかもしれません。}}

rc.lua のサンプルが以下にあります:

* http://git.sysphere.org/awesome-configs/tree/ - Awesome 3.4 configurations from Adrian C. (anrxc)

* http://pastebin.com/f6e4b064e - Darthlukan's awesome 3.4 configuration.

* 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

* ユーザによる設定ファイル http://awesome.naquadah.org/wiki/User_Configuration_Files

===Xephyr を使って rc.lua をデバッグする===

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:

$ Xephyr :1 -ac -br -noreset -screen 1152x720 &

$ DISPLAY=:1.0 awesome -c ~/.config/awesome/rc.lua.new

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.

As of July 2011, there is also {{aur|awmtt}} which provides the above functionality and more.

==テーマ==

[http://awesome.naquadah.org/wiki/Beautiful Beautiful] という lua ライブラリを使うことで awesome にテーマを適用するのに外部ファイルを使うことができるようになります。{{ic|rc.lua}} を修正せずに動的に awesome のカラーや壁紙を変更できるためとても便利です。

デフォルトのテーマは {{ic|/usr/share/awesome/themes/default}} です。これを {{ic|~/.config/awesome/themes/default}} にコピーして {{ic|rc.lua}} の {{ic|theme_path}} を変更してください。

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

詳しい説明は[http://awesome.naquadah.org/wiki/Beautiful こちら]。

[http://awesome.naquadah.org/wiki/Beautiful_themes サンプルテーマ]。

===壁紙を設定する===

Beautiful が壁紙を管理できるので、{{ic|.xinitrc}} や {{ic|.xsession}} などのファイルで壁紙を設定する必要はありません。またテーマごとに特定の壁紙を使うようにすることもできます。デフォルトのテーマファイルには wallpaper_cmd キーがあり、{{ic|beautiful.init}}("path_to_theme_file") が起動したときに与えられたコマンドが実行されます。Beautiful に壁紙について関わって欲しくない場合はコマンドを変えたりキーを削除してください。

例えば、{{ic|awsetbg}} を使って壁紙を設定するには、{{ic|theme.lua}} に選択したものを書きます:

theme.wallpaper_cmd = { "awsetbg -f .config/awesome/themes/awesome-wallpaper.png" }

{{Note|awsetbg を動かすにはデスクトップの壁紙を管理するプログラムをインストールする必要があります。'''[[Feh]]''' など。}}

====ランダム壁紙画像====

ランダムに壁紙をローテーションするには、{{ic|wallpaper_cmd}} を消去して、{{ic|.xinitrc}} に以下のスクリプトを追加してください:

{{bc|

while true;

do

awsetbg -r

sleep 15m

done &

}}

==Tips & Tricks==

Feel free to add any tips or tricks that you would like to pass on to other awesome users.

===awesome を GNOME のウィンドウマネージャとして使う===

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.

===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

===awesome 3 で 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),

===printscreen を有効にする===

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:

Lua code:

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.

===動的タグ===

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

[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!

===スペースインベーダー===

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

===Naughty ポップアップ通知===

[http://awesome.naquadah.org/wiki/Naughty naughty についての awesome wiki ページ]を見て下さい。

===ポップアップメニュー===

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 }

}

})

}}

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

===透過===

Awesome は xcompmgr を通して完全透過をサポートしています。git 版の xcompmgr を使いたいのなら、[https://aur.archlinux.org/packages.php?ID=16554 AUR] にあります。

次の一行を ~/.xinitrc に追加してください:

xcompmgr &

オプションについては ''man xcompmgr'' や [[xcompmgr]] を見て下さい。

awesome 3.4 では、ウィンドウ透過はシグナルを使って動的に設定することもできます。例えば、あなたの rc.lua に以下を加えることができます:

client.add_signal("focus", function(c)

c.border_color = beautiful.border_focus

c.opacity = 1

end)

client.add_signal("unfocus", function(c)

c.border_color = beautiful.border_normal

c.opacity = 0.7

end)

'''add_signal のエラーが出た場合は、代わりに connect_signal を使って下さい。'''

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:

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.

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 + PageUp/PageDown you can also use tansset-df available through the community package repository 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 ====

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 プログラム===

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

os.execute"dex -a -e Awesome"

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:

do

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.)

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:

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:

run_once("parcellite")

===Passing content to widgets with awesome-client===

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

{{bc|

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

mywidget.text = "initial text"

}}

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

{{bc|

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

}}

Don't forget to add the widget to your wibox.

===awesome のデフォルトと違うパネルを使う===

あなたが awesome の軽量性と機能性を買ってはいるがそのデフォルトのパネルの見た目が気に入らないときは、異なるパネルをインストールできます。xfce4-panel をインストールするには:

{{bc|

sudo pacman -S xfce4-panel

}}

勿論、他のパネルも同じようにインストールできます。

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|

properties = { floating = true } },

{ rule = { instance = "$yourapplicationlauncher" },

}}

to your rc.lua.

===Fix Java (GUI appears gray only)===

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|

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

{{Ic|/etc/profile.d/jre.sh}}

}}

===Nautilus をデスクトップに表示しないようにする (Gnome3)===

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.

#!/bin/sh

/usr/bin/nautilus-real --no-desktop $@

===Gnome3 からの移行===

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

If you wan't to keep a few convenient systray applets and your GTK theme, append this to your rc.lua;

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

===マウススクロールがタグを変えるのを防ぐ===

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)))

-- }}}

==トラブルシューティング==

===LibreOffice===

libreoffice の UI に問題がでる場合は libreoffice-gnome をインストールしてください。

===Mod4 キー===

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

$ xev

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"

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.

====Mod4 キー vs. IBM ThinkPad====

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:

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 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 [[Extra Keyboard Keys in Xorg#Step 2: Testing|(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.

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

keysym Caps_Lock = Super_L Caps_Lock

===Eclipse: メインウィンドウをリサイズ・移動できない===

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:
/.metadata/.plugins/org.eclipse.ui.workbench/ and the line to edit is
.}}

===YouTube: フルスクリーンが裏に表示される===

[https://bbs.archlinux.org/viewtopic.php?pid=1085494#p1085494] フルスクリーンモードにするとビデオがウェブブラウザの下に表示される場合、rc.lua に以下を追加してください

{ rule = { instance = "plugin-container" },

properties = { floating = true } },

Chromium には

{ rule = { instance = "exe" },

properties = { floating = true } },

===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.

===コンソール出力をファイルに書き出す===

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:

awful.key({ modkey, }, "w", function () awful.util.spawn_with_shell("luakit 2>>/tmp/luakit.log") end),

==外部リンク==

* http://awesome.naquadah.org/wiki/FAQ - FAQ

* http://www.lua.org/pil/ - Programming in Lua (first edition)

* http://awesome.naquadah.org/ - The official awesome website

* 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!

Show more