profile
viewpoint
If you are wondering where the data of this site comes from, please visit https://api.github.com/users/asmagill/events. GitMemory does not store any data, but only uses NGINX to cache data for a period of time. The idea behind GitMemory is simply to give users a better reading experience.

asmagill/hs._asm.undocumented.spaces 139

Spaces Module for Hammerspoon

asmagill/hammerspoon-config 68

hammerspoon configuration

asmagill/hammerspoon_asm.undocumented 45

Hammerspoon and Mjolnir modules utilizing undocumented APIs

asmagill/hammerspoon_asm 38

Hammerspoon modules in progress...

asmagill/hammerspoon-config-take2 27

Paired down config

asmagill/hs._asm.axuielement 21

Accessing Accessibility Objects with Hammerspoon

asmagill/HS_ModuleWalkthrough 15

How I make modules for Hammerspoon

asmagill/hs._asm.guitk 8

Experimental GUI toolkit for Hammerspoon

asmagill/hammerspoon_serial 5

A serial port module for Hammerspoon

asmagill/am335x_bandgap 4

dkms module to add bandgap sensor for cpu temp to BBB

issue closeddrandyhaas/haasmesh

Full image for re-flashing router?

I was attempting to upgrade the firmware with a newer kernel so I could install OpenVPN (kmod_tun for the Archer C7 V2 requires a newer kernel than what's provided) and I've basically borked it... the thing is now stuck in a reboot loop every time I turn it on.

I've ben reading about reinstalling a full openwrt image by holding down the reset/wps button while turning the router on which then tries to poll a tftp server for the image, but the dropbox links in your scripts only seem to refer to the sysupgrade image and I think I need the full image. I'm planning to set up a tftp server when I have access to my windows machine tomorrow and am hoping you have the full image also in your drop box somewhere that I can grab it from... I've got the TP-Link Archer C7 v2 model, and I have the "openwrt-ath79-generic-tplink_archer-c7-v2-squashfs-sysupgrade.bin" file... what I think I need would likely be named something like "openwrt-ath79-generic-tplink_archer-c7-v2-squashfs-factory.bin" or similar.

Can this image be made available somewhere? Or is it, and I've just missed it?

If not, would using the stock 19.07.3 factory image and then upgrading with "openwrt-ath79-generic-tplink_archer-c7-v2-squashfs-sysupgrade.bin" work?

Thanks for any help or advice you can provide.

closed time in a month

asmagill

issue commentdrandyhaas/haasmesh

Full image for re-flashing router?

Thanks, that worked perfectly!

asmagill

comment created time in a month

issue openeddrandyhaas/haasmesh

Full image for re-flashing router?

I was attempting to upgrade the firmware with a newer kernel so I could install OpenVPN (kmod_tun for the Archer C7 V2 requires a newer kernel than what's provided) and I've basically borked it... the thing is now stuck in a reboot loop every time I turn it on.

I've ben reading about reinstalling a full openwrt image by holding down the reset/wps button while turning the router on which then tries to poll a tftp server for the image, but the dropbox links in your scripts only seem to refer to the sysupgrade image and I think I need the full image. I'm planning to set up a tftp server when I have access to my windows machine tomorrow and am hoping you have the full image also in your drop box somewhere that I can grab it from... I've got the TP-Link Archer C7 v2 model, and I have the "openwrt-ath79-generic-tplink_archer-c7-v2-squashfs-sysupgrade.bin" file... what I think I need would likely be named something like "openwrt-ath79-generic-tplink_archer-c7-v2-squashfs-factory.bin" or similar.

Can this image be made available somewhere? Or is it, and I've just missed it?

If not, would using the stock 19.07.3 factory image and then upgrading with "openwrt-ath79-generic-tplink_archer-c7-v2-squashfs-sysupgrade.bin" work?

Thanks for any help or advice you can provide.

created time in a month

startedpikvm/pikvm

started time in 2 months

issue commentHammerspoon/hammerspoon

Cannot get hs.ipc.cli

That actually looks like a potentially useful addition... I can't try it out right now, but if I'm following the logic correctly, you can send in a string or table of strings (like lines in a shell script?) and via applescript it will prompt for the admin password, correct?

z20240

comment created time in 2 months

issue commentHammerspoon/hammerspoon

Cannot get hs.ipc.cli

hs.ipc.cliInstall() requires write access to /usr/local/bin and /usr/local/share/man/man1 to install the command line client and man page. If you've installed Homebrew in its traditional location, this should be taken care of for you; if you're using an M1 Mac, and installed Homebrew in the recommended alternate location, then I think it's using /opt/homebrew instead... you could try hs.ipc.cliInstall("/opt/homebrew") which will leverage the already writable directories and path addition that Homebrew required.

If you're not using Homebrew at all, then you'll need to make the necessary directories writable by you in order to install the links to the command line tool... in a Terminal window, do the following (each line should be entered separately, and enter your password when prompted after the first command):

sudo chgrp admin /usr/local/bin
sudo chmod g+w /usr/local/bin
sudo mkdir -p /usr/local/share/man/man1
sudo chgrp admin /usr/local/share/man/man1
sudo chmod g+w /usr/local/share/man/man1

Now hs.ipc.cliInstall() should work without issue.

z20240

comment created time in 2 months

issue commentHammerspoon/hammerspoon

Crash due to garbage collection

Yeah, eventtaps can be stopped by the system for a variety of reasons, usually due to not responding to events quickly enough or because of some action taken by the user that is considered of higher import... and these messages will be sent to your callback, even if you didn't explicitly list them in the type mask when setting up the tap.

We check for this in hs.eventtap and restart the eventtap; not sure if restarting is appropriate in your case -- depends upon what you're using the eventtap for and for how long; See https://github.com/Hammerspoon/hammerspoon/blob/master/extensions/eventtap/internal.m#L35-L42.

latenitefilms

comment created time in 2 months

pull request commentHammerspoon/Spoons

feat: EmmyLua Spoon

Still working out how the lua-language-server works with the latest version of BBEdit (14 claims to have added support for it), but I did notice that if I put the command hs.loadSpoon("EmmyLua") into my init.lua file, it slows down every reload, not just when changes to the docs have occurred... does this check the last-modified date on the docs.json file and compare it against the annotations? If not, it probably should... I'm not at a place where I can dig into it now, but you should be able to get at the file dates with hs.fs

folke

comment created time in 2 months

issue commentHammerspoon/hammerspoon

Convert a table of hs.drawing.color objects into an NSArray of NSColor objects?

Ack, forgot to push the initial nil to start things off...

     lua_pushnil(L);  /* first key */
     while (lua_next(L, idx) != 0) {
        ... the rest of the code ...
latenitefilms

comment created time in 2 months

issue commentHammerspoon/hammerspoon

Convert a table of hs.drawing.color objects into an NSArray of NSColor objects?

If you know the size of the array (i.e. it will always contain n elements, or the count is passed in as a separate argument) then just iterate through with for or similar and save entities that aren't nil into the array/dictionary.

If you don't know the size, then you have to use lua_next, which is guaranteed to iterate over all elements present in the table, just not in a specific order.

It should also be noted that NSArray can't have nil for an array member, so if you're accepting nil then you'll need a placeholder for those positions in the array corresponding to nil (You can use [NSNull null] for this purpose, but you'll have to remember to check for equality against it later, since [NSNull null] != nil) or use NSMutableDictionary (or NSMutableSet if order doesn't matter) instead.

Using lua_next you can get both the key and the value (but make sure to leave the key on the stack for the next invocation of lua_next)... after lua_next, the value is at the top of the stack (i.e. index = -1) and the key is just under it (i.e. at index = -2). But since you can't guarantee order, and if you're allow for non-existent (i.e. nil) entries, you'd need to use a dictionary, e.g.

NSMutableDictionary *colors = [NSMutableDictionary dictionary] ;

while (lua_next(L, idx) != 0) {
    colors[@(lua_tonumber(L, -2)] = [skin luaObjectAtIndex:-1 toClass:"NSColor"] ;
    // or [colors setValue:[skin luaObjectAtIndex:-1 toClass:"NSColor"]
    //              forKey:[NSNumber numberWithInteger:lua_tonumber(L, -2)]] ;
    
    lua_pop(L, 1) ; // pop value but leave key on stack for `lua_next`
}

// you can later iterate through the dictionary numericaly "in order" with
// something like this:

for (NSInteger i = 1 ; i <= [colors count] ; i++) {
    NSColor colorAtIndex = colors[@(i)] ;
    // or = [colors objectForKey:[NSNumber numberWithInteger:i]]
    
    if (colorAtIndex) {

        // do something with the color
        
    } // else that "position" in the array is empty
}
latenitefilms

comment created time in 2 months

issue commentHammerspoon/hammerspoon

Convert a table of hs.drawing.color objects into an NSArray of NSColor objects?

Looks good! I had forgotten about lua_rawgeti until I was about to press "comment" on my original example, which is why I added it as a last minute note... I didn't have an example of its use in front of me at the time.

I still have hopes of doing a series of documents about writing modules with LuaSkin and I think including things like this will be useful, as it's a little non-intuitive -- while LuaSkin has helpers for grabbing singular NSObject's, it's a little less clear when grabbing an array or table of them (but still easier than with stock lua); and making the distinction between lua_next and lua_rawgeti is an important one as well.

latenitefilms

comment created time in 2 months

issue commentHammerspoon/hammerspoon

Convert a table of hs.drawing.color objects into an NSArray of NSColor objects?

Couple of ways to do it...

If you don't mind making sure that every color sub-table has the key-value pair __luaSkinType = "NSColor", then a regular [skin toNSObjectAtIndex:idx] will work.

A more generic and lenient method is to iterate over the table while building the array...

NSMutableArray *colorArray = [NSMutableArray array] ;

while (lua_next(L, idx) != 0) {
    [colorArray addObject:[skin luaObjectAtIndex:-1 toClass:"NSColor"]] ;
    lua_pop(L, 1) ; // pop value but leave key on stack for `lua_next`
}

(I should note that lua_next may not return the elements in order... though in my experience, as long as the table being iterated over has always been an array (i.e. has never had a non-sequential-or-non-integer key added to the table) it will be. You will probably want to use lua_rawgeti if you need to guarantee order.)

latenitefilms

comment created time in 2 months

push eventasmagill/Spoons

Chris Jones

commit sha dede9e398f1a86bd2941a36d8529c5354fc10519

Limit GitHub Actions to only run on the official Spoons repo, so forks don't get filled with commits that make PRs harder.

view details

Chris Jones

commit sha bd84ca3504c19b03ae2a03491bea62a6953bd341

Fix a typo

view details

Krystof Celba

commit sha c631b6fe2fe1e0d2076e5950c0aa70ca7bb04b71

feat: add ForceTouchMapper spoon (#233)

view details

Spoons GitHub Bot

commit sha 1632f311a65e1a8fc0c95ec95dbb8680d3a7b704

Generate docs for ForceTouchMapper

view details

Spoons GitHub Bot

commit sha 4e9881219e10c543d512b2959850742418fd4708

Add binary package for ForceTouchMapper.

view details

Spoons GitHub Bot

commit sha 4b776f6faff613a77b54d71f2220665de778b893

Update docs

view details

Chris Jones

commit sha 5dddde7b592605c1e8d6d435311a27b7d11b8b1c

Fix a bunch of Spoons that have incorrect docstrings formatting for their function/method descriptions

view details

Spoons GitHub Bot

commit sha 1ea8fb35d2491bad6313edae4e5d445abc52239e

Generate docs for Asana

view details

Spoons GitHub Bot

commit sha 5df48148873c195903a90fb63c556ecec16fdd7b

Add binary package for Asana.

view details

Spoons GitHub Bot

commit sha 2a9db6ac73e35e961ec6536ea49a1075dc80e54c

Update docs

view details

Spoons GitHub Bot

commit sha 89563eab1b29ebac8240fe6c31189b3ee742d173

Generate docs for EvernoteOpenAndTag

view details

Spoons GitHub Bot

commit sha 62dea64daab02771b968c7e42c4fb45fa741520e

Add binary package for EvernoteOpenAndTag.

view details

Spoons GitHub Bot

commit sha 8ceb1e678ce0b73fdcbcaff2a7f63ce6793a35fd

Update docs

view details

Spoons GitHub Bot

commit sha 1bdfe2f24946196f608b98a0a978baefcba80b57

Generate docs for Keychain

view details

Spoons GitHub Bot

commit sha e72c7bca403128f63e09ece8eb1d000cbca701d5

Add binary package for Keychain.

view details

Spoons GitHub Bot

commit sha 2b3a00fcf798fca015fb17ad1e923f045d0477ba

Update docs

view details

Spoons GitHub Bot

commit sha fe220b5179ab9842aebb08b7dc4966c944419928

Generate docs for Leanpub

view details

Spoons GitHub Bot

commit sha 9db00940681b460ce364ac08dba111cfb4468c28

Add binary package for Leanpub.

view details

Spoons GitHub Bot

commit sha c7150ff1fb2c0059d8d1da56e17b4ca1702eb06c

Update docs

view details

Spoons GitHub Bot

commit sha 23de7b793e7ea19b3277c43a2f847f74e0037a33

Generate docs for PersonalHotspot

view details

push time in 2 months

push eventasmagill/hammerspoon-config-take2

asmagill

commit sha a1a21fa438e50ef9f41fd3297eabc8861ae08dbc

more putzing

view details

asmagill

commit sha 4b9f041822771ed148ad9bdaa3fe55843953d695

can't customize toolbars on chooser now... not sure why. for now this gets around my need to, I'll dig later

view details

push time in 3 months

push eventasmagill/hammerspoon-config-take2

asmagill

commit sha decfe2756a63696ce2efa95c2c6e57c133de0e11

justs putzing around

view details

push time in 3 months

issue commentHammerspoon/hammerspoon

Suggestions for debugging an infrequently hanging Hammerspoon?

It might also be instructive to see how much memory Hammerspoon is claiming when it's seeming hung... If it's particularly larger then usual, then it means we've got a memory leak somewhere (it wouldn't be the first time, and I know of at least one in the current release's hs.canvas module that I've posted a fix for, #2901, but it needs a little more testing before it's safe to land).

Open up the Activity Monitor and look at the memory usage for Hammerspoon... it's probably useful to check it every so often so you can get a feel for what your configuration usually looks like, then you have something to compare it to when it hangs.

von

comment created time in 3 months