raminsamadi123 / hyprinstall

Automatic installation script of Hyprland on Arch Linux
MIT License
18 stars 3 forks source link

How to use volume up and down keys #7

Open D3vil0p3r opened 1 year ago

D3vil0p3r commented 1 year ago

Hello! I'm just landed on Hyprland and I landed on this wonderful repository.

There is one aspect I don't understand about the volume up and down. The hyperland.conf file has the following bindkeys:

binde=, XF86AudioRaiseVolume, exec, wpctl set-volume @DEFAULT_AUDIO_SINK@ 5%+
binde=, XF86AudioLowerVolume, exec, wpctl set-volume @DEFAULT_AUDIO_SINK@ 5%-
binde=, XF86AudioMute, exec, wpctl set-mute @DEFAULT_AUDIO_SINK@ toggle
bind=, XF86AudioPlay, exec, playerctl play-pause
bind=, XF86AudioPause, exec, playerctl play-pause
bind=, XF86AudioNext, exec, playerctl next
bind=, XF86AudioPrev, exec, playerctl previous

and on my laptop keyboard, for increasing or decreasing the volume I must press Fn + LeftArrow for decreasing the volume and Fn + RightArrow for increasing it. With the configuration above these keys don't work. This is the keyboard layout of my laptop: image

raminsamadi123 commented 1 year ago

Hi there @D3vil0p3r, thank you for discovering our repository and for reaching out with your question.

Regarding the volume control issue, I understand that the current key bindings in the ~/.config/hypr/hyprland.conf file don't seem to work with the volume keys on your laptop keyboard, which are Fn + LeftArrow for decreasing volume and Fn + RightArrow for increasing it.

To address this, you can try the following steps:

  1. Install the required dependencies if you haven't already: playerctl and wireplumber (please note that I'm unsure of the exact package name for wireplumber).
  2. Open the ~/.config/hypr/hyprland.conf file and make sure the following changes has been made:
    binde=, XF86AudioRaiseVolume, exec, wpctl set-volume @DEFAULT_AUDIO_SINK@ 5%+
    binde=, XF86AudioLowerVolume, exec, wpctl set-volume @DEFAULT_AUDIO_SINK@ 5%-
    binde=, XF86AudioMute, exec, wpctl set-mute @DEFAULT_AUDIO_SINK@ toggle
    bind=, XF86AudioPlay, exec, playerctl play-pause
    bind=, XF86AudioPause, exec, playerctl play-pause
    bind=, XF86AudioNext, exec, playerctl next
    bind=, XF86AudioPrev, exec, playerctl previous
  3. Let me explain these changes in more detail:

As for the Fn key, it might not work as a key identifier in Linux. To determine the keycode for your Fn key, you can use tools like wev or xev. Once you have the keycode, you can refer to the Hyprland wiki for configuring binds with a keycode. Here's the link to the wiki page that might assist you: Hyprland Wiki - Configuring Binds.

I hope these suggestions help you resolve the volume control issue on your laptop. Please let me know if you have any further questions or if there's anything else I can assist you with.

Best regards, @raminsamadi123

D3vil0p3r commented 1 year ago

@raminsamadi123 you are so kind. Thank you for your answer.

I think the issue is related to the disabled systemctl wirepumbler or pipewire services. Indeed when I enabled them, it starts to work. I must detect which one of these two is the one to keep enabled and running. I guess wirepumbler. I will do more tests.