| 1 |
|
| 2 |
|
| 3 |
local gears = require("gears") |
| 4 |
local awful = require("awful") |
| 5 |
awful.rules = require("awful.rules") |
| 6 |
local tyrannical = require("tyrannical") |
| 7 |
require("awful.autofocus") |
| 8 |
|
| 9 |
local wibox = require("wibox") |
| 10 |
|
| 11 |
local beautiful = require("beautiful") |
| 12 |
|
| 13 |
local naughty = require("naughty") |
| 14 |
local menubar = require("menubar") |
| 15 |
local hotkeys_popup = require("awful.hotkeys_popup").widget |
| 16 |
|
| 17 |
|
| 18 |
|
| 19 |
|
| 20 |
if awesome.startup_errors then |
| 21 |
naughty.notify({ preset = naughty.config.presets.critical, |
| 22 |
title = "Oops, there were errors during startup!", |
| 23 |
text = awesome.startup_errors }) |
| 24 |
end |
| 25 |
|
| 26 |
|
| 27 |
do |
| 28 |
local in_error = false |
| 29 |
awesome.connect_signal("debug::error", function (err) |
| 30 |
|
| 31 |
if in_error then return end |
| 32 |
in_error = true |
| 33 |
|
| 34 |
naughty.notify({ preset = naughty.config.presets.critical, |
| 35 |
title = "Oops, an error happened!", |
| 36 |
text = err }) |
| 37 |
in_error = false |
| 38 |
end) |
| 39 |
end |
| 40 |
|
| 41 |
|
| 42 |
|
| 43 |
|
| 44 |
beautiful.init(awful.util.get_themes_dir() .. "default/theme.lua") |
| 45 |
|
| 46 |
|
| 47 |
terminal = "xterm" |
| 48 |
editor = os.getenv("EDITOR") or "nano" |
| 49 |
editor_cmd = terminal .. " -e " .. editor |
| 50 |
|
| 51 |
|
| 52 |
|
| 53 |
|
| 54 |
|
| 55 |
|
| 56 |
modkey = "Mod4" |
| 57 |
|
| 58 |
|
| 59 |
awful.layout.layouts = { |
| 60 |
awful.layout.suit.floating, |
| 61 |
awful.layout.suit.tile, |
| 62 |
awful.layout.suit.tile.left, |
| 63 |
awful.layout.suit.tile.bottom, |
| 64 |
awful.layout.suit.tile.top, |
| 65 |
awful.layout.suit.fair, |
| 66 |
awful.layout.suit.fair.horizontal, |
| 67 |
awful.layout.suit.spiral, |
| 68 |
awful.layout.suit.spiral.dwindle, |
| 69 |
awful.layout.suit.max, |
| 70 |
awful.layout.suit.max.fullscreen, |
| 71 |
awful.layout.suit.magnifier, |
| 72 |
awful.layout.suit.corner.nw, |
| 73 |
|
| 74 |
|
| 75 |
|
| 76 |
} |
| 77 |
|
| 78 |
|
| 79 |
|
| 80 |
local function client_menu_toggle_fn() |
| 81 |
local instance = nil |
| 82 |
|
| 83 |
return function () |
| 84 |
if instance and instance.wibox.visible then |
| 85 |
instance:hide() |
| 86 |
instance = nil |
| 87 |
else |
| 88 |
instance = awful.menu.clients({ theme = { width = 250 } }) |
| 89 |
end |
| 90 |
end |
| 91 |
end |
| 92 |
|
| 93 |
|
| 94 |
|
| 95 |
tyrannical.settings.default_layout = awful.layout.suit.tile.left |
| 96 |
tyrannical.settings.master_width_factor = 0.66 |
| 97 |
|
| 98 |
|
| 99 |
tyrannical.tags = { |
| 100 |
{ |
| 101 |
name = "Term", |
| 102 |
init = true, |
| 103 |
exclusive = true, |
| 104 |
screen = {1,2}, |
| 105 |
layout = awful.layout.suit.tile, |
| 106 |
selected = true, |
| 107 |
class = { |
| 108 |
"xterm" , "urxvt" , "aterm","URxvt","XTerm","konsole","terminator","gnome-terminal" |
| 109 |
} |
| 110 |
} , |
| 111 |
{ |
| 112 |
name = "Internet", |
| 113 |
init = true, |
| 114 |
exclusive = true, |
| 115 |
|
| 116 |
screen = screen.count()>1 and 2 or 1, |
| 117 |
layout = awful.layout.suit.max, |
| 118 |
class = { |
| 119 |
"Opera" , "Firefox" , "Rekonq" , "Dillo" , "Arora", |
| 120 |
"Chromium" , "nightly" , "minefield" } |
| 121 |
} , |
| 122 |
{ |
| 123 |
name = "Files", |
| 124 |
init = true, |
| 125 |
exclusive = true, |
| 126 |
screen = 1, |
| 127 |
layout = awful.layout.suit.tile, |
| 128 |
exec_once = {"dolphin"}, |
| 129 |
class = { |
| 130 |
"Thunar", "Konqueror", "Dolphin", "ark", "Nautilus","emelfm" |
| 131 |
} |
| 132 |
} , |
| 133 |
{ |
| 134 |
name = "Develop", |
| 135 |
init = true, |
| 136 |
exclusive = true, |
| 137 |
screen = 1, |
| 138 |
clone_on = 2, |
| 139 |
|
| 140 |
layout = awful.layout.suit.max , |
| 141 |
class ={ |
| 142 |
"Kate", "KDevelop", "Codeblocks", "Code::Blocks" , "DDD", "kate4"} |
| 143 |
} , |
| 144 |
{ |
| 145 |
name = "Doc", |
| 146 |
init = false, |
| 147 |
|
| 148 |
|
| 149 |
exclusive = true, |
| 150 |
layout = awful.layout.suit.max, |
| 151 |
class = { |
| 152 |
"Assistant" , "Okular" , "Evince" , "EPDFviewer" , "xpdf", |
| 153 |
"Xpdf" , } |
| 154 |
} , |
| 155 |
} |
| 156 |
|
| 157 |
|
| 158 |
tyrannical.properties.intrusive = { |
| 159 |
"ksnapshot" , "pinentry" , "gtksu" , "kcalc" , "xcalc" , |
| 160 |
"feh" , "Gradient editor", "About KDE" , "Paste Special", "Background color" , |
| 161 |
"kcolorchooser" , "plasmoidviewer" , "Xephyr" , "kruler" , "plasmaengineexplorer", |
| 162 |
} |
| 163 |
|
| 164 |
|
| 165 |
tyrannical.properties.floating = { |
| 166 |
"MPlayer" , "pinentry" , "ksnapshot" , "pinentry" , "gtksu" , |
| 167 |
"xine" , "feh" , "kmix" , "kcalc" , "xcalc" , |
| 168 |
"yakuake" , "Select Color$" , "kruler" , "kcolorchooser", "Paste Special" , |
| 169 |
"New Form" , "Insert Picture" , "kcharselect", "mythfrontend" , "plasmoidviewer" |
| 170 |
} |
| 171 |
|
| 172 |
|
| 173 |
tyrannical.properties.ontop = { |
| 174 |
"Xephyr" , "ksnapshot" , "kruler" |
| 175 |
} |
| 176 |
|
| 177 |
|
| 178 |
tyrannical.properties.centered = { |
| 179 |
"kcalc" |
| 180 |
} |
| 181 |
|
| 182 |
|
| 183 |
tyrannical.properties.size_hints_honor = { xterm = false, URxvt = false, aterm = false, sauer_client = false, mythfrontend = false} |
| 184 |
|
| 185 |
|
| 186 |
|
| 187 |
|
| 188 |
|
| 189 |
myawesomemenu = { |
| 190 |
{ "manual", terminal .. " -e man awesome" }, |
| 191 |
{ "edit config", editor_cmd .. " " .. awesome.conffile }, |
| 192 |
{ "restart", awesome.restart }, |
| 193 |
{ "quit", function() awesome.quit() end }, |
| 194 |
} |
| 195 |
|
| 196 |
mymainmenu = awful.menu({ items = { { "awesome", myawesomemenu, beautiful.awesome_icon }, |
| 197 |
{ "open terminal", terminal } |
| 198 |
} |
| 199 |
}) |
| 200 |
|
| 201 |
mylauncher = awful.widget.launcher({ image = beautiful.awesome_icon, |
| 202 |
menu = mymainmenu }) |
| 203 |
|
| 204 |
|
| 205 |
menubar.utils.terminal = terminal |
| 206 |
|
| 207 |
|
| 208 |
|
| 209 |
|
| 210 |
mytextclock = awful.widget.textclock() |
| 211 |
|
| 212 |
|
| 213 |
|
| 214 |
local taglist_buttons = awful.util.table.join( |
| 215 |
awful.button({ }, 1, function(t) t:view_only() end), |
| 216 |
awful.button({ modkey }, 1, function(t) |
| 217 |
if client.focus then |
| 218 |
client.focus:move_to_tag(t) |
| 219 |
end |
| 220 |
end), |
| 221 |
awful.button({ }, 3, awful.tag.viewtoggle), |
| 222 |
awful.button({ modkey }, 3, function(t) |
| 223 |
if client.focus then |
| 224 |
client.focus:toggle_tag(t) |
| 225 |
end |
| 226 |
end), |
| 227 |
awful.button({ }, 4, function(t) awful.tag.viewnext(t.screen) end), |
| 228 |
awful.button({ }, 5, function(t) awful.tag.viewprev(t.screen) end) |
| 229 |
) |
| 230 |
|
| 231 |
|
| 232 |
local tasklist_buttons = awful.util.table.join( |
| 233 |
awful.button({ }, 1, function (c) |
| 234 |
if c == client.focus then |
| 235 |
c.minimized = true |
| 236 |
else |
| 237 |
|
| 238 |
|
| 239 |
c.minimized = false |
| 240 |
if not c:isvisible() and c.first_tag then |
| 241 |
c.first_tag:view_only() |
| 242 |
end |
| 243 |
|
| 244 |
|
| 245 |
client.focus = c |
| 246 |
c:raise() |
| 247 |
end |
| 248 |
end), |
| 249 |
awful.button({ }, 3, client_menu_toggle_fn()), |
| 250 |
awful.button({ }, 4, function () |
| 251 |
awful.client.focus.byidx(1) |
| 252 |
end), |
| 253 |
awful.button({ }, 5, function () |
| 254 |
awful.client.focus.byidx(-1) |
| 255 |
end)) |
| 256 |
|
| 257 |
|
| 258 |
local function set_wallpaper(s) |
| 259 |
|
| 260 |
if beautiful.wallpaper then |
| 261 |
local wallpaper = beautiful.wallpaper |
| 262 |
|
| 263 |
if type(wallpaper) == "function" then |
| 264 |
wallpaper = wallpaper(s) |
| 265 |
end |
| 266 |
gears.wallpaper.maximized(wallpaper, s, true) |
| 267 |
end |
| 268 |
end |
| 269 |
|
| 270 |
|
| 271 |
screen.connect_signal("property::geometry", set_wallpaper) |
| 272 |
|
| 273 |
|
| 274 |
awful.screen.connect_for_each_screen(function(s) |
| 275 |
|
| 276 |
set_wallpaper(s) |
| 277 |
|
| 278 |
|
| 279 |
s.mypromptbox = awful.widget.prompt() |
| 280 |
|
| 281 |
|
| 282 |
s.mylayoutbox = awful.widget.layoutbox(s) |
| 283 |
s.mylayoutbox:buttons(awful.util.table.join( |
| 284 |
awful.button({ }, 1, function () awful.layout.inc(awful.layout.layouts, 1) end), |
| 285 |
awful.button({ }, 3, function () awful.layout.inc(awful.layout.layouts, -1) end), |
| 286 |
awful.button({ }, 4, function () awful.layout.inc(awful.layout.layouts, 1) end), |
| 287 |
awful.button({ }, 5, function () awful.layout.inc(awful.layout.layouts, -1) end))) |
| 288 |
|
| 289 |
s.mytaglist = awful.widget.taglist(s, awful.widget.taglist.filter.all, taglist_buttons) |
| 290 |
|
| 291 |
|
| 292 |
s.mytasklist = awful.widget.tasklist(s, awful.widget.tasklist.filter.currenttags, tasklist_buttons) |
| 293 |
|
| 294 |
|
| 295 |
|
| 296 |
s.mywibox = awful.wibar({ position = "top", screen = s }) |
| 297 |
|
| 298 |
|
| 299 |
|
| 300 |
s.mywibox:setup { |
| 301 |
layout = wibox.layout.align.horizontal, |
| 302 |
{ |
| 303 |
layout = wibox.layout.fixed.horizontal, |
| 304 |
mylauncher, |
| 305 |
s.mytaglist, |
| 306 |
s.mypromptbox, |
| 307 |
}, |
| 308 |
s.mytasklist, |
| 309 |
{ |
| 310 |
layout = wibox.layout.fixed.horizontal, |
| 311 |
mykeyboardlayout, |
| 312 |
wibox.widget.systray(), |
| 313 |
mytextclock, |
| 314 |
s.mylayoutbox, |
| 315 |
}, |
| 316 |
} |
| 317 |
end) |
| 318 |
|
| 319 |
|
| 320 |
|
| 321 |
|
| 322 |
root.buttons(awful.util.table.join( |
| 323 |
awful.button({ }, 3, function () mymainmenu:toggle() end), |
| 324 |
awful.button({ }, 4, awful.tag.viewnext), |
| 325 |
awful.button({ }, 5, awful.tag.viewprev) |
| 326 |
)) |
| 327 |
|
| 328 |
|
| 329 |
|
| 330 |
|
| 331 |
globalkeys = awful.util.table.join( |
| 332 |
awful.key({ modkey, }, "s", hotkeys_popup.show_help, |
| 333 |
{description="show help", group="awesome"}), |
| 334 |
awful.key({ modkey, }, "Left", awful.tag.viewprev, |
| 335 |
{description = "view previous", group = "tag"}), |
| 336 |
awful.key({ modkey, }, "Right", awful.tag.viewnext, |
| 337 |
{description = "view next", group = "tag"}), |
| 338 |
awful.key({ modkey, }, "Escape", awful.tag.history.restore, |
| 339 |
{description = "go back", group = "tag"}), |
| 340 |
|
| 341 |
awful.key({ modkey, }, "j", |
| 342 |
function () |
| 343 |
awful.client.focus.byidx( 1) |
| 344 |
end, |
| 345 |
{description = "focus next by index", group = "client"} |
| 346 |
), |
| 347 |
awful.key({ modkey, }, "k", |
| 348 |
function () |
| 349 |
awful.client.focus.byidx(-1) |
| 350 |
end, |
| 351 |
{description = "focus previous by index", group = "client"} |
| 352 |
), |
| 353 |
awful.key({ modkey, }, "w", function () mymainmenu:show() end, |
| 354 |
{description = "show main menu", group = "awesome"}), |
| 355 |
|
| 356 |
|
| 357 |
awful.key({ modkey, "Shift" }, "j", function () awful.client.swap.byidx( 1) end, |
| 358 |
{description = "swap with next client by index", group = "client"}), |
| 359 |
awful.key({ modkey, "Shift" }, "k", function () awful.client.swap.byidx( -1) end, |
| 360 |
{description = "swap with previous client by index", group = "client"}), |
| 361 |
awful.key({ modkey, "Control" }, "j", function () awful.screen.focus_relative( 1) end, |
| 362 |
{description = "focus the next screen", group = "screen"}), |
| 363 |
awful.key({ modkey, "Control" }, "k", function () awful.screen.focus_relative(-1) end, |
| 364 |
{description = "focus the previous screen", group = "screen"}), |
| 365 |
awful.key({ modkey, }, "u", awful.client.urgent.jumpto, |
| 366 |
{description = "jump to urgent client", group = "client"}), |
| 367 |
awful.key({ modkey, }, "Tab", |
| 368 |
function () |
| 369 |
awful.client.focus.history.previous() |
| 370 |
if client.focus then |
| 371 |
client.focus:raise() |
| 372 |
end |
| 373 |
end, |
| 374 |
{description = "go back", group = "client"}), |
| 375 |
|
| 376 |
|
| 377 |
awful.key({ modkey, }, "Return", function () awful.spawn(terminal) end, |
| 378 |
{description = "open a terminal", group = "launcher"}), |
| 379 |
awful.key({ modkey, "Control" }, "r", awesome.restart, |
| 380 |
{description = "reload awesome", group = "awesome"}), |
| 381 |
awful.key({ modkey, "Shift" }, "q", awesome.quit, |
| 382 |
{description = "quit awesome", group = "awesome"}), |
| 383 |
|
| 384 |
awful.key({ modkey, }, "l", function () awful.tag.incmwfact( 0.05) end, |
| 385 |
{description = "increase master width factor", group = "layout"}), |
| 386 |
awful.key({ modkey, }, "h", function () awful.tag.incmwfact(-0.05) end, |
| 387 |
{description = "decrease master width factor", group = "layout"}), |
| 388 |
awful.key({ modkey, "Shift" }, "h", function () awful.tag.incnmaster( 1, nil, true) end, |
| 389 |
{description = "increase the number of master clients", group = "layout"}), |
| 390 |
awful.key({ modkey, "Shift" }, "l", function () awful.tag.incnmaster(-1, nil, true) end, |
| 391 |
{description = "decrease the number of master clients", group = "layout"}), |
| 392 |
awful.key({ modkey, "Control" }, "h", function () awful.tag.incncol( 1, nil, true) end, |
| 393 |
{description = "increase the number of columns", group = "layout"}), |
| 394 |
awful.key({ modkey, "Control" }, "l", function () awful.tag.incncol(-1, nil, true) end, |
| 395 |
{description = "decrease the number of columns", group = "layout"}), |
| 396 |
awful.key({ modkey, }, "space", function () awful.layout.inc( 1) end, |
| 397 |
{description = "select next", group = "layout"}), |
| 398 |
awful.key({ modkey, "Shift" }, "space", function () awful.layout.inc(-1) end, |
| 399 |
{description = "select previous", group = "layout"}), |
| 400 |
|
| 401 |
awful.key({ modkey, "Control" }, "n", |
| 402 |
function () |
| 403 |
local c = awful.client.restore() |
| 404 |
|
| 405 |
if c then |
| 406 |
client.focus = c |
| 407 |
c:raise() |
| 408 |
end |
| 409 |
end, |
| 410 |
{description = "restore minimized", group = "client"}), |
| 411 |
|
| 412 |
|
| 413 |
awful.key({ modkey }, "r", function () awful.screen.focused().mypromptbox:run() end, |
| 414 |
{description = "run prompt", group = "launcher"}), |
| 415 |
|
| 416 |
awful.key({ modkey }, "x", |
| 417 |
function () |
| 418 |
awful.prompt.run { |
| 419 |
prompt = "Run Lua code: ", |
| 420 |
textbox = awful.screen.focused().mypromptbox.widget, |
| 421 |
exe_callback = awful.util.eval, |
| 422 |
history_path = awful.util.get_cache_dir() .. "/history_eval" |
| 423 |
} |
| 424 |
end, |
| 425 |
{description = "lua execute prompt", group = "awesome"}), |
| 426 |
|
| 427 |
awful.key({ modkey }, "p", function() menubar.show() end, |
| 428 |
{description = "show the menubar", group = "launcher"}) |
| 429 |
) |
| 430 |
|
| 431 |
|
| 432 |
clientkeys = awful.util.table.join( |
| 433 |
awful.key({ modkey, }, "f", |
| 434 |
function (c) |
| 435 |
c.fullscreen = not c.fullscreen |
| 436 |
c:raise() |
| 437 |
end, |
| 438 |
{description = "toggle fullscreen", group = "client"}), |
| 439 |
awful.key({ modkey, "Shift" }, "c", function (c) c:kill() end, |
| 440 |
{description = "close", group = "client"}), |
| 441 |
awful.key({ modkey, "Control" }, "space", awful.client.floating.toggle , |
| 442 |
{description = "toggle floating", group = "client"}), |
| 443 |
awful.key({ modkey, "Control" }, "Return", function (c) c:swap(awful.client.getmaster()) end, |
| 444 |
{description = "move to master", group = "client"}), |
| 445 |
awful.key({ modkey, }, "o", function (c) c:move_to_screen() end, |
| 446 |
{description = "move to screen", group = "client"}), |
| 447 |
awful.key({ modkey, }, "t", function (c) c.ontop = not c.ontop end, |
| 448 |
{description = "toggle keep on top", group = "client"}), |
| 449 |
awful.key({ modkey, }, "n", |
| 450 |
function (c) |
| 451 |
|
| 452 |
|
| 453 |
c.minimized = true |
| 454 |
end , |
| 455 |
{description = "minimize", group = "client"}), |
| 456 |
awful.key({ modkey, }, "m", |
| 457 |
function (c) |
| 458 |
c.maximized = not c.maximized |
| 459 |
c:raise() |
| 460 |
end , |
| 461 |
{description = "maximize", group = "client"}) |
| 462 |
) |
| 463 |
|
| 464 |
|
| 465 |
|
| 466 |
|
| 467 |
|
| 468 |
for i = 1, 9 do |
| 469 |
globalkeys = awful.util.table.join(globalkeys, |
| 470 |
|
| 471 |
awful.key({ modkey }, "#" .. i + 9, |
| 472 |
function () |
| 473 |
local screen = awful.screen.focused() |
| 474 |
local tag = screen.tags[i] |
| 475 |
if tag then |
| 476 |
tag:view_only() |
| 477 |
end |
| 478 |
end, |
| 479 |
{description = "view tag #"..i, group = "tag"}), |
| 480 |
|
| 481 |
awful.key({ modkey, "Control" }, "#" .. i + 9, |
| 482 |
function () |
| 483 |
local screen = awful.screen.focused() |
| 484 |
local tag = screen.tags[i] |
| 485 |
if tag then |
| 486 |
awful.tag.viewtoggle(tag) |
| 487 |
end |
| 488 |
end, |
| 489 |
{description = "toggle tag #" .. i, group = "tag"}), |
| 490 |
|
| 491 |
awful.key({ modkey, "Shift" }, "#" .. i + 9, |
| 492 |
function () |
| 493 |
if client.focus then |
| 494 |
local tag = client.focus.screen.tags[i] |
| 495 |
if tag then |
| 496 |
client.focus:move_to_tag(tag) |
| 497 |
end |
| 498 |
end |
| 499 |
end, |
| 500 |
{description = "move focused client to tag #"..i, group = "tag"}), |
| 501 |
|
| 502 |
awful.key({ modkey, "Control", "Shift" }, "#" .. i + 9, |
| 503 |
function () |
| 504 |
if client.focus then |
| 505 |
local tag = client.focus.screen.tags[i] |
| 506 |
if tag then |
| 507 |
client.focus:toggle_tag(tag) |
| 508 |
end |
| 509 |
end |
| 510 |
end, |
| 511 |
{description = "toggle focused client on tag #" .. i, group = "tag"}) |
| 512 |
) |
| 513 |
end |
| 514 |
|
| 515 |
|
| 516 |
clientbuttons = awful.util.table.join( |
| 517 |
awful.button({ }, 1, function (c) client.focus = c; c:raise() end), |
| 518 |
awful.button({ modkey }, 1, awful.mouse.client.move), |
| 519 |
awful.button({ modkey }, 3, awful.mouse.client.resize)) |
| 520 |
|
| 521 |
|
| 522 |
root.keys(globalkeys) |
| 523 |
|
| 524 |
|
| 525 |
|
| 526 |
|
| 527 |
|
| 528 |
awful.rules.rules = { |
| 529 |
|
| 530 |
|
| 531 |
{ rule = { }, |
| 532 |
properties = { border_width = beautiful.border_width, |
| 533 |
border_color = beautiful.border_normal, |
| 534 |
focus = awful.client.focus.filter, |
| 535 |
raise = true, |
| 536 |
keys = clientkeys, |
| 537 |
buttons = clientbuttons, |
| 538 |
screen = awful.screen.preferred, |
| 539 |
placement = awful.placement.no_overlap+awful.placement.no_offscreen |
| 540 |
} |
| 541 |
}, |
| 542 |
|
| 543 |
|
| 544 |
|
| 545 |
{ rule_any = { |
| 546 |
instance = { |
| 547 |
"DTA", |
| 548 |
"copyq", |
| 549 |
}, |
| 550 |
class = { |
| 551 |
"Arandr", |
| 552 |
"Gpick", |
| 553 |
"Kruler", |
| 554 |
"MessageWin", |
| 555 |
"Sxiv", |
| 556 |
"Wpa_gui", |
| 557 |
"pinentry", |
| 558 |
"veromix", |
| 559 |
"xtightvncviewer"}, |
| 560 |
|
| 561 |
name = { |
| 562 |
"Event Tester", |
| 563 |
}, |
| 564 |
role = { |
| 565 |
"AlarmWindow", |
| 566 |
"pop-up", |
| 567 |
} |
| 568 |
}, properties = { floating = true }}, |
| 569 |
|
| 570 |
|
| 571 |
|
| 572 |
{ rule_any = {type = { "normal", "dialog" } |
| 573 |
}, properties = { titlebars_enabled = true } |
| 574 |
}, |
| 575 |
|
| 576 |
|
| 577 |
|
| 578 |
|
| 579 |
} |
| 580 |
|
| 581 |
|
| 582 |
|
| 583 |
|
| 584 |
|
| 585 |
client.connect_signal("manage", function (c) |
| 586 |
|
| 587 |
|
| 588 |
|
| 589 |
|
| 590 |
if awesome.startup and |
| 591 |
not c.size_hints.user_position |
| 592 |
and not c.size_hints.program_position then |
| 593 |
|
| 594 |
awful.placement.no_offscreen(c) |
| 595 |
end |
| 596 |
end) |
| 597 |
|
| 598 |
|
| 599 |
|
| 600 |
client.connect_signal("request::titlebars", function(c) |
| 601 |
|
| 602 |
local buttons = awful.util.table.join( |
| 603 |
awful.button({ }, 1, function() |
| 604 |
client.focus = c |
| 605 |
c:raise() |
| 606 |
awful.mouse.client.move(c) |
| 607 |
end), |
| 608 |
awful.button({ }, 3, function() |
| 609 |
client.focus = c |
| 610 |
c:raise() |
| 611 |
awful.mouse.client.resize(c) |
| 612 |
end) |
| 613 |
) |
| 614 |
|
| 615 |
awful.titlebar(c) : setup { |
| 616 |
{ |
| 617 |
awful.titlebar.widget.iconwidget(c), |
| 618 |
buttons = buttons, |
| 619 |
layout = wibox.layout.fixed.horizontal |
| 620 |
}, |
| 621 |
{ |
| 622 |
{ |
| 623 |
align = "center", |
| 624 |
widget = awful.titlebar.widget.titlewidget(c) |
| 625 |
}, |
| 626 |
buttons = buttons, |
| 627 |
layout = wibox.layout.flex.horizontal |
| 628 |
}, |
| 629 |
{ |
| 630 |
awful.titlebar.widget.floatingbutton (c), |
| 631 |
awful.titlebar.widget.maximizedbutton(c), |
| 632 |
awful.titlebar.widget.stickybutton (c), |
| 633 |
awful.titlebar.widget.ontopbutton (c), |
| 634 |
awful.titlebar.widget.closebutton (c), |
| 635 |
layout = wibox.layout.fixed.horizontal() |
| 636 |
}, |
| 637 |
layout = wibox.layout.align.horizontal |
| 638 |
} |
| 639 |
end) |
| 640 |
|
| 641 |
|
| 642 |
client.connect_signal("mouse::enter", function(c) |
| 643 |
if awful.layout.get(c.screen) ~= awful.layout.suit.magnifier |
| 644 |
and awful.client.focus.filter(c) then |
| 645 |
client.focus = c |
| 646 |
end |
| 647 |
end) |
| 648 |
|
| 649 |
|
| 650 |
client.connect_signal("focus", function(c) c.border_color = beautiful.border_focus end) |
| 651 |
client.connect_signal("unfocus", function(c) c.border_color = beautiful.border_normal end) |
| 652 |
|