prasanthrangan / hyprdots

// Aesthetic, dynamic and minimal dots for Arch hyprland
GNU General Public License v3.0
5.63k stars 684 forks source link

keyboard layout #248

Closed TheyCallMeSecond closed 8 months ago

TheyCallMeSecond commented 9 months ago

hey man tnx for your wonderful job can you add keyboard layout indicator to panels?

TheyCallMeSecond commented 9 months ago

https://github.com/Alexays/Waybar/wiki/Module:-Language

prasanthrangan commented 9 months ago

Thank you so much... will definitely add this waybar module!

T-Crypt commented 9 months ago

@prasanthrangan I was looking into this and it seems like its going to be a variable to be able to do this...

As each person has a different device under hyprctl devices

the change keyboard layout requires the device name -- so it may require a script to run for this to get the current keyboard. What I have is below so far -- but wont work as the device varies from device to device.

"hyprland/language":`{
    "format": "{}",
    "on-click": " hyprctl switchxkblayout [Device] next",
},

Reference: https://wiki.hyprland.org/Configuring/Using-hyprctl/

T-Crypt commented 9 months ago

You could add a bind and just have the users set the layout they want and use the toggle option

kb_options = grp:alt_shift_toggle

config binds would be SUPER + A

prasanthrangan commented 9 months ago

yup just checked the hyprctl devices and it looks kinda useless as it just list all the devices (even ones that are not keyboards) --

❯ hyprctl devices
mice:
    Mouse at 562b4fc7bf70:
        logitech-m585/m590-1
            default speed: 0.00000
    Mouse at 562b4fc2da20:
        sonix-usb-device-2
            default speed: 0.00000
    Mouse at 562b4fdc3160:
        razer-barracuda-x-consumer-control-1
            default speed: 0.00000

Keyboards:
    Keyboard at 562b4f94a9b0:
        power-button
            rules: r "", m "", l "us", v "", o ""
            active keymap: English (US)
            main: no
    Keyboard at 562b4f92cee0:
        power-button-1
            rules: r "", m "", l "us", v "", o ""
            active keymap: English (US)
            main: no
    Keyboard at 562b4fa18aa0:
        sleep-button
            rules: r "", m "", l "us", v "", o ""
            active keymap: English (US)
            main: no
    Keyboard at 562b4fd018e0:
        logitech-m585/m590
            rules: r "", m "", l "us", v "", o ""
            active keymap: English (US)
            main: no
    Keyboard at 562b4fd3d380:
        sonix-usb-device
            rules: r "", m "", l "us", v "", o ""
            active keymap: English (US)
            main: no
    Keyboard at 562b4fd77730:
        sonix-usb-device-1
            rules: r "", m "", l "us", v "", o ""
            active keymap: English (US)
            main: no
    Keyboard at 562b4fdb0700:
        razer-barracuda-x-consumer-control
            rules: r "", m "", l "us", v "", o ""
            active keymap: English (US)
            main: no
    Keyboard at 562b4fde9710:
        eee-pc-wmi-hotkeys
            rules: r "", m "", l "us", v "", o ""
            active keymap: English (US)
            main: yes

so i think should be enough for now just to show indicator as --

"hyprland/language": {
    "format": "{short} {variant}"
},
T-Crypt commented 8 months ago

Fixed in #314 -- Can close out now