GithubHelp home page GithubHelp logo

slacktv's People

Contributors

pda avatar

Watchers

 avatar  avatar

slacktv's Issues

Quit command

@botname: quit should quit Chrome.

That would temporarily work around issues like #1 (quit and then load a URL) and other issues like tab accumulation and solving strange states like Chrome being off-screen.

In the long run, finer-grained control over Chrome is required.

Control Chrome with JXA (osascript -l JavaScript)

Currently open(1) is used to launch URLs in Chrome. There's a number of problems with this:

  • Tabs accumulate; each open creates a new tab.
  • If Chrome is already running, it wont enter presentation/kiosk mode.
  • Sometimes open pushes full-screen Chrome onto an invisible desktop.
  • There's no way to refresh/reload the currently URL.
  • There's no good way to quit Chrome.

Instead, OSA / [JXA]([osascript -l JavaScript][osascript]) should be used to control Chrome.

Go's text/template could be used to generate the JavaScript, or it could be static (and possibly pre-compiled) and parameterized for URLs etc.

Some examples / notes:

chrome = Application("Google Chrome");
chrome.activate()
win = chrome.windows[0]; // may not work if running with zero windows.
tab = win.tabs[win.activeTabIndex() - 1];
tab.url = "http://99designs.com/"
tab.reload()
chrome.quit()

An alternate IPC/RPC mechanism would be required for other platforms like GNU/Linux.

Refresh / Reload command

Commands @botname: refresh and @botname: reload should trigger a browser refresh. This probably requires something like AppleScript / OSA / JavaScript for Automation or something, rather than the currently used and very limited open command.

launchd integration

It should be possible to install slacktv as a launchd agent/thing, so that it runs when Mac OS boots.
Ideally something like slacktv --install-launchd or slacktv --install-launchd="SECRET-SLACK-TOKEN-HERE" would take care of this.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.