rankjilo.blogg.se

Hammerspoon app
Hammerspoon app








hammerspoon app
  1. HAMMERSPOON APP UPDATE
  2. HAMMERSPOON APP CODE
  3. HAMMERSPOON APP WINDOWS

Credits to Shantanu Goel who built some cool things with Hammerspoon and his latest post gave me the idea (& motivation) to build this.I have been looking at Hammerspoon to build something for sometime now, and this does not even scratch the surface of whats possible. We create a hotkey combination to manually refresh.We set this function to refresh data every 15 minutes.

HAMMERSPOON APP UPDATE

  • We have a function callGitLab, that calls an API call to fetch the Todos and update the menubar when it is loaded.
  • There are more than 50 alternatives to Hammerspoon for a variety of platforms, including Windows, Mac, Linux, X11 and Google Chrome.

    HAMMERSPOON APP CODE

    The code (IMO) is quite straightforward - At its core, Hammerspoon is just a bridge between the operating system and a Lua scripting engine' and is a Task Automation app in the os & utilities category. doEvery (POLL_INTERVAL_MINUTES * 60, callGitLab ) callGitLab ( ) bind (, "G", function ( ) callGitLab ( ) end ) decode (data ) updateMenuBar (todos ) end ) end asyncGet (GITLAB_TODO_API, headers, function (status, data ) Gl_menu : setClickCallback (onMenuClick ) function updateMenuBar (todos )Ĭounter = 0 for index in pairs (todos ) do URL to open when the menu bar is clicked local MENUBAR_CLICK_URL = "" - GitLab access token to make the API call local GITLAB_TOKEN = "" - TODOs API URL local GITLAB_TODO_API = "" local POLL_INTERVAL_MINUTES = 15 function onMenuClick ( ) I have never written a single line of Lua in my life before, but even then thanks to great documentation by Hammerspoon and the set of extensions already available, it did not take long to make this functional “app”Īfter installing Hammerspoon, open your a file and add the following For those who are not familiar with Hammerspoon, it is a MacOS automation that makes it super easy to interact with the operating system using a Lua Scripting Engine. So, to keep on top of my todos, without having to open GitLab all the time, I created a little Hammerspoon script that simply keeps the count of todos in my MacOS menu bar. A Todo is created anytime an issue is assigned to you, a Merge Request requires your review or someone mentions you in a comment, hence the Todos page serves as a hub for you to figure out what you can help with or what you can work on next. One nice concept that GitLab uses is that of Todos. ☝ Raycast allows defining shortcuts for many actions, including launching apps.įor my MacBook, I used Hammerspoon, a hotkey automation suite for MacOS.At SpotDraft we use self-hosted GitLab to host our source code and manage projects. The simplest one I think is with Raycast. There are many ways this can be achieved in MacOS. ☝ Just a small selection of the shortcuts I use. For something I do hundreds of times a day, it all adds up! 🎉 The result: I save a second of thinking for every app switch I do. For example, ctrl-win-w will always focus my web browser, where alt-tab requires some thinking to figure out how many Tabs to press. I settled a way that’s easier for me: shortcuts that always do one-and only one-thing. cmd-space firefox to use Spotlight (MacOS).alt-tab-tab-tab to switch to a window (Windows and MacOS) All files can be edited, add or modify the elements, change the color, etc.

    HAMMERSPOON APP WINDOWS

  • ctrl-alt-4 using uBar to emulate Windows behaviour (MacOS).
  • win-4 to launch the 4th taskbar app (Windows).
  • I often try one of these, but each one requires some thinking (or typing): Switching with a keyboard always required too much effort for me. Not much, but small frustrations easily add up over time.

    hammerspoon app

    ☝ Has this been as frustrating for me as anyone else? I found a way to make this faster, which has made my workflow a lot more efficient.

    hammerspoon app

    Switching apps is something I do hundreds of times a day on both MacOS and Windows.










    Hammerspoon app