Commit ec5c7168c8588a79f12a44a5155097552cde506e
1 parent
5f865a17be
Exists in
master
darmburn theme done
Showing 2 changed files with 20 additions and 33 deletions Inline Diff
awesome/awesome/darkburn/theme.lua
View file @
ec5c716
-------------------------------- | 1 | 1 | -------------------------------- | |
-- "Darkburn" awesome theme -- | 2 | 2 | -- "Darkburn" awesome theme -- | |
-- By LANRAT -- | 3 | 3 | -- By LANRAT -- | |
-------------------------------- | 4 | 4 | -------------------------------- | |
5 | 5 | |||
-- {{{ Main | 6 | 6 | -- {{{ Main | |
theme = {} | 7 | 7 | theme = {} | |
theme.confdir = awful.util.getdir("config") | 8 | 8 | theme.confdir = awful.util.getdir("config") | |
theme.themedir = theme.confdir .. "/darkburn/" | 9 | 9 | theme.themedir = theme.confdir .. "/darkburn/" | |
--TODO better wallpaper handling | 10 | |||
theme.wallpaper_cmd = { "awsetbg -a .wallpaper.jpg" } | 11 | 10 | theme.wallpaper_cmd = { "awsetbg -a .wallpaper.jpg" } | |
-- }}} | 12 | 11 | -- }}} | |
13 | 12 | |||
-- {{{ Styles | 14 | 13 | -- {{{ Styles | |
theme.font = "sans 8" | 15 | 14 | theme.font = "sans 8" | |
16 | 15 | |||
-- {{{ Colors | 17 | 16 | -- {{{ Colors | |
theme.fg_normal = "#DCDCCC" | 18 | 17 | theme.fg_normal = "#DCDCCC" | |
theme.fg_focus = "#F0DFAF" | 19 | 18 | theme.fg_focus = "#F0DFAF" | |
theme.fg_urgent = "#CC9393" | 20 | 19 | theme.fg_urgent = "#CC9393" | |
theme.bg_normal = "#000000" | 21 | 20 | theme.bg_normal = "#000000" | |
theme.bg_focus = "#111111" | 22 | 21 | theme.bg_focus = "#111111" | |
theme.bg_urgent = "#3F3F3F" | 23 | 22 | theme.bg_urgent = "#3F3F3F" | |
-- }}} | 24 | 23 | -- }}} | |
25 | 24 | |||
-- {{{ Borders | 26 | 25 | -- {{{ Borders | |
--theme.border_width = "1" | 27 | 26 | theme.border_width = 0 | |
theme.border_width = "0" | 28 | |||
theme.border_normal = "#3F3F3F" | 29 | 27 | theme.border_normal = "#3F3F3F" | |
theme.border_focus = "#6F6F6F" | 30 | 28 | theme.border_focus = "#6F6F6F" | |
theme.border_marked = "#CC9393" | 31 | 29 | --theme.border_marked = "#CC9393" | |
-- }}} | 32 | 30 | -- }}} | |
33 | 31 | |||
-- {{{ Titlebars | 34 | 32 | -- {{{ Titlebars | |
theme.titlebar_bg_focus = "#3F3F3F" | 35 | 33 | theme.titlebar_bg_focus = "#3F3F3F" | |
theme.titlebar_bg_normal = "#3F3F3F" | 36 | 34 | theme.titlebar_bg_normal = "#3F3F3F" | |
-- }}} | 37 | 35 | -- }}} | |
38 | 36 | |||
-- There are other variable sets | 39 | 37 | -- There are other variable sets | |
-- overriding the default one when | 40 | 38 | -- overriding the default one when | |
-- defined, the sets are: | 41 | 39 | -- defined, the sets are: | |
-- [taglist|tasklist]_[bg|fg]_[focus|urgent] | 42 | 40 | -- [taglist|tasklist]_[bg|fg]_[focus|urgent] | |
-- titlebar_[normal|focus] | 43 | 41 | -- titlebar_[normal|focus] | |
-- tooltip_[font|opacity|fg_color|bg_color|border_width|border_color] | 44 | 42 | -- tooltip_[font|opacity|fg_color|bg_color|border_width|border_color] | |
-- Example: | 45 | 43 | -- Example: | |
--theme.taglist_bg_focus = "#CC9393" | 46 | 44 | --theme.taglist_bg_focus = "#CC9393" | |
-- }}} | 47 | 45 | -- }}} | |
48 | 46 | |||
49 | 47 | |||
--TODO use these variables | 50 | |||
-- {{{ Widgets | 51 | 48 | -- {{{ Widgets | |
-- You can add as many variables as | 52 | 49 | -- You can add as many variables as | |
-- you wish and access them by using | 53 | 50 | -- you wish and access them by using | |
-- beautiful.variable in your rc.lua | 54 | 51 | -- beautiful.variableName in your rc.lua | |
--theme.fg_widget = "#AECF96" | 55 | 52 | theme.fg_widget = "#AECF96" | |
--theme.fg_center_widget = "#88A175" | 56 | 53 | theme.fg_center_widget = "#FFCF00" | |
--theme.fg_end_widget = "#FF5656" | 57 | 54 | theme.fg_end_widget = "#FF5656" | |
--theme.bg_widget = "#494B4F" | 58 | 55 | theme.bg_widget = "#111111" | |
--theme.border_widget = "#3F3F3F" | 59 | 56 | --theme.border_widget = "#3F3F3F" | |
-- }}} | 60 | 57 | -- }}} | |
61 | 58 | |||
-- {{{ Mouse finder | 62 | 59 | -- {{{ Mouse finder | |
theme.mouse_finder_color = "#CC9393" | 63 | 60 | --theme.mouse_finder_color = "#CC9393" | |
-- mouse_finder_[timeout|animate_timeout|radius|factor] | 64 | 61 | -- mouse_finder_[timeout|animate_timeout|radius|factor] | |
-- }}} | 65 | 62 | -- }}} | |
66 | 63 | |||
-- {{{ Menu | 67 | 64 | -- {{{ Menu | |
-- Variables set for theming the menu: | 68 | 65 | -- Variables set for theming the menu: | |
-- menu_[bg|fg]_[normal|focus] | 69 | 66 | -- menu_[bg|fg]_[normal|focus] | |
-- menu_[border_color|border_width] | 70 | 67 | -- menu_[border_color|border_width] | |
theme.menu_height = "16" | 71 | 68 | theme.menu_height = 16 | |
theme.menu_width = "100" | 72 | 69 | theme.menu_width = 100 | |
-- }}} | 73 | 70 | -- }}} | |
74 | 71 | |||
-- {{{ Icons | 75 | 72 | -- {{{ Icons | |
-- {{{ Taglist | 76 | 73 | -- {{{ Taglist | |
theme.taglist_squares_sel = theme.themedir .. "taglist/filled_corner.png" | 77 | 74 | theme.taglist_squares_sel = theme.themedir .. "taglist/filled_corner.png" | |
theme.taglist_squares_unsel = theme.themedir .. "taglist/corner.png" | 78 | 75 | theme.taglist_squares_unsel = theme.themedir .. "taglist/corner.png" | |
--theme.taglist_squares_resize = "false" | 79 | 76 | --theme.taglist_squares_resize = "false" | |
-- }}} | 80 | 77 | -- }}} | |
81 | 78 | |||
-- {{{ Misc | 82 | 79 | -- {{{ Misc | |
theme.awesome_icon = theme.themedir .. "awesome-icon.png" | 83 | 80 | theme.awesome_icon = theme.themedir .. "awesome-icon.png" | |
theme.menu_submenu_icon = theme.themedir .. "submenu.png" | 84 | 81 | theme.menu_submenu_icon = theme.themedir .. "submenu.png" | |
theme.tasklist_floating_icon = "/usr/share/awesome/themes/default/tasklist/floatingw.png" | 85 | 82 | theme.tasklist_floating_icon = "/usr/share/awesome/themes/default/tasklist/floatingw.png" | |
-- }}} | 86 | 83 | -- }}} | |
87 | 84 | |||
-- {{{ Layout | 88 | 85 | -- {{{ Layout | |
theme.layout_tile = theme.themedir .. "layouts/tile.png" | 89 | 86 | theme.layout_tile = theme.themedir .. "layouts/tile.png" | |
theme.layout_tileleft = theme.themedir .. "layouts/tileleft.png" | 90 | 87 | theme.layout_tileleft = theme.themedir .. "layouts/tileleft.png" | |
theme.layout_tilebottom = theme.themedir .. "layouts/tilebottom.png" | 91 | 88 | theme.layout_tilebottom = theme.themedir .. "layouts/tilebottom.png" | |
theme.layout_tiletop = theme.themedir .. "layouts/tiletop.png" | 92 | 89 | theme.layout_tiletop = theme.themedir .. "layouts/tiletop.png" | |
theme.layout_fairv = theme.themedir .. "layouts/fairv.png" | 93 | 90 | theme.layout_fairv = theme.themedir .. "layouts/fairv.png" | |
theme.layout_fairh = theme.themedir .. "layouts/fairh.png" | 94 | 91 | theme.layout_fairh = theme.themedir .. "layouts/fairh.png" | |
theme.layout_spiral = theme.themedir .. "layouts/spiral.png" | 95 | 92 | theme.layout_spiral = theme.themedir .. "layouts/spiral.png" | |
theme.layout_dwindle = theme.themedir .. "layouts/dwindle.png" | 96 | 93 | theme.layout_dwindle = theme.themedir .. "layouts/dwindle.png" | |
theme.layout_max = theme.themedir .. "layouts/max.png" | 97 | 94 | theme.layout_max = theme.themedir .. "layouts/max.png" | |
theme.layout_fullscreen = theme.themedir .. "layouts/fullscreen.png" | 98 | 95 | theme.layout_fullscreen = theme.themedir .. "layouts/fullscreen.png" | |
theme.layout_magnifier = theme.themedir .. "layouts/magnifier.png" | 99 | 96 | theme.layout_magnifier = theme.themedir .. "layouts/magnifier.png" | |
theme.layout_floating = theme.themedir .. "layouts/floating.png" | 100 | 97 | theme.layout_floating = theme.themedir .. "layouts/floating.png" | |
-- }}} | 101 | 98 | -- }}} | |
102 | 99 | |||
-- {{{ Titlebar | 103 | 100 | -- {{{ Titlebar | |
theme.titlebar_close_button_focus = theme.themedir .. "titlebar/close_focus.png" | 104 | 101 | theme.titlebar_close_button_focus = theme.themedir .. "titlebar/close_focus.png" | |
theme.titlebar_close_button_normal = theme.themedir .. "titlebar/close_normal.png" | 105 | 102 | theme.titlebar_close_button_normal = theme.themedir .. "titlebar/close_normal.png" | |
106 | 103 | |||
theme.titlebar_ontop_button_focus_active = theme.themedir .. "titlebar/ontop_focus_active.png" | 107 | 104 | theme.titlebar_ontop_button_focus_active = theme.themedir .. "titlebar/ontop_focus_active.png" | |
theme.titlebar_ontop_button_normal_active = theme.themedir .. "titlebar/ontop_normal_active.png" | 108 | 105 | theme.titlebar_ontop_button_normal_active = theme.themedir .. "titlebar/ontop_normal_active.png" | |
theme.titlebar_ontop_button_focus_inactive = theme.themedir .. "titlebar/ontop_focus_inactive.png" | 109 | 106 | theme.titlebar_ontop_button_focus_inactive = theme.themedir .. "titlebar/ontop_focus_inactive.png" | |
theme.titlebar_ontop_button_normal_inactive = theme.themedir .. "titlebar/ontop_normal_inactive.png" | 110 | 107 | theme.titlebar_ontop_button_normal_inactive = theme.themedir .. "titlebar/ontop_normal_inactive.png" | |
111 | 108 | |||
theme.titlebar_sticky_button_focus_active = theme.themedir .. "titlebar/sticky_focus_active.png" | 112 | 109 | theme.titlebar_sticky_button_focus_active = theme.themedir .. "titlebar/sticky_focus_active.png" | |
theme.titlebar_sticky_button_normal_active = theme.themedir .. "titlebar/sticky_normal_active.png" | 113 | 110 | theme.titlebar_sticky_button_normal_active = theme.themedir .. "titlebar/sticky_normal_active.png" | |
theme.titlebar_sticky_button_focus_inactive = theme.themedir .. "titlebar/sticky_focus_inactive.png" | 114 | 111 | theme.titlebar_sticky_button_focus_inactive = theme.themedir .. "titlebar/sticky_focus_inactive.png" | |
theme.titlebar_sticky_button_normal_inactive = theme.themedir .. "titlebar/sticky_normal_inactive.png" | 115 | 112 | theme.titlebar_sticky_button_normal_inactive = theme.themedir .. "titlebar/sticky_normal_inactive.png" | |
116 | 113 | |||
theme.titlebar_floating_button_focus_active = theme.themedir .. "titlebar/floating_focus_active.png" | 117 | 114 | theme.titlebar_floating_button_focus_active = theme.themedir .. "titlebar/floating_focus_active.png" | |
theme.titlebar_floating_button_normal_active = theme.themedir .. "titlebar/floating_normal_active.png" | 118 | 115 | theme.titlebar_floating_button_normal_active = theme.themedir .. "titlebar/floating_normal_active.png" | |
theme.titlebar_floating_button_focus_inactive = theme.themedir .. "titlebar/floating_focus_inactive.png" | 119 | 116 | theme.titlebar_floating_button_focus_inactive = theme.themedir .. "titlebar/floating_focus_inactive.png" | |
theme.titlebar_floating_button_normal_inactive = theme.themedir .. "titlebar/floating_normal_inactive.png" | 120 | 117 | theme.titlebar_floating_button_normal_inactive = theme.themedir .. "titlebar/floating_normal_inactive.png" |
awesome/awesome/rc.lua
View file @
ec5c716
-------------------------------------- | 1 | 1 | -------------------------------------- | |
---- Includes ---- | 2 | 2 | ---- Includes ---- | |
-------------------------------------- | 3 | 3 | -------------------------------------- | |
-- Standard awesome library | 4 | 4 | -- Standard awesome library | |
require("awful") | 5 | 5 | require("awful") | |
require("awful.autofocus") | 6 | 6 | require("awful.autofocus") | |
require("awful.rules") | 7 | 7 | require("awful.rules") | |
8 | 8 | |||
-- Theme handling library | 9 | 9 | -- Theme handling library | |
require("beautiful") | 10 | 10 | require("beautiful") | |
11 | 11 | |||
-- Notification library | 12 | 12 | -- Notification library | |
require("naughty") | 13 | 13 | require("naughty") | |
14 | 14 | |||
--Expose like plugin | 15 | 15 | --Expose like plugin | |
require("modules/revelation") | 16 | 16 | require("modules/revelation") | |
17 | 17 | |||
--calendaar popup | 18 | 18 | --calendaar popup | |
require('calendar2') | 19 | 19 | require('calendar2') | |
20 | 20 | |||
--freedesktop menus | 21 | 21 | --freedesktop menus | |
--require('modules/awesome-freedesktop/freedesktop.utils') | 22 | 22 | --require('modules/awesome-freedesktop/freedesktop.utils') | |
--require('modules/awesome-freedesktop/freedesktop.menu') | 23 | 23 | --require('modules/awesome-freedesktop/freedesktop.menu') | |
24 | 24 | |||
--for widgets | 25 | 25 | --for widgets | |
require("vicious") | 26 | 26 | require("vicious") | |
27 | 27 | |||
28 | 28 | |||
--local keydoc = require("keydoc") | 29 | 29 | --local keydoc = require("keydoc") | |
30 | 30 | |||
--make pretty things | 31 | 31 | --make pretty things | |
--this will crash if oocairo is not installed | 32 | 32 | --this will crash if oocairo is not installed | |
--bug: http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=681279 | 33 | 33 | --bug: http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=681279 | |
--require("blingbling") | 34 | 34 | --require("blingbling") | |
35 | 35 | |||
36 | 36 | |||
-------------------------------------- | 37 | 37 | -------------------------------------- | |
---- Variables ---- | 38 | 38 | ---- Variables ---- | |
-------------------------------------- | 39 | 39 | -------------------------------------- | |
40 | 40 | |||
-- {{{ Variable definitions | 41 | 41 | -- {{{ Variable definitions | |
-- This is used later as the default terminal and editor to run. | 42 | 42 | -- This is used later as the default terminal and editor to run. | |
terminal = "terminator" | 43 | 43 | terminal = "terminator" | |
editor = os.getenv("EDITOR") or "vim" | 44 | 44 | editor = os.getenv("EDITOR") or "vim" | |
editor_cmd = terminal .. " -e " .. editor | 45 | 45 | editor_cmd = terminal .. " -e " .. editor | |
web_browser = "google-chrome" | 46 | 46 | web_browser = "google-chrome" | |
file_manager = "thunar" | 47 | 47 | file_manager = "thunar" | |
lock_command = "xscreensaver-command -lock" | 48 | 48 | lock_command = "xscreensaver-command -lock" | |
exit_command = "cb-exit" | 49 | 49 | exit_command = "cb-exit" | |
50 | 50 | |||
-- Default modkey. | 51 | 51 | -- Default modkey. | |
-- Usually, Mod4 is the key with a logo between Control and Alt. | 52 | 52 | -- 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, | 53 | 53 | -- 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. | 54 | 54 | -- 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. | 55 | 55 | -- However, you can use another modifier like Mod1, but it may interact with others. | |
modkey = "Mod4" | 56 | 56 | modkey = "Mod4" | |
57 | 57 | |||
58 | 58 | |||
-------------------------------------- | 59 | 59 | -------------------------------------- | |
---- Plugin Settings ---- | 60 | 60 | ---- Plugin Settings ---- | |
-------------------------------------- | 61 | 61 | -------------------------------------- | |
62 | 62 | |||
--set default naughty timeout | 63 | 63 | --set default naughty timeout | |
naughty.config.default_preset.timeout = 2 | 64 | 64 | naughty.config.default_preset.timeout = 2 | |
65 | 65 | |||
66 | 66 | |||
-- Themes define colours, icons, and wallpapers | 67 | 67 | -- Themes define colours, icons, and wallpapers | |
beautiful.init( awful.util.getdir("config") .. "/darkburn/theme.lua") | 68 | 68 | beautiful.init( awful.util.getdir("config") .. "/darkburn/theme.lua") | |
69 | 69 | |||
70 | 70 | |||
-------------------------------------- | 71 | 71 | -------------------------------------- | |
---- Error Handleing ---- | 72 | 72 | ---- Error Handleing ---- | |
-------------------------------------- | 73 | 73 | -------------------------------------- | |
74 | 74 | |||
-- {{{ Error handling | 75 | 75 | -- {{{ Error handling | |
-- Check if awesome encountered an error during startup and fell back to | 76 | 76 | -- Check if awesome encountered an error during startup and fell back to | |
-- another config (This code will only ever execute for the fallback config) | 77 | 77 | -- another config (This code will only ever execute for the fallback config) | |
if awesome.startup_errors then | 78 | 78 | if awesome.startup_errors then | |
naughty.notify({ preset = naughty.config.presets.critical, | 79 | 79 | naughty.notify({ preset = naughty.config.presets.critical, | |
title = "Oops, there were errors during startup!", | 80 | 80 | title = "Oops, there were errors during startup!", | |
text = awesome.startup_errors }) | 81 | 81 | text = awesome.startup_errors }) | |
end | 82 | 82 | end | |
83 | 83 | |||
-- Handle runtime errors after startup | 84 | 84 | -- Handle runtime errors after startup | |
do | 85 | 85 | do | |
local in_error = false | 86 | 86 | local in_error = false | |
awesome.add_signal("debug::error", function (err) | 87 | 87 | awesome.add_signal("debug::error", function (err) | |
-- Make sure we don't go into an endless error loop | 88 | 88 | -- Make sure we don't go into an endless error loop | |
if in_error then return end | 89 | 89 | if in_error then return end | |
in_error = true | 90 | 90 | in_error = true | |
91 | 91 | |||
naughty.notify({ preset = naughty.config.presets.critical, | 92 | 92 | naughty.notify({ preset = naughty.config.presets.critical, | |
title = "Oops, an error happened!", | 93 | 93 | title = "Oops, an error happened!", | |
text = err }) | 94 | 94 | text = err }) | |
in_error = false | 95 | 95 | in_error = false | |
end) | 96 | 96 | end) | |
end | 97 | 97 | end | |
-- }}} | 98 | 98 | -- }}} | |
99 | 99 | |||
100 | 100 | |||
-------------------------------------- | 101 | 101 | -------------------------------------- | |
---- Tags and Layout ---- | 102 | 102 | ---- Tags and Layout ---- | |
-------------------------------------- | 103 | 103 | -------------------------------------- | |
104 | 104 | |||
-- Table of layouts to cover with awful.layout.inc, order matters. | 105 | 105 | -- Table of layouts to cover with awful.layout.inc, order matters. | |
layouts = | 106 | 106 | layouts = | |
{ | 107 | 107 | { | |
awful.layout.suit.tile, | 108 | 108 | awful.layout.suit.tile, | |
--awful.layout.suit.tile.left, | 109 | 109 | --awful.layout.suit.tile.left, | |
awful.layout.suit.tile.bottom, | 110 | 110 | awful.layout.suit.tile.bottom, | |
--awful.layout.suit.tile.top, | 111 | 111 | --awful.layout.suit.tile.top, | |
--awful.layout.suit.fair, | 112 | 112 | --awful.layout.suit.fair, | |
--awful.layout.suit.fair.horizontal, | 113 | 113 | --awful.layout.suit.fair.horizontal, | |
--awful.layout.suit.spiral, | 114 | 114 | --awful.layout.suit.spiral, | |
--awful.layout.suit.spiral.dwindle, | 115 | 115 | --awful.layout.suit.spiral.dwindle, | |
awful.layout.suit.max, | 116 | 116 | awful.layout.suit.max, | |
--awful.layout.suit.max.fullscreen, | 117 | 117 | --awful.layout.suit.max.fullscreen, | |
--awful.layout.suit.magnifier, | 118 | 118 | --awful.layout.suit.magnifier, | |
awful.layout.suit.floating, | 119 | 119 | awful.layout.suit.floating, | |
} | 120 | 120 | } | |
-- }}} | 121 | 121 | -- }}} | |
122 | 122 | |||
-- {{{ Tags | 123 | 123 | -- {{{ Tags | |
-- Define a tag table which hold all screen tags. | 124 | 124 | -- Define a tag table which hold all screen tags. | |
tags = { | 125 | 125 | tags = { | |
names = { 1, 2, 3, 4, 5, 6, 7, 8, 9 }, | 126 | 126 | names = { 1, 2, 3, 4, 5, 6, 7, 8, 9 }, | |
layout = { layouts[1], layouts[1], layouts[1], layouts[1], layouts[1], layouts[1], layouts[1], layouts[1], layouts[1],}, | 127 | 127 | layout = { layouts[1], layouts[1], layouts[1], layouts[1], layouts[1], layouts[1], layouts[1], layouts[1], layouts[1],}, | |
} | 128 | 128 | } | |
for s = 1, screen.count() do | 129 | 129 | for s = 1, screen.count() do | |
-- Each screen has its own tag table. | 130 | 130 | -- Each screen has its own tag table. | |
tags[s] = awful.tag(tags.names, s, tags.layout) | 131 | 131 | tags[s] = awful.tag(tags.names, s, tags.layout) | |
end | 132 | 132 | end | |
-- }}} | 133 | 133 | -- }}} | |
134 | 134 | |||
135 | 135 | |||
-------------------------------------- | 136 | 136 | -------------------------------------- | |
---- Menu ---- | 137 | 137 | ---- Menu ---- | |
-------------------------------------- | 138 | 138 | -------------------------------------- | |
139 | 139 | |||
-- {{{ Menu | 140 | 140 | -- {{{ Menu | |
-- Create a laucher widget and a main menu | 141 | 141 | -- Create a laucher widget and a main menu | |
myawesomemenu = { | 142 | 142 | myawesomemenu = { | |
{ "manual", terminal .. " -e man awesome" }, | 143 | 143 | { "manual", terminal .. " -e man awesome" }, | |
{ "edit config", editor_cmd .. " " .. awesome.conffile }, | 144 | 144 | { "edit config", editor_cmd .. " " .. awesome.conffile }, | |
{ "restart", awesome.restart }, | 145 | 145 | { "restart", awesome.restart }, | |
{ "quit", awesome.quit } | 146 | 146 | { "quit", awesome.quit } | |
} | 147 | 147 | } | |
148 | 148 | |||
--menu_items = freedesktop.menu.new() | 149 | 149 | --menu_items = freedesktop.menu.new() | |
menu_items = {} | 150 | 150 | menu_items = {} | |
table.insert(menu_items, { "awesome", myawesomemenu, beautiful.awesome_icon }) | 151 | 151 | table.insert(menu_items, { "awesome", myawesomemenu, beautiful.awesome_icon }) | |
table.insert(menu_items, { "Exit", exit_command }) | 152 | 152 | table.insert(menu_items, { "Exit", exit_command }) | |
153 | 153 | |||
mymainmenu = awful.menu.new({ items = menu_items, width = 150 }) | 154 | 154 | mymainmenu = awful.menu.new({ items = menu_items, width = beautiful.menu_width }) | |
155 | 155 | |||
mylauncher = awful.widget.launcher({ image = image(beautiful.awesome_icon), | 156 | 156 | mylauncher = awful.widget.launcher({ image = image(beautiful.awesome_icon), | |
menu = mymainmenu }) | 157 | 157 | menu = mymainmenu }) | |
-- }}} | 158 | 158 | -- }}} | |
159 | 159 | |||
160 | 160 | |||
-------------------------------------- | 161 | 161 | -------------------------------------- | |
---- WiBox ---- | 162 | 162 | ---- WiBox ---- | |
-------------------------------------- | 163 | 163 | -------------------------------------- | |
164 | 164 | |||
-- {{{ Wibox | 165 | 165 | -- {{{ Wibox | |
-- Create a textclock widget | 166 | 166 | -- Create a textclock widget | |
mytextclock = awful.widget.textclock({ align = "right" }) | 167 | 167 | mytextclock = awful.widget.textclock({ align = "right" }) | |
mytextclock.buttons = awful.util.table.join( | 168 | |||
awful.button({ }, 1, function() naughty.notify({text = "it works"}) end) | 169 | |||
) | 170 | |||
171 | 168 | |||
--calendar plugin | 172 | 169 | --calendar plugin | |
calendar2.addCalendarToWidget(mytextclock) | 173 | 170 | calendar2.addCalendarToWidget(mytextclock) | |
174 | 171 | |||
--separator widget | 175 | 172 | --separator widget | |
separator = widget({ type = "textbox" }) | 176 | 173 | separator = widget({ type = "textbox" }) | |
separator.text = "|" | 177 | 174 | separator.text = "|" | |
178 | 175 | |||
--space widget | 179 | 176 | --space widget | |
space = widget({ type = "textbox" }) | 180 | 177 | space = widget({ type = "textbox" }) | |
space.text = " " | 181 | 178 | space.text = " " | |
182 | 179 | |||
local fg_end_color = "#FF5656" | 183 | |||
local fg_color = "#AECF96" | 184 | |||
local fg_center_color = "#FFCF00" | 185 | |||
local bg_color = "#111111" | 186 | |||
187 | 180 | |||
--TODO height of bar for widgets and wibox should be set in theme | 188 | |||
--TODO rename theme | 189 | |||
190 | ||||
-- RAM usage widget | 191 | 181 | -- RAM usage widget | |
memwidget = awful.widget.progressbar() | 192 | 182 | memwidget = awful.widget.progressbar() | |
memwidget:set_width(8) | 193 | 183 | memwidget:set_width(8) | |
memwidget:set_height(15) | 194 | 184 | memwidget:set_height(beautiful.menu_height) | |
memwidget:set_vertical(true) | 195 | 185 | memwidget:set_vertical(true) | |
memwidget:set_background_color(bg_color) | 196 | 186 | memwidget:set_background_color(beautiful.bg_widget) | |
memwidget:set_color(fg_color) | 197 | 187 | memwidget:set_color(beautiful.fg_widget) | |
memwidget:set_gradient_colors({ fg_color, fg_center_color, fg_end_color }) | 198 | 188 | memwidget:set_gradient_colors({ beautiful.fg_widget, beautiful.fg_center_widget, beautiful.fg_end_widget }) | |
-- RAM usage tooltip | 199 | 189 | -- RAM usage tooltip | |
memwidget_t = awful.tooltip({ objects = { memwidget.widget },}) | 200 | 190 | memwidget_t = awful.tooltip({ objects = { memwidget.widget },}) | |
vicious.cache(vicious.widgets.mem) | 201 | 191 | vicious.cache(vicious.widgets.mem) | |
vicious.register(memwidget, vicious.widgets.mem, | 202 | 192 | vicious.register(memwidget, vicious.widgets.mem, | |
function (widget, args) | 203 | 193 | function (widget, args) | |
memwidget_t:set_text(" RAM: " .. args[1] .. "% " .. args[2] .. "MB / " .. args[3] .. "MB ") | 204 | 194 | memwidget_t:set_text(" RAM: " .. args[1] .. "% " .. args[2] .. "MB / " .. args[3] .. "MB ") | |
return args[1] | 205 | 195 | return args[1] | |
end, 5) | 206 | 196 | end, 5) | |
--update every 5 seconds | 207 | 197 | --update every 5 seconds | |
208 | 198 | |||
-- CPU usage widget | 209 | 199 | -- CPU usage widget | |
cpuwidget = awful.widget.graph() | 210 | 200 | cpuwidget = awful.widget.graph() | |
cpuwidget:set_width(30) | 211 | 201 | cpuwidget:set_width(30) | |
cpuwidget:set_height(15) | 212 | 202 | cpuwidget:set_height(beautiful.menu_height) | |
cpuwidget:set_background_color(bg_color) | 213 | 203 | cpuwidget:set_background_color(beautiful.bg_widget) | |
cpuwidget:set_color(fg_color) | 214 | 204 | cpuwidget:set_color(beautiful.fg_widget) | |
cpuwidget:set_gradient_angle(180) | 215 | 205 | cpuwidget:set_gradient_angle(180) | |
cpuwidget:set_gradient_colors({ fg_color, fg_center_color, fg_end_color }) | 216 | 206 | cpuwidget:set_gradient_colors({ beautiful.fg_widget, fg_center_widget, beautiful.fg_end_widget }) | |
cpuwidget_t = awful.tooltip({ objects = { cpuwidget.widget },}) | 217 | 207 | cpuwidget_t = awful.tooltip({ objects = { cpuwidget.widget },}) | |
-- Register CPU widget | 218 | 208 | -- Register CPU widget | |
vicious.register(cpuwidget, vicious.widgets.cpu, | 219 | 209 | vicious.register(cpuwidget, vicious.widgets.cpu, | |
function (widget, args) | 220 | 210 | function (widget, args) | |
cpuwidget_t:set_text("CPU Usage: " .. args[1] .. "%") | 221 | 211 | cpuwidget_t:set_text("CPU Usage: " .. args[1] .. "%") | |
return args[1] | 222 | 212 | return args[1] | |
end, 2) | 223 | 213 | end, 2) | |
224 | 214 | |||
-- Create a systray | 225 | 215 | -- Create a systray | |
mysystray = widget({ type = "systray" }) | 226 | 216 | mysystray = widget({ type = "systray" }) | |
227 | 217 | |||
-- Create a wibox for each screen and add it | 228 | 218 | -- Create a wibox for each screen and add it | |
mywibox = {} | 229 | 219 | mywibox = {} | |
mypromptbox = {} | 230 | 220 | mypromptbox = {} | |
mylayoutbox = {} | 231 | 221 | mylayoutbox = {} | |
mytaglist = {} | 232 | 222 | mytaglist = {} | |
mytaglist.buttons = awful.util.table.join( | 233 | 223 | mytaglist.buttons = awful.util.table.join( | |
awful.button({ }, 1, awful.tag.viewonly), | 234 | 224 | awful.button({ }, 1, awful.tag.viewonly), | |
awful.button({ modkey }, 1, awful.client.movetotag), | 235 | 225 | awful.button({ modkey }, 1, awful.client.movetotag), | |
awful.button({ }, 3, awful.tag.viewtoggle), | 236 | 226 | awful.button({ }, 3, awful.tag.viewtoggle), | |
awful.button({ modkey }, 3, awful.client.toggletag), | 237 | 227 | awful.button({ modkey }, 3, awful.client.toggletag), | |
awful.button({ }, 4, awful.tag.viewnext), | 238 | 228 | awful.button({ }, 4, awful.tag.viewnext), | |
awful.button({ }, 5, awful.tag.viewprev) | 239 | 229 | awful.button({ }, 5, awful.tag.viewprev) | |
) | 240 | 230 | ) | |
mytasklist = {} | 241 | 231 | mytasklist = {} | |
mytasklist.buttons = awful.util.table.join( | 242 | 232 | mytasklist.buttons = awful.util.table.join( | |
awful.button({ }, 1, function (c) | 243 | 233 | awful.button({ }, 1, function (c) | |
if c == client.focus then | 244 | 234 | if c == client.focus then | |
c.minimized = true | 245 | 235 | c.minimized = true | |
else | 246 | 236 | else | |
if not c:isvisible() then | 247 | 237 | if not c:isvisible() then | |
awful.tag.viewonly(c:tags()[1]) | 248 | 238 | awful.tag.viewonly(c:tags()[1]) | |
end | 249 | 239 | end | |
-- This will also un-minimize | 250 | 240 | -- This will also un-minimize | |
-- the client, if needed | 251 | 241 | -- the client, if needed | |
client.focus = c | 252 | 242 | client.focus = c | |
c:raise() | 253 | 243 | c:raise() | |
end | 254 | 244 | end | |
end), | 255 | 245 | end), | |
awful.button({ }, 3, function () | 256 | 246 | awful.button({ }, 3, function () | |
if instance then | 257 | 247 | if instance then | |
instance:hide() | 258 | 248 | instance:hide() | |
instance = nil | 259 | 249 | instance = nil | |
else | 260 | 250 | else | |
instance = awful.menu.clients({ width=250 }) | 261 | 251 | instance = awful.menu.clients({ width=250 }) | |
end | 262 | 252 | end | |
end), | 263 | 253 | end), | |
awful.button({ }, 4, function () | 264 | 254 | awful.button({ }, 4, function () | |
awful.client.focus.byidx(1) | 265 | 255 | awful.client.focus.byidx(1) | |
if client.focus then client.focus:raise() end | 266 | 256 | if client.focus then client.focus:raise() end | |
end), | 267 | 257 | end), | |
awful.button({ }, 5, function () | 268 | 258 | awful.button({ }, 5, function () | |
awful.client.focus.byidx(-1) | 269 | 259 | awful.client.focus.byidx(-1) | |
if client.focus then client.focus:raise() end | 270 | 260 | if client.focus then client.focus:raise() end | |
end)) | 271 | 261 | end)) | |
272 | 262 | |||
for s = 1, screen.count() do | 273 | 263 | for s = 1, screen.count() do | |
-- Create a promptbox for each screen | 274 | 264 | -- Create a promptbox for each screen | |
mypromptbox[s] = awful.widget.prompt({ layout = awful.widget.layout.horizontal.leftright }) | 275 | 265 | 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. | 276 | 266 | -- Create an imagebox widget which will contains an icon indicating which layout we're using. | |
-- We need one layoutbox per screen. | 277 | 267 | -- We need one layoutbox per screen. | |
mylayoutbox[s] = awful.widget.layoutbox(s) | 278 | 268 | mylayoutbox[s] = awful.widget.layoutbox(s) | |
mylayoutbox[s]:buttons(awful.util.table.join( | 279 | 269 | mylayoutbox[s]:buttons(awful.util.table.join( | |
awful.button({ }, 1, function () awful.layout.inc(layouts, 1) end), | 280 | 270 | awful.button({ }, 1, function () awful.layout.inc(layouts, 1) end), | |
awful.button({ }, 3, function () awful.layout.inc(layouts, -1) end), | 281 | 271 | awful.button({ }, 3, function () awful.layout.inc(layouts, -1) end), | |
awful.button({ }, 4, function () awful.layout.inc(layouts, 1) end), | 282 | 272 | awful.button({ }, 4, function () awful.layout.inc(layouts, 1) end), | |
awful.button({ }, 5, function () awful.layout.inc(layouts, -1) end))) | 283 | 273 | awful.button({ }, 5, function () awful.layout.inc(layouts, -1) end))) | |
-- Create a taglist widget | 284 | 274 | -- Create a taglist widget | |
mytaglist[s] = awful.widget.taglist(s, awful.widget.taglist.label.all, mytaglist.buttons) | 285 | 275 | mytaglist[s] = awful.widget.taglist(s, awful.widget.taglist.label.all, mytaglist.buttons) | |
286 | 276 | |||
-- Create a tasklist widget | 287 | 277 | -- Create a tasklist widget | |
mytasklist[s] = awful.widget.tasklist(function(c) | 288 | 278 | mytasklist[s] = awful.widget.tasklist(function(c) | |
return awful.widget.tasklist.label.currenttags(c, s) | 289 | 279 | return awful.widget.tasklist.label.currenttags(c, s) | |
end, mytasklist.buttons) | 290 | 280 | end, mytasklist.buttons) | |
291 | 281 | |||
-- Create the wibox | 292 | 282 | -- Create the wibox | |
mywibox[s] = awful.wibox({ position = "top", screen = s, height = "16" }) | 293 | 283 | mywibox[s] = awful.wibox({ position = "top", screen = s, height = beautiful.menu_height }) | |
-- Add widgets to the wibox - order matters | 294 | 284 | -- Add widgets to the wibox - order matters | |
mywibox[s].widgets = { | 295 | 285 | mywibox[s].widgets = { | |
{ | 296 | 286 | { | |
mylauncher, | 297 | 287 | mylauncher, | |
mytaglist[s], | 298 | 288 | mytaglist[s], | |
mypromptbox[s], | 299 | 289 | mypromptbox[s], | |
layout = awful.widget.layout.horizontal.leftright | 300 | 290 | layout = awful.widget.layout.horizontal.leftright | |
}, | 301 | 291 | }, | |
mylayoutbox[s], | 302 | 292 | mylayoutbox[s], | |
mytextclock, | 303 | 293 | mytextclock, | |
separator, | 304 | 294 | separator, | |
space, | 305 | 295 | space, | |
memwidget.widget, | 306 | 296 | memwidget.widget, | |
space, | 307 | 297 | space, | |
separator, | 308 | 298 | separator, | |
space, | 309 | 299 | space, | |
cpuwidget.widget, | 310 | 300 | cpuwidget.widget, | |
space, | 311 | 301 | space, | |
separator, | 312 | 302 | separator, | |
s == 1 and mysystray or nil, --only place the systray on the primary screen | 313 | 303 | s == 1 and mysystray or nil, --only place the systray on the primary screen | |
mytasklist[s], | 314 | 304 | mytasklist[s], | |
layout = awful.widget.layout.horizontal.rightleft | 315 | 305 | layout = awful.widget.layout.horizontal.rightleft | |
} | 316 | 306 | } | |
end | 317 | 307 | end | |
-- }}} | 318 | 308 | -- }}} | |
319 | 309 | |||
320 | 310 | |||
-------------------------------------- | 321 | 311 | -------------------------------------- | |
---- Key bindings ---- | 322 | 312 | ---- Key bindings ---- | |
-------------------------------------- | 323 | 313 | -------------------------------------- | |
324 | 314 | |||
-- {{{ Change workspace on scroll | 325 | 315 | -- {{{ Change workspace on scroll | |
root.buttons(awful.util.table.join( | 326 | 316 | root.buttons(awful.util.table.join( | |
--awful.button({ }, 3, function () mymainmenu:toggle() end), --I dont want a menu when I click on the desktop | 327 | 317 | --awful.button({ }, 3, function () mymainmenu:toggle() end), --I dont want a menu when I click on the desktop | |
awful.button({ }, 4, awful.tag.viewnext), | 328 | 318 | awful.button({ }, 4, awful.tag.viewnext), | |
awful.button({ }, 5, awful.tag.viewprev) | 329 | 319 | awful.button({ }, 5, awful.tag.viewprev) | |
)) | 330 | 320 | )) | |
-- }}} | 331 | 321 | -- }}} | |
332 | 322 | |||
333 | 323 | |||
-- {{{ Key bindings | 334 | 324 | -- {{{ Key bindings | |
globalkeys = awful.util.table.join( | 335 | 325 | globalkeys = awful.util.table.join( | |
336 | 326 | |||
--keydoc.group("Layout manipulation"), | 337 | 327 | --keydoc.group("Layout manipulation"), | |
338 | 328 | |||
--plugins | 339 | 329 | --plugins | |
awful.key({ modkey, }, "e", revelation), | 340 | 330 | awful.key({ modkey, }, "e", revelation), | |
--awful.key({ modkey, }, "F1", keydoc.display), --TODO finish this, needs arg string as last param | 341 | 331 | --awful.key({ modkey, }, "F1", keydoc.display), --TODO finish this, needs arg string as last param | |
342 | 332 | |||
--Conky toggle | 343 | 333 | --Conky toggle | |
awful.key({ }, "Pause", raise_conky, lower_conky), | 344 | 334 | awful.key({ }, "Pause", raise_conky, lower_conky), | |
--awful.key({}, "Pause", toggle_conky) | 345 | 335 | --awful.key({}, "Pause", toggle_conky) | |
346 | 336 | |||
--Move Client to Workspace Left/Right | 347 | 337 | --Move Client to Workspace Left/Right | |
--only works with 3.5, For 3.4 visit link | 348 | 338 | --only works with 3.5, For 3.4 visit link | |
--http://awesome.naquadah.org/wiki/Move_Window_to_Workspace_Left/Right | 349 | 339 | --http://awesome.naquadah.org/wiki/Move_Window_to_Workspace_Left/Right | |
awful.key({ modkey, "Shift" }, "Left", | 350 | 340 | awful.key({ modkey, "Shift" }, "Left", | |
function (c) | 351 | 341 | function (c) | |
local curidx = awful.tag.getidx() | 352 | 342 | local curidx = awful.tag.getidx() | |
if curidx == 1 then | 353 | 343 | if curidx == 1 then | |
awful.client.movetotag(tags[client.focus.screen][9]) | 354 | 344 | awful.client.movetotag(tags[client.focus.screen][9]) | |
else | 355 | 345 | else | |
awful.client.movetotag(tags[client.focus.screen][curidx - 1]) | 356 | 346 | awful.client.movetotag(tags[client.focus.screen][curidx - 1]) | |
end | 357 | 347 | end | |
--awful.tag.viewprev | 358 | 348 | --awful.tag.viewprev | |
end), | 359 | 349 | end), | |
awful.key({ modkey, "Shift" }, "Right", | 360 | 350 | awful.key({ modkey, "Shift" }, "Right", | |
function (c) | 361 | 351 | function (c) | |
local curidx = awful.tag.getidx() | 362 | 352 | local curidx = awful.tag.getidx() | |
if curidx == 9 then | 363 | 353 | if curidx == 9 then | |
awful.client.movetotag(tags[client.focus.screen][1]) | 364 | 354 | awful.client.movetotag(tags[client.focus.screen][1]) | |
else | 365 | 355 | else | |
awful.client.movetotag(tags[client.focus.screen][curidx + 1]) | 366 | 356 | awful.client.movetotag(tags[client.focus.screen][curidx + 1]) | |
end | 367 | 357 | end | |
--awful.tag.viewnext | 368 | 358 | --awful.tag.viewnext | |
end), | 369 | 359 | end), | |
awful.key({ modkey, }, "Left", awful.tag.viewprev ), | 370 | 360 | awful.key({ modkey, }, "Left", awful.tag.viewprev ), | |
awful.key({ modkey, }, "Right", awful.tag.viewnext ), | 371 | 361 | awful.key({ modkey, }, "Right", awful.tag.viewnext ), | |
awful.key({ modkey, }, "Escape", awful.tag.history.restore), | 372 | 362 | awful.key({ modkey, }, "Escape", awful.tag.history.restore), | |
373 | 363 | |||
awful.key({ modkey, }, "j", | 374 | 364 | awful.key({ modkey, }, "j", | |
function () | 375 | 365 | function () | |
awful.client.focus.byidx( 1) | 376 | 366 | awful.client.focus.byidx( 1) | |
if client.focus then client.focus:raise() end | 377 | 367 | if client.focus then client.focus:raise() end | |
end), | 378 | 368 | end), | |
awful.key({ modkey, }, "k", | 379 | 369 | awful.key({ modkey, }, "k", | |
function () | 380 | 370 | function () | |
awful.client.focus.byidx(-1) | 381 | 371 | awful.client.focus.byidx(-1) | |
if client.focus then client.focus:raise() end | 382 | 372 | if client.focus then client.focus:raise() end | |
end), | 383 | 373 | end), | |
--awful.key({ modkey, }, "w", function () mymainmenu:show({keygrabber=true}) end), --we dont like the menu | 384 | 374 | --awful.key({ modkey, }, "w", function () mymainmenu:show({keygrabber=true}) end), --we dont like the menu | |
385 | 375 | |||
-- Layout manipulation | 386 | 376 | -- Layout manipulation | |
awful.key({ modkey, "Shift" }, "j", function () awful.client.swap.byidx( 1) end), | 387 | 377 | awful.key({ modkey, "Shift" }, "j", function () awful.client.swap.byidx( 1) end), | |
awful.key({ modkey, "Shift" }, "k", function () awful.client.swap.byidx( -1) end), | 388 | 378 | awful.key({ modkey, "Shift" }, "k", function () awful.client.swap.byidx( -1) end), | |
awful.key({ modkey, "Control" }, "j", function () awful.screen.focus_relative( 1) end), | 389 | 379 | awful.key({ modkey, "Control" }, "j", function () awful.screen.focus_relative( 1) end), | |
awful.key({ modkey, "Control" }, "k", function () awful.screen.focus_relative(-1) end), | 390 | 380 | awful.key({ modkey, "Control" }, "k", function () awful.screen.focus_relative(-1) end), | |
awful.key({ modkey, }, "u", awful.client.urgent.jumpto), | 391 | 381 | awful.key({ modkey, }, "u", awful.client.urgent.jumpto), | |
awful.key({ modkey, }, "Tab", | 392 | 382 | awful.key({ modkey, }, "Tab", | |
function () | 393 | 383 | function () | |
awful.client.focus.history.previous() | 394 | 384 | awful.client.focus.history.previous() | |
if client.focus then | 395 | 385 | if client.focus then | |
client.focus:raise() | 396 | 386 | client.focus:raise() | |
end | 397 | 387 | end | |
end), | 398 | 388 | end), | |
399 | 389 | |||
-- Standard program | 400 | 390 | -- Standard program | |
awful.key({ modkey, }, "Return", function () awful.util.spawn(terminal) end), | 401 | 391 | awful.key({ modkey, }, "Return", function () awful.util.spawn(terminal) end), | |
awful.key({ modkey, }, "w", function () awful.util.spawn(web_browser) end), --hotkey to start web-browser | 402 | 392 | awful.key({ modkey, }, "w", function () awful.util.spawn(web_browser) end), --hotkey to start web-browser | |
awful.key({ modkey, }, "f", function () awful.util.spawn(file_manager) end), --hotkey to start my file manager | 403 | 393 | awful.key({ modkey, }, "f", function () awful.util.spawn(file_manager) end), --hotkey to start my file manager | |
awful.key({ modkey, "Control" }, "l", function () awful.util.spawn(lock_command) end), --lock screen | 404 | 394 | awful.key({ modkey, "Control" }, "l", function () awful.util.spawn(lock_command) end), --lock screen | |
awful.key({ modkey, "Control" }, "r", awesome.restart), | 405 | 395 | awful.key({ modkey, "Control" }, "r", awesome.restart), | |
awful.key({ modkey, "Shift" }, "q", awesome.quit), | 406 | 396 | awful.key({ modkey, "Shift" }, "q", awesome.quit), | |
407 | 397 | |||
-- Standard program | 408 | 398 | -- Standard program | |
awful.key({ modkey, }, "l", function () awful.tag.incmwfact( 0.05) end), | 409 | 399 | awful.key({ modkey, }, "l", function () awful.tag.incmwfact( 0.05) end), | |
awful.key({ modkey, }, "h", function () awful.tag.incmwfact(-0.05) end), | 410 | 400 | awful.key({ modkey, }, "h", function () awful.tag.incmwfact(-0.05) end), | |
awful.key({ modkey, "Shift" }, "h", function () awful.tag.incnmaster( 1) end), | 411 | 401 | awful.key({ modkey, "Shift" }, "h", function () awful.tag.incnmaster( 1) end), | |
awful.key({ modkey, "Shift" }, "l", function () awful.tag.incnmaster(-1) end), | 412 | 402 | awful.key({ modkey, "Shift" }, "l", function () awful.tag.incnmaster(-1) end), | |
awful.key({ modkey, "Control" }, "h", function () awful.tag.incncol( 1) end), | 413 | 403 | awful.key({ modkey, "Control" }, "h", function () awful.tag.incncol( 1) end), | |
awful.key({ modkey, "Control" }, "l", function () awful.tag.incncol(-1) end), | 414 | 404 | awful.key({ modkey, "Control" }, "l", function () awful.tag.incncol(-1) end), | |
awful.key({ modkey, }, "space", function () awful.layout.inc(layouts, 1) end), | 415 | 405 | awful.key({ modkey, }, "space", function () awful.layout.inc(layouts, 1) end), | |
awful.key({ modkey, "Shift" }, "space", function () awful.layout.inc(layouts, -1) end), | 416 | 406 | awful.key({ modkey, "Shift" }, "space", function () awful.layout.inc(layouts, -1) end), | |
417 | 407 | |||
awful.key({ modkey, "Control" }, "n", awful.client.restore), | 418 | 408 | awful.key({ modkey, "Control" }, "n", awful.client.restore), | |
419 | 409 | |||
-- Prompt | 420 | 410 | -- Prompt | |
awful.key({ modkey }, "r", function () mypromptbox[mouse.screen]:run() end), | 421 | 411 | awful.key({ modkey }, "r", function () mypromptbox[mouse.screen]:run() end), | |
422 | 412 | |||
awful.key({ modkey }, "x", | 423 | 413 | awful.key({ modkey }, "x", | |
function () | 424 | 414 | function () | |
awful.prompt.run({ prompt = "Run Lua code: " }, | 425 | 415 | awful.prompt.run({ prompt = "Run Lua code: " }, | |
mypromptbox[mouse.screen].widget, | 426 | 416 | mypromptbox[mouse.screen].widget, | |
awful.util.eval, nil, | 427 | 417 | awful.util.eval, nil, | |
awful.util.getdir("cache") .. "/history_eval") | 428 | 418 | awful.util.getdir("cache") .. "/history_eval") | |
end) | 429 | 419 | end) | |
) | 430 | 420 | ) | |
431 | 421 | |||
432 | 422 | |||
-- Compute the maximum number of digit we need, limited to 9 | 433 | 423 | -- Compute the maximum number of digit we need, limited to 9 | |
keynumber = 0 | 434 | 424 | keynumber = 0 | |
for s = 1, screen.count() do | 435 | 425 | for s = 1, screen.count() do | |
keynumber = math.min(9, math.max(#tags[s], keynumber)); | 436 | 426 | keynumber = math.min(9, math.max(#tags[s], keynumber)); | |
end | 437 | 427 | end | |
438 | 428 | |||
-- Bind all key numbers to tags. | 439 | 429 | -- Bind all key numbers to tags. | |
-- Be careful: we use keycodes to make it works on any keyboard layout. | 440 | 430 | -- 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. | 441 | 431 | -- This should map on the top row of your keyboard, usually 1 to 9. | |
for i = 1, keynumber do | 442 | 432 | for i = 1, keynumber do | |
globalkeys = awful.util.table.join(globalkeys, | 443 | 433 | globalkeys = awful.util.table.join(globalkeys, | |
awful.key({ modkey }, "#" .. i + 9, | 444 | 434 | awful.key({ modkey }, "#" .. i + 9, | |
function () | 445 | 435 | function () | |
local screen = mouse.screen | 446 | 436 | local screen = mouse.screen | |
if tags[screen][i] then | 447 | 437 | if tags[screen][i] then | |
awful.tag.viewonly(tags[screen][i]) | 448 | 438 | awful.tag.viewonly(tags[screen][i]) | |
end | 449 | 439 | end | |
end), | 450 | 440 | end), | |
awful.key({ modkey, "Control" }, "#" .. i + 9, | 451 | 441 | awful.key({ modkey, "Control" }, "#" .. i + 9, | |
function () | 452 | 442 | function () | |
local screen = mouse.screen | 453 | 443 | local screen = mouse.screen | |
if tags[screen][i] then | 454 | 444 | if tags[screen][i] then | |
awful.tag.viewtoggle(tags[screen][i]) | 455 | 445 | awful.tag.viewtoggle(tags[screen][i]) | |
end | 456 | 446 | end | |
end), | 457 | 447 | end), | |
awful.key({ modkey, "Shift" }, "#" .. i + 9, | 458 | 448 | awful.key({ modkey, "Shift" }, "#" .. i + 9, | |
function () | 459 | 449 | function () | |
if client.focus and tags[client.focus.screen][i] then | 460 | 450 | if client.focus and tags[client.focus.screen][i] then | |
awful.client.movetotag(tags[client.focus.screen][i]) | 461 | 451 | awful.client.movetotag(tags[client.focus.screen][i]) | |
end | 462 | 452 | end | |
end), | 463 | 453 | end), | |
awful.key({ modkey, "Control", "Shift" }, "#" .. i + 9, | 464 | 454 | awful.key({ modkey, "Control", "Shift" }, "#" .. i + 9, | |
function () | 465 | 455 | function () | |
if client.focus and tags[client.focus.screen][i] then | 466 | 456 | if client.focus and tags[client.focus.screen][i] then | |
awful.client.toggletag(tags[client.focus.screen][i]) | 467 | 457 | awful.client.toggletag(tags[client.focus.screen][i]) | |
end | 468 | 458 | end | |
end)) | 469 | 459 | end)) | |
end | 470 | 460 | end | |
471 | 461 | |||
clientbuttons = awful.util.table.join( | 472 | 462 | clientbuttons = awful.util.table.join( | |
awful.button({ }, 1, function (c) client.focus = c; c:raise() end), | 473 | 463 | awful.button({ }, 1, function (c) client.focus = c; c:raise() end), | |
awful.button({ modkey }, 1, awful.mouse.client.move), | 474 | 464 | awful.button({ modkey }, 1, awful.mouse.client.move), | |
awful.button({ modkey }, 3, awful.mouse.client.resize)) | 475 | 465 | awful.button({ modkey }, 3, awful.mouse.client.resize)) | |
476 | 466 | |||
-- Set keys | 477 | 467 | -- Set keys | |
root.keys(globalkeys) | 478 | 468 | root.keys(globalkeys) | |
-- }}} | 479 | 469 | -- }}} | |
480 | 470 | |||
481 | 471 | |||
-------------------------------------- | 482 | 472 | -------------------------------------- | |
--- Rules ---- | 483 | 473 | --- Rules ---- | |
-------------------------------------- | 484 | 474 | -------------------------------------- | |
485 | 475 | |||
clientkeys = awful.util.table.join( | 486 | 476 | clientkeys = awful.util.table.join( | |
awful.key({ modkey, }, "F11", function (c) c.fullscreen = not c.fullscreen end), | 487 | 477 | awful.key({ modkey, }, "F11", function (c) c.fullscreen = not c.fullscreen end), | |
awful.key({ modkey, "Shift" }, "c", function (c) c:kill() end), | 488 | 478 | awful.key({ modkey, "Shift" }, "c", function (c) c:kill() end), | |
awful.key({ modkey, "Control" }, "space", awful.client.floating.toggle ), | 489 | 479 | awful.key({ modkey, "Control" }, "space", awful.client.floating.toggle ), | |
awful.key({ modkey, "Control" }, "Return", function (c) c:swap(awful.client.getmaster()) end), | 490 | 480 | awful.key({ modkey, "Control" }, "Return", function (c) c:swap(awful.client.getmaster()) end), | |
--awful.key({ modkey, }, "o", awful.client.movetoscreen ), | 491 | 481 | --awful.key({ modkey, }, "o", awful.client.movetoscreen ), | |
--Move Client to Monitor Left/Right | 492 | 482 | --Move Client to Monitor Left/Right | |
awful.key({ modkey, }, "o", function(c) awful.client.movetoscreen(c,c.screen-1) end ), | 493 | 483 | awful.key({ modkey, }, "o", function(c) awful.client.movetoscreen(c,c.screen-1) end ), | |
awful.key({ modkey, }, "p", function(c) awful.client.movetoscreen(c,c.screen+1) end ), | 494 | 484 | awful.key({ modkey, }, "p", function(c) awful.client.movetoscreen(c,c.screen+1) end ), | |
495 | 485 | |||
--awful.key({ modkey, "Shift" }, "r", function (c) c:redraw() end), | 496 | 486 | --awful.key({ modkey, "Shift" }, "r", function (c) c:redraw() end), | |
awful.key({ modkey, }, "t", function (c) c.ontop = not c.ontop end), | 497 | 487 | awful.key({ modkey, }, "t", function (c) c.ontop = not c.ontop end), | |
awful.key({ modkey, }, "n", | 498 | 488 | awful.key({ modkey, }, "n", | |
function (c) | 499 | 489 | function (c) | |
-- The client currently has the input focus, so it cannot be | 500 | 490 | -- The client currently has the input focus, so it cannot be | |
-- minimized, since minimized clients can't have the focus. | 501 | 491 | -- minimized, since minimized clients can't have the focus. | |
c.minimized = true | 502 | 492 | c.minimized = true | |
end), | 503 | 493 | end), | |
awful.key({ modkey, }, "m", | 504 | 494 | awful.key({ modkey, }, "m", | |
function (c) | 505 | 495 | function (c) | |
c.maximized_horizontal = not c.maximized_horizontal | 506 | 496 | c.maximized_horizontal = not c.maximized_horizontal | |
c.maximized_vertical = not c.maximized_vertical | 507 | 497 | c.maximized_vertical = not c.maximized_vertical | |
end) | 508 | 498 | end) | |
) | 509 | 499 | ) | |
510 | 500 | |||
-- {{{ Rules | 511 | 501 | -- {{{ Rules | |
awful.rules.rules = { | 512 | 502 | awful.rules.rules = { | |
-- All clients will match this rule. | 513 | 503 | -- All clients will match this rule. | |
{ rule = { }, | 514 | 504 | { rule = { }, | |
properties = { border_width = beautiful.border_width, | 515 | 505 | properties = { border_width = beautiful.border_width, | |
border_color = beautiful.border_normal, | 516 | 506 | border_color = beautiful.border_normal, | |
focus = true, | 517 | 507 | focus = true, | |
keys = clientkeys, | 518 | 508 | keys = clientkeys, | |
buttons = clientbuttons } }, | 519 | 509 | buttons = clientbuttons } }, | |
{ rule = { class = "MPlayer" }, | 520 | 510 | { rule = { class = "MPlayer" }, | |
properties = { floating = true } }, | 521 | 511 | properties = { floating = true } }, | |
{ rule = { class = "pinentry" }, | 522 | 512 | { rule = { class = "pinentry" }, | |
properties = { floating = true } }, | 523 | 513 | properties = { floating = true } }, | |
{ rule = { class = "gimp" }, | 524 | 514 | { rule = { class = "gimp" }, | |
properties = { floating = true } }, | 525 | 515 | properties = { floating = true } }, | |
{ rule = { class = "Conky" }, | 526 | 516 | { rule = { class = "Conky" }, | |
properties = { | 527 | 517 | properties = { | |
floating = true, | 528 | 518 | floating = true, | |
sticky = true, | 529 | 519 | sticky = true, | |
ontop = false, | 530 | 520 | ontop = false, | |
focusable = false, | 531 | 521 | focusable = false, | |
size_hints = {"program_position", "program_size"} | 532 | 522 | size_hints = {"program_position", "program_size"} | |
} | 533 | 523 | } | |
} | 534 | 524 | } | |
-- Set Firefox to always map on tags number 2 of screen 1. | 535 | 525 | -- Set Firefox to always map on tags number 2 of screen 1. | |
-- { rule = { class = "Firefox" }, | 536 | 526 | -- { rule = { class = "Firefox" }, | |
-- properties = { tag = tags[1][2] } }, | 537 | 527 | -- properties = { tag = tags[1][2] } }, | |
} | 538 | 528 | } | |
-- }}} | 539 | 529 | -- }}} | |
540 | 530 | |||
541 | 531 | |||
-------------------------------------- | 542 | 532 | -------------------------------------- | |
--- Misc Functions ---- | 543 | 533 | --- Misc Functions ---- | |
-------------------------------------- | 544 | 534 | -------------------------------------- | |
545 | 535 | |||
function get_conky() | 546 | 536 | function get_conky() | |
local clients = client.get() | 547 | 537 | local clients = client.get() | |
local conky = nil | 548 | 538 | local conky = nil | |
local i = 1 | 549 | 539 | local i = 1 | |
while clients[i] | 550 | 540 | while clients[i] | |
do | 551 | 541 | do | |
if clients[i].class == "Conky" | 552 | 542 | if clients[i].class == "Conky" |