zevv / bucklespring

Nostalgia bucklespring keyboard sound
GNU General Public License v2.0
1.39k stars 82 forks source link

Independent volume control for keys? #89

Open eighteentee opened 4 years ago

eighteentee commented 4 years ago

Bucklespring is an amazing tool! It simply makes me want to type more and helps enormously with long English assignments :-)

One suggestion though. Only a minor one. I think some sort of GUI volume adjustment for the keys independent of the volume for the rest of the system would be brilliant. There are times when, you might be typing and listening to music or watching a video and the sound of the keys becomes simply too much as increasing the system volume also increases the key sounds; to the point where it becomes unrealistic because the keys are so loud in comparison to the other sounds.

SysH-north commented 2 years ago

Hi, i hope that you solve the pb, btw you didn't mention the Os or the Distribution of your machine but i'll give you a simple solution for Debian.

  1. lunch the app (buckle)
  2. install pavucontrol ((PulseAudio Volume Control (pavucontrol) ) as a volume control tool ( mixer)
  3. open the app (pavucontrol)
  4. go to "Playback section"
  5. at the bottom you'll notice "Show" menu
  6. chose all streams
  7. now you can see the volume level of each app
  8. Adjust your volume
  9. Enjoy

ps : i'm aware of the date of your issue, but just in case that you're a debian user and you did give up on the app , also as a simple solution for the next Debian users.

nimaipatel commented 1 year ago

This is an old issue but just in case someone comes here looking for a solution. I'm currently using bucklespring on arch linux with audio handled by pipewire + wireplumber. I have a wireplumber lua script that changes the volume for all audio inputs at once while ignoring the bucklespring input.

#!/usr/bin/wpexec
--luacheck: globals ObjectManager Interest Constraint Debug Core

local delta = tonumber((...)['delta'] / 100)
if delta == nil then
  delta = 0
end

local om = ObjectManager {
  Interest {
    type = "node",
    Constraint { "media.class", "matches", "*Stream*" },
    Constraint { "node.name", "not-equals", "buckle" },
    Constraint { "node.name", "not-equals", "Mechvibes" },
  }
}

om:connect("objects-changed", function ()
  Core.require_api("mixer", function(mixer)
    mixer.scale = "cubic"
    local new_vol = nil
    for obj in om:iterate() do
      local props = obj['global-properties']
      local id = props['object.id']
      if new_vol == nil then
        local curr = mixer:call("get-volume", id).volume
        new_vol = curr + delta
        if new_vol > 1 then new_vol = 1 end
        if new_vol < 0 then new_vol = 0 end
      end
      mixer:call("set-volume", id, new_vol)
    end
    print(math.ceil(new_vol * 100))
    Core.quit()
  end)
end)

om:activate()

For example, ./mixer.lua delta=5 will increase the volume for all inputs except bucklespring by 5% and ./mixer.lua delta=-5 will decrease by 5%. You can bind this to XF86AudioRaiseVolume and XF86AudioLowerVolume to have a completely stream-lined experience.