Coder Social home page Coder Social logo

xkblang's Introduction

Xkblang

Build Status licence

Xkblang is a simple program for getting current keyboard layout. Primarily this program was written for i3blocks blocklet for getting current layout.

Installation

Xkblang written on pure C. The only dependency is libX11.

$ make
$ sudo make install

OR with deb packet:

$ dpkg -i xkblang_1.0-1.deb

Usage

$ xkblang -p
English (US)

For short version:

$ xkblang -ps
En

To list all available layouts:

$ xkblang -l
0. English (US)
1. Russian

To set layout:

$ xkblang -t 0

xkblang's People

Contributors

luminousmen avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

Forkers

x11-good-tools

xkblang's Issues

[feature request] Add formatting option

It would be nice to have formatting options, something like this (from xkblayout-state help):

  %c -> current layout number
  %n -> current layout name
  %s -> current layout symbol
  %v -> current layout variant
  %e -> current layout variant (equals to %s if %v is empty)
  %C -> layout count
  %N -> layout names (one per line)
  %S -> layout symbols (one per line)
  %V -> layout variants (one per line)
  %E -> layout variants (one per line; layout symbol is used if variant is empty)
  %% -> A literal '%'

Usage:

$ xkblang
English (US)

$ xkblang 'layout: %n [%s]'
layout: English [us]

$ xkblang '%s\n%s\n#FFFFFF'
us
us
#FFFFFF

The latter example can be used as blocklet without any external wrapper โ€” just add this string as command block property to your i3blocks config.

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.