~unwox/awm-fuzzy

be903028a3355d5559e439c63553eadb6f9fb39d — scisssssssors 4 years ago 147974e master
Add `Set magnified` to client options
1 files changed, 27 insertions(+), 1 deletions(-)

M source.lua
M source.lua => source.lua +27 -1
@@ 90,8 90,34 @@ function sources.client_options()
      value = function () focused_client.fullscreen = not focused_client.fullscreen end,
    },
    {
      title = focused_client.magnified and "Unset magnified" or "Set magnified",
      description = "Set client floating, move it to the center and make it smaller",
      value = function ()
        if not focused_client.magnified then
          focused_client.floating = true

          if not awful then
            awful = require("awful")
          end

          local screen_geometry = awful.screen.focused().geometry

          focused_client.width = screen_geometry.width * 0.5
          focused_client.height = screen_geometry.height * 0.7
          focused_client.x = (screen_geometry.width - focused_client.width) / 2
          focused_client.y = (screen_geometry.height - focused_client.height) / 2

          focused_client.magnified = true
        else
          focused_client.floating = false

          focused_client.magnified = false
        end
      end
    },
    {
      title = focused_client.picture_in_picture and "Unset Picture-in-picture mod" or "Set Picture-in-picture mod",
      description = "Move client to the right bottom, make it smaller and sticky ",
      description = "Move client to the right bottom, make it smaller and sticky",
      value = function ()
        if not focused_client.picture_in_picture then
          focused_client.ontop = true