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

Allow changing step for volume up/down #616

Closed
repparw opened this issue Nov 27, 2024 · 4 comments · Fixed by #629
Closed

Allow changing step for volume up/down #616

repparw opened this issue Nov 27, 2024 · 4 comments · Fixed by #629
Labels
enhancement New feature or request good first issue Good for newcomers

Comments

@repparw
Copy link

repparw commented Nov 27, 2024

Allow to set a different step for volumeup/down keymaps instead of always using 5.

Maybe a config option, or an optional argument after the command (volumeup 2 instead of volumeup)

@repparw repparw added the enhancement New feature or request label Nov 27, 2024
@aome510 aome510 added the good first issue Good for newcomers label Nov 30, 2024
@DOD-101
Copy link
Contributor

DOD-101 commented Dec 7, 2024

If we change this into being an adjustable amount, would it not also make sense to have just one command (e.g. VolumeChange) to adjust the volume up or down. Then you could simply pass a positive or negative value.

This would also then be similar to the CLI option to change the volume. Thoughts @aome510?

@aome510
Copy link
Owner

aome510 commented Dec 7, 2024

If we change this into being an adjustable amount, would it not also make sense to have just one command (e.g. VolumeChange) to adjust the volume up or down. Then you could simply pass a positive or negative value.

This would also then similar to the CLI option to change the volume. Thoughts @aome510?

sounds good

DOD-101 added a commit to DOD-101/spotify-player that referenced this issue Dec 8, 2024
This change implements what was requested in aome510#616, but would require
users to re-write their `keymap.toml`.

BREAKING CHANGE: keymap.toml will have to be re-written
DOD-101 added a commit to DOD-101/spotify-player that referenced this issue Dec 8, 2024
This change implements what was requested in aome510#616.
DOD-101 added a commit to DOD-101/spotify-player that referenced this issue Dec 8, 2024
This change implements what was requested in aome510#616.
@aome510 aome510 closed this as completed in ff4eaac Dec 8, 2024
@repparw
Copy link
Author

repparw commented Dec 10, 2024

Sorry just checking this, but this makes it have a different format from all other commands.

Maybe make offset implicit. e.g "VolumeChange -2"

This also affects nix/home-manager configs... can't pass {{}} to command when the module expects strings.

programs.spotify-player = {
    enable = true;
    keymaps = [
      {
        command = { VolumeChange = { offset = 2 } };
        key_sequence = "0";
      }
      {
        command = { VolumeChange = { offset = -2 } };
        key_sequence = "9";
      }
      {
        command = "Mute";
        key_sequence = "m";
      }
      {
        command = "NextTrack";
        key_sequence = "n";
      }
      {
        command = "PreviousTrack";
        key_sequence = "b";
      }
      {
        command = "PreviousTrack";
        key_sequence = "p";
      }
      {
        command = "PreviousPage";
        key_sequence = "q";
      }
      {
        command = "FocusNextWindow";
        key_sequence = "l";
      }
      {
        command = "FocusPreviousWindow";
        key_sequence = "h";
      }
      {
        command = "Quit";
        key_sequence = "C-q";
      }
      {
        command = "LibraryPage";
        key_sequence = "g h";
      }
      {
        command = "LyricPage";
        key_sequence = "g l";
      }
    ];
    actions = [
      {
        action = "CopyLink";
        key_sequence = "y";
        target = "PlayingTrack";
      }
      {
        action = "CopyLink";
        key_sequence = "Y";
      }
      {
        action = "GoToArtist";
        key_sequence = "g A";
        target = "PlayingTrack";
      }
      {
        action = "GoToAlbum";
        key_sequence = "g B";
        target = "PlayingTrack";
      }
      {
        action = "ToggleLiked";
        key_sequence = "C-l";
        target = "PlayingTrack";
      }
    ];

@DOD-101
Copy link
Contributor

DOD-101 commented Dec 10, 2024

Sorry just checking this

No worries mate.

I just checked and this does work with home manager:

        {
          command = {
            VolumeChange = {
              offset = 2;
            };
          };
          key_sequence = "0";
        }

The TOML output looks a bit different but works the same.

Do keep in mind that this hasn't yet made it into a release, meaning if you want to use this currently, you will need to build from source.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request good first issue Good for newcomers
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants