|
||||
|
|||||||
![]() |
|
|
Strumenti della discussione | Modalità di visualizzazione |
|
|
#1 (permalink) |
|
Esperto della community ![]() ![]()
2,353 Messaggi
![]() ![]() ![]() |
Comandare amaroK tramite i tasti multimediali
Passo 1 - Trovare i codici di controllo dei tasti multimediali
Effettueremo questa operazione con xbindkeys. Eseguiamo: codice:
$ xbindkeys -k codice:
m:0x10 + c:162 codice:
Play/Pausa ==> m:0x10 + c:162 Stop ==> m:0x10 + c:164 Precedente ==> m:0x10 + c:144 Successivo ==> m:0x10 + c:153 Questo e' un semplice script bash: /home/alberto/Programmi/bin/amarok-ctl codice:
#!/bin/bash
amarokRunning=`ps cx | grep amarokapp`
if [ -n "$amarokRunning" ]
then
amarokStatus=`dcop amarok player status`
if [ "$amarokStatus" = "0" ]
then
if [ "$1" != "stop" ]
then
dcop amarok player play
fi
else
if [ "$amarokStatus" = "1" ]
then
if [ "$1" = "pause" ]
then
dcop amarok player play
fi
else
dcop amarok player $1
fi
fi
else
amarok
fi
codice:
$ chmod +x /home/alberto/Programmi/bin/amarok-ctl Per fare questo modifichiamo il file di configurazione di xbindkeys. Nel mio caso: /home/alberto/.xbindkeysrc codice:
"/home/alberto/Programmi/bin/amarok-ctl pause"
m:0x0 + c:162
"/home/alberto/Programmi/bin/amarok-ctl prev"
m:0x0 + c:144
"/home/alberto/Programmi/bin/amarok-ctl next"
m:0x0 + c:153
"/home/alberto/Programmi/bin/amarok-ctl stop"
m:0x0 + c:164
Possiamo lanciare xbindkeys manualmente con codice:
xbindkeys /home/alberto/.kde/Autostart/xbindkeys codice:
#!/bin/sh xbindkeys codice:
chmod +x /home/alberto/.kde/Autostart/xbindkeys
__________________
- Leggi il regolamento prima di postare - Hai scritto un articolo tecnico? - Grazie al nostro aiuto hai completato un redditizio lavoro? Potresti donare alla community una piccola percentuale - Prima di postare, controlla se la tua domanda non e' gia' stata posta - Se un utente ti è stato d'aiuto usa il pulsante Commenta Intervento per aumentare la sua reputazione! - La mia home page Ultima modifica di albertonissa : 08-06-2007 a 15:39. |
|
|
|
![]() |
«
OpenSuSE 10.2: Cambiare il Package Manager
|
Knoppix: Salvare i dati di un pc con una distribuzione live Linux
»
| Strumenti della discussione | |
| Modalità di visualizzazione | |
|
|
Tutti gli orari sono GMT +2. Attualmente sono le 09:55.








Modalità lineare

