Battery status API in macOS?
If you’re looking for a quick way to query it from the command line, you’ll find the pmset command helpful. To query the battery status, specifically, use: $ pmset -g batt
If you’re looking for a quick way to query it from the command line, you’ll find the pmset command helpful. To query the battery status, specifically, use: $ pmset -g batt
Checkout command line tools for Xcode from apple. It’s official support from apple to only create the command line tools.
Update: Starting with macOS Big Sur (11.0), sed now does support the I flag for case-insensitive matching, so the command in the question should now work (BSD sed doesn’t reporting its version, but you can go by the date at the bottom of the man page, which should be March 27, 2017 or more recent); … Read more
As others pointed out, this message is coming from your shell prompt. The problem is that in a freshly created repository HEAD (.git/HEAD) points to a ref that doesn’t exist yet. % git init test Initialized empty shared Git repository in /Users/jhelwig/tmp/test/.git/ % cd test % cat .git/HEAD ref: refs/heads/master % ls -l .git/refs/heads total … Read more
Found by experimentation, and inspecting the command lines generated by Xcode for a reference rpath demo project by Dave Driblin: otool -L shows you the install name of the linked libraries. To get @rpath to work, you need to change the install name of the library: $ gcc -dynamiclib blah.o -install_name @rpath/t/libblah.dylib -o libblah.dylib $ … Read more
MAMP Folks just posted the workaround Workaround for the 10.10 Preview 5 bug: Rename the file “envvars” located in /Applications/MAMP/Library/bin into “_envvars” Test Update: It works! Works for Yosemite release too!
Looks like you need to uncomment the following: #LoadModule userdir_module libexec/apache2/mod_userdir.so and #Include /private/etc/apache2/extra/httpd-userdir.conf Then in httpd-userdir.conf you may need to uncomment: #Include /private/etc/apache2/users/*.conf Lastly you would need to create /private/etc/apache2/users/kevin.conf if it doesn’t exist. I think it should look something like this: <Directory “/Users/kevin/Sites/”> Options Indexes MultiViews AllowOverride None Require all granted </Directory> Make … Read more
Swapping CTRL and CAPS LOCK Go into System Preferences Enter the Keyboard & Mouse preference pane In the Keyboard tab, click Modifier Keys… Swap the actions for Caps Lock and Control. Using ALT/OPTION as META In the menu bar, click Terminal Click Preferences… Under the Settings tab, go to the Keyboard tab Check the box … Read more
Use the xattr command. You can inspect the extended attributes: $ xattr s.7z com.apple.metadata:kMDItemWhereFroms com.apple.quarantine and use the -d option to delete one extended attribute: $ xattr -d com.apple.quarantine s.7z $ xattr s.7z com.apple.metadata:kMDItemWhereFroms you can also use the -c option to remove all extended attributes: $ xattr -c s.7z $ xattr s.7z xattr -h … Read more
To clear the terminal manually: ⌘+K Command+K for newer keyboards To clear the terminal from within a shell script; /usr/bin/osascript -e ‘tell application “System Events” to tell process “Terminal” to keystroke “k” using command down’