Skip to content

Instantly share code, notes, and snippets.

@frioux
Last active May 24, 2019 15:10
Show Gist options
  • Save frioux/32e522db49cc39b35ae7e007ef65119e to your computer and use it in GitHub Desktop.
Save frioux/32e522db49cc39b35ae7e007ef65119e to your computer and use it in GitHub Desktop.
debugging
sharetags = require("sharetags")
local function screen_tag_state(s)
for i, t in ipairs(s.selected_tags) do
local activated = "NOT"
if t.activated then
activated = "IS"
end
print("AC: screen " .. s.index .. " has tag " .. t.name)
end
end
print("AC: client swapping 1 and 2")
screen_tag_state(screen[1])
screen_tag_state(screen[2])
sharetags.swap_screen(screen[1], screen[2])
print("AC: client swapping 1 and 2 again")
screen_tag_state(screen[1])
screen_tag_state(screen[2])
sharetags.swap_screen(screen[1], screen[2])
print("AC: should be back where we started")
screen_tag_state(screen[1])
screen_tag_state(screen[2])
screen.connect_signal("tag::history::update", function(s)
for i, t in ipairs(s.selected_tags) do
print("screen " .. s.index .. " has tag " .. t.name)
end
end)
client.connect_signal("request::activate", function(c, ctx, hints)
print("client " .. c.window .. " requested " .. ctx)
end)
AC: client swapping 1 and 2
AC: screen 1 has tag 1
AC: screen 2 has tag 2
moving tag 2 to screen 1
screen 1 has tag 2
moving tag 1 to screen 2
screen 1 has tag 2
screen 1 has tag 1
screen 1 has tag 2
AC: client swapping 1 and 2 again
AC: screen 1 has tag 1
AC: screen 1 has tag 2
moving tag 1 to screen 2
screen 1 has tag 1
moving tag 2 to screen 2
screen 1 has tag 1
screen 1 has tag 1
screen 1 has tag 2
AC: should be back where we started
AC: screen 1 has tag 1
AC: screen 1 has tag 2
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment