Sane color handling of osx's accent and highlight color from the commandline

Overview

osx-colors ci ./LICENSE

Sane command line color customisation for osx, no more fiddling about with defaults, internal apple color constants and rgb color codes

Say you want to change your Accent and Highlight Color to Green like this

If you wanted to change it via terminal, normally you'd need to do this

$ defaults write -g AppleAccentColor -string 3
$ defaults write -g AppleHighlightColor -string "0.752941 0.964706 0.678431 Green"

Instead.... do this 😄

$ osx-colors set green

Or to set your Accent & Highlight color based on the wallpaper pallete generated from pywal also requires jq

$ osx-colors set $(jq --raw-output '.colors.color9' < ~/.cache/wal/colors.json)

Features

  • Sane color handling using color names and a single command
  • Provide it a color in hex and it'll find the "nearest" available apple color to it and set it to this, this is awesome if you use pywal and want matching accent/highlight colors to your wallpaper
  • Restarts Finder,Docker,System Preferences etc upon setting so colors can be immediately seen

Why

I'm a huge fan of pywal and what I thought would complete the color scheme would be Accent & Highlight colors in osx that were based on the generated color palette of the wallaper, however I wasn't able to find anything that did it and color management from the commandline simply sucked, so I wrote this for my personal needs

Limitations

  • At present you can only set both the AccentColor and HighlightColor together, however the HighlightColor can be customized to any color in the UI (from what I can see)
  • Finding the nearest "color" isn't perfect but i've found it good enough, welcome alternative algorithms/solutions to this

Getting Started

Dependencies

  • MacOS Monterey (It probably works on others I just haven't tested it!)
  • Python 3.8 or greater

Installing

pip install osx-colors

Usage

To set the Accent and Highlight color to Red

$ osx-colors set red
Setting the 'Accent Color' to 'red'
Setting the 'Highlight Color' to 'red'
Restarting Finder, Spotlight and System Preferences, others may need to be restarted manually

To set the Accent and Highlight color to the closest color to the HEX color provided

$ osx-colors set 0029ff
Searching for the closest Apple color to '0029ff' we found 'blue'
Setting the 'Accent Color' to 'blue'
Setting the 'Highlight Color' to 'blue'
Restarting Finder, Spotlight and System Preferences, others may need to be restarted manually

For more usage instructions see

$ osx-colors --help

Contributing

Feel free to lodge an issue regarding a feature request/bug report and we'll go from there!

All contributions welcome 🙂

Running the tests

$ make test

For other build tasks see Makefile

Versioning

We use SemVer for versioning. For the versions available, see the Releases on this repository.

TODO

  • Ability to get colors - not sure of use case?
  • Ability to set a custom Highlight color

License

This project is licensed under the MIT license

Acknowledgments

  • Thanks to ofstack for the code to match the "nearest" color, i'm no color scientist
  • Thanks to quantum_libet on reddit for a rundown on the insanity of color management via the terminal
You might also like...
A web-based visualization and debugging platform for NuPIC

Cerebro 2 A web-based visualization and debugging platform for NuPIC. Usage Set up cerebro2.server to export your model state. Then, run: cd static py

Trace all method entries and exits, the exit also prints the return value, if it is of basic type

Trace all method entries and exits, the exit also prints the return value, if it is of basic type. The apk must have set the android:debuggable="true" flag.

The official code of LM-Debugger, an interactive tool for inspection and intervention in transformer-based language models.
The official code of LM-Debugger, an interactive tool for inspection and intervention in transformer-based language models.

LM-Debugger is an open-source interactive tool for inspection and intervention in transformer-based language models. This repository includes the code

DCL - An easy to use diacritic library used for diacritic and accent manipulation.

Diacritics Library This library is used for adding, and removing diacritics from strings. Getting started Start by importing the module: import dcl DC

Color getter (including method to get random color or complementary color) made out of Python

python-color-getter Color getter (including method to get random color or complementary color) made out of Python Setup pip3 install git+https://githu

Sane and flexible OpenAPI 3 schema generation for Django REST framework.

drf-spectacular Sane and flexible OpenAPI 3.0 schema generation for Django REST framework. This project has 3 goals: Extract as much schema informatio

sane is a command runner made simple.
sane is a command runner made simple.

sane is a command runner made simple.

Amazing GitHub Template - Sane defaults for your next project!

🚀 Useful README.md, LICENSE, CONTRIBUTING.md, CODE_OF_CONDUCT.md, SECURITY.md, GitHub Issues and Pull Requests and Actions templates to jumpstart your projects.

UMT is a unified and flexible framework which can handle different input modality combinations, and output video moment retrieval and/or highlight detection results.

Unified Multi-modal Transformers This repository maintains the official implementation of the paper UMT: Unified Multi-modal Transformers for Joint Vi

Highlight Translator can help you translate the words quickly and accurately.
Highlight Translator can help you translate the words quickly and accurately.

Highlight Translator can help you translate the words quickly and accurately. By only highlighting, copying, or screenshoting the content you want to translate anywhere on your computer (ex. PDF, PPT, WORD etc.), the translated results will then be automatically displayed before you.

Commandline Python app to Autodownload mediafire folders and files.

Commandline Python app to Autodownload mediafire folders and files.

Zendesk Ticket Viewer is a lightweight commandline client for fetching and displaying tickets from a Zendesk account provided by the user

Zendesk Ticket Viewer is a lightweight commandline client for fetching and displaying tickets from a Zendesk account provided by the user.

Python commandline tool for remembering linux/terminal commands
Python commandline tool for remembering linux/terminal commands

ehh Remember linux commands Commandline tool for remembering linux/terminal commands. It stores your favorite commands in ~/ehh.json in your homedir a

Clint is a module filled with a set of awesome tools for developing commandline applications.

Clint: Python Command-line Interface Tools Clint is a module filled with a set of awesome tools for developing commandline applications. C ommand L in

Commandline script to interact with volkswagencarnet library
Commandline script to interact with volkswagencarnet library

volkswagencarnet-client command line script to interact with volkswagencarnet library Table of Contents General Info Setup Usage Example Acknowledgeme

Chess-commandline - Chess in the Command Line using the Chess Module Can detect Checkmates

chess-commandline Chess in the Command Line using the Chess Module Can detect Ch

Tarstats - A simple Python commandline application that collects statistics about tarfiles

A simple Python commandline application that collects statistics about tarfiles.

Convert three types of color in your clipboard and paste it to the color property (gamma correct)
Convert three types of color in your clipboard and paste it to the color property (gamma correct)

ColorPaster [Blender Addon] Convert three types of color in your clipboard and paste it to the color property (gamma correct) How to Use Hover your mo

Color Picker and Color Detection tool for METR4202
Color Picker and Color Detection tool for METR4202

METR4202 Color Detection Help This is sample code that can be used for the METR4202 project demo. There are two files provided, both running on Python

Comments
  • Add the iMac colours to colour options available

    Add the iMac colours to colour options available

    Since the new 2021 iMacs came out, they've had new customisable accent colours which you can get with the simple terminal command, but these aren't available on this yet defaults write -g NSColorSimulateHardwareAccent -bool YES defaults write -g NSColorSimulatedHardwareEnclosureNumber -int}

    Therefore, you could add these colours (there's 6 of them) to the database thing to check for matches to those colours as well.

    Other than that its a really cool project!!!

    opened by xQueenAurorax 1
Releases(v1.1.0)
Owner
Clint Plummer
Clint Plummer
Pyinstrument - a Python profiler. A profiler is a tool to help you optimize your code - make it faster.

Pyinstrument🚴 Call stack profiler for Python. Shows you why your code is slow!

Joe Rickerby 5k Jan 08, 2023
一个小脚本,用于trace so中native函数的调用。

trace_natives 一个IDA小脚本,获取SO代码段中所有函数的偏移地址,再使用frida-trace 批量trace so函数的调用。 使用方法 1.将traceNatives.py丢进IDA plugins目录中 2.IDA中,Edit-Plugins-traceNatives IDA输

296 Dec 28, 2022
VizTracer is a low-overhead logging/debugging/profiling tool that can trace and visualize your python code execution.

VizTracer is a low-overhead logging/debugging/profiling tool that can trace and visualize your python code execution.

2.8k Jan 08, 2023
🔥 Pyflame: A Ptracing Profiler For Python. This project is deprecated and not maintained.

Pyflame: A Ptracing Profiler For Python (This project is deprecated and not maintained.) Pyflame is a high performance profiling tool that generates f

Uber Archive 3k Jan 07, 2023
Inject code into running Python processes

pyrasite Tools for injecting arbitrary code into running Python processes. homepage: http://pyrasite.com documentation: http://pyrasite.rtfd.org downl

Luke Macken 2.7k Jan 08, 2023
A gdb-like Python3 Debugger in the Trepan family

Abstract Features More Exact location information Debugging Python bytecode (no source available) Source-code Syntax Colorization Command Completion T

R. Bernstein 126 Nov 24, 2022
A web-based visualization and debugging platform for NuPIC

Cerebro 2 A web-based visualization and debugging platform for NuPIC. Usage Set up cerebro2.server to export your model state. Then, run: cd static py

Numenta 24 Oct 13, 2021
Hdbg - Historical Debugger

hdbg - Historical Debugger This is in no way a finished product. Do not use this

Fivreld 2 Jan 02, 2022
Little helper to run Steam apps under Proton with a GDB debugger

protongdb A small little helper for running games with Proton and debugging with GDB Requirements At least Python 3.5 protontricks pip package and its

Joshie 21 Nov 27, 2022
Full-screen console debugger for Python

PuDB: a console-based visual debugger for Python Its goal is to provide all the niceties of modern GUI-based debuggers in a more lightweight and keybo

Andreas Klöckner 2.6k Jan 01, 2023
Integration of IPython pdb

IPython pdb Use ipdb exports functions to access the IPython debugger, which features tab completion, syntax highlighting, better tracebacks, better i

Godefroid Chapelle 1.7k Jan 07, 2023
An x86 old-debug-like program.

An x86 old-debug-like program.

Pablo Niklas 1 Jan 10, 2022
pdb++, a drop-in replacement for pdb (the Python debugger)

pdb++, a drop-in replacement for pdb What is it? This module is an extension of the pdb module of the standard library. It is meant to be fully compat

1k Dec 24, 2022
Visual Interaction with Code - A portable visual debugger for python

VIC Visual Interaction with Code A simple tool for debugging and interacting with running python code. This tool is designed to make it easy to inspec

Nathan Blank 1 Nov 16, 2021
Cyberbrain: Python debugging, redefined.

Cyberbrain1(电子脑) aims to free programmers from debugging.

laike9m 2.3k Jan 07, 2023
pdb++, a drop-in replacement for pdb (the Python debugger)

pdb++, a drop-in replacement for pdb What is it? This module is an extension of the pdb module of the standard library. It is meant to be fully compat

1k Jan 02, 2023
Sane color handling of osx's accent and highlight color from the commandline

osx-colors Sane command line color customisation for osx, no more fiddling about with defaults, internal apple color constants and rgb color codes Say

Clint Plummer 8 Nov 17, 2022
Sampling profiler for Python programs

py-spy: Sampling profiler for Python programs py-spy is a sampling profiler for Python programs. It lets you visualize what your Python program is spe

Ben Frederickson 9.5k Jan 08, 2023
Silky smooth profiling for Django

Silk Silk is a live profiling and inspection tool for the Django framework. Silk intercepts and stores HTTP requests and database queries before prese

Jazzband 3.7k Jan 01, 2023
An improbable web debugger through WebSockets

wdb - Web Debugger Description wdb is a full featured web debugger based on a client-server architecture. The wdb server which is responsible of manag

Kozea 1.6k Dec 09, 2022