ラベル awesome の投稿を表示しています。 すべての投稿を表示
ラベル awesome の投稿を表示しています。 すべての投稿を表示

2009年12月13日日曜日

awesome の config file を github にうpした

http://github.com/mamimu/awesome-window-manager-config
awesome以外にも,vimやらscreenやらzshやらもうpしてるよ★

2009年12月11日金曜日

awesome 3.4でcpuやmemの使用率を表示させる.

やり方がわからなかったけど,調べたら出てきたので載せる
sudo apt-get install git-core
cd .config/awesome
git clone http://git.sysphere.org/vicious
vi rc.lua
-- Standard awesome library
require("vicious")
require("wicked")
require("awful")
require("awful.autofocus")
require("awful.rules")
-- Theme handling library
require("beautiful")
-- Notification library
require("naughty")
-- Load Debian menu entries
require("debian.menu")

-- {{{ Variable definitions
-- Themes define colours, icons, and wallpapers
beautiful.init("/usr/share/awesome/themes/default/theme.lua")
-- beautiful.init("/usr/share/awesome/themes/zenburn/theme.lua")
--zenburn
-- This is used later as the default terminal and editor to run.
terminal = "x-terminal-emulator"
editor = os.getenv("EDITOR") or "editor"
editor_cmd = terminal .. " -e " .. editor

-- Default modkey.
-- Usually, Mod4 is the key with a logo between Control and Alt.
-- If you do not like this or do not have such a key,
-- I suggest you to remap Mod4 to another key using xmodmap or other tools.
-- However, you can use another modifier like Mod1, but it may interact with others.
modkey = "Mod3"

-- Table of layouts to cover with awful.layout.inc, order matters.
layouts =
{
awful.layout.suit.tile,
awful.layout.suit.tile.left,
awful.layout.suit.tile.bottom,
awful.layout.suit.tile.top,
awful.layout.suit.fair,
awful.layout.suit.fair.horizontal,
awful.layout.suit.spiral,
awful.layout.suit.spiral.dwindle,
awful.layout.suit.max,
awful.layout.suit.max.fullscreen,
awful.layout.suit.magnifier,
awful.layout.suit.floating
}
-- }}}

-- {{{ Tags
-- Define a tag table which hold all screen tags.
tags = {}
for s = 1, screen.count() do
-- Each screen has its own tag table.
tags[s] = awful.tag({ 1, 2, 3, 4, 5, 6, 7, 8, 9 }, s, awful.layout.suit.tile)
end
-- }}}

-- {{{ Menu
-- Create a laucher widget and a main menu
myawesomemenu = {
{ "manual", terminal .. " -e man awesome" },
{ "edit config", editor_cmd .. " " .. awful.util.getdir("config") .. "/rc.lua" },
{ "restart", awesome.restart },
{ "quit", awesome.quit }
}

mymainmenu = awful.menu({ items = { { "awesome", myawesomemenu, beautiful.awesome_icon },
{ "Debian", debian.menu.Debian_menu.Debian },
{ "open terminal", terminal }
}
})

mylauncher = awful.widget.launcher({ image = image(beautiful.awesome_icon),
menu = mymainmenu })
-- }}}

-- {{{ Wibox
-- Create a textclock widget
mytextclock = awful.widget.textclock( { align = "right" },"%Y/%m/%d (%a) %H:%M:%S","1")

-- Create a systray
mysystray = widget({ type = "systray" })

refreshdelay = 1
-- memwidget
-- text
memtext = widget({ type = "textbox" })
memtext.text = ' mem '
-- bar
membar = awful.widget.progressbar()
membar:set_width(50)
membar:set_height(17)
membar:set_background_color("#494B4F")
membar:set_border_color(nil)
membar:set_color("#AECF96")
membar:set_gradient_colors({ "#AECF96", "#88A175", "#FF5656" })
vicious.register(membar, vicious.widgets.mem, "$1", refreshdelay)
-- // memwidget

-- cpuwidget
-- text
cputext = widget({ type = "textbox" })
cputext.text = ' cpu '
-- graph
cpugraph = awful.widget.graph()
cpugraph:set_width(50)
cpugraph:set_height(17)
cpugraph:set_background_color("#494B4F")
cpugraph:set_color("#FF5656")
cpugraph:set_gradient_colors({ "#FF5656", "#88A175", "#AECF96" })
vicious.register(cpugraph, vicious.widgets.cpu, "$1", refreshdelay)
-- // cpuwidget


-- Create a wibox for each screen and add it
mywibox = {}
mypromptbox = {}
mylayoutbox = {}
mytaglist = {}
mytaglist.buttons = awful.util.table.join(
awful.button({ }, 1, awful.tag.viewonly),
awful.button({ modkey }, 1, awful.client.movetotag),
awful.button({ }, 3, awful.tag.viewtoggle),
awful.button({ modkey }, 3, awful.client.toggletag),
awful.button({ }, 4, awful.tag.viewnext),
awful.button({ }, 5, awful.tag.viewprev)
)
mytasklist = {}
mytasklist.buttons = awful.util.table.join(
awful.button({ }, 1, function (c)
if not c:isvisible() then
awful.tag.viewonly(c:tags()[1])
end
client.focus = c
c:raise()
end),
awful.button({ }, 3, function ()
if instance then
instance:hide()
instance = nil
else
instance = awful.menu.clients({ width=250 })
end
end),
awful.button({ }, 4, function ()
awful.client.focus.byidx(1)
if client.focus then client.focus:raise() end
end),
awful.button({ }, 5, function ()
awful.client.focus.byidx(-1)
if client.focus then client.focus:raise() end
end))

for s = 1, screen.count() do
-- Create a promptbox for each screen
mypromptbox[s] = awful.widget.prompt({ layout = awful.widget.layout.horizontal.leftright })
-- Create an imagebox widget which will contains an icon indicating which layout we're using.
-- We need one layoutbox per screen.
mylayoutbox[s] = awful.widget.layoutbox(s)
mylayoutbox[s]:buttons(awful.util.table.join(
awful.button({ }, 1, function () awful.layout.inc(layouts, 1) end),
awful.button({ }, 3, function () awful.layout.inc(layouts, -1) end),
awful.button({ }, 4, function () awful.layout.inc(layouts, 1) end),
awful.button({ }, 5, function () awful.layout.inc(layouts, -1) end)))
-- Create a taglist widget
mytaglist[s] = awful.widget.taglist(s, awful.widget.taglist.label.all, mytaglist.buttons)

-- Create a tasklist widget
mytasklist[s] = awful.widget.tasklist(function(c)
return awful.widget.tasklist.label.currenttags(c, s)
end, mytasklist.buttons)

-- Create the wibox
mywibox[s] = awful.wibox({ position = "top", screen = s })
-- Add widgets to the wibox - order matters
mywibox[s].widgets = {
{
mylauncher,
mytaglist[s],
mypromptbox[s],
layout = awful.widget.layout.horizontal.leftright
},
mytextclock,
mylayoutbox[s],
s == 1 and mysystray or nil,
membar.widget,
memtext,
cpugraph.widget,
cputext,
mytasklist[s],
layout = awful.widget.layout.horizontal.rightleft
}
end
-- }}}

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

-- {{{ Key bindings
globalkeys = awful.util.table.join(
awful.key({ modkey, }, "Left", awful.tag.viewprev ),
awful.key({ modkey, }, "Right", awful.tag.viewnext ),
awful.key({ modkey, }, "Escape", awful.tag.history.restore),

awful.key({ modkey, }, "j",
function ()
awful.client.focus.byidx( 1)
if client.focus then client.focus:raise() end
end),
awful.key({ modkey, }, "k",
function ()
awful.client.focus.byidx(-1)
if client.focus then client.focus:raise() end
end),
awful.key({ modkey, }, "w", function () mymainmenu:show(true) end),

-- Layout manipulation
awful.key({ modkey, "Shift" }, "j", function () awful.client.swap.byidx( 1) end),
awful.key({ modkey, "Shift" }, "k", function () awful.client.swap.byidx( -1) end),
awful.key({ modkey, "Control" }, "j", function () awful.screen.focus_relative( 1) end),
awful.key({ modkey, "Control" }, "k", function () awful.screen.focus_relative(-1) end),
awful.key({ modkey, }, "u", awful.client.urgent.jumpto),
awful.key({ modkey, }, "Tab",
function ()
awful.client.focus.history.previous()
if client.focus then
client.focus:raise()
end
end),

-- Standard program
awful.key({ modkey, }, "Return", function () awful.util.spawn(terminal) end),
awful.key({ modkey, "Control" }, "r", awesome.restart),
awful.key({ modkey, "Shift" }, "q", awesome.quit),

awful.key({ modkey, }, "l", function () awful.tag.incmwfact( 0.05) end),
awful.key({ modkey, }, "h", function () awful.tag.incmwfact(-0.05) end),
awful.key({ modkey, "Shift" }, "h", function () awful.tag.incnmaster( 1) end),
awful.key({ modkey, "Shift" }, "l", function () awful.tag.incnmaster(-1) end),
awful.key({ modkey, "Control" }, "h", function () awful.tag.incncol( 1) end),
awful.key({ modkey, "Control" }, "l", function () awful.tag.incncol(-1) end),
awful.key({ modkey, }, "space", function () awful.layout.inc(layouts, 1) end),
awful.key({ modkey, "Shift" }, "space", function () awful.layout.inc(layouts, -1) end),

-- Prompt
awful.key({ modkey }, "F2", function () mypromptbox[mouse.screen]:run() end),

awful.key({ modkey }, "x",
function ()
awful.prompt.run({ prompt = "Run Lua code: " },
mypromptbox[mouse.screen].widget,
awful.util.eval, nil,
awful.util.getdir("cache") .. "/history_eval")
end)
)

clientkeys = awful.util.table.join(
awful.key({ modkey, }, "f", function (c) c.fullscreen = not c.fullscreen end),
awful.key({ modkey, }, "F4", function (c) c:kill() end),
awful.key({ modkey, "Control" }, "space", awful.client.floating.toggle ),
awful.key({ modkey, "Control" }, "Return", function (c) c:swap(awful.client.getmaster()) end),
awful.key({ modkey, }, "o", awful.client.movetoscreen ),
awful.key({ modkey, "Shift" }, "r", function (c) c:redraw() end),
awful.key({ modkey, }, "n", function (c) c.minimized = not c.minimized end),
awful.key({ modkey, }, "m",
function (c)
c.maximized_horizontal = not c.maximized_horizontal
c.maximized_vertical = not c.maximized_vertical
end)
)

-- Compute the maximum number of digit we need, limited to 9
keynumber = 0
for s = 1, screen.count() do
keynumber = math.min(9, math.max(#tags[s], keynumber));
end

-- Bind all key numbers to tags.
-- Be careful: we use keycodes to make it works on any keyboard layout.
-- This should map on the top row of your keyboard, usually 1 to 9.
for i = 1, keynumber do
globalkeys = awful.util.table.join(globalkeys,
awful.key({ modkey }, "#" .. i + 9,
function ()
local screen = mouse.screen
if tags[screen][i] then
awful.tag.viewonly(tags[screen][i])
end
end),
awful.key({ modkey, "Control" }, "#" .. i + 9,
function ()
local screen = mouse.screen
if tags[screen][i] then
awful.tag.viewtoggle(tags[screen][i])
end
end),
awful.key({ modkey, "Shift" }, "#" .. i + 9,
function ()
if client.focus and tags[client.focus.screen][i] then
awful.client.movetotag(tags[client.focus.screen][i])
end
end),
awful.key({ modkey, "Control", "Shift" }, "#" .. i + 9,
function ()
if client.focus and tags[client.focus.screen][i] then
awful.client.toggletag(tags[client.focus.screen][i])
end
end))
end

clientbuttons = awful.util.table.join(
awful.button({ }, 1, function (c) client.focus = c; c:raise() end),
awful.button({ modkey }, 1, awful.mouse.client.move),
awful.button({ modkey }, 3, awful.mouse.client.resize))

-- Set keys
root.keys(globalkeys)
-- }}}

-- {{{ Rules
awful.rules.rules = {
-- All clients will match this rule.
{ rule = { },
properties = { border_width = beautiful.border_width,
border_color = beautiful.border_normal,
focus = true,
keys = clientkeys,
buttons = clientbuttons } },
{ rule = { class = "MPlayer" },
properties = { floating = true } },
{ rule = { class = "pinentry" },
properties = { floating = true } },
{ rule = { class = "gimp" },
properties = { floating = true } },
-- Set パイヤーポックス to always map on tags number 2 of screen 1.
-- { rule = { class = "パイヤーポックス" },
-- properties = { tag = tags[1][2] } },
}
-- }}}

-- {{{ Signals
-- Signal function to execute when a new client appears.
client.add_signal("manage", function (c, startup)
-- Add a titlebar
-- awful.titlebar.add(c, { modkey = modkey })

-- Enable sloppy focus
c:add_signal("mouse::enter", function(c)
if awful.layout.get(c.screen) ~= awful.layout.suit.magnifier
and awful.client.focus.filter(c) then
client.focus = c
end
end)

if not startup then
-- Set the windows at the slave,
-- i.e. put it at the end of others instead of setting it master.
-- awful.client.setslave(c)

-- Put windows in a smart way, only if they does not set an initial position.
if not c.size_hints.user_position and not c.size_hints.program_position then
awful.placement.no_overlap(c)
awful.placement.no_offscreen(c)
end
end
end)

client.add_signal("focus", function(c) c.border_color = beautiful.border_focus end)
client.add_signal("unfocus", function(c) c.border_color = beautiful.border_normal end)
-- }}}

-- {{{ startup
os.execute("パイヤーポックス &")
--os.execute("gtk-recordmydesktop &")
os.execute("gvtray &")
os.execute("wicd-client &")
--- }}}



これでおっけーなはず

2009年11月5日木曜日

タイル型WM普及のために動画撮った


糞画質で無音だけど,awesome window managerってこんなもんだよってのが伝わらないね.
動画の編集は難しい

2009年11月3日火曜日

SLiMを使う

今までlogin managerにkdmを使ってた.
ubuntu入れてもkdmを使ってた.kdmが大好きだった.嘘,それしか使い方を覚えて無かっただけ.
2009-11-02 - それ、Gentooだとどうなる?SLiMがお勧めされてたので,使ってみた.
ubuntu 9.10用のパッケージはないので,9.04用をDLしてきてdpkg -i でインストールする.
wget http://mirror.in.th/ubuntu/pool/universe/s/slim/slim_1.3.0-2_i386.deb
sudo dpkg -i slim_1.3.0-2_i386.deb
インストール途中でlogin managerをkdm/gdmから変更するか聞いてくるからslimにする.
awesomeが起動出来るようにする.

sudo vi /etc/slim.conf
54 sessions awesome,default

themeはSLiM Themesにわりとあるので,落としてきて,解凍したら,/usr/share/slim/themes/に置く
wget http://download.berlios.de/slim/slim-lunar-0.4.tar.bz2
tar jzxvf slim-lunar-0.4.tar.bz2
sudo mv slim-lunar-0.4 /usr/share/slim/themes
sudo vi /etc/slim.conf
72 current_theme slim-lunar-0.4
usernameにconsoleと打ち込むと端末が起動する.
haltとrebootと入力するとroot passwordを要求されて,root passwordを打ち込むとshutdownとrebootを行う.


こんな感じになります.

2009年10月31日土曜日

awesome 3.4でデフォルトがfloatingになってる

ubuntu 9.10が出たからサクッとupgradeしてみた.
ubuntu 9.10だとawesome v3.3.4で,今まで使ってたrc.luaだとCPUやメモリのusageが表示出来ない!
公式wiki見てもよくわかんないので,調子に乗って3.4に上げてみたらデフォルトがfloatingになってて死ぬほど使いづらい.
52 tags[s] = awful.tag({ 1, 2, 3, 4, 5, 6, 7, 8, 9 }, s, awful.layout.suit.tile)

ついでに日付も%Y/%m%d (%a) %H:%M:%Sで表示させたい.
77 mytextclock = awful.widget.textclock( { align = "right" },"%Y/%m/%d (%a) %H:%M:%S","1")

赤文字の部分を加えてawesomeを再起動すればおk.
CPUやメモリのusageはそのうち追加する.たぶん

2009年9月7日月曜日

linuxで青空文庫を読む

縦書きエディタが云々の話じゃなくて,青空文庫ビュアーの話.

いくつかソフトがある
xjp2を使う→コンパイルが必要で,起動してもセグって落ちたから放置
Aozora Viewerを使う→JAVAが入ってりゃ動く

というわけで,Aozora Viewerを使いましょう.JAVA入れて,HPへ行ってボタン(↑Aozora Viewer 3.0(無料版)を起動します って部分)押せば起動するはず.

でも,僕は起動しなかった!aozora.jnlpってファイルがダウンロードされちゃう!

調べてみると,なんか,firefoxのcontent-typeに追加されてないっぽいから,ダウンロードされちゃうみたい.
Force Content-Type 1.2.2を入れてcontent-typeを追加する方法もあるけど,これだけのためにaddon入れるのもなーって事で他の方法
端末を起動させて
javaws aozora.jnlp
これだけでおk!
mkdir -p ~/.soso/aozora
しおりを挟むためのディレクトリを作る
awesome window managerとか使ってる時は,先に
export AWT_TOOLKIT=MToolkit
してね



こんな感じで読めるよ.

2009年8月2日日曜日

mixer

音量調節するときにkmix使ってたけど,awesomeのテーマに合ってない!
ってことで,gvtray使ってみる
sudo apt-get install python-alsaaudio python-gnome2-extras
wget http://gtk-tray-utils.googlecode.com/svn/trunk/gvtray-1.1.tar.gz
tar zxvf gvtray-1.1.tar.gz
cd gvtray-1.1
sudo mkdir /usr/share/gvtray
sudo cp gvtray /usr/bin
sudo cp gvtray.py /usr/share/gvtray/
sudo cp -r gvtray_about/ /usr/share/gvtray/gvtray_about

これでおk

2009年7月5日日曜日

awesomeのtaskbarにcpuとmemoryの使用状況を表示する

↓のを$HOME/.config/awesome/rc.luaで保存するか,赤文字の部分を追加する!
参考:Hate Talk: Awesome Window Manager
こんな感じ↓になる

もしかしたらawesome-extraが必要かも
Ubuntu -- karmic の awesome-extra パッケージに関する詳細
Debian -- squeeze の awesome-extra パッケージに関する詳細
-- Standard awesome library
require("awful")
-- Theme handling library
require("beautiful")
-- Notification library
require("naughty")
require("wicked")
-- Load Debian menu entries
require("debian.menu")

-- {{{ Variable definitions
-- Themes define colours, icons, and wallpapers
-- The default is a dark theme
theme_path = "/usr/share/awesome/themes/default/theme"
-- Uncommment this for a lighter theme
-- theme_path = "/usr/share/awesome/themes/sky/theme"

-- Actually load theme
beautiful.init(theme_path)

-- This is used later as the default terminal and editor to run.
terminal = "urxvt"
editor = os.getenv("EDITOR") or "editor"
editor_cmd = terminal .. " -e " .. editor

-- Default modkey.
-- Usually, Mod4 is the key with a logo between Control and Alt.
-- If you do not like this or do not have such a key,
-- I suggest you to remap Mod4 to another key using xmodmap or other tools.
-- However, you can use another modifier like Mod1, but it may interact with others.
modkey = "Mod4"

-- Table of layouts to cover with awful.layout.inc, order matters.
layouts =
{
awful.layout.suit.tile,
awful.layout.suit.tile.left,
awful.layout.suit.tile.bottom,
awful.layout.suit.tile.top,
awful.layout.suit.fair,
awful.layout.suit.fair.horizontal,
awful.layout.suit.max,
awful.layout.suit.max.fullscreen,
awful.layout.suit.magnifier,
awful.layout.suit.floating
}

-- Table of clients that should be set floating. The index may be either
-- the application class or instance. The instance is useful when running
-- a console app in a terminal like (Music on Console)
-- x-terminal-emulator -name mocp -e mocp
floatapps =
{
-- by class
["MPlayer"] = true,
["pinentry"] = true,
["gimp"] = true,
-- by instance
["mocp"] = true
}

-- Applications to be moved to a pre-defined tag by class or instance.
-- Use the screen and tags indices.
apptags =
{
-- ["Firefox"] = { screen = 1, tag = 2 },
-- ["mocp"] = { screen = 2, tag = 4 },
}

-- Define if we want to use titlebar on all applications.
use_titlebar = false
-- }}}

-- {{{ Tags
-- Define tags table.
tags = {}
for s = 1, screen.count() do
-- Each screen has its own tag table.
tags[s] = {}
-- Create 9 tags per screen.
for tagnumber = 1, 9 do
tags[s][tagnumber] = tag(tagnumber)
-- Add tags to screen one by one
tags[s][tagnumber].screen = s
awful.layout.set(layouts[1], tags[s][tagnumber])
end
-- I'm sure you want to see at least one tag.
tags[s][1].selected = true
end
-- }}}

-- {{{ Wibox
-- Create a textbox widget
mytextbox = widget({ type = "textbox", align = "right" })
-- Set the default text in textbox
mytextbox.text = " " .. AWESOME_RELEASE .. " "

-- Create a laucher widget and a main menu
myawesomemenu = {
{ "manual", terminal .. " -e man awesome" },
{ "edit config", editor_cmd .. " " .. awful.util.getdir("config") .. "/rc.lua" },
{ "restart", awesome.restart },
{ "quit", awesome.quit }
}

mymainmenu = awful.menu.new({ items = { { "awesome", myawesomemenu, beautiful.awesome_icon },
{ "open terminal", terminal },
{ "Debian", debian.menu.Debian_menu.Debian }
}
})

mylauncher = awful.widget.launcher({ image = image(beautiful.awesome_icon),
menu = mymainmenu })

-- Create a systray
mysystray = widget({ type = "systray", align = "right" })

-- Create a wibox for each screen and add it
mywibox = {}
mypromptbox = {}
mylayoutbox = {}
mytaglist = {}
mytaglist.buttons = { button({ }, 1, awful.tag.viewonly),
button({ modkey }, 1, awful.client.movetotag),
button({ }, 3, function (tag) tag.selected = not tag.selected end),
button({ modkey }, 3, awful.client.toggletag),
button({ }, 4, awful.tag.viewnext),
button({ }, 5, awful.tag.viewprev) }
mytasklist = {}
mytasklist.buttons = { button({ }, 1, function (c)
if not c:isvisible() then
awful.tag.viewonly(c:tags()[1])
end
client.focus = c
c:raise()
end),
button({ }, 3, function () if instance then instance:hide() end instance = awful.menu.clients({ width=250 }) end),
button({ }, 4, function ()
awful.client.focus.byidx(1)
if client.focus then client.focus:raise() end
end),
button({ }, 5, function ()
awful.client.focus.byidx(-1)
if client.focus then client.focus:raise() end
end) }

for s = 1, screen.count() do
-- Create a promptbox for each screen
mypromptbox[s] = widget({ type = "textbox", align = "left" })
-- Create an imagebox widget which will contains an icon indicating which layout we're using.
-- We need one layoutbox per screen.
mylayoutbox[s] = widget({ type = "imagebox", align = "right" })
mylayoutbox[s]:buttons({ button({ }, 1, function () awful.layout.inc(layouts, 1) end),
button({ }, 3, function () awful.layout.inc(layouts, -1) end),
button({ }, 4, function () awful.layout.inc(layouts, 1) end),
button({ }, 5, function () awful.layout.inc(layouts, -1) end) })
-- Create a taglist widget
mytaglist[s] = awful.widget.taglist.new(s, awful.widget.taglist.label.all, mytaglist.buttons)

-- Create a tasklist widget
mytasklist[s] = awful.widget.tasklist.new(function(c)
return awful.widget.tasklist.label.currenttags(c, s)
end, mytasklist.buttons)

-- Create the wibox
mywibox[s] = wibox({ position = "top", fg = beautiful.fg_normal, bg = beautiful.bg_normal })

--- Create a cpu widget
cpuwidget = widget({
type = 'textbox',
name = 'cpuwidget'
})

wicked.register(cpuwidget, wicked.widgets.cpu,' CPU:')

--and then create a cpu graph
cpugraphwidget = widget({
type = 'graph',
name = 'cpugraphwidget',

})

cpugraphwidget.height = 0.85
cpugraphwidget.width = 80
cpugraphwidget.bg = '#333333'
cpugraphwidget.border_color = '#0a0a0a'
cpugraphwidget.grow = 'left'

cpugraphwidget:plot_properties_set('cpu', {
fg = '#AEC6D8',
fg_center = '#285577',
fg_end = '#285577',
vertical_gradient = false
})

wicked.register(cpugraphwidget, wicked.widgets.cpu, '$1', 1, 'cpu')

--mem widget
memwidget = widget({
type = 'textbox',
name = 'memwidget'
})

wicked.register(memwidget, wicked.widgets.mem,' Memory: ',nil, nil, {2, 4, 4})

--Add mem widgit
membarwidget = widget({
type = 'progressbar',
name = 'membarwidget'
})

membarwidget.height = 0.85
membarwidget.width = 80
membarwidget.bg = '#333333'
membarwidget.border_color = '#0a0a0a'
membarwidget.grow = 'left'

membarwidget:bar_properties_set('mem', {
bg = '#222222',
fg = '#285577',
fg_center = '#285577',
fg_end = '#285577',
fg_off = '#222222',
reverse = false,
min_value = 0,
max_value = 100
})

wicked.register(membarwidget, wicked.widgets.mem, '$1', 1, 'mem')

-- Add widgets to the wibox - order matters
mywibox[s].widgets = { mylauncher,
mytaglist[s],
mytasklist[s],
mypromptbox[s],
mytextbox,
mylayoutbox[s],
cpuwidget,
cpugraphwidget,
memwidget,
membarwidget,
s == 1 and mysystray or nil
}
mywibox[s].screen = s
end
-- }}}


-- {{{ Mouse bindings
root.buttons({
button({ }, 3, function () mymainmenu:toggle() end),
button({ }, 4, awful.tag.viewnext),
button({ }, 5, awful.tag.viewprev)
})
-- }}}

-- {{{ Key bindings
globalkeys =
{
key({ modkey, }, "Left", awful.tag.viewprev ),
key({ modkey, }, "Right", awful.tag.viewnext ),
key({ modkey, }, "Escape", awful.tag.history.restore),

key({ modkey, }, "j",
function ()
awful.client.focus.byidx( 1)
if client.focus then client.focus:raise() end
end),
key({ modkey, }, "k",
function ()
awful.client.focus.byidx(-1)
if client.focus then client.focus:raise() end
end),

-- Layout manipulation
key({ modkey, "Shift" }, "j", function () awful.client.swap.byidx( 1) end),
key({ modkey, "Shift" }, "k", function () awful.client.swap.byidx( -1) end),
key({ modkey, "Control" }, "j", function () awful.screen.focus( 1) end),
key({ modkey, "Control" }, "k", function () awful.screen.focus(-1) end),
key({ modkey, }, "u", awful.client.urgent.jumpto),
key({ modkey, }, "Tab",
function ()
awful.client.focus.history.previous()
if client.focus then
client.focus:raise()
end
end),

-- Standard program
key({ modkey, }, "Return", function () awful.util.spawn(terminal) end),
key({ modkey, "Control" }, "r", awesome.restart),
key({ modkey, "Shift" }, "q", awesome.quit),

key({ modkey, }, "l", function () awful.tag.incmwfact( 0.05) end),
key({ modkey, }, "h", function () awful.tag.incmwfact(-0.05) end),
key({ modkey, "Shift" }, "h", function () awful.tag.incnmaster( 1) end),
key({ modkey, "Shift" }, "l", function () awful.tag.incnmaster(-1) end),
key({ modkey, "Control" }, "h", function () awful.tag.incncol( 1) end),
key({ modkey, "Control" }, "l", function () awful.tag.incncol(-1) end),
key({ modkey, }, "space", function () awful.layout.inc(layouts, 1) end),
key({ modkey, "Shift" }, "space", function () awful.layout.inc(layouts, -1) end),

-- Prompt
key({ modkey }, "F2",
function ()
awful.prompt.run({ prompt = "Run: " },
mypromptbox[mouse.screen],
awful.util.spawn, awful.completion.bash,
awful.util.getdir("cache") .. "/history")
end),

key({ modkey }, "F3",
function ()
awful.prompt.run({ prompt = "Run Lua code: " },
mypromptbox[mouse.screen],
awful.util.eval, awful.prompt.bash,
awful.util.getdir("cache") .. "/history_eval")
end),
}

-- Client awful tagging: this is useful to tag some clients and then do stuff like move to tag on them
clientkeys =
{
key({ modkey, }, "f", function (c) c.fullscreen = not c.fullscreen end),
key({ modkey, }, "F4", function (c) c:kill() end),
key({ modkey, "Control" }, "space", awful.client.floating.toggle ),
key({ modkey, "Control" }, "Return", function (c) c:swap(awful.client.getmaster()) end),
key({ modkey, }, "o", awful.client.movetoscreen ),
key({ modkey, "Shift" }, "r", function (c) c:redraw() end),
key({ modkey }, "t", awful.client.togglemarked),
key({ modkey,}, "m",
function (c)
c.maximized_horizontal = not c.maximized_horizontal
c.maximized_vertical = not c.maximized_vertical
end),
}

-- Compute the maximum number of digit we need, limited to 9
keynumber = 0
for s = 1, screen.count() do
keynumber = math.min(9, math.max(#tags[s], keynumber));
end

for i = 1, keynumber do
table.insert(globalkeys,
key({ modkey }, i,
function ()
local screen = mouse.screen
if tags[screen][i] then
awful.tag.viewonly(tags[screen][i])
end
end))
table.insert(globalkeys,
key({ modkey, "Control" }, i,
function ()
local screen = mouse.screen
if tags[screen][i] then
tags[screen][i].selected = not tags[screen][i].selected
end
end))
table.insert(globalkeys,
key({ modkey, "Shift" }, i,
function ()
if client.focus and tags[client.focus.screen][i] then
awful.client.movetotag(tags[client.focus.screen][i])
end
end))
table.insert(globalkeys,
key({ modkey, "Control", "Shift" }, i,
function ()
if client.focus and tags[client.focus.screen][i] then
awful.client.toggletag(tags[client.focus.screen][i])
end
end))
end


for i = 1, keynumber do
table.insert(globalkeys, key({ modkey, "Shift" }, "F" .. i,
function ()
local screen = mouse.screen
if tags[screen][i] then
for k, c in pairs(awful.client.getmarked()) do
awful.client.movetotag(tags[screen][i], c)
end
end
end))
end

-- Set keys
root.keys(globalkeys)
-- }}}

-- {{{ Hooks
-- Hook function to execute when focusing a client.
awful.hooks.focus.register(function (c)
if not awful.client.ismarked(c) then
c.border_color = beautiful.border_focus
end
end)

-- Hook function to execute when unfocusing a client.
awful.hooks.unfocus.register(function (c)
if not awful.client.ismarked(c) then
c.border_color = beautiful.border_normal
end
end)

-- Hook function to execute when marking a client
awful.hooks.marked.register(function (c)
c.border_color = beautiful.border_marked
end)

-- Hook function to execute when unmarking a client.
awful.hooks.unmarked.register(function (c)
c.border_color = beautiful.border_focus
end)

-- Hook function to execute when the mouse enters a client.
awful.hooks.mouse_enter.register(function (c)
-- Sloppy focus, but disabled for magnifier layout
if awful.layout.get(c.screen) ~= awful.layout.suit.magnifier
and awful.client.focus.filter(c) then
client.focus = c
end
end)

-- Hook function to execute when a new client appears.
awful.hooks.manage.register(function (c, startup)
-- If we are not managing this application at startup,
-- move it to the screen where the mouse is.
-- We only do it for filtered windows (i.e. no dock, etc).
if not startup and awful.client.focus.filter(c) then
c.screen = mouse.screen
end

if use_titlebar then
-- Add a titlebar
awful.titlebar.add(c, { modkey = modkey })
end
-- Add mouse bindings
c:buttons({
button({ }, 1, function (c) client.focus = c; c:raise() end),
button({ modkey }, 1, awful.mouse.client.move),
button({ modkey }, 3, awful.mouse.client.resize)
})
-- New client may not receive focus
-- if they're not focusable, so set border anyway.
c.border_width = beautiful.border_width
c.border_color = beautiful.border_normal

-- Check if the application should be floating.
local cls = c.class
local inst = c.instance
if floatapps[cls] then
awful.client.floating.set(c, floatapps[cls])
elseif floatapps[inst] then
awful.client.floating.set(c, floatapps[inst])
end

-- Check application->screen/tag mappings.
local target
if apptags[cls] then
target = apptags[cls]
elseif apptags[inst] then
target = apptags[inst]
end
if target then
c.screen = target.screen
awful.client.movetotag(tags[target.screen][target.tag], c)
end

-- Do this after tag mapping, so you don't see it on the wrong tag for a split second.
client.focus = c

-- Set key bindings
c:keys(clientkeys)

-- Set the windows at the slave,
-- i.e. put it at the end of others instead of setting it master.
-- awful.client.setslave(c)

-- Honor size hints: if you want to drop the gaps between windows, set this to false.
-- c.size_hints_honor = false
end)

-- Hook function to execute when arranging the screen.
-- (tag switch, new client, etc)
awful.hooks.arrange.register(function (screen)
local layout = awful.layout.getname(awful.layout.get(screen))
if layout and beautiful["layout_" ..layout] then
mylayoutbox[screen].image = image(beautiful["layout_" .. layout])
else
mylayoutbox[screen].image = nil
end

-- Give focus to the latest client in history if no window has focus
-- or if the current window is a desktop or a dock one.
if not client.focus then
local c = awful.client.focus.history.get(screen, 0)
if c then client.focus = c end
end
end)

-- Hook called every minute
awful.hooks.timer.register(1, function ()
mytextbox.text = os.date(" %Y/%m/%d (%a) %H:%M:%S ")
end)
-- }}}

os.execute("firefox &")
os.execute("gwibber &")
-- os.execute("audacious &")
-- os.execute("thunderbird &")
os.execute("pidgin &")
-- os.execute("skype &")

2009年6月29日月曜日

fehの使い方とか


壁紙のサイズとモニターの解像度が合ってないと,画像が引き延ばされてぽっちゃり画像になっちゃう!

・1)画像のサイズをモニターの解像度に合わせる
めんどくさいし,左右か上下をカットする必要がある!
・2)ごまかす
feh --bg-seamless hogehoge.jpg をすると




ごまかせたwwwwwwwwwww
オプションはこんなかんじで使える

--bg-tile
タイル状に壁紙を並べる

--bg-center
壁紙を中央に表示してくれる.サイズが合ってないときは黒で左右上下を埋める

--bg-scale
壁紙を画面のサイズに引き延ばす

--bg-seamless
いっぱい表示してくれる

2009年6月20日土曜日

awesome起動時にfirefoxとかを起動させる!

よく使うソフトがログイン時に起動するようになってたら便利ー
本家wikiに書いてた→Autostart - awesome

cp -R /etc/xdg/awesome/ ~/.config/awesome/
vi .config/awesome/rc.lua
os.execute("firefox &")
os.execute("gwibber &")
os.execute("audacious &")
os.execute("thunderbird &")
os.execute("pidgin &")

最後の部分に追加してね★

これでlogin時にfirefoxとgwibberとaudaciousとpidginとthnunderbirdが起動するよ!

2009年6月18日木曜日

awesome起動時にエラーがでる!

awsetbg: Something went wrong while setting the wallpaper.
Run 'display -sample 1920x1080+0+0 -window root /usr/share/awesome/themes/default/background.png' from an xterm to find out what.

壁紙は表示されてるし,普通に使えてるから特に気にしてなかったけど,
一度気になり出すと,止まらなくなっちゃう!
Arch Linux Forums / [SOLVED] Awesome 3.2 [cant/dont know how] set wallpaper

sudo apt-get install feh
vi /usr/share/awesome/themes/default/theme
52 # You can use your own command to set your wallpaper
53 #wallpaper_cmd = awsetbg /usr/share/awesome/themes/default/background.png
54 wallpaper_cmd = feh --bg-scale /usr/share/awesome/themes/default/background.png


赤文字の部分を書き換えてね.feh使ったけど,displayコマンドでも大丈夫そうかな?試してないからわからないけど

2009年3月7日土曜日

awesomeの壁紙を変える

書いてなかったような気がするので書いておくよ!

まず設定ファイルをコピーするよ!
cp -R /etc/xdg/awesome/ /home/hogehoge/.config/

次に.config/awesome/themeを書き換えるー大体50行目くらいのところだよ!
wallpaper_cmd = awsetbg /usr/share/awesome/themes/default/background.png

wallpaper_cmd = awsetbg /home/hogehoge/hogehoge.jpg
ログインし直すと壁紙が変わるよ

display -window root hogehoge.jpg
これでも変えられるよ.

2009年2月21日土曜日

xlockで画面のロック

ちょっと席を離れる時とか,画面のロックをすると思うんだけど,KDEからawesomeに変えたので,xlock入れてみた.
sudo apt-get install xlockmore

実行は端末とかからxlockでおk.ロック画面はランダムで色々表示されるよ.
xlock -nolock -mode hogehogeとかで確認するといいよ.

無変換キーをMod3にする方法

$HOME/.Xmodmap書いても読み込まなくてキーッってなってた.

$HOME/.Xmodmap
add mod3 = Muhenkan

/etc/X11/Xsession
USERMODMAP=$HOME/.Xmodmap


これでおk

2009年2月20日金曜日

Thinkpad X31にawesomeをインストールしたよ!

やっぱawesomeがいいわぁ・・・タイル型にはまると抜け出せないね!

ただ,\|が入力出来なくなってた.HALと関係ありそうだったから,HAL切っちゃった

今のところ別に問題は起きてないからいいや.

s30がカクカクシカシカしてたのもHALの影響っぽいよ,多分.確認は取ってない.

2009年2月19日木曜日

KDEからawesomeに乗り換えた

awesomeにも慣れて,KDEじゃなくてもいいんじゃね?と思いつき,唯一KDE環境で使ってたThinkpad X31をkubuntu 8.10をupdateしてみた.

デスクトップとThinkpad s30の方で既に使っていて,やっぱりKDEよりawesomeのが良いわーってことで,さくっと!

8.04から8.10にupdateするために,alternateを落としてきてsudo mount -o loop ~/Desktop/kubuntu-8.10-alternate-i386.iso /media/cdrom0

後はオートマティックにupdateして,再起動すればそこには元気なKDE4.1の姿が('A`)ヴォー

その後apt-get update && apt-get upgradeをすると,なんとKDEが削除されてしまい,別にいらないけどとても困った.

いやまぁとても困ったのは,vimが削除されたこと!

自分の日記を参考にawesomeの導入を終え,knetworkmanagerが使いにくかったのでwicdを導入して今一段落ついた.

今からCtrlとCaps Lockの入れ替えと,Mod3を無変換に割り当てる!これで完了!

2009年1月4日日曜日

awesome 3.1に時計を表示させる

新年あけましたね,今年もよろしくお願いします.

何もしなくてもunix時間が表示されていると思うけど,わかんねーよってことで

変更前
awful.hooks.timer.register(1, function ()
-- For unix time_t lovers
mytextbox.text = " " .. os.time() .. " time_t "
-- Otherwise use:
-- mytextbox.text = " " .. os.date() .. " "
end)

変更後
awful.hooks.timer.register(1, function ()
-- For unix time_t lovers
--mytextbox.text = " " .. os.time() .. " "
-- Otherwise use:
mytextbox.text = " " .. os.date("%Y/%m/%d %H:%M:%S (%a)") .. " "
end)
こんな感じにすると良いよ.

2008年12月24日水曜日

kde4が不安定なの?デュアルモニタだから?

kubuntu8.10にうpしたデスクトップは,NVIDIAのグラボが載ってるのでデュアルモニターが出来る.
無事awesome3.1をインストールして,特に設定もせずに快適に使っていると,Mod4+Shift+hjklでぐるぐる回しているとキーが効かなくなる・・・orz
それよりも深刻なのは,skypeが途中で固まり,kill -kill でも殺せなくて,再起動するしかなくなるのが…orz
skypeは今同じバージョン再インストールして,デュアルモニターじゃなくしたら何とか再起動しなくても殺せるようになった.

awesome - kubuntu

kubuntu 8.04.1でawesome3.1を使おうと頑張ったわけだけど、依存関係が解消できないー.
なのでkubuntu8.10に今さながらうpした.
8.10はkde4になってるってどこかで読んで遠慮してたんだけど、どうせawesomeに変えるし、いいかーと思ってインストールしたら大変.
デュアルモニターにしてたら壁紙が一つの画面にしか設定できない・・・orz
後,いつもバーは上においているんだけど,それも移動できないっぽい・・・orz
軽くなるとか言ってた癖に,何気に重い…というか,不安定っぽい…orz
これからawesomeをインストールするよ!よ!

結論:kde4は当分見送った方が良い

2008年12月22日月曜日

awesome_3.1

いつまで経ってもリポジトリに追加されないのでコンパイルしてみた.
参考にしたぺーじ今日からはじめる awesome チュートリアル

# aptitude install cdbs debhelper devscripts
# aptitude install autotools-dev libxcb-render0-dev libxcb1-dev gperf pkg-config libxcb-shm0-dev m4 autoconf automake libtool x11proto-core-dev
$ mkdir src && cd src
$ dget http://ftp.de.debian.org/debian/pool/main/x/xcb-util/xcb-util_0.3.1-2.dsc
$ dpkg-source -x xcd-util_0.3.1-2.dsc
$ cd xcb-util-0.3.1
$ dpkg-buildpackage
$ cd ..
# dpkg -i *.deb
# mkdir xcb && mv *.* xcb/
# aptitude install libxcb-xinerama0-dev libxcb-randr0-dev libcairo2-dev xmlto asciidoc libpango1.0-dev cmake lua5.1 luadoc libreadline-dev libev-dev liblua5.1-dev libimlib2-dev libx11-xcb-dev
$ dget http://ftp.de.debian.org/debian/pool/main/a/awesome/awesome_3.1-1.dsc
$ dpkg-source -x awesome_3.1-1.dsc
$ cd awesome-3.1
$ dpkg-buildpackage
$ cd ..
$ dpkg -i awesome_3.1-1.deb


んで,logoutして,kdmとかからセッションタイプをawesomeに変更すればおk!

stalonetrayなくても,systemtrayがあるし,特に何もしなくても時間が書いてあるし.

本当にすごい><><

awesome2.xから設定がすごく変わってるよ!