awesomeWM / awesome

awesome window manager
https://awesomewm.org/
GNU General Public License v2.0
6.39k stars 597 forks source link

Win-M btn behaviour in Awesome WM #2909

Closed xor512 closed 2 years ago

xor512 commented 5 years ago

Reopening https://github.com/awesomeWM/awesome/issues/2906 as a new issue since after Google... sorry Microsoft bought Gthub one cannot reopen issues anymore. In 10 yrs we will be all using gerrit or similar bullsh.. so there is not much to complain. anyway maybe smbd can help? I really like awesome WMm it's just these small inconveniencies..

=== Cut from https://www.linux.org.ru/forum/desktop/15283708?cid=15287475 === @psychon Everything works but unfortunately I started to want more and got stuck. :( What I wanted is:

  1. Shortcut to close every window in currently opened tag
  2. Shortcut to minimize every window in currently opened tag
  3. Shortcut to bring back every window in currently opened tag

1 and 2 where easy but 3 is a real pain. Even if i mininize one window with modjey+N and then try to bring back it appears in a different place. Here is what I am trying to do;

`clientkeys = gears.table.join(
awful.key({ modkey, "Control"   }, "m",      
    function ()
        for _, cl in ipairs(mouse.screen.selected_tag:clients()) do
             local c = cl
             if c then
               c.minimized = true
             end
        end
    end,
          {description = "minimize all windows in current tag", group = "client"}),
awful.key({ modkey, "Control"   }, "n",      
    function ()
        for _, cl in ipairs(mouse.screen.selected_tag:clients()) do
             local c = cl
             --if c then
             --   c.unminimize = true
             --end
             c:emit_signal(
                 "request::activate", "key.unminimize", {raise = true}
             )
        end
    end,
          {description = "maximize all windows in current tag", group = "client"}),
awful.key({ modkey, "Control"   }, "c",      
    function ()
        for _, cl in ipairs(mouse.screen.selected_tag:clients()) do
             local c = cl
             if c then
               c:kill()
             end
        end
    end,
          {description = "close all windows in current tag", group = "client"}),`

Problem is here:

`            --if c then
             --   c.unminimize = true
             --end
             c:emit_signal(
                 "request::activate", "key.unminimize", {raise = true}
             )`

None of this works. it restores only one window in a place it wants.

can you please help once agan? I would be very appreciated === End of cut ===

Originally posted by @xor512 in https://github.com/awesomeWM/awesome/issues/2906#issuecomment-541472373

psychon commented 5 years ago

Are you looking for c.minimized = false?

Also, local c = cl if c then c.minimized = true end should be equivalent to the shorter cl.minimized = true.

andrepc22 commented 2 years ago

In order to restore all minimized windows you should add that instruction to globalkeys table. Inside this function: globalkeys=gears.table.join() I recommend to place it below the restore minimized funtion

awful.key({modkey, "Shift"   }, "a",
      function()
          for _, c in ipairs(mouse.screen.selected_tag:clients()) do
              local c = awful.client.restore()
              if c then
                  c:emit_signal(
                  "request::activate",  "key.unminimize", {raise = true}
                  )
              end
          end
      end,
          {description = "restore all minimized windows in current tag", group = "client"}),
Aire-One commented 2 years ago

Thank you, @andrepc22, for your snippet. (I think it has a " floating at "key.unminimize that shouldn't be there.)

Given there are some solution proposed, but we didn't hear back from the OP, I'll close this issue or now. Feel free to continue commenting or reopen the issue whenever it's needed.