porras / i3-keyboard-layout Goto Github PK
View Code? Open in Web Editor NEWChange keyboard layout with a keystroke + show it in the status bar
License: MIT License
Change keyboard layout with a keystroke + show it in the status bar
License: MIT License
I love this repo. I've been using this script for years now but I'm not an i3 user, even when I was I used to use i3blocks as my bar.
I was thinking why it should be "i3-keyboard-layout"?
It assumes that everybody uses i3status along with i3 which is sad.
It can simply be keyboard-layout and have keyboard-layout related scripts. (kblayout
for better life even)
kblayout
the star, script itself.i3status-kblayout
containing current i3status function of the i3-keyboard-layout.blocks-kblayout
containing update script for i3blocks (something like this)And maybe make the script read some $STATUSBAR
variable before sending refresh singal to any bar so it can work with all bars (this is my implementation in my repo, default on dwmblocks
):
[ "$STATUSBAR" = "i3status" ] && pgrep i3status | xargs --no-run-if-empty kill -s USR1 || # tell i3status to update
pkill -RTMIN+30 "${STATUSBAR:-dwmblocks}"
It makes the main script more aligned with its purpose: Managing layouts only.
Hi, i prefer to use capslock for switch, but i think, that with this key will be problems.
Do you know how to resolve this?
The idea to display keyboard layout in i3status bar is very good (and frankly should be implemented in i3status conf itself), but all you really need is setxkbmap, which probably comes in every Linux. Specifically, it would be great to somehow display the output of
setxkbmap -query | awk '/layout/{print $2}'
This output should somehow go in i3status bar. I have not found a way to include this in i3status. It is very puzzling to me that i3wm developers, otherwise extremely conscious of utf8 stuff and such, do not allow a simple output like this in i3status.
Hi there,
I can change the layout using the script, but the string displayed on the i3bar isn't updated when I cycle between layouts, not even after refreshing i3. The same string is always displayed.
I am using manjaro i3.
Hi, and thanks for this script.
I usually switch between es, us and latam layouts. The cycle won't work due to it does not recognize the "latam" code.
Solution is easy, in line 6 just change this:
setxkbmap -query | grep -oP 'layout:\s*\K(\w{2})'
to this:
setxkbmap -query | grep -oP 'layout:\s*\K(\w{2,5})'
It should be checked for other codes with more characters, maybe.
Hi
My keystroke is
bindsym $mod+space exec ~/.config/i3/i3-keyboard-layout cycle br "us,br intl"
This command works when I run it directly on CLI, but i3 raises error:
ERROR: Expected one of these tokens: <end>, '[', 'move', 'exec', 'exit', 'restart', 'reload', 'shmlog', 'debuglog', 'border', 'layout', 'append_layout', 'workspace', 'focus', 'kill', 'open', 'fullscreen', 'sticky', 'split', 'floating', 'mark', 'unmark', 'resize', 'rename', 'nop', 'scratchpad', 'swap', 'title_format', 'mode', 'bar', 'gaps'
ERROR: Your command: exec ~/.config/i3/i3-keyboard-layout cycle br "us,br intl"
ERROR: ^^^^^^^^
~
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.