Skip to content
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

Open
wants to merge 9 commits into
base: master
Choose a base branch
from
Open

Added sharedtags-greedyview to recipes #126

wants to merge 9 commits into from

Conversation

dakling
Copy link

@dakling dakling commented Apr 30, 2018

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.

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.
Copy link
Member

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)
Copy link
Member

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()
Copy link
Member

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
Copy link
Member

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,
Copy link
Member

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).

-- greedyview xmonad-style
if tag.selected then
local newsel = screen.selected_tag
newsel.screen = oldscreen
Copy link
Member

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?

newsel.screen = oldscreen
end
local oldsel = oldscreen.selected_tag
tag.screen = screen
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Same question as above

--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).
Copy link
Member

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?

end
end

return setmetatable(sharedtags, { __call = function(...) return sharedtags.new(select(2, ...)) end })
Copy link
Member

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).

@psychon psychon requested a review from Elv13 April 30, 2018 10:32
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",
Copy link
Member

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.

@dakling
Copy link
Author

dakling commented Apr 30, 2018

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)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants