又熬夜了,配置 awesome

为什么我每天晚上都会遇到让我不想睡觉的事情呢?比如今天, awesome 更新到了 3.2, 我之前的配置文件又再次不好用了,只得继续重新配置一遍。这个可不能不做,不然我的电脑约等于没法用了。于是就又忙到这个时间了。
这个 awesome 也确实可恨,每次更新总要把配置文件语法改那么一点点。虽然确实每次改动都能看出是进步了,但是每次都要人重新配置这不要人命么。一开始我还非常仔细的配置,后来我干脆直接拿默认配置过来随便改改,勉强能用就不管了。幸好 awesome 的默认配置还不算难用。

记录一下今天晚上的成果。先勉强这样用起来吧,别的以后再说,真得睡觉了。我都饿了。

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
--- /etc/xdg/awesome/rc.lua	2009-03-19 07:46:50.000000000 +0800
+++ .config/awesome/rc.lua	2009-03-20 03:34:40.981216823 +0800
@@ -8,7 +8,7 @@
 -- {{{ Variable definitions
 -- Themes define colours, icons, and wallpapers
 -- The default is a dark theme
-theme_path = "/usr/share/awesome/themes/default/theme"
+theme_path = "/home/steamedfish/.config/awesome/default/theme"
 -- Uncommment this for a lighter theme
 -- theme_path = "/usr/share/awesome/themes/sky/theme"
 
@@ -16,8 +16,8 @@
 beautiful.init(theme_path)
 
 -- This is used later as the default terminal and editor to run.
-terminal = "xterm"
-editor = os.getenv("EDITOR") or "nano"
+terminal = "urxvt"
+editor = os.getenv("EDITOR") or "vim"
 editor_cmd = terminal .. " -e " .. editor
 
 -- Default modkey.
@@ -52,6 +52,11 @@
     ["MPlayer"] = true,
     ["pinentry"] = true,
     ["gimp"] = true,
+    ["SMPlayer"] = true,
+    ["Gimp"] = true,
+    ["Pidgin"] = true,
+    ["Kopete"] = true,
+    ["feh"] = true,
     -- by instance
     ["mocp"] = true
 }
@@ -75,12 +80,23 @@
     -- Each screen has its own tag table.
     tags[s] = {}
     -- Create 9 tags per screen.
+    tags[s][1] = tag({ name = "bash" })
+    tags[s][2] = tag({ name = "firefox" })
+    tags[s][3] = tag({ name = "pidgin" })
+    tags[s][4] = tag({ name = "PCManX" })
+    tags[s][5] = tag({ name = "floating" })
+    tags[s][6] = tag({ name = "six" })
+    tags[s][7] = tag({ name = "seven" })
+    tags[s][8] = tag({ name = "eight" })
+    tags[s][9] = tag({ name = "nine" })
     for tagnumber = 1, 9 do
-        tags[s][tagnumber] = tag(tagnumber)
+        -- 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
+        -- Setup tag six to use floating layout.
+        awful.layout.set(layouts[10], tags[s][5])
     -- I'm sure you want to see at least one tag.
     tags[s][1].selected = true
 end
@@ -90,18 +106,26 @@
 -- Create a textbox widget
 mytextbox = widget({ type = "textbox", align = "right" })
 -- Set the default text in textbox
-mytextbox.text = "<b><small> " .. AWESOME_RELEASE .. " </small></b>"
+-- mytextbox.text = "<b><small> " .. AWESOME_RELEASE .. " </small></b>"
+mytextbox.text = "<b><small> Fisher Duan </small></b>"
 
 -- Create a laucher widget and a main menu
 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 }
 }
 
-mymainmenu = awful.menu.new({ items = { { "awesome", myawesomemenu, beautiful.awesome_icon },
-                                        { "open terminal", terminal }
+mymainmenu = awful.menu.new({ items = { 
+                                        { "open terminal", terminal },
+                                        { "firefox", "firefox" },
+                                        { "pidgin", "pidgin" },
+                                        { "emacs", "emacs" },
+                                        { "pcmanx", "pcmanx" },
+                                        { "Files", "pcmanfm" },
+                                        { "awesome", myawesomemenu, beautiful.awesome_icon }
                                       }
                             })
 
@@ -145,7 +169,7 @@
     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] = widget({ type = "imagebox", align = "left" })
     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),
@@ -159,14 +183,14 @@
                                               end, mytasklist.buttons)
 
     -- Create the wibox
-    mywibox[s] = wibox({ position = "top", fg = beautiful.fg_normal, bg = beautiful.bg_normal })
+    mywibox[s] = wibox({ position = "bottom", fg = beautiful.fg_normal, bg = beautiful.bg_normal })
     -- Add widgets to the wibox - order matters
     mywibox[s].widgets = { mylauncher,
                            mytaglist[s],
-                           mytasklist[s],
+                           mylayoutbox[s],
                            mypromptbox[s],
+                           mytasklist[s],
                            mytextbox,
-                           mylayoutbox[s],
                            s == 1 and mysystray or nil }
     mywibox[s].screen = s
 end
@@ -225,9 +249,10 @@
     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),
+    key({ modkey, "Control" }, "l",     function () awful.util.spawn("xscreensaver-command -activate") end),
 
     -- Prompt
-    key({ modkey }, "F1",
+    key({ modkey }, "F2",
         function ()
             awful.prompt.run({ prompt = "Run: " },
             mypromptbox[mouse.screen],
@@ -428,8 +453,8 @@
     end
 end)
 
--- Hook called every minute
-awful.hooks.timer.register(60, function ()
-    mytextbox.text = os.date(" %a %b %d, %H:%M ")
+-- Hook called every second
+awful.hooks.timer.register(1, function ()
+    mytextbox.text = os.date(" %Y-%m-%e, %H:%M:%S ")
 end)
 -- }}}

Tags:

This entry was posted on Friday, March 20th, 2009 at 3:38 am and is filed under 技术相关, 疯疯癫癫. You can follow any responses to this entry through the RSS 2.0 feed. You can leave a response, or trackback from your own site.

7 Responses to “又熬夜了,配置 awesome”

wd March 20th, 2009 at 8:38 am

哇, 这个blog 居然更新了。。。

[Reply]

SteamedFish March 20th, 2009 at 3:07 pm

wd: 哇, 这个blog 居然更新了。。。

晕,被鄙视了。。。以后一定多多更新。

[Reply]

Corsair March 21st, 2009 at 3:26 pm

改成 lua 以后还每次变一点点??

[Reply]

SteamedFish March 21st, 2009 at 4:16 pm

Corsair: 改成 lua 以后还每次变一点点??

是啊

[Reply]

YCF March 21st, 2009 at 9:00 pm

每次更新都在兴奋之余,厌烦配置文件的改动!

[Reply]

GunsNRose April 11th, 2009 at 11:01 pm

awesome 3.2变化有点大,之前我用 一个文件来存自定义的key,结果3.2使用全局key跟clientkey方式

[Reply]

pipitu August 6th, 2009 at 2:44 pm

同配置awesome ING….
话说,熬夜是不好滴,会长豆豆滴

[Reply]

Leave a Reply