Results 1 to 6 of 6

Thread: Changing the keyboard volume curve

  1. #1
    Join Date
    Mar 2008
    Beans
    20
    Distro
    Ubuntu 9.04 Jaunty Jackalope

    [solved] Changing the keyboard volume curve

    Hi,

    The volume up/down buttons on my keyboard work perfectly apart from the adjustment of one press is too much. Currently it takes 16 presses to go from 0% to 100% volume but I would prefer it to be more like 32 presses.

    I'm guessing the volume curve is stored in a configuration file somewhere but I can't find it and there's nothing in the GUI to adjust it.

    Any ideas?
    Last edited by fastfret79; July 28th, 2009 at 09:16 PM. Reason: solved

  2. #2
    Join Date
    Mar 2008
    Beans
    20
    Distro
    Ubuntu 9.04 Jaunty Jackalope

    Re: Changing the keyboard volume curve

    I found that I can use the program keytouch to customise what happens when each button is pressed and can assign the following to volume up:

    Code:
    aumix -v +3
    This will increase the volume by 3% which is exactly what I want. The problem now is that keytouch isn't capturing the key presses. I get the following from the command line:

    Code:
    Warning: Not all keys can be grabbed by this program. This
             can be caused by another program which is already
             grabbing these keys.
    Last edited by fastfret79; February 6th, 2009 at 04:01 PM.

  3. #3
    Join Date
    Mar 2008
    Beans
    20
    Distro
    Ubuntu 9.04 Jaunty Jackalope

    Re: Changing the keyboard volume curve

    Wow, after nearly six months I have finally solved my problem!!!

    All you need to do is first make sure that the Volume up and down are disabled in the normal 'Keyboard Shortcuts' settings.

    Then install the CompizConfig Settings Manager:

    Code:
    sudo apt-get install compizconfig-settings-manager
    Then launch the utility and under the 'General' category, enable the 'Commands' module. THen under the 'Commands' tab, set the following for Command Line 0:

    Code:
    amixer set Master 3%+
    Then on the 'Key Bindings' tab, set the 'Run Command 0' to 'XF86AudioRaiseVolume' (may be different in your case - use the buttons to grab your keypress)

    Then repeat the process using a different slot (and change the '+' to a '-' in the command line) and bind to the Volume Down key... et voila!

    If you are using metacity and not compiz, you can run 'gconf-editor' and under 'Apps > Metacity' there are similar settings under 'global_keybindings' and 'keybinding_commands'

    Hope this helps someone else too

    btw - there is space for up to 12 commands that you can set custom keystrokes for, plus button bindings and edge bindings too - lots of possibilities!

  4. #4
    Join Date
    Jul 2009
    Location
    Tampere, Finland
    Beans
    16
    Distro
    Ubuntu 9.04 Jaunty Jackalope

    Re: Changing the keyboard volume curve

    Quote Originally Posted by fastfret79 View Post
    Wow, after nearly six months I have finally solved my problem!!!
    Wow! Great stuff, thanks for sharing! I've been bugged with this issue lately as well (music always too loud or too quiet) so it's good that you posted the solution even if the thread seems like a monologue. Have to try this out soon.

    It's very annoying to Google around and find posts like "Thanks for all the tips but I got it working now by myself" and no info for others with the same problem!

  5. #5
    Join Date
    Mar 2008
    Beans
    20
    Distro
    Ubuntu 9.04 Jaunty Jackalope

    Re: Changing the keyboard volume curve

    Hey thanks Sepanderi,

    Sharing is always good, plus it's a good way for me to write a note for myself as I'll probably have forgotten how I did this once Karmic comes out!

    I always found it an annoying problem and had all but given up on it - it's something that seems so simple but I couldn't find anyway of doing what was needed before.

    I recently switched from using the Gnome menu and panels to using tint2 and gnome-do and had lost the volume control in the sys tray (and is no longer needed) so the problem reared it's head again!

    Let me know if you need any help setting this up and if any of my instructions aren't clear

  6. #6
    Join Date
    Mar 2008
    Beans
    20
    Distro
    Ubuntu 9.04 Jaunty Jackalope

    Re: Changing the keyboard volume curve

    Hopefully the final entry to my mostly one-way conversation

    One thing I miss is the nice new notifications that came with Jaunty, so I modified a script I found that wraps amixer and uses the notify-send command to ... er ... notify you:

    Code:
    #!/bin/sh
    
    if [ $1 = 'up' ]; then
    amixer set Master 3%+
    elif [ $1 = 'down' ]; then
    amixer set Master 3%-
    elif [ $1 = 'tinyup' ]; then
    amixer set Master 1%+
    elif [ $1 = 'tinydown' ]; then
    amixer set Master 1%-
    elif [ $1 = 'mute' ]; then
    amixer set Master toggle
    else
    echo "Unknown control command: $1" >&2
    exit 1
    fi
    VOLUME=$(amixer sget Master | sed '/^ *Mono: /{s/^.*\[\(.*\)%\].*/\1/;p;};d;')
    STATUS=$(amixer sget Master | awk '$2 == "Mono:" { print $NF; }')
    if [ $STATUS = '[off]' ]; then
    ICON=notification-audio-volume-muted
    else
    echo $VOLUME
    if [ $VOLUME -eq 0 ]; then
    ICON=notification-audio-volume-off
    elif [ $VOLUME -lt 33 ]; then
    ICON=notification-audio-volume-low
    elif [ $VOLUME -lt 66 ]; then
    ICON=notification-audio-volume-medium
    else
    ICON=notification-audio-volume-high
    fi
    VOLUME="${VOLUME}%"
    fi
    notify-send "Volume" -i $ICON -h int:value:$VOLUME -h string:x-canonical-private-synchronous:
    Just save the code and make it executable - I saved it to a file called 'VolChange' in my home folder.

    Then in the compizconfig-settings-manager command section, I set the command for Volume Up to the following:

    Code:
    sh ~/VolChange up
    Similarly, I changed the Volume Down command but with 'down' at the end. I have also added a 'tinyup' and 'tinydown' that alters the volume by 1% and assigned it to ctrl+Volume Up/Down for when you want small changes

Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •