-
Notifications
You must be signed in to change notification settings - Fork 34
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Added sharedtags-greedyview to recipes #126
base: master
Are you sure you want to change the base?
Conversation
recipes/sharedtags-greedyview
Outdated
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. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why xrandr.lua
?
recipes.mdwn
Outdated
@@ -37,6 +37,7 @@ to improve your Awesome setup. | |||
* [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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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-greedyview
instead.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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).
recipes/sharedtags-greedyview.lua
Outdated
-- greedyview xmonad-style | ||
if tag.selected then | ||
local newsel = screen.selected_tag | ||
newsel.screen = oldscreen |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why do this in two lines instead of just screen.selected_tag.screen = oldscreen
?
recipes/sharedtags-greedyview.lua
Outdated
newsel.screen = oldscreen | ||
end | ||
local oldsel = oldscreen.selected_tag | ||
tag.screen = screen |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Same question as above
recipes/sharedtags-greedyview.lua
Outdated
--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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Huh? Does the comment mean this was fixed in 4.1?
recipes/sharedtags-greedyview.lua
Outdated
end | ||
end | ||
|
||
return setmetatable(sharedtags, { __call = function(...) return sharedtags.new(select(2, ...)) end }) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why the select
trick instead of just __call = function(self, args) return sharedtags.new(args) end
(which is IMO more readable).
recipes/sharedtags-greedyview.lua
Outdated
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.