Accendere il led del mouse
- Fiery CroSS
- Scoppiettante Seguace
- Messaggi: 977
- Iscrizione: martedì 4 aprile 2006, 15:05
Accendere il led del mouse
Funziona perfettamente ma vorrei creare uno script per accendere/spegnere il led azzurro della rotellina a comando (normalmente con Ubuntu 12.04 è sempre spendo tranne per un istante al boot).
Qualche idea su come potrei fare?
Ho fatto qualche ricerca su Google ma non ho trovato nulla di utile, spero nel vostro aiuto!
Grazie mille!
- dade-bian
- Scoppiettante Seguace
- Messaggi: 597
- Iscrizione: sabato 17 dicembre 2011, 12:08
- Desktop: Gnome Shell
- Distribuzione: Ubuntu/Debian
- Sesso: Maschile
- Località: Milano
Re: Accendere il led del mouse
XDD ti rispondo io per esperienza personale e faccio ancora tutto ora questo grande errore, ci chiedi una cosa troppo grande da rispondere attraverso una discussione.
ci puoi chiedere al massimo la correzione di un codice o un consiglio come fare a fare un singolo comando.
In bocca al lupo lo stesso sembra una cosa utile quella che vuoi fare
- Fiery CroSS
- Scoppiettante Seguace
- Messaggi: 977
- Iscrizione: martedì 4 aprile 2006, 15:05
Re: Accendere il led del mouse
$ dmesg|tail
Codice: Seleziona tutto
[ 3156.756057] usb 3-1: new low-speed USB device number 5 using uhci_hcd
[ 3156.942488] input: HP Wireless Optical Mobile Mouse as /devices/pci0000:00/0000:00:1a.0/usb3/3-1/3-1:1.0/input/input15
[ 3156.942738] generic-usb 0003:03F0:8207.0006: input,hidraw0: USB HID v1.00 Mouse [HP Wireless Optical Mobile Mouse] on usb-0000:00:1a.0-1/input0
Codice: Seleziona tutto
totale 0
drwxr-xr-x 2 root root 0 ago 8 15:37 capabilities
lrwxrwxrwx 1 root root 0 ago 8 15:39 device -> ../../../3-1:1.0
drwxr-xr-x 3 root root 0 ago 8 15:37 event9
drwxr-xr-x 2 root root 0 ago 8 15:37 id
-r--r--r-- 1 root root 4096 ago 8 15:39 modalias
drwxr-xr-x 3 root root 0 ago 8 15:37 mouse0
-r--r--r-- 1 root root 4096 ago 8 15:37 name
-r--r--r-- 1 root root 4096 ago 8 15:39 phys
drwxr-xr-x 2 root root 0 ago 8 15:39 power
-r--r--r-- 1 root root 4096 ago 8 15:39 properties
lrwxrwxrwx 1 root root 0 ago 8 15:37 subsystem -> ../../../../../../../../class/input
-rw-r--r-- 1 root root 4096 ago 8 15:37 uevent
-r--r--r-- 1 root root 4096 ago 8 15:39 uniq
Codice: Seleziona tutto
HP Wireless Optical Mobile Mouse
Codice: Seleziona tutto
totale 0
-r--r--r-- 1 root root 4096 ago 8 15:37 abs
-r--r--r-- 1 root root 4096 ago 8 15:37 ev
-r--r--r-- 1 root root 4096 ago 8 15:43 ff
-r--r--r-- 1 root root 4096 ago 8 15:37 key
-r--r--r-- 1 root root 4096 ago 8 15:43 led
-r--r--r-- 1 root root 4096 ago 8 15:43 msc
-r--r--r-- 1 root root 4096 ago 8 15:37 rel
-r--r--r-- 1 root root 4096 ago 8 15:43 snd
-r--r--r-- 1 root root 4096 ago 8 15:37 sw
Codice: Seleziona tutto
0
Codice: Seleziona tutto
bash: led: Permesso negato
Codice: Seleziona tutto
bash: echo: errore in scrittura: Errore di input/output
- vaeVictis
- Imperturbabile Insigne
- Messaggi: 4703
- Iscrizione: venerdì 27 luglio 2012, 17:58
- Desktop: Gnome
- Distribuzione: Ubuntu 20.04 64bit
Re: Accendere il led del mouse
Non so se sia una svista nel copiare il comando, ma quell'output mi "insospettisce".Fiery CroSS » [url=http://forum.ubuntu-it.org/viewtopic.php?p=4153767#p4153767]oggi, 16.14[/url] ha scritto: [...]
Se provo a fare sudo echo 1 > /sys/devices/pci0000:00/0000:00:1a.0/usb3/3-1/3-1:1.0/input/input15/capabilities/ led mi da:Codice: Seleziona tutto
bash: led: Permesso negato
Hai notato che nel path del file che vuoi sovrascrivere c'è uno spazio prima di "led"??
Posta per cortesia l'output di:
Codice: Seleziona tutto
ls -hl /sys/devices/pci0000:00/0000:00:1a.0/usb3/3-1/3-1:1.0/input/input15/capabilities/led
Anche perché l'output dovrebbe contenere il path completo del file su cui non hai i permessi, per esempio:
Codice: Seleziona tutto
echo 1 >> /sys/devices/pci0000\:00/0000\:00\:1f.0/power/wakeup
bash: /sys/devices/pci0000:00/0000:00:1f.0/power/wakeup: Permesso negato
In genere non è una buona pratica quella di cambiare i permessi a file di questo tipo (o ancora peggio alle directory che le contengono).Cambiando i permessi e rieseguendo il comando echo ottengo invece:Idee? Sono completamente fuori strada?Codice: Seleziona tutto
bash: echo: errore in scrittura: Errore di input/output
Con che comando hai cambiato tali permessi?
Ciao.
«I fear not the man who has practiced 10000 kicks once,
but I fear the man who has practiced one kick 10000 times.»
- Fiery CroSS
- Scoppiettante Seguace
- Messaggi: 977
- Iscrizione: martedì 4 aprile 2006, 15:05
Re: Accendere il led del mouse
credo che lo spazio sia stato un errore di battitura quando riprovavo i comandi per copiarne l'output.
Ad ogni modo ecco qui i comandi corretti, compreso quello che mi chiedevi di eseguire (prima e dopo aver cambiato i permessi al file 'led'):
Codice: Seleziona tutto
$ dmesg|grep -i 'optical'
[ 4.371378] input: HP Wireless Optical Mobile Mouse as /devices/pci0000:00/0000:00:1a.0/usb3/3-1/3-1:1.0/input/input9
[ 4.372632] generic-usb 0003:03F0:8207.0001: input,hidraw0: USB HID v1.00 Mouse [HP Wireless Optical Mobile Mouse] on usb-0000:00:1a.0-1/input0
$ cat /sys/devices/pci0000:00/0000:00:1a.0/usb3/3-1/3-1:1.0/input/input9/name
HP Wireless Optical Mobile Mouse
Codice: Seleziona tutto
$ ls -hl /sys/devices/pci0000:00/0000:00:1a.0/usb3/3-1/3-1:1.0/input/input9/capabilities/led
-r--r--r-- 1 root root 4,0K ago 8 21:06 /sys/devices/pci0000:00/0000:00:1a.0/usb3/3-1/3-1:1.0/input/input9/capabilities/led
$ sudo chmod +w /sys/devices/pci0000:00/0000:00:1a.0/usb3/3-1/3-1:1.0/input/input9/capabilities/led
$ ls -hl /sys/devices/pci0000:00/0000:00:1a.0/usb3/3-1/3-1:1.0/input/input9/capabilities/led
-rw-r--r-- 1 root root 4,0K ago 8 21:08 /sys/devices/pci0000:00/0000:00:1a.0/usb3/3-1/3-1:1.0/input/input9/capabilities/led
Codice: Seleziona tutto
$ sudo echo 1 > /sys/devices/pci0000:00/0000:00:1a.0/usb3/3-1/3-1:1.0/input/input9/capabilities/led
bash: /sys/devices/pci0000:00/0000:00:1a.0/usb3/3-1/3-1:1.0/input/input9/capabilities/led: Permesso negato
andrea@andrea-R519:~$ sudo su
# echo 1 > /sys/devices/pci0000:00/0000:00:1a.0/usb3/3-1/3-1:1.0/input/input9/capabilities/led
bash: echo: errore in scrittura: Errore di input/output
Al riavvio inoltre i permessi tornano quelli di default, ovvero -r--r--r--.
Ho provato anche con il comando xset che mi permette di controllare il led del "Scroll Lock", e solo quello, sulla tastiera ma niente da fare, la rotellina non si accende!
Codice: Seleziona tutto
$ xset -q
Keyboard Control:
auto repeat: on key click percent: 0 LED mask: 00000002
XKB indicators:
00: Caps Lock: off 01: Num Lock: on 02: Scroll Lock: off
03: Compose: off 04: Kana: off 05: Sleep: off
06: Suspend: off 07: Mute: off 08: Misc: off
09: Mail: off 10: Charging: off 11: Shift Lock: off
12: Group 2: off 13: Mouse Keys: off
auto repeat delay: 500 repeat rate: 33
auto repeating keys: 00ffffffdffffbbf
fadfffefffedffff
9fffffffffffffff
fff7ffffffffffff
bell percent: 50 bell pitch: 400 bell duration: 100
Pointer Control:
acceleration: 11/2 threshold: 10
Screen Saver:
prefer blanking: yes allow exposures: yes
timeout: 0 cycle: 0
Colors:
default colormap: 0x20 BlackPixel: 0 WhitePixel: 16777215
Font Path:
/usr/share/fonts/X11/misc,/usr/share/fonts/X11/Type1,built-ins
DPMS (Energy Star):
Standby: 0 Suspend: 0 Off: 0
DPMS is Enabled
Monitor is On
$ xset led named "Mouse Keys"
$ xset -q
Keyboard Control:
auto repeat: on key click percent: 0 LED mask: 00002002
XKB indicators:
00: Caps Lock: off 01: Num Lock: on 02: Scroll Lock: off
03: Compose: off 04: Kana: off 05: Sleep: off
06: Suspend: off 07: Mute: off 08: Misc: off
09: Mail: off 10: Charging: off 11: Shift Lock: off
12: Group 2: off 13: Mouse Keys: on
auto repeat delay: 500 repeat rate: 33
auto repeating keys: 00ffffffdffffbbf
fadfffefffedffff
9fffffffffffffff
fff7ffffffffffff
bell percent: 50 bell pitch: 400 bell duration: 100
Pointer Control:
acceleration: 11/2 threshold: 10
Screen Saver:
prefer blanking: yes allow exposures: yes
timeout: 0 cycle: 0
Colors:
default colormap: 0x20 BlackPixel: 0 WhitePixel: 16777215
Font Path:
/usr/share/fonts/X11/misc,/usr/share/fonts/X11/Type1,built-ins
DPMS (Energy Star):
Standby: 0 Suspend: 0 Off: 0
DPMS is Enabled
Monitor is On
- vaeVictis
- Imperturbabile Insigne
- Messaggi: 4703
- Iscrizione: venerdì 27 luglio 2012, 17:58
- Desktop: Gnome
- Distribuzione: Ubuntu 20.04 64bit
Re: Accendere il led del mouse
Cerco di capire meglio il problema (mai avuto mouse ottici con led) e ti faccio sapere
«I fear not the man who has practiced 10000 kicks once,
but I fear the man who has practiced one kick 10000 times.»
- Fiery CroSS
- Scoppiettante Seguace
- Messaggi: 977
- Iscrizione: martedì 4 aprile 2006, 15:05
- vaeVictis
- Imperturbabile Insigne
- Messaggi: 4703
- Iscrizione: venerdì 27 luglio 2012, 17:58
- Desktop: Gnome
- Distribuzione: Ubuntu 20.04 64bit
Re: Accendere il led del mouse
Quindi:
Codice: Seleziona tutto
file /sys/devices/pci0000:00/0000:00:1a.0/usb3/3-1/3-1:1.0/input/input9/capabilities/led
hai visto il mouse ottico nel negozio online di Canonical?
«I fear not the man who has practiced 10000 kicks once,
but I fear the man who has practiced one kick 10000 times.»
- Fiery CroSS
- Scoppiettante Seguace
- Messaggi: 977
- Iscrizione: martedì 4 aprile 2006, 15:05
Re: Accendere il led del mouse
Codice: Seleziona tutto
$ file /sys/devices/pci0000:00/0000:00:1a.0/usb3/3-1/3-1:1.0/input/input9/capabilities/led
/sys/devices/pci0000:00/0000:00:1a.0/usb3/3-1/3-1:1.0/input/input9/capabilities/led: ASCII text
- vaeVictis
- Imperturbabile Insigne
- Messaggi: 4703
- Iscrizione: venerdì 27 luglio 2012, 17:58
- Desktop: Gnome
- Distribuzione: Ubuntu 20.04 64bit
Re: Accendere il led del mouse
Pertanto posso fare le prove in locale sul mio computer
«I fear not the man who has practiced 10000 kicks once,
but I fear the man who has practiced one kick 10000 times.»
- Fiery CroSS
- Scoppiettante Seguace
- Messaggi: 977
- Iscrizione: martedì 4 aprile 2006, 15:05
Re: Accendere il led del mouse
- cristian_c
- Accecante Asceta
- Messaggi: 23422
- Iscrizione: lunedì 29 ottobre 2007, 11:31
Re: Accendere il led del mouse
Mi chiedo però quale sia lo scopo di tutto ciòFiery CroSS » [url=http://forum.ubuntu-it.org/viewtopic.php?p=4154007#p4154007]08/08/2012, 22:15[/url] ha scritto: Ricorda però che io non voglio controllare la luce sotto il mouse (solitamente rossa) ma il led nella rotellina! Grazie ancora per l'interesse!
- vaeVictis
- Imperturbabile Insigne
- Messaggi: 4703
- Iscrizione: venerdì 27 luglio 2012, 17:58
- Desktop: Gnome
- Distribuzione: Ubuntu 20.04 64bit
Re: Accendere il led del mouse
Io non mi sono fatto più "vivo" perché non sto riuscendo a risolvere.cristian_c » [url=http://forum.ubuntu-it.org/viewtopic.php?p=4156577#p4156577]oggi, 14.26[/url] ha scritto:Mi chiedo però quale sia lo scopo di tutto ciòFiery CroSS » [url=http://forum.ubuntu-it.org/viewtopic.php?p=4154007#p4154007]08/08/2012, 22:15[/url] ha scritto: Ricorda però che io non voglio controllare la luce sotto il mouse (solitamente rossa) ma il led nella rotellina! Grazie ancora per l'interesse!
Un utilizzo? Io ho trovato la cosa interessante perché sarebbe troppo "fico" fare uno script che ti accende e spegne la luce secondo il ritmo di una canzone che stai ascoltando
«I fear not the man who has practiced 10000 kicks once,
but I fear the man who has practiced one kick 10000 times.»
Chi c’è in linea
Visualizzano questa sezione: 0 utenti iscritti e 12 ospiti