aĪ small collection of useful functions written by me and found on the internet. Show the song playing on KINK's ( ) livestream when you press ⌘ + ⌥ + K. The menu includes two items "Nu op TV" and "Straks op TV" showing the shows currently playing and up next for all your favorite channels. Clicking on the name of a show for which an alert was set disables the alert. A list of all alerts set is available in the menu as well. If "Alarmgeluid" is on, a sound will be played as well. This script will save a file called tvmenu_nf in your hammerspoon directory (typically ~/.hammerspoon) to store which channels are marked as favorite.īy clicking on a tvshow you can set a popup alert for the start of the show. People use it for all sorts of automations, with key remappings and quick window switchers being the most common applications. It will then be added at the top of the menu, and all scheduled tvshows starting with the one currently playing are shown in that menu. Hammerspoon is a macOS automation framework that allows you to hook into all sort of OS interfaces using Lua scripts. The first time you launch the script the list of favorite channels is empty, so click on "Kanaal toevoegen" and pick a channel from the list. In the example below, argument token_github is the name of the password stored in the login keychain. a provides the token_keystroke function to generate keystrokes for a generated token generated with a specific seed. So instead of scheduling a task to run each minute to check what the wifi network is, when a wifi event happens the OS API that youre registered to triggers a call to your task. Create a new password, store a Google Authenticator token seed (a 16-byte string) One benefit that hammerspoon brings is it bridges the gap between your scripts/tasks and operating system APIs.Open Keychain and select the login chain.a - a slightly modified version of a by imzyxwvu to work with Lua 5.3 and use basexx and hs.hash.The a module requires the following modules, which are also included in this repository: OSX' Keychain is used for safe storage of the token seed. This way you can enter TOTP tokens without having to remove your hands from the keyboard. However, the watcher already provides you with the. For example: hs.application.get (appName):kill (). You would have to instantiate a new object first to be able to call its kill method. You used the global module hs.application and tried to call an object method :kill () from it. This script retrieves a Google authenticator token seed from OSX's Keychain, generates keystrokes for the current TOTP token. your code is pretty much right, there is only one mistake. a - a menubar showing a TV guide for (mostly) Dutch channels.Use OSX Keychain to store the token seed. a - calculate a Google authenticator token value and generate keystrokes for it.I hope that’s a starting point, more an ELI12, but maybe a start.This is a collection of my Hammerspoon scripts. (This basically solves one of the issues with Aleph - despite all the work to make things more straightforward, you still had to write a bunch of C to write apps). But: my bet would be it then lets end-users write scripts/apps/whatever the term will be in Lua, if you’d like. It’s probably a lot of C, and it’s all sat atop Linux. So: Norns itself is probably not written in Lua. But once they’ve written that, anybody can access that functionality through the TT language as an end-user. To add new functions to it, developers write some C. So here, Teletype, if you know it, is a good example: Teletype itself is written in C. (In the games example - the engine developers can add things that can be controlled by the Lua, and return data to it). But just like the games example, if the DSP-type hooks are exposed, you could control DSP with it. Im trying to write a fairly simple script for Hammerspoon where I am looping through a table of app windows. One place you see it a lot is the games industry: the games engines are all C#/C++, but they often expose Lua as a scripting language for level designers to just drop things in ad-hoc, and so that scripting changes can be made very quickly - because it’s interpreted, you don’t need to run compilation for every alteration, just reload the scripts. Lua is particularly popular because the interpreter is very small can be embedded inside C programs. It is close-ish to what I’d call a ‘curly brace language’. It is a long while since I’ve written any, so take this all with a pinch of salt. It has things like data structures and loops and logic and so forth. Lua is a simple scripting language - it’s not particularly complex to use, but it’s more like a language like Javascript than like, say, the Teletype script language.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |