#contents

* 使い方 [#j7735660]
- [[ウィンドウマネージャawesomeの基本操作 - momoto.github.io>http://momoto.github.io/blog/2013/03/27/awesome-tutorials/]]

* 設定 [#g1d32356]
[[awesome>http://awesome.naquadah.org/wiki/Main_Page]]
** Widget [#xad9b82d]
*** textclock [#y8b0d952]
- .config/awesome/rc.lua
<pre>
% diff -Nur /etc/xdg/awesome/rc.lua .config/awesome/rc.lua 
--- /etc/xdg/awesome/rc.lua	2013-10-13 08:33:20.000000000 +0900
+++ .config/awesome/rc.lua	2014-03-20 16:25:56.944716840 +0900
@@ -110,7 +111,7 @@
 
 -- {{{ Wibox
 -- Create a textclock widget
-mytextclock = awful.widget.textclock()
+mytextclock = awful.widget.textclock(" %Y.%m.%d[%a]%H:%M:%S ", 1)
 
 -- Create a wibox for each screen and add it
 mywibox = {}
</pre>

情報:[[どくたーぺっぱーちぇりお 春なのに、awesomeでおー寒っ!>http://doctorpeppercheerio.blog.fc2.com/blog-entry-92.html]]
- [[メカニカルとか好きだ: awesome 3.4でデフォルトがfloatingになってる>http://samemiso.blogspot.jp/2009/10/awesome-34floating.html]]

*** delightful [#p3315304]
- [[Delightful>http://solitudo.net/software/awesome/delightful/]]
- [[Delightful - awesome>https://awesome.naquadah.org/wiki/Delightful]]

<pre>
% &color(blue){sudo pacman -S gnome-icon-theme};
% &color(blue){yaourt -S sensors-applet};
% &color(blue){sudo pacman -S lua-socket lua-sec};
% &color(blue){sudo pacman -S libgweather};
</pre>
- [[AUR (ja) - delightful-git>https://aur.archlinux.org/packages/delightful-git/]]~
メンテされていない

*** batteryinfo [#cf9589dd]
battery.lua~
[[koentje/awesome-batteryInfo · GitHub>https://github.com/koentje/awesome-batteryInfo]]よりダウンロードしたものを、(lua attempt to concatenate global 変数名 というエラーが出たので)一部手直ししてある。
<pre>
-- This function returns a formatted string with the current battery status. It
-- can be used to populate a text widget in the awesome window manager. Based
-- on the "Gigamo Battery Widget" found in the wiki at awesome.naquadah.org

local naughty = require("naughty")
local beautiful = require("beautiful")

function batteryInfo(adapter)
  local percent
  local icon
  local battery
  local fh = io.open("/sys/class/power_supply/"..adapter.."/present", "r")
  if fh == nil then
    battery = "A/C"
    icon = ""
    percent = ""
  else
    local fcur = io.open("/sys/class/power_supply/"..adapter.."/energy_now")  
    local fcap = io.open("/sys/class/power_supply/"..adapter.."/energy_full")
    local fsta = io.open("/sys/class/power_supply/"..adapter.."/status")
    local cur = fcur:read()
    local cap = fcap:read()
    local sta = fsta:read()
    fcur:close()
    fcap:close()
    fsta:close()
    battery = math.floor(cur * 100 / cap)
  
    if sta:match("Charging") then
      icon = "⚡"
      percent = "%"
    elseif sta:match("Unknown") then
      icon = ""
      percent = "%"
    elseif sta:match("Discharging") then
      icon = ""
      percent = "%"
      if tonumber(battery) < 15 then
        naughty.notify({ title    = "Battery Warning"
               , text     = "Battery low!".."  "..battery..percent.."  ".."left!"
               , timeout  = 5
               , position = "top_right"
               , fg       = beautiful.fg_focus
               , bg       = beautiful.bg_focus
        })
      end
    end
  end
  return " "..icon..battery..percent.." "
end
</pre>

rc.lua
<pre>
--- /etc/xdg/awesome/rc.lua	2014-04-11 18:36:26.000000000 +0900
+++ /home/itou-r/.config/awesome/rc.lua	2014-09-29 07:42:24.512655019 +0900
@@ -10,6 +10,8 @@
 -- Notification library
 local naughty = require("naughty")
 local menubar = require("menubar")
+-- Battery status widget
+local battery = require("battery")
 
 -- {{{ Error handling
 -- Check if awesome encountered an error during startup and fell back to
@@ -111,6 +113,11 @@
 -- {{{ Wibox
 -- Create a textclock widget
 mytextclock = awful.widget.textclock()
+-- battery icon from http://findicons.com/search/battery
+mybatteryicon = wibox.widget.imagebox()
+mybatteryicon:set_image("/home/itou-r/.config/awesome/icons/battery_discharging_100-mod.png")
+batterywidget = wibox.widget.textbox()
+batterywidget:set_text(batteryInfo("BAT0"))
 
 -- Create a wibox for each screen and add it
 mywibox = {}
@@ -190,6 +197,8 @@
 
     -- Widgets that are aligned to the right
     local right_layout = wibox.layout.fixed.horizontal()
+    right_layout:add(mybatteryicon)
+    right_layout:add(batterywidget)
     if s == 1 then right_layout:add(wibox.widget.systray()) end
     right_layout:add(mytextclock)
     right_layout:add(mylayoutbox[s])
@@ -443,3 +452,10 @@
 client.connect_signal("focus", function(c) c.border_color = beautiful.border_focus end)
 client.connect_signal("unfocus", function(c) c.border_color = beautiful.border_normal end)
 -- }}}
+
+
+batterywidget_timer = timer({timeout = 60})
+batterywidget_timer:connect_signal("timeout", function()
+    batterywidget:set_text(batteryInfo("BAT0"))
+end)
+batterywidget_timer:start()
</pre>

- [[koentje/awesome-batteryInfo · GitHub>https://github.com/koentje/awesome-batteryInfo]]
-- [[Gigamo Battery Widget - awesome>http://awesome.naquadah.org/wiki/Gigamo_Battery_Widget]]
- [[Yet Another Battery Widget (Awesome 3.5.1) &laquo; Nim&#039;s Cynical Pleasantries>http://blog.lick-me.org/2013/08/yet-another-battery-widget-awesome-3-5-1/]]
- [[awesome - ArchWiki>https://wiki.archlinux.org/index.php/Awesome]]
- [[Widgets in awesome - awesome>http://awesome.naquadah.org/wiki/Widgets_in_awesome]]
- [[Awesome: несколько вопросов к пользующимся.>http://archlinux.org.ru/forum/topic/11265/?page=2]]

** vicious [#d0fe7fd8]
- [[Vicious - awesome>http://awesome.naquadah.org/wiki/Vicious]]
- [[Awesome-3.5/wi.lua at master · setkeh/Awesome-3.5 · GitHub>https://github.com/setkeh/Awesome-3.5/blob/master/wi.lua]]

** Blingbling [#td69c856]
- [[Blingbling - awesome>http://awesome.naquadah.org/wiki/Blingbling]]
-- [[https://github.com/cedlemo/blingbling>https://github.com/cedlemo/blingbling]]

** フォント [#w6f43097]
Window のメニューフォントが大きすぎたので、変更した。いろいろ調べてみたが、lxappearance パッケージをインストールして調節するのが一番楽だった。
<pre>
% &color(blue){sudo pacman -S lxappearance};
% &color(blue){lxappearance};
</pre>

&#x54;hinkPad X61 では、デフォルトのフォントを "Cantarell 11" -> "Sans 9" にするとちょうどよい感じになった。lxappearance を実行すると、以下のファイルが生成されていた。

~/.gtkrc-2.0
<pre>
# DO NOT EDIT! This file will be overwritten by LXAppearance.
# Any customization should be done in ~/.gtkrc-2.0.mine instead.

gtk-theme-name="Adwaita"
gtk-icon-theme-name="gnome"
gtk-font-name="Sans 9"
gtk-cursor-theme-size=0
gtk-toolbar-style=GTK_TOOLBAR_BOTH
gtk-toolbar-icon-size=GTK_ICON_SIZE_LARGE_TOOLBAR
gtk-button-images=1
gtk-menu-images=1
gtk-enable-event-sounds=1
gtk-enable-input-feedback-sounds=1
gtk-xft-antialias=1
gtk-xft-hinting=1
gtk-xft-hintstyle="hintfull"
gtk-xft-rgba="rgb"
include "/home/hogehoge/.gtkrc-2.0.mine"
</pre>

- [[[ubuntu] 9.04 awesome wm fonts are too big>http://ubuntuforums.org/showthread.php?t=1194981]]
- [[11.10 - Fonts in menu are larger than they should be under Awesome WM - Ask Ubuntu>http://askubuntu.com/questions/82095/fonts-in-menu-are-larger-than-they-should-be-under-awesome-wm]]
- [[気の向くままに ~備忘録@wiki~ - Ubuntu Linux 10.10 - デスクトップ環境>http://www10.atwiki.jp/shirayuu/pages/55.html#id_d01f5f20]]

* Screenshot [#l81cee43]
スクリーンショットを撮るコマンドをインストールして、それを有効にすればよい。[[Scrot>http://freecode.com/projects/scrot]]あたりが良さげな感じ。(ちなみに、Scrot の作者の Tom Gilbert 氏は以前よく使っていた camE の作者でもある。)

ファイル名を指定しなければ %Y-%m-%d_%H%M%S_$wx$h_scrot.png という名前でカレントディレクトリに保存される。

** カレントウィンドを撮る [#i0c1954e]
<pre>
$ &color(blue){scrot}; &color(red){-u};
</pre>

** 遅延 [#da38e8c2]
5秒後にスクリーンショットを撮る
<pre>
$ &color(blue){scrot}; &color(red){-d 5};
</pre>

** カウントダウンする [#fe8e40c5]
-c オプションをつけると、1秒毎にカウントダウンしてくれる。
<pre>
$ &color(blue){scrot}; &color(red){-d 5 -c};
</pre>

- [[awesome - ArchWiki - Enable printscreens>https://wiki.archlinux.org/index.php/awesome#Enable_printscreens]]
- [[Taking a screenshot - ArchWiki>https://wiki.archlinux.org/index.php/Taking_a_screenshot]]


* 情報 [#g5b98e50]
- [[~nabeken/diary/ : 今日からはじめるawesomeチュートリアル (3.4版)>http://projects.tsuntsun.net/~nabeken/diary/Awesome/tutorial-1.html]]
- [[lay.sakuraの遊び場: awesome WM の導入と設定>http://lay-sakura.blogspot.jp/2010/11/awesome-wm.html]]
- [[kmaed/kmawesome · GitHub>https://github.com/kmaed/kmawesome]]
- [[どくたーぺっぱーちぇりお 春なのに、awesomeでおー寒っ!>http://doctorpeppercheerio.blog.fc2.com/blog-entry-92.html]]
- [[awesome-dotfiles/rc.lua at master · Mic92/awesome-dotfiles · GitHub>https://github.com/Mic92/awesome-dotfiles/blob/master/rc.lua]]
- [[Custom Awesome Config>https://raw.githubusercontent.com/fernol/awesome-wm/master/rc.lua]]

トップ   差分 バックアップ リロード   一覧 単語検索 最終更新   ヘルプ   最終更新のRSS