Sha256: 8a34ca3663b7caaeec105e30ea822afc63ce0e5644c8fed114cf1cab7e33e489

Contents?: true

Size: 614 Bytes

Versions: 1

Compression:

Stored size: 614 Bytes

Contents

require "thor"
require "thor/zsh_completion"

require "yaml"
require "json"

module WindowArranger
  class CLI < Thor
    include ZshCompletion::Command

    desc "list", "List windows"
    def list
      windows = WindowArranger::Script.list_windows
      puts windows.to_yaml
    end

    desc "Update", "Update size and position of windows"
    def update
      definitions = YAML.safe_load($stdin.read)
      WindowArranger::Script.update_bounds(definitions).each do |log|
        next unless log["type"] == "update"

        puts "Updated: #{log["definition"]}"
      end
      puts "Done."
    end
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
window_arranger-0.1.0 lib/window_arranger/cli.rb