diff options
author | Mike Crute <mike@crute.us> | 2020-04-30 11:10:41 -0700 |
---|---|---|
committer | Mike Crute <mike@crute.us> | 2020-04-30 11:10:41 -0700 |
commit | 9333e177240f0579808caebc9c1d7f91e435e922 (patch) | |
tree | 44680ccc5bf8e8aae9470ea9759f9e2940d4150e /.config | |
parent | 14c3483de3eb7946628f94d48456bb657976745f (diff) | |
download | dotfiles-9333e177240f0579808caebc9c1d7f91e435e922.tar.bz2 dotfiles-9333e177240f0579808caebc9c1d7f91e435e922.tar.xz dotfiles-9333e177240f0579808caebc9c1d7f91e435e922.zip |
Cleanup deprecated awesome functions
Diffstat (limited to '.config')
-rw-r--r-- | .config/awesome/mcrute.lua | 30 |
1 files changed, 14 insertions, 16 deletions
diff --git a/.config/awesome/mcrute.lua b/.config/awesome/mcrute.lua index 4bf6734..60a9d86 100644 --- a/.config/awesome/mcrute.lua +++ b/.config/awesome/mcrute.lua | |||
@@ -273,7 +273,7 @@ function connect_signals() | |||
273 | awful.screen.connect_for_each_screen(function(s) | 273 | awful.screen.connect_for_each_screen(function(s) |
274 | s:connect_signal("arrange", function() | 274 | s:connect_signal("arrange", function() |
275 | for _, c in pairs(awful.client.visible(s)) do | 275 | for _, c in pairs(awful.client.visible(s)) do |
276 | if awful.client.floating.get(c) then | 276 | if c.floating then |
277 | c.border_width = dpi(3) | 277 | c.border_width = dpi(3) |
278 | c.border_color = beautiful.border_focus | 278 | c.border_color = beautiful.border_focus |
279 | else | 279 | else |
@@ -302,9 +302,9 @@ function connect_signals() | |||
302 | -- awesome exec's a new awesome which will inherit everything from the | 302 | -- awesome exec's a new awesome which will inherit everything from the |
303 | -- current session. | 303 | -- current session. |
304 | if not is_restart then | 304 | if not is_restart then |
305 | -- The use of io.popen here is intentional because it will block | 305 | -- The use of os.execute here is intentional because it will block |
306 | -- until systemd has finished stopping the target. | 306 | -- until systemd has finished stopping the target. |
307 | io.popen("systemctl --user stop desktop.target") | 307 | os.execute("systemctl --user stop desktop.target") |
308 | end | 308 | end |
309 | end) | 309 | end) |
310 | end | 310 | end |
@@ -357,15 +357,12 @@ function zoom_screen(zoom_stop) | |||
357 | zoom_stop = #edp_zoom_modes | 357 | zoom_stop = #edp_zoom_modes |
358 | end | 358 | end |
359 | 359 | ||
360 | print(zoom_stop) | ||
361 | print(mode) | ||
362 | |||
363 | if zoom_stop ~= 0 then | 360 | if zoom_stop ~= 0 then |
364 | mode = edp_zoom_modes[zoom_stop] | 361 | mode = edp_zoom_modes[zoom_stop] |
365 | panning = default_edp_mode | 362 | panning = default_edp_mode |
366 | end | 363 | end |
367 | 364 | ||
368 | awful.util.spawn("xrandr --output eDP-1 --mode " .. mode .. " --panning " .. panning) | 365 | awful.spawn.spawn("xrandr --output eDP-1 --mode " .. mode .. " --panning " .. panning) |
369 | end | 366 | end |
370 | 367 | ||
371 | -- | 368 | -- |
@@ -405,10 +402,10 @@ function zoom_screen_reset() | |||
405 | zoom_screen(0) | 402 | zoom_screen(0) |
406 | end | 403 | end |
407 | 404 | ||
408 | -- make_spawn is a shortcut for generating awful.util.spawn closures and allows | 405 | -- make_spawn is a shortcut for generating awful.spawn.spawn closures and allows |
409 | -- using this shorthand in other places in this file. | 406 | -- using this shorthand in other places in this file. |
410 | function make_spawn(cmd) | 407 | function make_spawn(cmd) |
411 | return function() awful.util.spawn(cmd) end | 408 | return function() awful.spawn.spawn(cmd) end |
412 | end | 409 | end |
413 | 410 | ||
414 | -- add_global_keys adds additional key bindings to the root key map. More | 411 | -- add_global_keys adds additional key bindings to the root key map. More |
@@ -506,7 +503,7 @@ end | |||
506 | -- and position it to the right of the laptop built-in display. This should be | 503 | -- and position it to the right of the laptop built-in display. This should be |
507 | -- good enough for most screens. | 504 | -- good enough for most screens. |
508 | function default_display_handler(card, edp_mode) | 505 | function default_display_handler(card, edp_mode) |
509 | awful.util.spawn("xrandr --output eDP-1 --mode " .. edp_mode .. " --output " .. card .. " --auto --right-of eDP-1") | 506 | awful.spawn.spawn("xrandr --output eDP-1 --mode " .. edp_mode .. " --output " .. card .. " --auto --right-of eDP-1") |
510 | end | 507 | end |
511 | 508 | ||
512 | -- get_displays uses a shell script helper (~/bin/enumerate-displays) to | 509 | -- get_displays uses a shell script helper (~/bin/enumerate-displays) to |
@@ -521,6 +518,7 @@ function get_displays() | |||
521 | local parts = nil | 518 | local parts = nil |
522 | local outputs = nil | 519 | local outputs = nil |
523 | 520 | ||
521 | -- TODO: Make this async (awful.spawn.with_line_callback) | ||
524 | outputs = io.popen(os.getenv("HOME") .. "/bin/enumerate-displays") | 522 | outputs = io.popen(os.getenv("HOME") .. "/bin/enumerate-displays") |
525 | 523 | ||
526 | while true do | 524 | while true do |
@@ -552,7 +550,7 @@ function configure_displays() | |||
552 | 550 | ||
553 | -- Only built-in display is connected | 551 | -- Only built-in display is connected |
554 | if #displays == 1 and displays[1].edid == "DELL_XPS_13" then | 552 | if #displays == 1 and displays[1].edid == "DELL_XPS_13" then |
555 | awful.util.spawn("xrandr " .. | 553 | awful.spawn.spawn("xrandr " .. |
556 | "--output eDP-1 --mode " .. default_edp_mode .. " " .. | 554 | "--output eDP-1 --mode " .. default_edp_mode .. " " .. |
557 | "--output DP-1 --off " .. | 555 | "--output DP-1 --off " .. |
558 | "--output DP-2 --off " .. | 556 | "--output DP-2 --off " .. |
@@ -564,23 +562,23 @@ function configure_displays() | |||
564 | 562 | ||
565 | for _, s in pairs(displays) do | 563 | for _, s in pairs(displays) do |
566 | if s.edid == "DELL U2715H" then -- 27" Dell monitors (assumed 2) | 564 | if s.edid == "DELL U2715H" then -- 27" Dell monitors (assumed 2) |
567 | awful.util.spawn("xrandr " .. | 565 | awful.spawn.spawn("xrandr " .. |
568 | "--output DP-1 --auto " .. | 566 | "--output DP-1 --auto " .. |
569 | "--output DP-2 --auto --right-of DP-1 " .. | 567 | "--output DP-2 --auto --right-of DP-1 " .. |
570 | "--output eDP-1 --off") | 568 | "--output eDP-1 --off") |
571 | return | 569 | return |
572 | elseif s.edid == "DELL U3219Q" then -- 32" 4k Dell monitor | 570 | elseif s.edid == "DELL U3219Q" then -- 32" 4k Dell monitor |
573 | awful.util.spawn("xrandr --output " .. s.card .. " --auto --output eDP-1 --off") | 571 | awful.spawn.spawn("xrandr --output " .. s.card .. " --auto --output eDP-1 --off") |
574 | --split_screen_vertical() | 572 | --split_screen_vertical() |
575 | elseif s.edid == "49S405" then -- 32" 4k Dell monitor | 573 | elseif s.edid == "49S405" then -- 32" 4k Dell monitor |
576 | awful.util.spawn("xrandr --output " .. s.card .. " --auto --output eDP-1 --off") | 574 | awful.spawn.spawn("xrandr --output " .. s.card .. " --auto --output eDP-1 --off") |
577 | --split_screen_vertical() | 575 | --split_screen_vertical() |
578 | elseif s.edid == "DELL U3415W" then -- 34" curved widescreen Dell monitors | 576 | elseif s.edid == "DELL U3415W" then -- 34" curved widescreen Dell monitors |
579 | awful.util.spawn("xrandr --output " .. s.card .. " --auto --output eDP-1 --off") | 577 | awful.spawn.spawn("xrandr --output " .. s.card .. " --auto --output eDP-1 --off") |
580 | --split_screen_vertical() | 578 | --split_screen_vertical() |
581 | return | 579 | return |
582 | elseif s.edid == "DELL U3417W" then -- 34" curved widescreen Dell monitors | 580 | elseif s.edid == "DELL U3417W" then -- 34" curved widescreen Dell monitors |
583 | awful.util.spawn("xrandr --output " .. s.card .. " --auto --output eDP-1 --off") | 581 | awful.spawn.spawn("xrandr --output " .. s.card .. " --auto --output eDP-1 --off") |
584 | --split_screen_vertical() | 582 | --split_screen_vertical() |
585 | return | 583 | return |
586 | elseif s.edid == "DELL_XPS_13" then -- Built-in display | 584 | elseif s.edid == "DELL_XPS_13" then -- Built-in display |