Jump to content

glawrie

Member
  • Posts

    22
  • Joined

  • Last visited

Posts posted by glawrie

  1. For ages there has been an excellent workflow (Gauth) that provides a simple TFA/OTP generating interface - which is amazingly useful once you get it working.  However it is one of the PY2 workflows that is difficult to get working with newer versions of macOS - the latest macOS / XCode updates have broken the hacked py3 version that somene created from the original again ...

     

    Given how pervasive TFA/OTP schemes are right now (and increasingly so) it maybe is now time to build this kind of function into the Alfred Core. I can see several benefits that would acrue from so doing:

    • It would be faster - the PY version (particularly on first load after a boot) is quite slow (when it works)
    • It would continue to work when macOS updates - difficult to over state how useful this is ...
    • It could possibly store its secrets in the macOS keychain - Gauth saves them into a plain-text file which is possibly not the most secure approach
    • It could be built into other workflows
    • It is really not complicated to do (utility libraries to support generating the requisite codes exist for most languages it seems)

     

    Fingers crossed that this idea gains some support - I think implementing this would be a big step up.

  2. Looks like Alfred 5 breaks this add-on :(

     

    After updating to Alfred 5 (and while using the Python 3 version of Gauth Workflow) the workflow fails.

     

    Turned on the debug and the error relates to something called `readPlist` (I'm not a python speaker)... here's the error log:

     

    [16:47:54.532] Logging Started...
    [16:48:04.291] Google Authenticator[Script Filter] Queuing argument ''
    [16:48:04.400] Google Authenticator[Script Filter] Script with argv '(null)' finished
    [16:48:04.403] ERROR: Google Authenticator[Script Filter] Code 1: Traceback (most recent call last):
      File "/Users/glawrie/Sync/AppSync/Alfred.alfredpreferences/workflows/user.workflow.1D847186-5E7D-4AC8-B2A3-B6032E5FD5A7/workflow.py", line 7, in <module>
        import alfred
      File "/Users/glawrie/Sync/AppSync/Alfred.alfredpreferences/workflows/user.workflow.1D847186-5E7D-4AC8-B2A3-B6032E5FD5A7/alfred.py", line 22, in <module>
        preferences = plistlib.readPlist('info.plist')
    AttributeError: module 'plistlib' has no attribute 'readPlist'

     

    Does anyone know what needs to be done to fix?

  3. So one step forward, one back...

    • Getting Alfred to find python is relatively painless, open the workflow in alfred workflow panel and click on the gauth Script Filter tile and change 'python' to 'python3', and then repeat this with the fourth of the 'run script' tiles in the second column.  On my system at least doing that gets Alfred actually running the python.
    • Fixing the python scripts to run under python 3... haven't got that going yet.  Running 2to3 and fixing the file open lines simply push the fail to a later error.  Where I am currently is trying to work out what is causing this problem
    • Quote

        File "gauth.py", line 198, in <module>
          main(action=alfred.args()[0], query=alfred.args()[1])

      which appears to be not passing meaningful information (so there is something wrong with the alfred.args values... )

     

  4. I did a bit of digging and turned on Alfred debugger: couple of issues

    1. Some modifications are needed to the python scripts to work with Python 3
    2. Alfred is reporting that it is not able to find python even though it is installed

    I am not so good with Python and I have not tracked down all the issues between Python 2 and 3, but seems they are more complex than just runing 2to3 on the files.

    For example line 20 of the file alfred.py

    preferences = plistlib.readPlist('info.plist')

    Needs to become

    with open('info.plist','rb') as fp:
      preferences = plistlib.load(fp)

    But to get beyond this requires getting Alfred to recognise that python is installed... not sure what modification is needed - on my system python is installed and typing `python gauth.py` into zsh triggers processing of the file via python - but the same from within Alfred fails.

    If anyone has guidance on how to get Alfred to recognise that python is installed... that would be a helpful addition...

     

     

  5. Gauth workflow has stopped working on my system following update to macOS (12.3). Have tried reinstalling the workflow but without success. Gauth add sort-of works - in that you are prompted for a new secret - but nothing happens if you then enter any data. Normal use of guath simply doesn't happen - the option appears in Alfred as you type Gauth... but when you hit space after the keyword you get bounced to entering text for search-engine search.

    Using Alfred 4.6.4 [1293] - Gauth was working fine with this version before macOS update, so currently suspicion is that it is the macOS version that is behind issue.

     

    Anyone got any insights? Anyone see the same issues?

  6. I use a keyboard that for reasons unknown is unable to send the media key codes successfully to macOS - hitting play/pause works to play/pause the currently selected media app, but hitting "next" or "prev" media keys does nothing.

    If I simulate these keypresses using the macos "keyboard viewer" app then the media apps all respond correctly - but opening the keyboard viewer simply to skip a track is tedious, and I don't have the screen space free to leave the viewer visible all the time.

    My keyboard provider (logitech) is not so far able to rectify the issue - so while I wait I thought maybe I could use Alfred to send the appropriate media key presses to the macos system in response to a command.

    Unfortunately the mini-player in Alfred is tied to the Music app and I'm using something else.

    Is there a way to get Alfred to do this?

    Thanks in advance for any help.

  7. 36 minutes ago, glawrie said:

    Any ideas?

    Sort of wondering about the line 62 in gauth.py

    secret = secret.ljust(int(math.ceil(len(secret) / 16.0) * 16), '=')

    The secret I'm getting from Amazon (that works in other authenticators) is 52 chars long - which means that secret after this step has 12 `=` symbols at the end - maybe this not playing nicely with your staged processing of the key (as the final step in the revised approach receives '========' as the input in the amazon case).

    Or maybe it is OK... but regardless, if anyone has thoughts on how this might be fixed I'd value the input.

  8. On 3/28/2020 at 6:47 PM, TomekB said:

     

    I have fixed that by replacing key decoding in two places in gauth.py

     

    
            key = base64.b32decode(secret[0:8], casefold=True)
            key = key + base64.b32decode(secret[8:16], casefold=True)
            key = key + base64.b32decode(secret[16:24], casefold=True)
            key = key + base64.b32decode(secret[24:32], casefold=True)
            key = key + base64.b32decode(secret[32:40], casefold=True)
            key = key + base64.b32decode(secret[40:48], casefold=True)
            key = key + base64.b32decode(secret[48:56], casefold=True)
            key = key + base64.b32decode(secret[56:64], casefold=True)

    As longer key seems to be not supported by b32decode.

     

    Thanks for posting.  Have tried to get this to work, but even after pasting in the alternative code I still cannot get Amazon OTP secret to be recognised.  If I add the amazon code that works in other OTP solutions direct ~/.gauth the amazon entry does not show up, if I try to add via Alfred (the Gauth Add thing) the workflow reports an error in the format of the submission.

    Any ideas?

  9. I am having trouble with spotlight on my 2015 MBA 13.  Running macOS 10.15.3.  Someone suggested I use the Alfred metadata reset to trigger a reindex of spotlight.

     

    I am running Alfred 4.0.8 with powerpack.

     

    I started the process to reset meta data, and clicked on the option to delete the spotlight V100 file.  When I got to the part where I authorise the deletion I got this result...

    Attempting to delete .Spotlight-V100...
    
    Password:
    rm: /System/Volumes/Data/.Spotlight-V100: Operation not permitted
    
    Requesting metadata reindex...

    It fails.  The user account has full permissions (I can get SUDO -S to work from a terminal window), so it should have worked.  My guess is that the difference is that Catalina introduces "Read Only" system volume feature (see description here).

     

    I think this might be somewhere / something that needs an update - but of course maybe I'm just doing it wrong.

     

    Grateful for any advice.

     

     

  10. On 10/12/2019 at 8:11 AM, Walker said:


    Okay, for other peoples' reference: 

    I fixed it by adding one more permission that I missed in System Preferences.   Following the instructions completely from here helped me find the one box that needed to be checked:

    https://www.alfredapp.com/help/getting-started/permissions/#integration

     I have the same issue (typing ens followed by space sends Alfred away from running the Evernote script).

    So I went to check the permissions, and Alfred is not showing up in the automation part of the privacy options.

    Clicking on the Open macos Automation Preferences button in Alfred's Settings / General tab does not help - it takes me to the appropriate part of system preferences, but there does not appear to be any way to add Alfred to the list of things with permission.

    Can anyone offer any guidance on what I can do to correct this?

    Thanks!

    (running macos 10.14.6, Alfred 4.0.8 with powerpack, Evernote 7.1.3 direct)

  11. Sorry - I mis-spoke.  It is not reverse order it is actually some weird random-ish order that I don't really understand.  The event that finally got me to post a question was indeed apparently the creation of a list in reverse track order, but actually on deeper testing it seems Alfred is creating a playlist that has all the tracks for each album consecutively, but the tracks within each album and the albums appear in some kind of random order.  Shuffle is not turned on, and they do not appear to be being sorted by some unseen value (e.g. date).

     

    Unfortunately it is hard to show this with pictures - as iTunes does not show track numbers in playlists (at least I can't get it to).  But the two here show part of the album / date order listing for a band on my system, followed by the playlist that Alfred generated when I asked it to play all the albums by that band (so itunes mini / artists / play all in alfred).  You can see the Alfred list is beginning with an album that is not 'first in the date list'.  If you check, you'll also see that the tracks from "The Bends" (the one Alfred is playing first) are in random order... 

     

    I've checked, and shuffle is turned off in my copy of iTunes.

     

    HTH

     

    The multi-playlists thing?  Yes I'm syncing to several other devices, so I guess it might be a sync issue.

     

     

    Screen Shot 2017-10-27 at 11.37.44.PNG

    Screen Shot 2017-10-27 at 11.37.35.PNG

  12. Not really used it much before, but noticed tonight that when using iTunes mini to start playing 'an artist' it is adding their albums with the tracks in reverse order.  

    I'm guessing that this is an unwelcome interaction between Alfred settings and iTunes settings, but can't work out how / what / where to go to fix it.

    Any suggestions / guidance would be great.

    Also - probably a forlorn hope - is there any way to get iTunes to play things from Alfred without creating a spam playlist?  Tedious to have to go and delete them periodically.

  13. I regularly use iCloud services.

     

    I've got a very simple workflow installed that simply appends the appropriate iCloud service to a request - so 'iCloud mail' will go to the iCloud.com/mail page.

     

    When I enter iCloud into Alfred the iCloud workflow appears as an option in the drop-down list.  But if I select it then it gets run but without any service word added (i.e. it takes me just to iCloud).

     

    I'd much rather have the option to enter enough of iCloud to get it in the list, choose it from the drop down, and then add the appropriate service before it gets acted on by Alfred.  So choosing the suggested workflow replaces the partially typed iCloud and waits more typed input rather than running the workflow.

     

    Is there a way to do this?

     

    (PS I know that I could simply rename the iCloud workflow to be very short ... but wondered if there is a way to this).

  14. Could Alfred have inline conversion functionality = so if you type in 75m one of the solutions offered is various conversions of this to other distance units (e.g. 82.02 ft), based on a guess triggered by the inclusion of some qualifying symbol - so £20 would return currency conversions, 8kg would return weight mass conversions etc. ?

     

    I don't think this idea is very novel - I suspect that someone has thought of it before.  If so, consider this a "+1" for that one.

×
×
  • Create New...