mattburchett

Old RC.lua for AwesomeWM

Jun 11th, 2011
247
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 30.05 KB | None | 0 0
  1. -- Standard awesome library
  2. require("awful")
  3. require("awful.autofocus")
  4. require("awful.rules")
  5. -- Theme handling library
  6. require("beautiful")
  7. -- Notification library
  8. require("naughty")
  9. -- Vicious Library
  10. require("vicious")
  11. -- MPD LIB
  12. --require("lib/mpd")
  13. -- AWESOMPD
  14. --require("awesompd")
  15.  
  16. -- {{{ Variable definitions
  17. -- Themes define colours, icons, and wallpapers
  18. beautiful.init("/home/burchettm/.config/awesome/themes/awesomeo/theme.lua")
  19.  
  20. -- This is used later as the default terminal and editor to run.
  21. terminal = "sakura"
  22. editor = os.getenv("EDITOR") or "vim"
  23. editor_cmd = terminal .. " -e " .. editor
  24.  
  25. -- Default modkey.
  26. -- Usually, Mod4 is the key with a logo between Control and Alt.
  27. -- If you do not like this or do not have such a key,
  28. -- I suggest you to remap Mod4 to another key using xmodmap or other tools.
  29. -- However, you can use another modifier like Mod1, but it may interact with others.
  30. modkey = "Mod4"
  31.  
  32. -- Table of layouts to cover with awful.layout.inc, order matters.
  33. layouts =
  34. {
  35. awful.layout.suit.floating,
  36. awful.layout.suit.tile,
  37. awful.layout.suit.tile.left,
  38. awful.layout.suit.tile.bottom,
  39. awful.layout.suit.tile.top,
  40. awful.layout.suit.fair,
  41. awful.layout.suit.fair.horizontal,
  42. awful.layout.suit.spiral,
  43. awful.layout.suit.spiral.dwindle,
  44. awful.layout.suit.max,
  45. awful.layout.suit.max.fullscreen,
  46. awful.layout.suit.magnifier
  47. }
  48. -- }}}
  49.  
  50. -- {{{ Tags
  51. -- Define a tag table which hold all screen tags.
  52. tags = {}
  53. for s = 1, screen.count() do
  54. -- Each screen has its own tag table.
  55. tags[s] = awful.tag({ "work", "term", "www", "chat", "music", "social" }, s,
  56. { layouts[1], layouts[2], layouts[1], -- Tags: 1, 2, 3
  57. layouts[1], layouts[1], layouts[1], -- 4, 5 ,6
  58. layouts[1], layouts[1], layouts[1] -- 7, 8, 9
  59. })
  60. end
  61. -- }}}
  62. -- {{{ Menu
  63. -- Create a laucher widget and a main menu
  64. myawesomemenu = {
  65. { "Manual", terminal .. " -e man awesome" },
  66. { "Edit Config", editor_cmd .. " " .. awful.util.getdir("config") .. "/rc.lua" },
  67. { "Restart", awesome.restart },
  68. { "Quit", awesome.quit }
  69. }
  70.  
  71. myaccessoriesmenu = {
  72. { "Android Notifier Desktop", "/usr/share/android-notifier-desktop/run.sh" },
  73. { "Application Finder", "xfce4-appfinder" },
  74. { "Archive Manager", "file-roller" },
  75. { "Avant Window Navigator", "avant-window-navigator" },
  76. { "Disk Utility", "palimpsest" },
  77. { "DOSBOX Emulator", "dosbox" },
  78. { "gShot", "gshot" },
  79. { "gVim", "gvim" },
  80. { "LXDE Image Viewer", "gpicview" },
  81. { "KeePassX", "keepassx" },
  82. { "LXTerminal", "lxtermnal" },
  83. { "Mousepad", "mousepad" },
  84. { "Orage Globaltime", "globaltime" },
  85. { "PCManFM File Manager", "pcmanfm" },
  86. { "Root Terminal", "gksu -l gnome-terminal" },
  87. { "Sakura", "sakura" },
  88. { "Screenshot", "xfce4-screenshooter" },
  89. { "Sensor Viewer", "xfce4-sensors" },
  90. { "Squeeze", "squeeze" },
  91. { "Terminator", "terminator" },
  92. { "Virus Scanner", "clamtk" },
  93. { "Xarchiver", "xarchiver" }
  94. }
  95.  
  96. myarchmenu = {
  97. { "AUR", "xdg-open http://aur.archlinux.org" },
  98. { "Bugs", "xdg-open http://bugs.archlinux.org" },
  99. { "Developers", "xdg-open http://www.archlinux.org/developers/" },
  100. { "Documentation", "xdg-open http://wiki.archlinux.org/index.php/Official_Arch_Linux_Install_Guide" },
  101. { "Donate", "xdg-open http://www.archlinux.org/donate/" },
  102. { "Forum", "xdg-open http://bbs.archlinux.org" },
  103. { "Homepage", "xdg-open http://repos.archlinux.org" },
  104. { "SVN", "xdg-open http://repos.archlinux.org" },
  105. { "Schwag", "xdg-open http://www.zazzle.com/archlinux/" },
  106. { "Wiki", "xdg-open http://wiki.archlinux.org" }
  107. }
  108.  
  109. mygamesmenu = {
  110. { "Alien Arena", "alienarena" },
  111. { "America's Army 3", "env WINEPREFIX='/home/burchettm/.wineprefix/Steam' wine winebrowser steam://rungameid/13140" },
  112. { "Ceiling Fan Man", "env WINEPREFIX='/home/burchettm/.wineprefix/SFGames' wine C:\\\\windows\\\\command\\\\start.exe /Unix /home/burchettm/.wineprefix/SFGames/dosdevices/c:/users/burchettm/Start\\ Menu/Programs/Skyfall/Ceiling\\ Fan\\ Man/Play\\ Ceiling\\ Fan\\ Man.lnk" },
  113. { "Ceiling Fan Man II", "env WINEPREFIX='/home/burchettm/.wineprefix/SFGames' wine C:\\\\windows\\\\command\\\\start.exe /Unix /home/burchettm/.wineprefix/SFGames/dosdevices/c:/users/burchettm/Start\\ Menu/Programs/Skyfall/Ceiling\\ Fan\\ Man\\ II\\ Demo/Play\\ Ceiling\\ Fan\\ Man\\ II.lnk" },
  114. { "Curse Client", "env WINEPREFIX='/home/burchettm/.wineprefix/Curse' wine C:\\\\windows\\\\command\\\\start.exe /Unix /home/burchettm/.wineprefix/Curse/dosdevices/c:/users/Public/Start\\ Menu/Programs/Curse/Curse\\ Client.lnk" },
  115. { "Fallout 3", "env WINEPREFIX='/home/burchettm/.wineprefix/Fallout3' wine C:\\\\windows\\\\command\\\\start.exe /Unix /home/burchettm/.wineprefix/Fallout3/dosdevices/c:/users/Public/Start\\ Menu/Programs/Bethesda\\ Softworks/Fallout\\ 3/Fallout\\ 3.lnk" },
  116. { "Frets on Fire", "fretsonfire" },
  117. { "GCFScape", "env WINEPREFIX='/home/burchettm/.wine' wine C:\\\\windows\\\\command\\\\start.exe /Unix /home/burchettm/.wine/dosdevices/c:/users/Public/Start\\ Menu/Programs/GCFScape/GCFScape.lnk" },
  118. { "GTA San Andreas", "env WINEPREFIX='/home/burchettm/.wineprefix/GTASA' wine C:\\\\windows\\\\command\\\\start.exe /Unix /home/burchettm/.wineprefix/GTASA/dosdevices/c:/users/Public/Start\\ Menu/Programs/Rockstar\\ Games/GTA\\ San\\ Andreas/Play\\ GTA\\ San\\ Andreas.lnk" },
  119. { "Imprudence", "/usr/bin/imprudence-secondlife" },
  120. { "Infiltration", "env WINEPREFIX='/home/burchettm/.wineprefix/UT' wine C:\\\\windows\\\\command\\\\start.exe /Unix /home/burchettm/.wineprefix/UT/dosdevices/c:/users/Public/Start\\ Menu/Programs/SentryStudios/Infiltration/Play\\ Infiltration.lnk" },
  121. { "LinCity-NG", "lincity-ng" },
  122. { "MaNGOLin", "/home/burchettm/Apps/MaNGOLin/MaNGOLin" },
  123. { "MCEdit", "python26 -O '/home/burchettm/Apps/MCEdit-linux/MCEditData/mcedit.pyo'" },
  124. { "Minecraft", "minecraft" },
  125. { "Oblivion", "env WINEPREFIX='/home/burchettm/.wineprefix/Oblivion' wine C:\\\\windows\\\\command\\\\start.exe /Unix /home/burchettm/.wineprefix/Oblivion/dosdevices/c:/users/Public/Start\\ Menu/Programs/Bethesda\\ Softworks/Oblivion/Oblivion.lnk" },
  126. { "PlayOnLinux", "playonlinux" },
  127. { "Second Life", "/usr/bin/secondlife" },
  128. { "SimCity 4 Deluxe", "env WINEPREFIX='home/burchettm/.wineprefix/SimCity4' wine '/home/burchettm/.wineprefix/SimCity4/drive_c/Program Files/Maxis/SimCity 4 Deluxe/Apps/SimCity 4.exe' -intro:off -customresolution:enabled -r1920x1080x32" },
  129. { "SLiteChat", "env WINEPREFIX='/home/burchettm/.wine' wine C:\\\\windows\\\\command\\\\start.exe /Unix /home/burchettm/.wine/dosdevices/c:/users/Public/Start\\ Menu/Programs/SLiteChat\\ for\\ Windows/SLiteChat\\ -\\ Text-based\\ IM\\ client\\ for\\ Second\\ Life.lnk" },
  130. { "Soldier of Fortune", "env WINEPREFIX='/home/burchettm/.wineprefix/SOF' wine C:\\\\windows\\\\command\\\\start.exe /Unix /home/burchettm/.wineprefix/SOF/dosdevices/c:/users/Public/Start\\ Menu/Programs/Raven\\ Software/Soldier\\ of\\ Fortune\\ Platinum/Soldier\\ of\\ Fortune\\ Platinum.lnk" },
  131. { "Snowglobe 1.3", "snowglobe" },
  132. { "Steam", "env WINEPREFIX='/home/burchettm/.wineprefix/Steam' wine C:\\\\windows\\\\command\\\\start.exe /Unix /home/burchettm/.wineprefix/Steam/dosdevices/c:/users/burchettm/Start\\ Menu/Programs/Steam/Steam.lnk" },
  133. { "Strike Force 181", "env WINEPREFIX='/home/burchettm/.wineprefix/UT' wine C:\\\\unrealtournament\\\\System\\\\Strike\\ Force.exe" },
  134. { "SuperTuxKart", "/usr/bin/supertuxkart --log=file" },
  135. { "PyLoTRO", "pylotro" },
  136. { "UT2004", "env WINEPREFIX='/home/burchettm/.wineprefix/UT' wine C:\\\\windows\\\\command\\\\start.exe /Unix /home/burchettm/.wineprefix/UT/dosdevices/c:/users/Public/Start\\ Menu/Programs/Unreal\\ Tournament\\ 2004/Play\\ UT2004.lnk" },
  137. { "UTGOTY", "env WINEPREFIX='/home/burchettm/.wineprefix/UT' wine C:\\\\windows\\\\command\\\\start.exe /Unix /home/burchettm/.wineprefix/UT/dosdevices/c:/users/Public/Start\\ Menu/Programs/Unreal\\ Tournament\\ G.O.T.Y.\\ Edition/Play\\ Unreal\\ Tournament.lnk" },
  138. { "World of Padman", "worldofpadman" },
  139. { "WoW-Cataclysm", "wine '/media/Terabyte/WoW-Cataclysm/Launcher.exe" },
  140. { "WoW-PTR", "env WINEPREFIX='/home/burchettm/.wine' wine C:\\\\windows\\\\command\\\\start.exe /Unix /home/burchettm/.wine/dosdevices/c:/users/Public/Start\\ Menu/Programs/World\\ of\\ Warcraft\\ Public\\ Test/World\\ of\\ Warcraft.lnk" },
  141. { "WoW-WotLK", "wine '/media/Terabyte/WoW-WoTLK/Wow.exe'" }
  142. }
  143.  
  144. mygraphicsmenu = {
  145. { "Adobe ImageReady 7.0", "env WINEPREFIX='/home/burchettm/.wineprefix/Adobe' wine C:\\\\windows\\\\command\\\\start.exe /Unix /home/burchettm/.wineprefix/Adobe/dosdevices/c:/users/Public/Start\\ Menu/Programs/Adobe\\ ImageReady\\ 7.0.lnk" },
  146. { "Adobe PhotoShop 7.0", "env WINEPREFIX='/home/burchettm/.wineprefix/Adobe' wine '/home/burchettm/.wineprefix/Adobe/drive_c/Program Files/Adobe/Photoshop 7.0/Photoshop.exe'" },
  147. { "Dreamweaver 8", "env WINEPREFIX='/home/burchettm/.wineprefix/Adobe' wine C:\\\\windows\\\\command\\\\start.exe /Unix /home/burchettm/.wineprefix/Adobe/dosdevices/c:/users/burchettm/Start\\ Menu/Programs/Macromedia/Macromedia\\ Dreamweaver\\ 8.lnk" },
  148. { "IconsExtract", "env WINEPREFIX='/home/burchettm/.wine' wine C:\\\\windows\\\\command\\\\start.exe /Unix /home/burchettm/.wine/dosdevices/c:/users/burchettm/Start\\ Menu/Programs/NirSoft\\ IconsExtract/IconsExtract.lnk" },
  149. { "GIMP", "gimp-2.6" },
  150. { "LXDE Image Viewer", "gpicview" },
  151. { "MCEdit", "python26 -O '/home/burchettm/Apps/MCEdit-linux/MCEditData/mcedit.pyo'" },
  152. { "MS Paint", "env WINEPREFIX='/home/burchettm/.wine' wine '/home/burchettm/.wine/drive_c/windows/mspaint.exe'" },
  153. { "Ristretto Photo Viewer", "ristretto" }
  154. }
  155.  
  156. myinternetmenu = {
  157. { "Avahi SSH", "/usr/bin/bssh" },
  158. { "Avahi VNC", "/usr/bin/bvnc" },
  159. { "Chromium", "chromium" },
  160. { "Curse Client", "env WINEPREFIX='/home/burchettm/.wineprefix/Curse' wine C:\\\\windows\\\\command\\\\start.exe /Unix /home/burchettm/.wineprefix/Curse/dosdevices/c:/users/Public/Start\\ Menu/Programs/Curse/Curse\\ Client.lnk" },
  161. { "Deluge", "deluge-gtk" },
  162. { "Dropbox", "/opt/dropbox/dropboxd" },
  163. { "FileZilla", "filezilla" },
  164. { "Links", "xlinks -g" },
  165. { "Mangler", "mangler" },
  166. { "Midori", "midori" },
  167. { "Mitter", "/usr/bin/mitter" },
  168. { "MS RDP", "env WINEPREFIX='/home/burchettm/.wine' wine '/home/burchettm/.wine/drive_c/Program Files/RDP/mstsc.exe'" },
  169. { "NeverNote", "/usr/share/nevernote/nevernote.sh" },
  170. { "Opera", "/usr/bin/opera" },
  171. { "Pidgin", "pidgin" },
  172. { "qBittorent", "qbittorrent" },
  173. { "QuickSynergy", "quicksynergy" },
  174. { "SeaMonkey", "seamonkey" },
  175. { "Skype", "skype" },
  176. { "TeamSpeak 3", "/usr/bin/teamspeak3" },
  177. { "TeamViewer", "/opt/teamviewer/teamviewer/6/bin/teamviewer" },
  178. { "Thunderbird", "thunderbird" },
  179. { "Transmission", "transmission-gtk" },
  180. { "Turpial", "turpial" },
  181. { "TweetDeck", "adobe-air /opt/tweetdeck/tweetdeck.air" },
  182. { "WhizNet", "env WINEPREFIX='/home/burchettm/.wineprefix/Whizkid' wine C:\\\\windows\\\\command\\\\start.exe /Unix /home/burchettm/.wineprefix/Whizkid/dosdevices/c:/users/Public/Start\\ Menu/Programs/Whizkid\\ Online/WhizNet/WhizNet.lnk" }
  183. }
  184.  
  185. myofficemenu = {
  186. { "Dictionary", "xfce4-dict" },
  187. { "Orage Calendar", "orage" },
  188. { "Orage Globaltime", "globaltime" },
  189. { "PDF Viewer", "epdfview" }
  190. }
  191.  
  192. myprogrammingmenu = {
  193. { "Android SDK", "android" },
  194. { "CMake", "cmake-gui" },
  195. { "Dreamweaver 8", "env WINEPREFIX='/home/burchettm/.wineprefix/Adobe' wine C:\\\\windows\\\\command\\\\start.exe /Unix /home/burchettm/.wineprefix/Adobe/dosdevices/c:/users/burchettm/Start\\ Menu/Programs/Macromedia/Macromedia\\ Dreamweaver\\ 8.lnk" },
  196. { "Glade", "glade" },
  197. { "Google Gadget Designer", "/usr/bin/ggl-gtk -sa -nd -gp /usr/share/google-gadgets/designer.gg" },
  198. { "Qt Assistant", "/usr/bin/assistant" },
  199. { "Qt Designer", "/usr/bin/designer" },
  200. { "Qt Linguist", "/usr/bin/linguist" }
  201. }
  202.  
  203. mysoundmenu = {
  204. { "AcetoneISO", "acetoneiso" },
  205. { "Audacious", "audacious" },
  206. { "Cheese", "cheese" },
  207. { "dvd::rip", "/usr/bin/vendor_perl/dvdrip" },
  208. { "EasyTAG", "easytag" },
  209. { "Ex Falso", "exfalso" },
  210. { "GNOME MPlayer", "gnome-mplayer" },
  211. { "GNOME MPC", "gmpc" },
  212. { "Goggles Music Manger", "gogglesmm" },
  213. { "GTK-RecordMyDesktop", "gtk-recordmydesktop" },
  214. { "HandBrake", "ghb" },
  215. { "Last.FM", "lastfm" },
  216. { "Mixer", "xfce4-mixer" },
  217. { "Nero Linux", "nero" },
  218. { "Nero Linux Express", "neroexpress" },
  219. { "Pithos", "pithos" },
  220. { "QT V4L2 Tester", "qv4l2" },
  221. { "Quod Libet", "quodlibet" },
  222. { "Sonata", "sonata" },
  223. { "VLC", "vlc" },
  224. { "VolWheel", "volwheel" },
  225. { "Webcam Application", "wxcam" },
  226. { "XBMC", "xbmc" },
  227. { "Xfburn", "xfburn" }
  228. }
  229.  
  230. mysystemtoolsmenu = {
  231. { "Avahi Zeroconf", "/usr/bin/avahi-discover" },
  232. { "Bulk Rename", "/usr/lib/Thunar/ThunarBulkRename" },
  233. { "Cairo-Dock", "cairo-dock -c" },
  234. { "GLX-Dock", "cairo-dock -o" },
  235. { "GParted", "gksu /usr/sbin/gparted" },
  236. { "LXDE Task Manager", "lxtask" },
  237. { "Manage Printing", "/usr/bin/xdg-open http://localhost:631/" },
  238. { ".NET 1.1 Configuration", "env WINEPREFIX='/home/burchettm/.wineprefix/SOF' wine C:\\\\windows\\\\command\\\\start.exe /Unix /home/burchettm/.wineprefix/SOF/dosdevices/c:/users/burchettm/Start\\ Menu/Programs/Administrative\\ Tools/Microsoft\\ .NET\\ Framework\\ 1.1\\ Configuration.lnk" },
  239. { ".NET 1.1 Wizards", "env WINEPREFIX='/home/burchettm/.wineprefix/SOF' wine C:\\\\windows\\\\command\\\\start.exe /Unix /home/burchettm/.wineprefix/SOF/dosdevices/c:/users/burchettm/Start\\ Menu/Programs/Administrative\\ Tools/Microsoft\\ .NET\\ Framework\\ 1.1\\ Wizards.lnk" },
  240. { "RXVT-Unicode", "urxvt" },
  241. { "Terminal", "terminal" },
  242. { "Thunar", "Thunar" },
  243. { "UNetBootIn", "/usr/bin/unetbootin" },
  244. { "VMware Player", "/usr/bin/vmplayer" },
  245. { "VMware Workstation", "/usr/bin/vmware" },
  246. { "VirtualBox", "VirtualBox" },
  247. { "Virtual Network Editor", "/usr/bin/vmware-netcfg" },
  248. { "Wireshark", "Wireshark" },
  249. { "XFCE Task Manager", "xfce4-taskmanager" }
  250. }
  251.  
  252. mymainmenu = awful.menu({ items = { { " ", " " },
  253. { "Opera", "opera" },
  254. { "Pidgin", "pidgin" },
  255. { "Skype", "skype" },
  256. { "Sonata", "sonata" },
  257. { "TeamSpeak3", "teamspeak3" },
  258. { "Terminal", "sakura" },
  259. { "Turpial", "turpial" },
  260. { " ", " " },
  261. { "Accessories", myaccessoriesmenu, beautiful.menu_accessories },
  262. { "Arch Linux" , myarchmenu, beautiful.arch_icon },
  263. { "Games", mygamesmenu, beautiful.menu_games },
  264. { "Graphics", mygraphicsmenu, beautiful.menu_graphics },
  265. { "Internet", myinternetmenu, beautiful.menu_internet },
  266. { "Office", myofficemenu, beautiful.menu_office },
  267. { "Programming", myprogrammingmenu, beautiful.menu_programming },
  268. { "Sound & Video", mysoundmenu, beautiful.menu_sound },
  269. { "System Tools", mysystemtoolsmenu, beautiful.menu_system },
  270. { " ", " " },
  271. { "Awesome", myawesomemenu, beautiful.awesome_icon }
  272. }
  273. })
  274.  
  275. mylauncher = awful.widget.launcher({ image = image(beautiful.arch_icon),
  276. menu = mymainmenu })
  277. -- }}}
  278.  
  279. -- {{{ Wibox
  280. -- Create a textclock widget
  281. mytextclock = awful.widget.textclock({ align = "right" }, " %a, %Y/%m/%d | %H:%M:%S ", 1)
  282.  
  283. -- Create a systray
  284. mysystray = widget({ type = "systray" })
  285.  
  286. -- Create a wibox for each screen and add it
  287. mywibox = {}
  288. mypromptbox = {}
  289. mylayoutbox = {}
  290. mytaglist = {}
  291. mytaglist.buttons = awful.util.table.join(
  292. awful.button({ }, 1, awful.tag.viewonly),
  293. awful.button({ modkey }, 1, awful.client.movetotag),
  294. awful.button({ }, 3, awful.tag.viewtoggle),
  295. awful.button({ modkey }, 3, awful.client.toggletag),
  296. awful.button({ }, 4, awful.tag.viewnext),
  297. awful.button({ }, 5, awful.tag.viewprev)
  298. )
  299. mytasklist = {}
  300. mytasklist.buttons = awful.util.table.join(
  301. awful.button({ }, 1, function (c)
  302. if not c:isvisible() then
  303. awful.tag.viewonly(c:tags()[1])
  304. end
  305. client.focus = c
  306. c:raise()
  307. end),
  308. awful.button({ }, 3, function ()
  309. if instance then
  310. instance:hide()
  311. instance = nil
  312. else
  313. instance = awful.menu.clients({ width=250 })
  314. end
  315. end),
  316. awful.button({ }, 4, function ()
  317. awful.client.focus.byidx(1)
  318. if client.focus then client.focus:raise() end
  319. end),
  320. awful.button({ }, 5, function ()
  321. awful.client.focus.byidx(-1)
  322. if client.focus then client.focus:raise() end
  323. end))
  324.  
  325. for s = 1, screen.count() do
  326. -- Create a promptbox for each screen
  327. mypromptbox[s] = awful.widget.prompt({ layout = awful.widget.layout.horizontal.leftright })
  328. -- Create an imagebox widget which will contains an icon indicating which layout we're using.
  329. -- We need one layoutbox per screen.
  330. mylayoutbox[s] = awful.widget.layoutbox(s)
  331. mylayoutbox[s]:buttons(awful.util.table.join(
  332. awful.button({ }, 1, function () awful.layout.inc(layouts, 1) end),
  333. awful.button({ }, 3, function () awful.layout.inc(layouts, -1) end),
  334. awful.button({ }, 4, function () awful.layout.inc(layouts, 1) end),
  335. awful.button({ }, 5, function () awful.layout.inc(layouts, -1) end)))
  336. -- Create a taglist widget
  337. mytaglist[s] = awful.widget.taglist(s, awful.widget.taglist.label.all, mytaglist.buttons)
  338.  
  339. -- Create a tasklist widget
  340. mytasklist[s] = awful.widget.tasklist(function(c)
  341. return awful.widget.tasklist.label.currenttags(c, s)
  342. end, mytasklist.buttons)
  343.  
  344. -- Create the wibox
  345. mywibox[s] = awful.wibox({ position = "top", screen = s })
  346. -- Add widgets to the wibox - order matters
  347. mywibox[s].widgets = {
  348. {
  349. mylauncher,
  350. mytaglist[s],
  351. mypromptbox[s],
  352. layout = awful.widget.layout.horizontal.leftright
  353. },
  354. mylayoutbox[s],
  355. mytextclock,
  356. s == 1 and mysystray or nil,
  357. mytasklist[s],
  358. layout = awful.widget.layout.horizontal.rightleft
  359. }
  360. end
  361. -- }}}
  362.  
  363. -- {{{ Mouse bindings
  364. root.buttons(awful.util.table.join(
  365. awful.button({ }, 3, function () mymainmenu:toggle() end),
  366. awful.button({ }, 4, awful.tag.viewnext),
  367. awful.button({ }, 5, awful.tag.viewprev)
  368. ))
  369. -- }}}
  370.  
  371. -- {{{ Key bindings
  372. globalkeys = awful.util.table.join(
  373. awful.key({ modkey, }, "Left", awful.tag.viewprev ),
  374. awful.key({ modkey, }, "Right", awful.tag.viewnext ),
  375. awful.key({ modkey, }, "Escape", awful.tag.history.restore),
  376. awful.key({ modkey, }, "j",
  377. function ()
  378. awful.client.focus.byidx( 1)
  379. if client.focus then client.focus:raise() end
  380. end),
  381. awful.key({ modkey, }, "k",
  382. function ()
  383. awful.client.focus.byidx(-1)
  384. if client.focus then client.focus:raise() end
  385. end),
  386. awful.key({ modkey, }, "w", function () mymainmenu:show({keygrabber=true}) end),
  387.  
  388. -- User Added Keybindings
  389. awful.key({}, "Print", function () awful.util.spawn("scrotshooter") end),
  390. awful.key({}, "Alt_Sys_Req", function () awful.util.spawn("scrotshooter-aprint") end),
  391. awful.key({}, "XF86AudioRaiseVolume", function () awful.util.spawn("amixer set Master 5%+") end),
  392. awful.key({}, "XF86AudioLowerVolume", function () awful.util.spawn("amixer set Master 5%-") end),
  393. awful.key({}, "XF86AudioMute", function () awful.util.spawn("amixer set Master toggle") end),
  394.  
  395.  
  396. -- Layout manipulation
  397. awful.key({ modkey, "Shift" }, "j", function () awful.client.swap.byidx( 1) end),
  398. awful.key({ modkey, "Shift" }, "k", function () awful.client.swap.byidx( -1) end),
  399. awful.key({ modkey, "Control" }, "j", function () awful.screen.focus_relative( 1) end),
  400. awful.key({ modkey, "Control" }, "k", function () awful.screen.focus_relative(-1) end),
  401. awful.key({ modkey, }, "u", awful.client.urgent.jumpto),
  402. awful.key({ modkey, }, "Tab",
  403. function ()
  404. awful.client.focus.history.previous()
  405. if client.focus then
  406. client.focus:raise()
  407. end
  408. end),
  409.  
  410. -- Standard program
  411. awful.key({ modkey, }, "Return", function () awful.util.spawn(terminal) end),
  412. awful.key({ modkey, "Control" }, "r", awesome.restart),
  413. awful.key({ modkey, "Shift" }, "q", awesome.quit),
  414.  
  415. awful.key({ modkey, }, "l", function () awful.tag.incmwfact( 0.05) end),
  416. awful.key({ modkey, }, "h", function () awful.tag.incmwfact(-0.05) end),
  417. awful.key({ modkey, "Shift" }, "h", function () awful.tag.incnmaster( 1) end),
  418. awful.key({ modkey, "Shift" }, "l", function () awful.tag.incnmaster(-1) end),
  419. awful.key({ modkey, "Control" }, "h", function () awful.tag.incncol( 1) end),
  420. awful.key({ modkey, "Control" }, "l", function () awful.tag.incncol(-1) end),
  421. awful.key({ modkey, }, "space", function () awful.layout.inc(layouts, 1) end),
  422. awful.key({ modkey, "Shift" }, "space", function () awful.layout.inc(layouts, -1) end),
  423.  
  424. -- Prompt
  425. awful.key({ modkey }, "r", function () mypromptbox[mouse.screen]:run() end),
  426.  
  427. awful.key({ modkey }, "x",
  428. function ()
  429. awful.prompt.run({ prompt = "Run Lua code: " },
  430. mypromptbox[mouse.screen].widget,
  431. awful.util.eval, nil,
  432. awful.util.getdir("cache") .. "/history_eval")
  433. end)
  434. )
  435.  
  436. clientkeys = awful.util.table.join(
  437. awful.key({ modkey, }, "f", function (c) c.fullscreen = not c.fullscreen end),
  438. awful.key({ modkey, "Shift" }, "c", function (c) c:kill() end),
  439. awful.key({ modkey, "Control" }, "space", awful.client.floating.toggle ),
  440. awful.key({ modkey, "Control" }, "Return", function (c) c:swap(awful.client.getmaster()) end),
  441. awful.key({ modkey, }, "o", awful.client.movetoscreen ),
  442. awful.key({ modkey, "Shift" }, "r", function (c) c:redraw() end),
  443. awful.key({ modkey, }, "t", function (c) c.ontop = not c.ontop end),
  444. awful.key({ modkey, }, "n", function (c) c.minimized = not c.minimized end),
  445. awful.key({ modkey, }, "m",
  446. function (c)
  447. c.maximized_horizontal = not c.maximized_horizontal
  448. c.maximized_vertical = not c.maximized_vertical
  449. end)
  450. )
  451.  
  452. -- Compute the maximum number of digit we need, limited to 9
  453. keynumber = 0
  454. for s = 1, screen.count() do
  455. keynumber = math.min(9, math.max(#tags[s], keynumber));
  456. end
  457.  
  458. -- Bind all key numbers to tags.
  459. -- Be careful: we use keycodes to make it works on any keyboard layout.
  460. -- This should map on the top row of your keyboard, usually 1 to 9.
  461. for i = 1, keynumber do
  462. globalkeys = awful.util.table.join(globalkeys,
  463. awful.key({ modkey }, "#" .. i + 9,
  464. function ()
  465. local screen = mouse.screen
  466. if tags[screen][i] then
  467. awful.tag.viewonly(tags[screen][i])
  468. end
  469. end),
  470. awful.key({ modkey, "Control" }, "#" .. i + 9,
  471. function ()
  472. local screen = mouse.screen
  473. if tags[screen][i] then
  474. awful.tag.viewtoggle(tags[screen][i])
  475. end
  476. end),
  477. awful.key({ modkey, "Shift" }, "#" .. i + 9,
  478. function ()
  479. if client.focus and tags[client.focus.screen][i] then
  480. awful.client.movetotag(tags[client.focus.screen][i])
  481. end
  482. end),
  483. awful.key({ modkey, "Control", "Shift" }, "#" .. i + 9,
  484. function ()
  485. if client.focus and tags[client.focus.screen][i] then
  486. awful.client.toggletag(tags[client.focus.screen][i])
  487. end
  488. end))
  489. end
  490.  
  491. clientbuttons = awful.util.table.join(
  492. awful.button({ }, 1, function (c) client.focus = c; c:raise() end),
  493. awful.button({ modkey }, 1, awful.mouse.client.move),
  494. awful.button({ modkey }, 3, awful.mouse.client.resize))
  495.  
  496. -- Set keys
  497. root.keys(globalkeys)
  498. -- }}}
  499.  
  500. -- {{{ Rules
  501. awful.rules.rules = {
  502. -- All clients will match this rule.
  503. { rule = { },
  504. properties = { border_width = beautiful.border_width,
  505. border_color = beautiful.border_normal,
  506. focus = true,
  507. keys = clientkeys,
  508. buttons = clientbuttons } },
  509. { rule = { class = "MPlayer" },
  510. properties = { floating = true } },
  511. { rule = { class = "pinentry" },
  512. properties = { floating = true } },
  513. { rule = { class = "gimp" },
  514. properties = { floating = true } },
  515. { rule = { class = "Opera" }, properties = { tag = tags[1][3] } },
  516. { rule = { class = "Pidgin" }, properties = { tag = tags[1][4] } },
  517. { rule = { class = "Skype" }, properties = { tag = tags[1][4] } },
  518. { rule = { class = "Sonata" }, properties = { tag = tags[1][5] } },
  519. { rule = { class = "Turpial" }, properties = { tag = tags[1][6] } },
  520. -- Set Firefox to always map on tags number 2 of screen 1.
  521. -- { rule = { class = "Firefox" },
  522. -- properties = { tag = tags[1][2] } },
  523. }
  524. -- }}}
  525.  
  526. -- {{{ Signals
  527. -- Signal function to execute when a new client appears.
  528. client.add_signal("manage", function (c, startup)
  529. -- Add a titlebar
  530. -- awful.titlebar.add(c, { modkey = modkey })
  531.  
  532. -- Enable sloppy focus
  533. c:add_signal("mouse::enter", function(c)
  534. if awful.layout.get(c.screen) ~= awful.layout.suit.magnifier
  535. and awful.client.focus.filter(c) then
  536. client.focus = c
  537. end
  538. end)
  539.  
  540. if not startup then
  541. -- Set the windows at the slave,
  542. -- i.e. put it at the end of others instead of setting it master.
  543. -- awful.client.setslave(c)
  544.  
  545. -- Put windows in a smart way, only if they does not set an initial position.
  546. if not c.size_hints.user_position and not c.size_hints.program_position then
  547. awful.placement.no_overlap(c)
  548. awful.placement.no_offscreen(c)
  549. end
  550. end
  551. end)
  552.  
  553. client.add_signal("focus", function(c) c.border_color = beautiful.border_focus end)
  554. client.add_signal("unfocus", function(c) c.border_color = beautiful.border_normal end)
  555. -- }}}
  556. -- User Mods
  557. -- -- AutoStart
  558. awful.util.spawn_with_shell("volwheel")
  559. awful.util.spawn_with_shell("dropboxd")
  560. awful.util.spawn_with_shell("mpd")
  561. awful.util.spawn_with_shell("wmname LG3D")
  562. -- Status Bar
  563. -- --mystatusbar = wibox({ position = "bottom" })
  564. -- --mystatusbar.screen = 1
  565. -- -- Create a Textbox
  566. --mytextbox = widget({ type = "textbox", name = "mytextbox" })
  567. -- -- Set text of the textbox
  568. --mytextbox.text = "Hello, world!"
  569. -- -- Create a Statusbar
  570. --mystatusbar = awful.wibox({ position = "bottom", name = "mystatusbar" })
  571. -- -- Add widgets to the statusbar
  572. --mystatusbar.widgets = { }
  573. -- -- Add the statusbar on screen 1
  574. --mystatusbar.screen = 1
  575. -- -- MPD Widget
  576. -- Initialize widget
  577. --mpdwidget = widget({ type = "textbox" })
  578. -- Register widget
  579. --vicious.register(mpdwidget, vicious.widgets.mpd,
  580. -- function (widget, args)
  581. -- if args["{state}"] == "Stop" then
  582. -- return "MPD - Stopped "
  583. -- else
  584. -- return args["{Artist}"]..' - '.. args["{Title}"]
  585. -- end
  586. -- end, 10)
  587. -- -- AwesomMPD
  588. -- musicwidget = awesompd:create() -- Create awesompd widget
  589. -- musicwidget.font = "Liberation Mono" -- Set widget font
  590. -- musicwidget.scrolling = true -- If true, the text in the widget will be scrolled
  591. -- musicwidget.output_size = 30 -- Set the size of widget in symbols
  592. -- musicwidget.update_interval = 10 -- Set the update interval in seconds
  593. -- musicwidget.path_to_icons = "/home/burchettm/.config/awesome/icons" -- Set the folder where icons are located (change username to your login name)
  594. -- Set all the servers to work with (here can be any servers you use)
  595. -- musicwidget.servers = {
  596. -- { server = "localhost",
  597. -- port = 6600 },
  598. -- { server = "192.168.0.72",
  599. -- port = 6600 }
  600. -- }
  601. -- Set the buttons of the widget
  602. -- musicwidget:register_buttons({ { "", awesompd.MOUSE_LEFT, musicwidget:command_toggle() },
  603. -- { "Control", awesompd.MOUSE_SCROLL_UP, musicwidget:command_prev_track() },
  604. -- { "Control", awesompd.MOUSE_SCROLL_DOWN, musicwidget:command_next_track() },
  605. -- { "", awesompd.MOUSE_SCROLL_UP, musicwidget:command_volume_up() },
  606. -- { "", awesompd.MOUSE_SCROLL_DOWN, musicwidget:command_volume_down() },
  607. -- { "", awesompd.MOUSE_RIGHT, musicwidget:command_show_menu() } })
  608. -- musicwidget:run()
Advertisement
Add Comment
Please, Sign In to add comment