All Projects → pirate → Mac Keyboard Brightness

pirate / Mac Keyboard Brightness

Licence: mit
🔆 Programmatically get & set the keyboard & display backlight brightness on Macs. Flash your keyboard to the music! (only works on <2015 Macs)

Programming Languages

c
50402 projects - #5 most used programming language

Projects that are alternatives of or similar to Mac Keyboard Brightness

Tqdm
A Fast, Extensible Progress Bar for Python and CLI
Stars: ✭ 20,632 (+11052.43%)
Mutual labels:  terminal, utilities
Wechatcmd
提供微信终端版本、微信命令行版本聊天功能、微信机器人
Stars: ✭ 628 (+239.46%)
Mutual labels:  terminal, mac
Sharpkeys
SharpKeys is a utility that manages a Registry key that allows Windows to remap one key to any other key.
Stars: ✭ 4,402 (+2279.46%)
Mutual labels:  keyboard, utilities
Im Select
Switch your input method through terminal 📟
Stars: ✭ 288 (+55.68%)
Mutual labels:  terminal, mac
Mac Zsh Completions
macOS specific additional completion definitions for Zsh.
Stars: ✭ 79 (-57.3%)
Mutual labels:  terminal, mac
Glorious Demo
The easiest way to demonstrate your code in action.
Stars: ✭ 3,290 (+1678.38%)
Mutual labels:  terminal, mac
Saws
A supercharged AWS command line interface (CLI).
Stars: ✭ 4,886 (+2541.08%)
Mutual labels:  terminal, utilities
ukrainian-typographic-keyboard
Combined Ukrainian keyboard layout with typographic symbols
Stars: ✭ 356 (+92.43%)
Mutual labels:  keyboard, mac
Reminders Cli
Command-line interface to interact with the Reminders.app
Stars: ✭ 67 (-63.78%)
Mutual labels:  terminal, mac
Blightmud
A terminal mud client written in Rust
Stars: ✭ 61 (-67.03%)
Mutual labels:  terminal, mac
Mac Setup
🛠️ Front end web development setup for macOS.
Stars: ✭ 265 (+43.24%)
Mutual labels:  terminal, mac
Display manager
An open-source Python library which can modify your Mac's display settings manually or automatically.
Stars: ✭ 109 (-41.08%)
Mutual labels:  brightness, mac
govarnam
Easily Type Indian Languages on computer and mobile. GoVarnam is a cross-platform transliteration library. Manglish -> Malayalam, Thanglish -> Tamil, Hinglish -> Hindi plus another 10 languages. GoVarnam is a near-Go port of libvarnam
Stars: ✭ 97 (-47.57%)
Mutual labels:  keyboard, mac
Haxor News
Browse Hacker News like a haxor: A Hacker News command line interface (CLI).
Stars: ✭ 3,342 (+1706.49%)
Mutual labels:  terminal, utilities
productivity-tips-for-mac
Awesome Productivity Tips for Mac Developers
Stars: ✭ 38 (-79.46%)
Mutual labels:  mac, utilities
Yaspin
A lightweight terminal spinner for Python with safe pipes and redirects 🎁
Stars: ✭ 413 (+123.24%)
Mutual labels:  terminal, utilities
Nocturnal
A Dimness and Night Shift menu bar app for macOS 🌙
Stars: ✭ 199 (+7.57%)
Mutual labels:  brightness, mac
Powerkey
Remap your Macbook's power key to Forward Delete
Stars: ✭ 212 (+14.59%)
Mutual labels:  keyboard, mac
Nord Iterm2
An arctic, north-bluish clean and elegant iTerm2 color scheme.
Stars: ✭ 651 (+251.89%)
Mutual labels:  terminal, mac
Night Shift On Unsupported Macs
Enable Night Shift on older Unsupported Macs
Stars: ✭ 86 (-53.51%)
Mutual labels:  brightness, mac

Control Mac Keyboard Brightness: kbrightness & dbrightness

Programmatically flash the keyboard lights and control display brightness on Macs. You can flash them to the beat of music, or use it for alerts and notifications.

This was inspired by @tcr's repo. This is also an alternative to the old iSpazz iTunes plugin, which no longer works. I had trouble finding any other easy-to-use binary for controlling keyboard brightness, so I made one.

Flashing keyboard gif Flashing display gif

Usage

  • blink is a shortcut to flash the keyboard lights [n] times for [t] seconds each time
  • kbrightness manages the keyboard backlight brightness
  • dbrightness manages the display backlight brightness
  • python3 audio.py flash the keyboard based on the audio input from your mic, makes it flash to the beat of music

Use blink in your shell scripts to alert you when things have succeeded or failed. e.g. wget https://example.com/large-file.mp4 && blink 2 or ./tests.py || blink 3 1

git clone https://github.com/pirate/mac-keyboard-brightness
cd mac-keyboard-brightness/

./kbrightness          # gets current keyboard brightness
# 0.286447
./kbrightness 0.85     # sets keyboard brightness to 85%

./dbrightness          # gets current display brightness
# 0.938477
./dbrightness 0.42     # sets display brightness to 42%
=======

./blink                # flash the keyboard lights once (good for subtle alerts, e.g. git pull && blink 2)
./blink 2              # flash the keyboard lights twice
./blink 10 0.1         # flash the keyboard lights 10 times, for 0.1 seconds each time
./blink 1000 0.01      # turn your keyboard into a disco strobe

=======

# Flash your keyboard to the beat of the music! (uses mic input)
brew install python3 pyaudio portaudio
pip3 install --upgrade pyaudio audioop
python3 audio.py

You should be able to download the repo and use the binaries without needing to recompile anything (tested on macOS Sierra, High Sierra, and Mojave).

Why?

It's fun. Here are some ideas:

  • make a bitbar menubar app to control keyboard brightness
  • make your keyboard lights flash for security alerts using Security Growler
  • make your keyboard flash right before your display is about to sleep
  • make your keyboard flash on incoming email
  • make your keyboard flash to the beat of music
  • make your keyboard flash when your boss's iPhone comes within bluetooth range

Advanced

If you want to write more advanced programs to update the brightness at higher frequencies (e.g. to make your keyboard flash to music), you can use the C functions directly.

  • setDisplayBrightness, getDisplayBrightness
  • setKeyboardBrightness, getKeyboardBrightness
  • getLightSensors: get ambient light sensor values, see @tcr's original repo

Compile each file individually with:

gcc -std=c99 -o kbrightness keyboard-brightness.c -framework IOKit -framework ApplicationServices
# OR
gcc -std=c99 -o dbrightness display-brightness.c -framework IOKit -framework ApplicationServices

Links

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].