Giter Site home page Giter Site logo

scripts'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
%

ipernity-downloader

Ipernity download script (uses their Shell API).

Usage

usage: ipernity-downloader.py [-h] [-v] --key KEY --secret SECRET -o OUTPUT

optional arguments:
  -h, --help            show this help message and exit
  -v, --verbose         Be verbose
  --key KEY             Ipernity API key
  --secret SECRET       Ipernity API secret
  -o OUTPUT, --output OUTPUT
                        Download output directory

scripts's People

Contributors

philipbel avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

scripts's Issues

Invalid icns files

The icns files that apple-kbd-dat-icon-extract.py returns are not valid icns files.

$ iconutil -c iconset icon1.icns
/Users/user/Pictures/keyboard-icons/icon1.icns:error: Invalid ICNS file.
icon1.icns:error: Failed to write iconset.

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.