hyprwm / Hyprland

Hyprland is an independent, highly customizable, dynamic tiling Wayland compositor that doesn't sacrifice on its looks.
https://hyprland.org
BSD 3-Clause "New" or "Revised" License
21.53k stars 900 forks source link

hyprctl switchxkblayout current next - device not found #7843

Closed keliss closed 1 month ago

keliss commented 1 month ago

Already reported ? *

Regression?

Yes

System Info and Version

System/Version info ```sh Hyprland, built from branch at commit 9a09eac79b85c846e3a865a9078a3f8ff65a9259 (props: bump version to 0.42.0). Date: Wed Aug 7 19:17:10 2024 Tag: v0.42.0, commits: 5069 flags: (if any) System Information: System name: Linux Node name: karasique Release: 6.10.8-arch1-1 Version: #1 SMP PREEMPT_DYNAMIC Wed, 04 Sep 2024 15:16:37 +0000 GPU information: 64:00.0 VGA compatible controller [0300]: Advanced Micro Devices, Inc. [AMD/ATI] Phoenix1 [1002:15bf] (rev dd) (prog-if 00 [VGA controller]) os-release: NAME="Arch Linux" PRETTY_NAME="Arch Linux" ID=arch BUILD_ID=rolling ANSI_COLOR="38;2;23;147;209" HOME_URL="https://archlinux.org/" DOCUMENTATION_URL="https://wiki.archlinux.org/" SUPPORT_URL="https://bbs.archlinux.org/" BUG_REPORT_URL="https://gitlab.archlinux.org/groups/archlinux/-/issues" PRIVACY_POLICY_URL="https://terms.archlinux.org/docs/privacy-policy/" LOGO=archlinux-logo plugins: ======Config-Start====== Config File: /home/amogus/.config/hypr/hyprland.conf: Read Succeeded # ####################################################################################### # AUTOGENERATED HYPR CONFIG. # PLEASE USE THE CONFIG PROVIDED IN THE GIT REPO /examples/hypr.conf AND EDIT IT, # OR EDIT THIS ONE ACCORDING TO THE WIKI INSTRUCTIONS. # ####################################################################################### #autogenerated = 1 # remove this line to remove the warning # This is an example Hyprland config file. # Refer to the wiki for more information. # https://wiki.hyprland.org/Configuring/Configuring-Hyprland/ # Please note not all available settings / options are set here. # For a full list, see the wiki # You can split this configuration into multiple files # Create your files separately and then link them to this file like this: # source = ~/.config/hypr/myColors.conf ################ ### MONITORS ### ################ # See https://wiki.hyprland.org/Configuring/Monitors/ monitor=,preferred,auto,1 ################### ### MY PROGRAMS ### ################### # See https://wiki.hyprland.org/Configuring/Keywords/ # Set programs that you use $terminal = foot $fileManager = dolphin $menu = rofi -show drun -show-icons ################# ### AUTOSTART ### ################# # Autostart necessary processes (like notifications daemons, status bars, etc.) # Or execute your favorite apps at launch like this: # exec-once = $terminal # exec-once = nm-applet & # exec-once = waybar & hyprpaper & firefox exec-once = /usr/lib/polkit-kde-authentication-agent-1 exec-once = swww-daemon exec-once = waybar exec-once = /home/amogus/.config/hypr/pgupdn_switch.sh exec-once = [workspace 2 silent] firefox ############################# ### ENVIRONMENT VARIABLES ### ############################# # See https://wiki.hyprland.org/Configuring/Environment-variables/ env = XCURSOR_SIZE,24 env = HYPRCURSOR_SIZE,24 ##################### ### LOOK AND FEEL ### ##################### # Refer to https://wiki.hyprland.org/Configuring/Variables/ # https://wiki.hyprland.org/Configuring/Variables/#general general { gaps_in = 5 gaps_out = 10 border_size = 1 # https://wiki.hyprland.org/Configuring/Variables/#variable-types for info about colors #col.active_border = rgba(33ccffee) rgba(00ff99ee) 45deg col.active_border = rgb(DDCCFF) col.inactive_border = rgba(595959aa) # Set to true enable resizing windows by clicking and dragging on borders and gaps resize_on_border = false # Please see https://wiki.hyprland.org/Configuring/Tearing/ before you turn this on allow_tearing = false layout = dwindle } misc { disable_hyprland_logo = true disable_splash_rendering = true force_default_wallpaper = 0 } # https://wiki.hyprland.org/Configuring/Variables/#decoration decoration { rounding = 8 # Change transparency of focused and unfocused windows active_opacity = 1.0 inactive_opacity = 1.0 drop_shadow = true shadow_range = 4 shadow_render_power = 3 col.shadow = rgba(1a1a1aee) # https://wiki.hyprland.org/Configuring/Variables/#blur blur { enabled = true size = 2 passes = 3 brightness = 1 vibrancy = 1 ignore_opacity = true } } group { col.border_active = rgb(DDCCFF) col.border_inactive = rgba(595959aa) groupbar { height = 1 render_titles = false col.active = rgb(6a8f60) col.inactive = rgb(646e8a) } } # https://wiki.hyprland.org/Configuring/Variables/#animations animations { enabled = true # Default animations, see https://wiki.hyprland.org/Configuring/Animations/ for more bezier = myBezier, 0.05, 0.9, 0.1, 1.05 bezier = myBezierNotJumpy, 0.05, 0.9, 0.1, 1 bezier = ws, 0, 1, 0.5, 1 animation = windowsIn, 1, 7, myBezierNotJumpy animation = windowsOut, 1, 7, default, popin 80% animation = windowsMove, 1, 3, myBezierNotJumpy animation = border, 1, 10, default animation = borderangle, 1, 8, default animation = fade, 1, 7, default animation = workspaces, 1, 3, ws animation = fadeSwitch, 1, 1, default } # See https://wiki.hyprland.org/Configuring/Dwindle-Layout/ for more dwindle { pseudotile = true # Master switch for pseudotiling. Enabling is bound to mainMod + P in the keybinds section below preserve_split = true # You probably want this force_split = 2 } # See https://wiki.hyprland.org/Configuring/Master-Layout/ for more master { new_status = master } ############# ### INPUT ### ############# # https://wiki.hyprland.org/Configuring/Variables/#input input { kb_layout = us,ru kb_variant = kb_model = kb_options = kb_rules = follow_mouse = 1 sensitivity = 0.2 # -1.0 - 1.0, 0 means no modification. touchpad { natural_scroll = true scroll_factor = 1 } } # https://wiki.hyprland.org/Configuring/Variables/#gestures gestures { workspace_swipe = false } # Example per-device config # See https://wiki.hyprland.org/Configuring/Keywords/#per-device-input-configs for more device { name = epic-mouse-v1 sensitivity = -0.5 } #################### ### KEYBINDINGSS ### #################### # See https://wiki.hyprland.org/Configuring/Keywords/ $mainMod = SUPER # Sets "Windows" key as main modifier # Example binds, see https://wiki.hyprland.org/Configuring/Binds/ for more bind = $mainMod, T, exec, $terminal # Kill the process in the activewindow. Useful for killing buggy xwayland apps when MOD + C doesn't work binds = Super_L&Alt_L, X, exec, hyprctl activewindow | grep pid | cut -d: -f2 | tail -n 1 | xargs -I{} kill {} bind = $mainMod, Q, exit, bind = $mainMod, F, exec, $fileManager bind = $mainMod, V, togglefloating, bind = $mainMod, SPACE, exec, $menu bind = $mainMod, P, pseudo, # dwindle bind = $mainMod, J, togglesplit, # dwindle # Disable annoying pgup and pgdn buttons bind = , Prior, exec, "echo 'no-op' > /dev/null" bind = , Next, exec, "echo 'no-op' > /dev/null" ### Special keys # Volume control bindel = , XF86AudioLowerVolume, exec, wpctl set-volume @DEFAULT_AUDIO_SINK@ 5%- bindel = , XF86AudioRaiseVolume, exec, wpctl set-volume @DEFAULT_AUDIO_SINK@ 5%+ bindl = , XF86AudioMute, exec, wpctl set-mute @DEFAULT_AUDIO_SINK@ toggle bindl = , XF86AudioMicMute, exec, wpctl set-mute @DEFAULT_AUDIO_SOURCE@ toggle # Brightness control bindel = , XF86MonBrightnessDown, exec, sudo brillo -qU 5 bindel = , XF86MonBrightnessUp, exec, sudo brillo -qA 5 # Screenshots bind = , XF86Display, exec, grimblast copy area ### Window management # Misc bind = $mainMod, X, killactive, bind = $mainMod, F, fullscreen, 0 bind = $mainMod, less, exec, hyprctl switchxkblayout current next # Resize window binde = $mainMod ALT, right, resizeactive, 20 0 binde = $mainMod ALT, left, resizeactive, -20 0 binde = $mainMod ALT, up, resizeactive, 0 -20 binde = $mainMod ALT, down, resizeactive, 0 20 bind = $mainMod ALT, less, resizeactive, exact 1223 1146 # Move focus bind = $mainMod, left, movefocus, l bind = $mainMod, right, movefocus, r bind = $mainMod, up, movefocus, u bind = $mainMod, down, movefocus, d binde = $mainMod, grave, changegroupactive, f # Move window within workspace # Doesn't work yet, see: https://github.com/hyprwm/Hyprland/issues/4368 bind = $mainMod CTRL, left, swapnext, prev, bind = $mainMod CTRL, right, swapnext, #bind = $mainMod CTRL, right, movewindow, r bind = $mainMod CTRL, up, movewindow, u bind = $mainMod CTRL, down, movewindow, d # Move/resize windows with mouse bindm = $mainMod, mouse:272, movewindow bindm = $mainMod, mouse:273, resizewindow ### Workspace management # Scroll through existing workspaces binds = Super_L&Shift_L, right, workspace, +1 binds = Super_L&Shift_L, left, workspace, -1 # Switch workspaces bind = $mainMod, 1, workspace, 1 bind = $mainMod, 2, workspace, 2 bind = $mainMod, 3, workspace, 3 bind = $mainMod, 4, workspace, 4 bind = $mainMod, 5, workspace, 5 bind = $mainMod, 6, workspace, 6 bind = $mainMod, 7, workspace, 7 bind = $mainMod, 8, workspace, 8 bind = $mainMod, 9, workspace, 9 bind = $mainMod, 0, workspace, 10 # Move active window to a workspace with mainMod + SHIFT + [0-9] binds = Super_L&Control_L&Shift_L, right, movetoworkspace, +1 binds = Super_L&Control_L&Shift_L, left, movetoworkspace, -1 bind = $mainMod SHIFT, 1, movetoworkspace, 1 bind = $mainMod SHIFT, 2, movetoworkspace, 2 bind = $mainMod SHIFT, 3, movetoworkspace, 3 bind = $mainMod SHIFT, 4, movetoworkspace, 4 bind = $mainMod SHIFT, 5, movetoworkspace, 5 bind = $mainMod SHIFT, 6, movetoworkspace, 6 bind = $mainMod SHIFT, 7, movetoworkspace, 7 bind = $mainMod SHIFT, 8, movetoworkspace, 8 bind = $mainMod SHIFT, 9, movetoworkspace, 9 bind = $mainMod SHIFT, 0, movetoworkspace, 10 # Example special workspace (scratchpad) bind = $mainMod, S, togglespecialworkspace, magic bind = $mainMod SHIFT, S, movetoworkspace, special:magic ### Misc ############################## ### WINDOWS AND WORKSPACES ### ############################## # See https://wiki.hyprland.org/Configuring/Window-Rules/ for more # See https://wiki.hyprland.org/Configuring/Workspace-Rules/ for workspace rules # Example windowrule v1 # windowrule = float, ^(kitty)$ # Example windowrule v2 # windowrulev2 = float,class:^(kitty)$,title:^(kitty)$ windowrulev2 = suppressevent maximize, class:.* # You'll probably like this. windowrulev2 = center(1), class:firefox windowrulev2 = workspace 2, class:firefox windowrulev2 = group barred, workspace:2 windowrulev2 = group override set, class:firefox windowrulev2 = workspace 4, initialTitle:Spotify windowrulev2 = workspace 3, class:webstorm windowrulev2 = opacity 0.85 0.75, class:foot ======Config-End======== ```

Description

Hi. I tried to set up kb layout switching as described in the documentation, but the following doesn't work even though the docs say it should:

➜  ~ hyprctl switchxkblayout current next
device not found

Not sure if this is expected and the docs are outdated, or if it is a regression.

Here's the relevant output of hyprctl devices if that helps:

Keyboards:
    Keyboard at 5bbbfed4e060:
        video-bus
            rules: r "", m "", l "us,ru", v "", o ""
            active keymap: English (US)
            main: no
    Keyboard at 5bbbfed69030:
        power-button
            rules: r "", m "", l "us,ru", v "", o ""
            active keymap: English (US)
            main: no
    Keyboard at 5bbbfea0ad40:
        sleep-button
            rules: r "", m "", l "us,ru", v "", o ""
            active keymap: English (US)
            main: no
    Keyboard at 5bbbfea037b0:
        at-translated-set-2-keyboard
            rules: r "", m "", l "us,ru", v "", o ""
            active keymap: English (US)
            main: yes
    Keyboard at 5bbbfe029e70:
        thinkpad-extra-buttons
            rules: r "", m "", l "us,ru", v "", o ""
            active keymap: English (US)
            main: no

How to reproduce

Run the command above on a fresh installation of Hyprland.

Crash reports, logs, images, videos

No response

londeril commented 1 month ago

Hi :)

I've just tested this on my Hyprland install and it works as described in the docs.

~ hyprctl switchxkblayout current next     
ok

Output from hyprctl devices

Keyboards:
    Keyboard at 5c7601c82a90:
        power-button
            rules: r "", m "", l "ch,us", v "", o ""
            active keymap: German (Switzerland)
            main: no
    Keyboard at 5c7607eeec70:
        power-button-1
            rules: r "", m "", l "ch,us", v "", o ""
            active keymap: German (Switzerland)
            main: no
    Keyboard at 5c7607f55e60:
        logitech-gaming-mouse-g600-keyboard
            rules: r "", m "", l "ch,us", v "", o ""
            active keymap: German (Switzerland)
            main: no
    Keyboard at 5c7607f914b0:
        logitech-mx-vertical
            rules: r "", m "", l "ch,us", v "", o ""
            active keymap: German (Switzerland)
            main: no
    Keyboard at 5c7607fcb710:
        asus-rog-strix-go-2.4-consumer-control
            rules: r "", m "", l "ch,us", v "", o ""
            active keymap: German (Switzerland)
            main: no
    Keyboard at 5c7608006e00:
        logitech-usb-receiver
            rules: r "", m "", l "ch,us", v "", o ""
            active keymap: German (Switzerland)
            main: yes
    Keyboard at 5c76080417e0:
        logitech-usb-receiver-consumer-control
            rules: r "", m "", l "ch,us", v "", o ""
            active keymap: German (Switzerland)
            main: no
    Keyboard at 5c760807cb30:
        logitech-usb-receiver-system-control
            rules: r "", m "", l "ch,us", v "", o ""
            active keymap: German (Switzerland)
            main: no
    Keyboard at 5c76080b7d00:
        eee-pc-wmi-hotkeys
            rules: r "", m "", l "ch,us", v "", o ""
            active keymap: German (Switzerland)
            main: no 

Relevant part from my hyprland.conf

input {
    kb_layout = ch,us
    kb_variant =
    kb_model =
    kb_options =
    kb_rules =
    follow_mouse = 1
    touchpad {
        natural_scroll = true
    }
    sensitivity = 0 # -1.0 - 1.0, 0 means no modification.
}

I'm running Hyprland from the Arch repo

Name            : hyprland
Version         : 0.43.0-1

(edited for spelling)

keliss commented 1 month ago

Huh, interesting. I'll try to update to 0.43.0 tomorrow to see if that helps, thank you.

nwg-piotr commented 1 month ago

This happens to me on the random basis on just started Hyprland, and manifests in the nwg-panel -> KeyboardLayout module. hyprctl -j devices returns {'mice': [], 'keyboards': [], 'tablets': [], 'touch': [], 'switches': []}. If I re-launch the panel after a while, it works well.

keliss commented 1 month ago

Upgrading to 0.43.0 solved the issue, false alarm. @nwg-piotr this might be unrelated because for me the output of the devices command was never empty. So I think we should close this one, and if you'd like, you can open a new issue for your problem.