Code Monkey home page Code Monkey logo

apple-kbd-dat-icon-extract's Introduction

apple-kbd-dat-icon-extract.py

After creating a custom [1] keyboard layout with Ukelele, I wanted it to match the original layout's icon. It turns out that OS X stores the country flags in /System/Library/Keyboard Layouts/AppleKeyboardLayouts.bundle/Contents/Resources/AppleKeyboardLayouts-L.dat.

I don't know the exact structure of that file, but the icons are simply there (look for icns in hex, i.e. 0x69636e73).

apple-kbd-dat-icon-extract.py is a quick and dirty script the exracts the icons (icns files) from the above file and writes them to the specified output directory.

[1] Not really custom. OS X doesn't support the БДС 5237-2005 Bulgarian phonetic layout (GNU/Linux does).

Sample usage

% mkdir /tmp/icons
% ./apple-kbd-dat-icon-extract.py -o /tmp/icons
./apple-kbd-dat-icon-extract.py: Reading /System/Library/Keyboard Layouts/AppleKeyboardLayouts.bundle/Contents/Resources/AppleKeyboardLayouts-L.dat
./apple-kbd-dat-icon-extract.py: Writing icon file /tmp/icons/icon1.icns
./apple-kbd-dat-icon-extract.py: Writing icon file /tmp/icons/icon2.icns
./apple-kbd-dat-icon-extract.py: Writing icon file /tmp/icons/icon3.icns
...
./apple-kbd-dat-icon-extract.py: Writing icon file /tmp/icons/icon132.icns
%

apple-kbd-dat-icon-extract's People

Contributors

chaimleib avatar philipbel avatar rimas-kudelis avatar

Watchers

 avatar

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.