{"action":"created","issue":{"url":"https://api.github.com/repos/f1u77y/xmonad-contrib/issues/1","repository_url":"https://api.github.com/repos/f1u77y/xmonad-contrib","labels_url":"https://api.github.com/repos/f1u77y/xmonad-contrib/issues/1/labels{/name}","comments_url":"https://api.github.com/repos/f1u77y/xmonad-contrib/issues/1/comments","events_url":"https://api.github.com/repos/f1u77y/xmonad-contrib/issues/1/events","html_url":"https://github.com/f1u77y/xmonad-contrib/pull/1","id":188648017,"number":1,"title":"X.A.Minimize: Add withLastMinimized', use to write withLastMinimized (and merge master)","user":{"login":"IvanMalison","id":1246619,"avatar_url":"https://avatars.githubusercontent.com/u/1246619?v=3","gravatar_id":"","url":"https://api.github.com/users/IvanMalison","html_url":"https://github.com/IvanMalison","followers_url":"https://api.github.com/users/IvanMalison/followers","following_url":"https://api.github.com/users/IvanMalison/following{/other_user}","gists_url":"https://api.github.com/users/IvanMalison/gists{/gist_id}","starred_url":"https://api.github.com/users/IvanMalison/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/IvanMalison/subscriptions","organizations_url":"https://api.github.com/users/IvanMalison/orgs","repos_url":"https://api.github.com/users/IvanMalison/repos","events_url":"https://api.github.com/users/IvanMalison/events{/privacy}","received_events_url":"https://api.github.com/users/IvanMalison/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":2,"created_at":"2016-11-10T23:35:07Z","updated_at":"2016-11-11T04:39:35Z","closed_at":null,"pull_request":{"url":"https://api.github.com/repos/f1u77y/xmonad-contrib/pulls/1","html_url":"https://github.com/f1u77y/xmonad-contrib/pull/1","diff_url":"https://github.com/f1u77y/xmonad-contrib/pull/1.diff","patch_url":"https://github.com/f1u77y/xmonad-contrib/pull/1.patch"},"body":""},"comment":{"url":"https://api.github.com/repos/f1u77y/xmonad-contrib/issues/comments/259879718","html_url":"https://github.com/f1u77y/xmonad-contrib/pull/1#issuecomment-259879718","issue_url":"https://api.github.com/repos/f1u77y/xmonad-contrib/issues/1","id":259879718,"user":{"login":"IvanMalison","id":1246619,"avatar_url":"https://avatars.githubusercontent.com/u/1246619?v=3","gravatar_id":"","url":"https://api.github.com/users/IvanMalison","html_url":"https://github.com/IvanMalison","followers_url":"https://api.github.com/users/IvanMalison/followers","following_url":"https://api.github.com/users/IvanMalison/following{/other_user}","gists_url":"https://api.github.com/users/IvanMalison/gists{/gist_id}","starred_url":"https://api.github.com/users/IvanMalison/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/IvanMalison/subscriptions","organizations_url":"https://api.github.com/users/IvanMalison/orgs","repos_url":"https://api.github.com/users/IvanMalison/repos","events_url":"https://api.github.com/users/IvanMalison/events{/privacy}","received_events_url":"https://api.github.com/users/IvanMalison/received_events","type":"User","site_admin":false},"created_at":"2016-11-11T04:39:35Z","updated_at":"2016-11-11T04:39:35Z","body":"Here is how I use it:\r\n``` haskell\r\nrestoreFocus action = withFocused $ \\orig -> action >> windows (W.focusWindow orig)\r\n\r\nwithWorkspace f = withWindowSet $ \\ws ->\r\n  maybe (return ()) f (W.stack . W.workspace . W.current $ ws)\r\n\r\nminimizeOtherClassesInWorkspace = restoreFocus $\r\n    withWorkspace (windowsWithUnfocusedClass >=> mapM_ minimizeWindow)\r\n\r\nwindowsWithUnfocusedClass ws = windowsWithOtherClasses ws (W.focus ws)\r\n\r\nwindowsWithOtherClasses workspace window = do\r\n  windowClass <- getClass window\r\n  let predicate = (/= windowClass)\r\n  filterM (\\w -> predicate <$> getClass w) (W.integrate workspace)\r\n\r\nwindowIsMinimized w = do\r\n  minimized <- XS.gets minimizedStack\r\n  return $ w `elem` minimized\r\n\r\nmaybeUnminimizeFocused = withFocused $ \\w ->\r\n  windowIsMinimized w >>= flip when (maximizeWindow w)\r\n\r\nrestoreAllMinimized = restoreFocus $\r\n  withLastMinimized $ \\w -> maximizeWindow w >> restoreAllMinimized\r\n\r\nrestoreOrMinimizeOtherClasses = withLastMinimized' $ \\mw ->\r\n  case mw of\r\n    Just _ -> restoreAllMinimized\r\n    Nothing -> minimizeOtherClassesInWorkspace\r\n```\r\n\r\nBasically I have a function that minimizes all but the current window class, OR if there a minimized windows, inverts that action. Its basically a toggle all but a certain class in a workspace."}}
{"actor":{"display_login":"IvanMalison"}}