Code Monkey home page Code Monkey logo

Comments (20)

pallotron avatar pallotron commented on May 29, 2024

can you repro this every single time?

from yubiswitch.

TwP avatar TwP commented on May 29, 2024

I tried it twice with the same results. My buddy @zerowidth also had an immediate crash when he fired up the application. We are sitting across the table from each other right now.

from yubiswitch.

pallotron avatar pallotron commented on May 29, 2024

mmm mkay, can you guys trying to delete ~/Library/Preferences/*.yubiswitch.plist and try again?

from yubiswitch.

pallotron avatar pallotron commented on May 29, 2024

Application crashes because of an uncaught Exception:

*** Terminating app due to uncaught exception 'NSInternalInconsistencyException', reason: 'Invalid parameter not satisfying: aKeyEquivalent != nil' abort() called`

I'll dig a bit more in deep tomorrow (I'm on GMT timezone).

from yubiswitch.

TwP avatar TwP commented on May 29, 2024

@pallotron unfortunately there was no ~/Library/Preferences/*.yubiswitch.plist entry to delete 😿

from yubiswitch.

pallotron avatar pallotron commented on May 29, 2024

does the previous release work?

from yubiswitch.

pallotron avatar pallotron commented on May 29, 2024

do you see anything when typing defaults read pallotron.yubiswitch?

e.g.:

$ defaults read pallotron.yubiswitch
{
    hotkey =     {
        characters = "\\U00a5";
        charactersIgnoringModifiers = y;
        keyCode = 16;
        modifierFlags = 1572864;
    };
    startAtLogin = 1;
    switchOffDelay =     {
        enabled = 1;
        interval = "10.0";
    };
}

from yubiswitch.

pallotron avatar pallotron commented on May 29, 2024

try to replace ~/Library/Preferences/pallotron.yubiswitch.plist with a copy taken from http://blog.angelofailla.com/download/pallotron.yubiswitch.plist

from yubiswitch.

TwP avatar TwP commented on May 29, 2024

Here are the steps I took based upon your suggestions and the results for each step.

Defaults

➙ defaults read pallotron.yubiswitch
2014-03-24 09:29:05.252 defaults[9883:507] 
Domain pallotron.yubiswitch does not exist

Release v0.3

This release did work. I was able to enable / disable the yubikey nano. After installing this release there were defaults installed under the pallotron.yubiswitch domain. There was also a .plist file in the ~/Library/Preferences folder.

Release v0.5

With the success of the previous release I installed v0.5, and it still crashed immediately upon startup with the same NSInternalInconsistencyException.

New .plist File

With v0.5 installed, I downloaded the .plist file from the link you provided and installed it to ~/Library/Preferences/pallotron.yubiswitch.plist. The same crash on startup happened.

So v0.5 is simply not working for whatever reason on this machine 😢

from yubiswitch.

pallotron avatar pallotron commented on May 29, 2024

meh,
ok i'll send you a dmg later that will catch and ignore that NSInternalInconsistencyException exception. i'm curious to know if ignoring that exception will get you a working application.

from yubiswitch.

zerowidth avatar zerowidth commented on May 29, 2024

I was able to reproduce the same error, including after each step that @TwP tried.

I don't know ObjC very well, but I poked around with the debugger and isolated the problem to this line: https://github.com/pallotron/yubiswitch/blob/master/yubiswitch/AppDelegate.m#L107-L108

        NSDictionary* hotkey = [[NSUserDefaults standardUserDefaults]
                                dictionaryForKey:@"hotkey"];

When this runs, it's getting nil from NSUserDefaults for that "hotkey" key, and the subsequent call to set the menu item key equivalent fails because there's no value:

        [[statusMenu itemAtIndex:0]
         setKeyEquivalent:[hotkey valueForKey:@"charactersIgnoringModifiers"]];

I don't know how the NSUserDefaults system works or how your computer got a "hotkey" dictionary set, but it would appear that neither my nor @TwP's computers have a value there.

from yubiswitch.

pallotron avatar pallotron commented on May 29, 2024

Sorry for the delay in responding.
I've created a dmg in which I added the default values for the hotkey dictionary at https://github.com/pallotron/yubiswitch/blob/master/yubiswitch/DefaultPreferences.plist as showed below.
Can you please download the dmg at http://blog.angelofailla.com/download/yubiswitch_0.5.dmg then install it and let me know if it works?

+       <key>hotkey</key>
+       <dict>
+               <key>charactersIgnoringModifiers</key>
+               <string>y</string>
+               <key>keyCode</key>
+               <integer>16</integer>
+               <key>characters</key>
+               <string>\U00a5</string>
+               <key>modifierFlags</key>
+               <integer>1572864</integer>
+       </dict>

from yubiswitch.

pallotron avatar pallotron commented on May 29, 2024

if you install that dmg and it works, then go to preference, change the hotkey or any other parameter, then quit the app and you should see the preference file appearing in your ~/Library path

from yubiswitch.

TwP avatar TwP commented on May 29, 2024

@pallotron happy to report that the new application works!

from yubiswitch.

pallotron avatar pallotron commented on May 29, 2024

#successkid

i'll commit and push to the remote repo now :)

from yubiswitch.

pallotron avatar pallotron commented on May 29, 2024

released 0.6 -> https://github.com/pallotron/yubiswitch/releases/tag/v0.6

thanks people and sorry if it took so long. enjoy!

from yubiswitch.

zerowidth avatar zerowidth commented on May 29, 2024

thank you!

from yubiswitch.

zerowidth avatar zerowidth commented on May 29, 2024

As a follow-up, the new applescript support means I can put an "KeyOn" command in my ssh aliases for servers that require yubikey, saving me clicks and typing. Such a great tool, thanks for sharing it!

from yubiswitch.

pallotron avatar pallotron commented on May 29, 2024

@zerowidth : do you use a LocalCommand setting in ~/.ssh_config or just an alias or bash function?

from yubiswitch.

zerowidth avatar zerowidth commented on May 29, 2024

I run it as part of a bash function to run it before the ssh command. AFAIK LocalCommand wouldn't run until the ssh session was completely established, which requires my yubikey...

from yubiswitch.

Related Issues (20)

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.