Added sharedtags-greedyview to recipes#126
Added sharedtags-greedyview to recipes#126dakling wants to merge 9 commits intoawesomeWM:masterfrom dakling:master
Conversation
| The process of setting up this script is as follows: | ||
|
|
||
| 1. Create a file called `sharedtags-greedyview.lua` in your file system (preferably in | ||
| awesome's folder) with the [[script|xrandr.lua]] content. |
| * [Collision geometric navigation keybindings](https://github.com/Elv13/collision) | ||
| * [Tyrannical dynamic tag managment framework](https://github.com/Elv13/tyrannical) | ||
| * [Repetitive dynamic keybindings and macros](https://github.com/Elv13/repetitive) | ||
| * [Alternative tag management for multiple screens](https://github.com/dakling/awesome-sharedtags) |
There was a problem hiding this comment.
Either
- This links to GitHub and the previous commits that add (basically) a local copy of the GitHub contents should go.
- This links to
recipes/sharedtags-greedyviewinstead.
Right now, the content added in the previous commits is not linked from anywhere and so could as well be removed.
| -- screen. If they are not, accessing the tags will result in an error. It | ||
| -- doesn't make sense to fix the error, since clients on the now-hidden tags | ||
| -- will automatically be moved to a tag on a visible screen. | ||
| s:connect_signal("removed",function() |
There was a problem hiding this comment.
These two signal connections can be replaced with just capi.screen.connect_signal("removed", function(s).
| else | ||
| awful.tag.viewtoggle(tag) | ||
| end | ||
| end |
There was a problem hiding this comment.
Uhm... assuming I understood this correctly, this is the same as awful.tag.viewmore(seltags, s), except that it does not mess up the tag history as badly.
|
|
||
| for i,t in ipairs(def) do | ||
| tags[i] = awful.tag.add(t.name or i, { | ||
| screen = (t.screen and t.screen <= capi.screen.count()) and t.screen or capi.screen.primary, |
There was a problem hiding this comment.
What's up with t.screen <= capi.screen.count()? That seems (a) pointless (if screens are numbers) or (b) broken (if screen objects are used, which I think is actually the case).
| -- greedyview xmonad-style | ||
| if tag.selected then | ||
| local newsel = screen.selected_tag | ||
| newsel.screen = oldscreen |
There was a problem hiding this comment.
Why do this in two lines instead of just screen.selected_tag.screen = oldscreen?
| newsel.screen = oldscreen | ||
| end | ||
| local oldsel = oldscreen.selected_tag | ||
| tag.screen = screen |
| --else | ||
| -- NOTE: A bug in awesome 4.0 is causing all tags to be deselected | ||
| -- here. A shame, but I haven't found a nice way to work around it | ||
| -- except by fixing the bug (history seems to be in a weird state). |
There was a problem hiding this comment.
Huh? Does the comment mean this was fixed in 4.1?
| end | ||
| end | ||
|
|
||
| return setmetatable(sharedtags, { __call = function(...) return sharedtags.new(select(2, ...)) end }) |
There was a problem hiding this comment.
Why the select trick instead of just __call = function(self, args) return sharedtags.new(args) end (which is IMO more readable).
| local sharedtags = { | ||
| _VERSION = "sharedtags v1.0.0 for v4.0", | ||
| _DESCRIPTION = "Share tags for awesome window manager v4.0 with greedyview", | ||
| _URL = "https://github.com/dakling/dakling/awesome-www", |
There was a problem hiding this comment.
Oh and: Is it a good idea to leave the URL in? It seems like this file was copied around and possibly changed at least four times since it was on that URL.
link to this repository directly
Implemented suggested changes
|
Thanks for the suggestions, I tried to change everything you mentioned. I am not really a trained programmer though, and the code is almost entirely written by someone else, so not sure if I did a good job. (In case this is wasting too much of your time, feel free to simply dismiss the pull request) |
This recipe allows to use tags differently in multiple monitor setting. The behaviour resembles xmonad's default behaviour. More information can be found in the description.