{"action":"created","issue":{"url":"https://api.github.com/repos/awesomeWM/awesome/issues/2462","repository_url":"https://api.github.com/repos/awesomeWM/awesome","labels_url":"https://api.github.com/repos/awesomeWM/awesome/issues/2462/labels{/name}","comments_url":"https://api.github.com/repos/awesomeWM/awesome/issues/2462/comments","events_url":"https://api.github.com/repos/awesomeWM/awesome/issues/2462/events","html_url":"https://github.com/awesomeWM/awesome/issues/2462","id":377194777,"node_id":"MDU6SXNzdWUzNzcxOTQ3Nzc=","number":2462,"title":"why \"intuitive\" window switching needs hacking /usr/share/awesome/lib/awful/widget/tasklist.lua ?","user":{"login":"xor512","id":29346009,"node_id":"MDQ6VXNlcjI5MzQ2MDA5","avatar_url":"https://avatars3.githubusercontent.com/u/29346009?v=4","gravatar_id":"","url":"https://api.github.com/users/xor512","html_url":"https://github.com/xor512","followers_url":"https://api.github.com/users/xor512/followers","following_url":"https://api.github.com/users/xor512/following{/other_user}","gists_url":"https://api.github.com/users/xor512/gists{/gist_id}","starred_url":"https://api.github.com/users/xor512/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/xor512/subscriptions","organizations_url":"https://api.github.com/users/xor512/orgs","repos_url":"https://api.github.com/users/xor512/repos","events_url":"https://api.github.com/users/xor512/events{/privacy}","received_events_url":"https://api.github.com/users/xor512/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":6,"created_at":"2018-11-04T21:06:32Z","updated_at":"2018-11-08T03:58:03Z","closed_at":null,"author_association":"NONE","body":"I'm totally OK with modkey+ljk but, simply out of common sense, they should work in a way that:\r\n\r\n1. First I open firefox\r\n2. Then lxterminal\r\n3. Then audacious\r\nI'm focused on audacious.\r\n\r\nPressing modkey+j should switch to lxterminal and pressing it again to firefox again to audacios and so on...\r\n\r\nPressing modkey+k being in audacious should switch to firefox and tnext to lxterminal...\r\n\r\nThat seems totally understandable, useful and simple.\r\n\r\nHowever it does not work like that. It doesn't matter how many window I open modkey+k moves me to the first opened. I won't even try to describe what actually modkey+j,k does since this seem following some totally random rules.\r\n\r\nI would understand if this advice helped (that maybe sensible reason that going to left/right is impossible when new added windows became masters):\r\n\r\n```lua\r\n{ rule = { }, properties = { }, callback = awful.client.setslave }\r\n```\r\n\r\nBut it doesn't. Indeed it stops opening new windows as master in tiling configurations, which may or may not be suitable for somebody but switching between windows using modkey+l,k doesn't make any sense in neither case.\r\n\r\nAnd also it appears that sensible going to left/right is when new added windows became masters (or slaves) is actually possible after hacking /usr/share/awesome/lib/awful/widget/tasklist.lua:\r\n\r\n```lua\r\nlocal function tasklist_update(s, w, buttons, filter, data, style, update_function)\r\n    local clients = {}\r\n    for _, c in ipairs(capi.client.get()) do\r\n        if not (c.skip_taskbar or c.hidden\r\n            or c.type == \"splash\" or c.type == \"dock\" or c.type == \"desktop\")\r\n            and filter(c, s) then\r\n            table.insert(clients, 1, c) -- HERE IS THE FIX\r\n        end\r\n    end\r\n\r\n    local function label(c, tb) return tasklist_label(c, style, tb) end\r\n\r\n    update_function(w, buttons, label, data, clients)\r\nend\r\n```\r\nNo matter the setslave option this works predictably.\r\n\r\nFollowing advice containing this hack in https://stackoverflow.com/questions/14537666/how-to-change-the-way-awesome-wm-add-items-to-the-tasklist, I've changed, as suggested, original \r\n```lua\r\ntable.insert(clients, c)\r\n```\r\nto \r\n```lua\r\ntable.insert(clients, 1, c)\r\n```\r\nand it started working as a charm (with or without setslave). I've also had to copy this file to ~/.config/awesome/awful/widget/ to not change original one. After that if I open 5 different windows and modkey+j goes to 4th and modkey+k to (5+1)%5 = 1. If then I'm at window opened as 3rd modkey+k will switch me to 4th and modkey+j to 2nd.\r\n\r\nSo modkey+j goes \"back\", modkey+k \"forward\". This way I can totally predict what is going on.\r\n\r\nSo:\r\n\r\n1. Why going left/right in window history in (expecially visible in floating tags) has some random logic?\r\n2. Why to make it sensible there is no way to do so in rc.lua?\r\n3. If I just change where to place new clients, in the beginning or in the end shouldn't just modkey-j/k start to work in opposite directions? Well I don't see them doing so. I'm seeing no pattern at all.\r\n\r\nMaybe this is a bug? I was really annoyed until I've googled this \"solution\" and applied it. Before I usually used mouse or app switcher (right click on taskbar) to switch between task. I know that you can actually open app switcher by some key binding not using mouse but what the point then in modkey+j/k? Eventually they will get you to the window you want but there is no way to guees which one of them to use and when you will lend up in the window you want.\r\n\r\nAgain after a hack with table.iinsert(clients, 1, c) modkey+j/k strarted to completely make sense and behave like going left/right where left is an \"older\" application\" (earlier started) and right is a \"younger one\" (started later).\r\n\r\nIf this not a bug please at least explain this in FAQ."},"comment":{"url":"https://api.github.com/repos/awesomeWM/awesome/issues/comments/436865507","html_url":"https://github.com/awesomeWM/awesome/issues/2462#issuecomment-436865507","issue_url":"https://api.github.com/repos/awesomeWM/awesome/issues/2462","id":436865507,"node_id":"MDEyOklzc3VlQ29tbWVudDQzNjg2NTUwNw==","user":{"login":"Elv13","id":340384,"node_id":"MDQ6VXNlcjM0MDM4NA==","avatar_url":"https://avatars0.githubusercontent.com/u/340384?v=4","gravatar_id":"","url":"https://api.github.com/users/Elv13","html_url":"https://github.com/Elv13","followers_url":"https://api.github.com/users/Elv13/followers","following_url":"https://api.github.com/users/Elv13/following{/other_user}","gists_url":"https://api.github.com/users/Elv13/gists{/gist_id}","starred_url":"https://api.github.com/users/Elv13/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Elv13/subscriptions","organizations_url":"https://api.github.com/users/Elv13/orgs","repos_url":"https://api.github.com/users/Elv13/repos","events_url":"https://api.github.com/users/Elv13/events{/privacy}","received_events_url":"https://api.github.com/users/Elv13/received_events","type":"User","site_admin":false},"created_at":"2018-11-08T03:58:03Z","updated_at":"2018-11-08T03:58:03Z","author_association":"MEMBER","body":"Try https://github.com/elv13/collision, it has multiple modes to navigate clients. Maybe you will like one of them \"enough\" (and no, it doesn't integrate with the tasklist)"}}
{"actor":{"display_login":"Elv13"}}