Omahub
← All plugins
L

Keyboard Layout

by lef

Shows your keyboard layout on the bar and switches it with a click, scroll or key. Set up to four layouts with variants, choose the switch key, and edit input.lua safely with backups and one-click restore.

Security review

No obvious issues detected

Deterministic scan — not a security guarantee

None
Risk level
None
Analyzed commit
4ca9732
Scanned
1 week ago

No potentially dangerous behavior detected in the analyzed commit.

Automated analysis only — not a security guarantee.

AI advisory review

No obvious issues detected

Language-model assessment · ~deepseek/deepseek-v4-flash-latest — advisory only

Low
AI risk level
Low
Recommendation
install
Model
~deepseek/deepseek-v4-flash-latest
Analyzed commit
4ca9732
Reviewed
1 week ago

The plugin is a well-structured keyboard layout switcher that only edits the user's Hyprland input.lua with explicit user action, takes backups, and uses bounded, non-shell-executed helpers. The deterministic scan found no issues, and the sampled code shows careful input validation and no hidden destructive or credential-harvesting behavior.

  • The plugin writes to ~/.config/hypr/input.lua and reloads Hyprland, but only when the user explicitly presses Apply/Restore, and it takes backups first.
  • It invokes external commands (hyprctl, xkbcli, xdg-open, omarchy bar move) with argument vectors rather than shell strings, and validates device/layout names before use.
  • The Perl helpers use O_NOFOLLOW, byte limits, and UTF-8 checks, reducing risk from symlink/FIFO or oversized-file tricks.
  • A human may still want to spot-check the full Service.qml and InputLua.pl write path, since only a sample of the repository was reviewed.
How this check works

This review combines the deterministic scan (the rule-based results above) with an independent look at the plugin's code by a language model. The model reads a trimmed sample of the repository's files, the manifest, and the README, then gives a plain-language risk level and a recommendation: install (no notable danger), review (look closer first), or avoid (clearly dangerous).

It runs on the same analyzed commit as the deterministic scan and is strictly advisory — it is not a security guarantee and never blocks a plugin by itself. A human moderator still reviews plugins before they are listed.

AI advisory only — automated analysis, not a security guarantee.

Install
$ omarchy plugin add https://github.com/Somnius/Keyboard-Layout-for-Omarchy --enable
Desktop #Hyprland #bar #quickshell

Keyboard Layout for Omarchy

See which keyboard layout you're typing in, switch it in one move, and set up your layouts without editing config files.

An Omarchy bar widget for anyone who types in more than one language. It works with any language: English + Greek, German + Russian, Portuguese + Arabic, … up to four layouts.

<img width="1600" alt="Keyboard Layout: the bar label and the settings panel" src="preview.png" />

What you get

  • The layout on your bar. A short label such as EN, GR or DE. Hover it for the full name, e.g. Greek (polytonic).
  • Switching your way. Right-click or scroll on the label, press your switch key, or bind a Hyprland key. Middle-click jumps straight back to your main layout.
  • Every keyboard at once. Laptop keyboard, USB receiver, second keyboard: they all switch together and never end up on different layouts.
  • Setup in a panel, not a text editor. Pick layouts and variants from a searchable list of 750+, choose a switch key (Caps Lock, Alt+Shift, Ctrl+Shift, and 12 more), then press Apply.
  • Safe with your config. Only the layout settings in ~/.config/hypr/input.lua are touched. Your comments and your other options stay as they are. A backup is taken before every change, and any backup can be restored with one click.
  • Optional extras, off by default. A small toast at the top center of the screen when the layout changes, and an accent colour on the label while you're off your main layout.

Quick start

omarchy plugin add https://github.com/Somnius/Keyboard-Layout-for-Omarchy.git --enable
  1. The widget appears on the bar, and the first time it asks whether it should sit next to the clock or on the right.
  2. Left-click the label to open the panel. Under Layouts, keep English (US) as layout 1 and add your other layouts (type to search, e.g. greek or polytonic).
  3. Choose a Switch key and press Apply & reload Hyprland. Done.

Using it

On the bar label Does
Left-click Opens the panel
Right-click or scroll down Next layout
Scroll up Previous layout
Middle-click Main layout (layout 1)
Hover Full layout name

The panel has three columns, and fewer on narrow screens:

  • Layouts. Up to four, with variants. Reorder with ↑ ↓ and remove with ✕. Layout 1 is your main layout.
  • Switch key & Display.
    • Switch key: the key that cycles layouts, with an optional Caps Lock LED that lights while you're off the main layout.
    • Apply: saves the layout and switch-key settings and reloads Hyprland.
    • Display: the toast, the accent label, and where the widget sits on the bar.
  • Backups. Back up now, open the backups folder, or restore any earlier version.

Keep English (US) as layout 1 if you type passwords in English

Lock screens and password prompts often start on your main layout. If layout 1 is Greek, for example, a password typed in English comes out as Greek characters and is rejected. The panel warns whenever layout 1 isn't English (US), and asks you to confirm before applying such a change.

Keybindings and scripting

Every panel action is also a command:

omarchy-shell lef.keyboard-layout next          # or: prev, set 0, set gr, set 'gr(polytonic)'
omarchy-shell lef.keyboard-layout status        # current state as JSON
omarchy-shell lef.keyboard-layout backup        # back up input.lua now
omarchy-shell lef.keyboard-layout toast on      # or off

Hyprland binding example (~/.config/hypr/bindings.lua). This pairs well with the None switch key:

o.bind("SUPER + ALT + K", "Next keyboard layout", "omarchy-shell lef.keyboard-layout next")
o.bind("SUPER + ALT + J", "Main keyboard layout", "omarchy-shell lef.keyboard-layout set 0")

The full command list is in docs/IPC.md.

What it changes on your system

File When What
~/.config/hypr/input.lua Only when you press Apply or Restore kb_layout, kb_variant, and the layout-switch part of kb_options. Everything else in the file is left as it is.
~/.config/omarchy/keyboard-layout/config.json When you change a panel setting Placement, toast, and accent label
~/.config/omarchy/keyboard-layout/backups/ Before every Apply or Restore, or on Back up now Copies of input.lua. The newest 10 are kept.

Nothing else is changed: no system files, and no root access is needed. Details: docs/CONFIGURATION.md and docs/BACKUPS.md.

Requirements

Omarchy with its shell (Quickshell), Hyprland, xkbcli, and Perl with core modules only. All of these ship with Omarchy. Nothing extra needs installing.

Documentation

Development

From a local checkout of this repository:

ln -s "$PWD" ~/.config/omarchy/plugins/lef.keyboard-layout
omarchy restart shell
  • Run the tests with tests/run.sh, which runs the QML logic suite and the Perl I/O suites.
  • Validate the manifest with omarchy plugin validate ..
  • Quickshell's file watcher doesn't follow symlinks, so run omarchy restart shell after editing.

Upgrading from 1.1.x

  • Your current settings are picked up as they are.
  • The old Primary / Second choice is replaced by up to four layout rows.
  • The one-time input.lua.bak.<timestamp> next to input.lua is still listed and restorable, but new backups go to the backups folder.
  • Moving the widget no longer restarts the shell.

Uninstall

omarchy plugin remove lef.keyboard-layout

Your last-applied layout settings stay in input.lua. Remove ~/.config/omarchy/keyboard-layout/ as well if you don't want to keep the backups.

License

MIT