Skip to main content

Thread: Link keystroke with a sound


i have sound linked caps lock key operation. have visual indication.

looking through past posts seems not possible.

have tried windows programs under wine, these don't work.

surely must possible make link somehow?

ideas?

randj

firstly when running compiz.
edit: though set in unity using compiz, found carries on other sessions different window managers...eg gnome , gnome classic(no effects).

uses ffplay needs ffmpeg installed.
there other ways of playing sound find ffplay more reliable different formats.

test in terminal...
code:
ffplay -nodisp -autoexit /usr/share/sounds/gnome/default/alerts/glass.ogg
if works open compizconfig-settings-manager (ccsm)
, goto commands plugin.
in command line 0 box, paste in...
code:
ffplay -nodisp -autoexit /usr/share/sounds/gnome/default/alerts/glass.ogg
goto key bindings tab , click on disabled button run command 0
mark enabled , hit grab key combination button.
press capslock key close little ccsm window , click ok.
should have sound when capslock pressed.


use path script in command line 0 box.
plays sound , sends notification on status of capslock.
sound plays when capslock enabled.
code:
#!/bin/bash    value=$(xset q | grep "caps lock:" | awk '{print $4}' | grep -c on)    if [ "$value" -eq "1" ];       notify-send -i  "/usr/share/icons/gnome/48x48/devices/keyboard.png" "                    caps lock on" &     ffplay -nodisp -autoexit /usr/share/sounds/gnome/default/alerts/glass.ogg        else     notify-send -i  "/usr/share/icons/gnome/48x48/devices/keyboard.png" "                    caps lock off"       fi
attached images attached images


Forum The Ubuntu Forum Community Ubuntu Official Flavours Support General Help [ubuntu] Link keystroke with a sound


Ubuntu

Comments

Popular posts from this blog

How to set the order of FAQs instead of alphabetical

Thread: Get UK Keyboard working

how do I change the e-mail address for my merchant account