Coder Social home page Coder Social logo

happens's Introduction

happens

A keyboard layout switcher. Just highlight the text and press a preconfigured hotkey to switch the layout.

Installation

  1. Install xdotool:
sudo apt install xdotool
  1. Grab the binary from releases and put it in any folder that is visible in $PATH.

Note:

If there is no pre-built binary for your platform, you may build it yourself from source like this (Rust tooling is required):

git clone https://github.com/v-spassky/happens.git
cd happens
cargo build --release
cp target/release/happens ~/.local/bin/
chmod u+x ~/.local/bin/happens
  1. Bind the binary to a hotkey in your desktop environment.

ubuntu hotkey binding example

You may set up the binding in two distinct modes:

Using one of the precompiled tables:
happens --table [ru-to-eng | eng-to-ru]

Example:

happens --table ru-to-eng

With such configuration, the program will work like this:

workflow demonstration

Using your own custom table:
happens --from-file /<...>/table.txt

In this case, the table.txt file should be formatted as follows:

<key1_before>: <key1_after>
<key2_before>: <key2_after>
...
<keyN_before>: <keyN_after>

Example:

a: R
s: R
d: R
f: R
g: R

With the configuration above using the custom table shown above, the program will work like this:

workflow demonstration 2

Development notes

To set up the program up and running, first set up a hotkey binding to call such command:

happens --from-file /<...>/happens/samples/custom_table.txt --logfile-name /<...>/happens/logs.txt

Alternatively, if you want to use the a precompiled table:

happens --table [ru-to-eng | eng-to-ru] --logfile-name /<...>/happens/logs.txt

Then, copy the binary from project folder to a folder, visible in $PATH and make it executable:

cargo build
cp target/debug/happens ~/.local/bin/
chmod u+x ~/.local/bin/happens

Or, as a shortcut:

cargo build && cp target/debug/happens ~/.local/bin/ && chmod u+x ~/.local/bin/happens

It is also possible to run the program via a terminal like this:

cargo run -- --from-file /<...>/happens/samples/custom_table.txt

happens's People

Contributors

v-spassky 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.