vitor Posted September 2, 2014 Share Posted September 2, 2014 This workflow is officially deprecated. Call macclean and your keyboard will be temporarily locked (for seconds_to_lock in the Workflow Environment Variables) so you can clean it at will without messing what you’re doing. The workflow will give you a timer of how many seconds are left to unlock and a notification when it’s done. You will be asked for your password when locking since this operation requires elevated privileges (which is a good thing). Do keep in mind that if something goes wrong in the process you may need to forcefully restart your machine. That is very unlikely and I’ve been using this for quite some time without any issues, but you should be aware of it. Download | Source forgetfulfellow and surrealroad 2 Link to comment
vitor Posted September 17, 2014 Author Share Posted September 17, 2014 Update. Sometimes BetterTouchTool could lose some functionality and need to be restarted, after using this, so it’ll now do it for you, if you have it installed and running. Link to comment
kwehner57 Posted September 17, 2014 Share Posted September 17, 2014 Does this only work with an internal keyboard? I'm using a USB keyboard connected to my MacBook Pro and it's not locking when I invoke the workflow. Link to comment
vitor Posted September 17, 2014 Author Share Posted September 17, 2014 I don’t have other keyboards to test it on, so I can’t add such a feature reliably. However, that never struck me as a problem: with an external keyboard, you can simply disconnect it. The workflow was made with the keyboards you can’t do that to in mind. Link to comment
cands Posted September 22, 2014 Share Posted September 22, 2014 Thanks this is very convenient, I used to shut down to clean... Works great for me Link to comment
rice.shawn Posted September 30, 2014 Share Posted September 30, 2014 Does this only work with an internal keyboard? I'm using a USB keyboard connected to my MacBook Pro and it's not locking when I invoke the workflow. Whenever I clean my USB or Bluetooth keyboards, I just unplug/take out the batteries, then I put them under the sink (or take them into the shower) and wash them out really well. It sounds scary, but as long as they're off and you give them more than enough time to dry, then they're just fine. Put a fan on them for half a day. I really wouldn't recommend that, however, for laptop. Also, if you break your keyboard after doing this, I'm not responsible. Link to comment
smarg19 Posted September 30, 2014 Share Posted September 30, 2014 This workflow isn't functioning for me. In trying to figure out why, I also found that the workflow has no way to report errors in the only "real" step, the shell script. That aside, I tried simply to run this shell command in Terminal: sudo kextunload -bundle-id com.apple.driver.AppleUSBTCKeyboard And I got this error: (kernel) Kext com.apple.driver.AppleUSBTCKeyboard not found for unload request. Failed to unload com.apple.driver.AppleUSBTCKeyboard - (libkern/kext) not found. How can I fix this and thus fix the workflow? Link to comment
vitor Posted September 30, 2014 Author Share Posted September 30, 2014 smarg19 Could you please download the newest version and try again? If it still does not work, what’re the outputs of (in a terminal) kextstat | grep -i 'keyboard' | awk '{ print $6 }', and kextstat | grep -i 'touch' | awk '{ print $6 }'? In addition, what mac model are you using? Link to comment
mixterdee Posted October 22, 2014 Share Posted October 22, 2014 (edited) It doesn't work for me. I just keep getting a password prompt 'oasscript wants to make changes' Here is my output com.apple.driver.AppleHIDKeyboard com.apple.driver.AppleBluetoothHIDKeyboard & com.apple.driver.AppleMultitouchDriver com.apple.driver.AppleBluetoothMultitouch Macbook Air 2013 Edited October 22, 2014 by MJD Link to comment
vitor Posted October 23, 2014 Author Share Posted October 23, 2014 And what happens after you input the password, MJD? Please do the operation with the debugger open, and post the output. Link to comment
mixterdee Posted October 26, 2014 Share Posted October 26, 2014 (edited) @Vítor the output is here Starting debug for 'MachineClean' [iNFO: alfred.workflow.input.keyword] Processing output 'alfred.workflow.action.script' with arg '' No other information is made available. I trigger the workflow, it asks for my password, it says it will lock for 50 seconds, after 50 seconds I get a message saying it is unlocked. All the while I am able to use trackpad and keyboard. I have tried with and without the bluetooth keyboard and trackpad. Edited October 26, 2014 by MJD Link to comment
vitor Posted November 3, 2014 Author Share Posted November 3, 2014 MJD I was able to briefly get my hands on a Macbook Air (which is why it took me some days to reply, as I knew I was going to get that chance) and reproduce the issue. I could only mess around with it for a few minutes, so I haven’t got a resolution. There are some things I’d like to try, but due to the nature of what this does (unloading kexts) I’d prefer to have something more solid than giving you random commands over the internet to try.That said, if you search online for a way to disable your keyboard/trackpad and find one that works for your Macbook Air (you should be able to try it easily in a terminal), then we should be able to set it up in the workflow without an issue, and I can do it for you. mixterdee 1 Link to comment
mixterdee Posted November 3, 2014 Share Posted November 3, 2014 Thanks for that Vitor. I'll try and find something and come back to you. Link to comment
octothorpe Posted November 3, 2014 Share Posted November 3, 2014 Cool, but you can also just go to the main login screen, which leaves only the password field active. Clean away and then when you're done, clear out the password field and log back in. Link to comment
vitor Posted November 4, 2014 Author Share Posted November 4, 2014 Cool, but you can also just go to the main login screen, which leaves only the password field active. Clean away and then when you're done, clear out the password field and log back in. You can try, but I highly advise against it. I did that in my old MacBook Pro; I also tried logging in to the guest account. In both of those situations (both tried more than once), cleaning the keyboard left me in a state where I couldn’t do anything: the system became frozen and was unrecoverable, except via a forced shutdown. Anecdotal, I know, but that’s why I created the workflow in the first place — way safer for me. Link to comment
forgetfulfellow Posted November 5, 2014 Share Posted November 5, 2014 Wow, I could have never imagined a workflow for this! This perfectly addresses my super-OCD-cleanliness first world problems. Thanks! (Also I could imagine using this to force myself to take a break from my computer) Link to comment
vitor Posted December 27, 2015 Author Share Posted December 27, 2015 Update. It now detects if you’re on a MacBook Air (found a method that does not require connecting to the internet) and prevents you from running the workflow if that is the case. Link to comment
vitor Posted October 5, 2016 Author Share Posted October 5, 2016 Update. It now uses OneUpdater, so this should be the last time you need to manually update. Link to comment
vitor Posted November 9, 2016 Author Share Posted November 9, 2016 Update. It now shows a countdown timer so you know exactly how much time is left. Also, you can no longer give a specific time for locking at run time. Instead, setting your custom time permanently is now easier, via the Workflow Environment Variables To update, download the latest version (same URL) or wait a few days (15 or less) and it’ll prompt you to on next usage, since it uses OneUpdater. Link to comment
flome Posted December 21, 2016 Share Posted December 21, 2016 I'm running MacOS Sierra 10.12.3 and when my countdown timer expires, I never re-gain keyboard functionality even though the notification states that I re-enabled both the keyboard and trackpad. Requires a hard reboot. Link to comment
vitor Posted December 22, 2016 Author Share Posted December 22, 2016 (edited) @flome Tell me about your Mac. With this workflow, that is more important than the OS version. Edited January 6, 2017 by vitor Link to comment
Stu Posted January 6, 2017 Share Posted January 6, 2017 I have this problem too since I upgraded to the new MacBook Pro with touch bar - As @vitor suggests, it's not OS related as I migrated by machine from my old MacBook where machineclean worked to the new one where it fails to unlock the keyboard after the specified time (but the mouse is OK) Link to comment
vitor Posted January 6, 2017 Author Share Posted January 6, 2017 (edited) At this point, I’m getting more inclined to deprecate the workflow. It never worked with MacBook Airs, and now it seems it won’t work with the MacBook Pro with Touch Bar. If you read the issues you’ll see how hard it is to diagnose without access to the specific machine model. With my MacBook where it used to work with El Capitan it seems to be causing kernel panics with Sierra. And it always shows the dialog to connect a bluetooth keyboard, obscuring the countdown. Full-fledged apps can do it, like KeyboardCleanTool. I’m unsure it can be accomplished via CLI without a tool made for it. I’ll continue to look for a solution and update the workflow if I can find it, deprecate it if I don’t. Edited January 6, 2017 by vitor Link to comment
vitor Posted February 16, 2017 Author Share Posted February 16, 2017 Update. No longer thinking about deprecating the workflow. It occurred to me the problems might be caused by the keyboard and the trackpad being locked, causing the OS to think there was no way out. Removed the Trackpad locking, so it now only locks the keyboard. So far it seems to be working fine. To update, download the latest version (same URL) or wait a few days (15 or less) and it’ll prompt you to on next usage, since it uses OneUpdater. Link to comment
cands Posted February 18, 2017 Share Posted February 18, 2017 Thanks for the update. I've been using this workflow for a long time, it's very handy and never had any problems. Even better now with the countdown timer! There is one minor thing that annoys me: since updating to Sierra (I'm pretty sure but not 100% that it started then) I'm prompted to input password ("osascript wants to make changes. Enter your password to allow this") after I call the workflow. I guess this is not the desired behavior? Any tips how to fix this? Link to comment
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now