Giter Site home page Giter Site logo

echuraev / keyboard_layout Goto Github PK

View Code? Open in Web Editor NEW
71.0 5.0 12.0 1.02 MB

Keyboard switcher for Awesome WM with additional layouts

License: MIT License

Lua 100.00%
awesomewm keyboard-layout keyboard-widget keyboard-switcher widget lua switcher-widget

keyboard_layout's People

Contributors

adsoncicilioti avatar asavonic avatar echuraev avatar krydos avatar naafx8 avatar octelly 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  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  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  avatar  avatar

keyboard_layout's Issues

Init.lua don't allow put/clone on another directory

Many users like to put their modules, widgets, plugins, etc, in another folder to be more organized, instead of putting them in the root of the awesome config directory.

For example:
I have the modules folder where I put all the third party libs and modules. When requesting this lib, I just call it like this:
local kblayout = require("modules.keyboard_layout")
or
local kblayout = require("modules/keyboard_layout")

As your init.lua is, the call is absolute, not allowing to use in a custom directory to improve the organization.

Problems with layouts with special characters

os.execute(kbdcfg.cmd .. " " .. layout.subcmd)

This line caused problems for me. The reason is that, I use the following config:

kbdcfg.add_primary_layout("English (US)", "EN", "us")
kbdcfg.add_primary_layout("Czech (QWERTY)", "CZ", "cz(qwerty)")

Since the layout's name doesn't get wrapped in quotes, the cz(qwerty) layout causes problems. I fixed it by modifying my local copy as such:

os.execute(kbdcfg.cmd .. " \"" .. layout.subcmd .. "\"")

Remember input method per winodw

Hey @echuraev
Thanks for the package.

Don't you know if there is any way to remember what keyboard layout was selected previously for a window?

Like Chrome has EN and Skype has RU.
When I switch from Skype (RU) to Chrome (EN) the input method is also change. It usually called Allow different layouts for individual windows

US-INTL-ALTGR

how would you add the the variants (US-INTL-ALTGR, in my case) in this? i'm quite confused how to write them at the .add_primary_layout part

┌─(^.^)-(~)
└─> setxkbmap -print -verbose 10
Setting verbose level to 10
locale is C
Trying to load rules file ./rules/evdev...
Trying to load rules file /usr/share/X11/xkb/rules/evdev...
Success.
Applied rules from evdev:
rules:      evdev
model:      pc105
layout:     us,us
variant:    altgr-intl,
Trying to build keymap using the following components:
keycodes:   evdev+aliases(qwerty)
types:      complete
compat:     complete
symbols:    pc+us(altgr-intl)+us:2+inet(evdev)
geometry:   pc(pc105)
xkb_keymap {
	xkb_keycodes  { include "evdev+aliases(qwerty)"	};
	xkb_types     { include "complete"	};
	xkb_compat    { include "complete"	};
	xkb_symbols   { include "pc+us(altgr-intl)+us:2+inet(evdev)"	};
	xkb_geometry  { include "pc(pc105)"	};
};

kbdcfg not found

Awesome cannot find a command kbdcfg. Which package do i need to install?

Per-layout command / more flexible commands

My use case is that I alternate between US and US Dvorak. For both, I have a setxkbmap option and I then reload ~/.xmodmaprc. I use this rather unfortunate line:

kbdcfg.add_primary_layout("Dvorak", "DV", "-option\" compose:ralt  dvorak && xmodmap ~/.xmodmaprc && echo \"")

This is to "hack" into the os.execute that is done by the code.

A much more elegant solution would be to have a add_primary_layout with named arguments name, icon, full_command, cmd_argument, with the last two optional, although one of the two should be there. For instance:

kbdcfg.add_primary_layout_opt { name = "Dvorak", icon = "DV",
   full_command = "setxkbmap -option compase:ralt dvorak && xmodmap ~/.xmodmaprc" }

xbdcfg.add_primary_layout_opt { name = "US", icon = "US", cmd_argument = "us" }

Alternatively, we could specify the command when creating kbdcfg as:

cmd = "setxkbmap -option compose:ralt \"{}\" && xmodap ~/.xmodmaprc"

… but this does not provide the same flexibility.

Caps lock

How I can map CAPS LOCK switching language?

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.