Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add a way to control the volume/brightness with gestures #470

Closed
ConstantMan opened this issue Mar 12, 2021 · 5 comments
Closed

Add a way to control the volume/brightness with gestures #470

ConstantMan opened this issue Mar 12, 2021 · 5 comments

Comments

@ConstantMan
Copy link

ConstantMan commented Mar 12, 2021

Is your feature request related to a problem?

In Windows 10 there's an ability to change volume with 3 fingers up/down
For example if I swipe 5mm volume changes by 5% (approximately), 10mm - 10% and so on.
With libinput-gestures and pulseaudio on Arch:
gesture swipe up pactl set-sink-volume 0 +10%

So if I want to change volume by 30% I need to swipe 3 times, not 1.

Describe the solution you'd like

Touchegg i believe can implement this feature way better than libinput ,especially with the "repeat command" option

Describe alternatives you've considered

I tried adding the keyboard shortcut i have for volume -/+ but it doesn't work and i don't know what command i should use

@JoseExposito
Copy link
Owner

Hi!

This is already possible, try this config:

    <gesture type="SWIPE" fingers="3" direction="UP">
      <action type="RUN_COMMAND">
        <repeat>true</repeat>
        <command>pactl set-sink-volume 0 +10%</command>
        <decreaseCommand>pactl set-sink-volume 0 -10%</decreaseCommand>
      </action>
    </gesture>

    <gesture type="SWIPE" fingers="3" direction="DOWN">
      <action type="RUN_COMMAND">
        <repeat>true</repeat>
        <command>pactl set-sink-volume 0 -10%</command>
        <decreaseCommand>pactl set-sink-volume 0 +10%</decreaseCommand>
      </action>
    </gesture>

@ConstantMan
Copy link
Author

Nice ,I just tested it very smooth , I'm really surprised ,although it would be nice if it was possible to see the volume OSD

@parkerlreed
Copy link

You can. Just emulate the button presses

xdotool key XF86AudioLowerVolume

or

xdotool key XF86AudioRaiseVolume

As the commands

@Troilus90
Copy link

Troilus90 commented Sep 15, 2021

Hi, Josè.

I tried to do the same on KDE neon, automatically and manually, but it doesn't work. Maybe because is debian based and not arch based. Is there a list of the commands? Sorry but I'm new in the GNU/Linux world.

Thanks.

Edit: With the following commands it works. I post it with those about brightness control. It could be usefull for someone else. Thanks again for this spectacular software.

To decrease the volume:
qdbus org.kde.kglobalaccel /component/kmix invokeShortcut "decrease_volume"

To increase the volume:
qdbus org.kde.kglobalaccel /component/kmix invokeShortcut "increase_volume"

To decrese the brightness:
qdbus org.kde.Solid.PowerManagement /org/kde/Solid/PowerManagement/Actions/BrightnessControl org.kde.Solid.PowerManagement.Actions.BrightnessControl.setBrightness $(expr $(qdbus org.kde.Solid.PowerManagement /org/kde/Solid/PowerManagement/Actions/BrightnessControl org.kde.Solid.PowerManagement.Actions.BrightnessControl.brightness) - 375)

To increase the brightness:
qdbus org.kde.Solid.PowerManagement /org/kde/Solid/PowerManagement/Actions/BrightnessControl org.kde.Solid.PowerManagement.Actions.BrightnessControl.setBrightness $(expr $(qdbus org.kde.Solid.PowerManagement /org/kde/Solid/PowerManagement/Actions/BrightnessControl org.kde.Solid.PowerManagement.Actions.BrightnessControl.brightness) + 375)

@thepronightly
Copy link

Hi, Josè.

I tried to do the same on KDE neon, automatically and manually, but it doesn't work. Maybe because is debian based and not arch based. Is there a list of the commands? Sorry but I'm new in the GNU/Linux world.

Thanks.

Edit: With the following commands it works. I post it with those about brightness control. It could be usefull for someone else. Thanks again for this spectacular software.

To decrease the volume: qdbus org.kde.kglobalaccel /component/kmix invokeShortcut "decrease_volume"

To increase the volume: qdbus org.kde.kglobalaccel /component/kmix invokeShortcut "increase_volume"

To decrese the brightness: qdbus org.kde.Solid.PowerManagement /org/kde/Solid/PowerManagement/Actions/BrightnessControl org.kde.Solid.PowerManagement.Actions.BrightnessControl.setBrightness $(expr $(qdbus org.kde.Solid.PowerManagement /org/kde/Solid/PowerManagement/Actions/BrightnessControl org.kde.Solid.PowerManagement.Actions.BrightnessControl.brightness) - 375)

To increase the brightness: qdbus org.kde.Solid.PowerManagement /org/kde/Solid/PowerManagement/Actions/BrightnessControl org.kde.Solid.PowerManagement.Actions.BrightnessControl.setBrightness $(expr $(qdbus org.kde.Solid.PowerManagement /org/kde/Solid/PowerManagement/Actions/BrightnessControl org.kde.Solid.PowerManagement.Actions.BrightnessControl.brightness) + 375)

That command great! Thank you for this mate.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants