View Single Post
Old 20-05-2012, 12:13   #58
vampirodolce1
Senior Member
 
L'Avatar di vampirodolce1
 
Iscritto dal: Jul 2006
Messaggi: 1172
Per chi come me guarda i film sul computer e usa il cellulare come telecomando, segnalo l'applicazione 'sshmote' per Android, che si collega al server ssh installato sul pc e permette di avere un vero e proprio telecomando sullo schermo del cellulare. Nel mio caso il computer prende l'indirizzo IP datogli dal cellulare e non c'e' alcun router ADSL intermedio, il tutto e' fatto via wifi.

sshmote e' compatibile con svariati player multimediali (mplayer, vlc, amarok, kaffeine,...), io ho usato mplayer.

Per essere piu' precisi, per avere la multisessione conviene selezionare la modalita' 'mplayer with screen', che lancia mplayer dentro una sessione di screen. Ad esempio, il PLAY del telecomando equivale a:
Quote:
screen -dmS sshmote mplayer -slave -fs -zoom %s
Come si vede screen viene lanciato con l'opzione detach, a cui ci possiamo riagganciare se chiudiamo sshmote sul cellulare.

Va notato che screen non funziona correttamente se all'avvio (runlevel S) non viene eseguito /etc/init.d/screen-cleanup e lo stesso problema c'e' se si prova a lanciare screen in una sessione ssh qualsiasi senza prima aver eseguito '/etc/init.d/screen-cleanup start'. Alternativamente si possono eseguire, sempre in uno script all'avvio, i comandi:
Quote:
mkdir -p /var/run/screen
chown root:utmp /var/run/screen
chmod 775 /var/run/screen
Una nota sul timeout dello schermo. In X si gestisce col comando xset. L'opzione 'q' ci fa vedere i parametri attualmente in uso:
Quote:
debian@localhost:~/Desktop$ xset q
Keyboard Control:
auto repeat: on key click percent: 0 LED mask: 00000000
XKB indicators:
00: Caps Lock: off 01: Num Lock: off 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: 0 bell pitch: 400 bell duration: 100
Pointer Control:
acceleration: 20/10 threshold: 10
Screen Saver:
prefer blanking: yes allow exposures: yes
timeout: 600 cycle: 600

Colors:
default colormap: 0x20 BlackPixel: 0 WhitePixel: 16777215
Font Path:
/usr/share/fonts/X11/misc,/usr/share/fonts/X11/100dpi/:unscaled,/usr/share/fonts/X11/75dpi/:unscaled,/usr/share/fonts/X11/Type1,/usr/share/fonts/X11/100dpi,/usr/share/fonts/X11/75dpi,built-ins
DPMS (Energy Star):
Standby: 600 Suspend: 600 Off: 600
DPMS is Enabled
Monitor is On
La pagina man di xset fra le altre cose dice:
Quote:
-dpms The -dpms option disables DPMS (Energy Star) features.

+dpms The +dpms option enables DPMS (Energy Star) features.

dpms flags...
The dpms option allows the DPMS (Energy Star) parameters to be set. The option can take up to three
numerical values, or the `force' flag followed by a DPMS state. The `force' flags forces the server to
immediately switch to the DPMS state specified. The DPMS state can be one of `standby', `suspend', `off',
or `on'. When numerical values are given, they set the inactivity period (in units of seconds) before the
three modes are activated. The first value given is for the `standby' mode, the second is for the `sus‐
pend' mode, and the third is for the `off' mode. Setting these values implicitly enables the DPMS fea‐
tures. A value of zero disables a particular mode.

s The s option lets you set the screen saver parameters. This option accepts up to two numerical parame‐
ters, a 'blank/noblank' flag, an 'expose/noexpose' flag, an 'on/off' flag, an 'activate/reset' flag, or
the 'default' flag. If no parameters or the 'default' flag is used, the system will be set to its default
screen saver characteristics. The 'on/off' flags simply turn the screen saver functions on or off. The
'activate' flag forces activation of screen saver even if the screen saver had been turned off. The
'reset' flag forces deactivation of screen saver if it is active. The 'blank' flag sets the preference to
blank the video (if the hardware can do so) rather than display a background pattern, while 'noblank' sets
the preference to display a pattern rather than blank the video. The 'expose' flag sets the preference to
allow window exposures (the server can freely discard window contents), while 'noexpose' sets the prefer‐
ence to disable screen saver unless the server can regenerate the screens without causing exposure events.
The length and period parameters for the screen saver function determines how long the server must be
inactive for screen saving to activate, and the period to change the background pattern to avoid burn in.
The arguments are specified in seconds. If only one numerical parameter is given, it will be used for the
length.
Impostiamo il timeout secondo le nostre esigenze:
Quote:
xset s 600 #timeout screensaver 10 minuti
xset s 0 #timeout screensaver disabilitato
xset dpms 30000 50000 50000 #rispettivi tempi di standby, suspend e off del monitor
Per gustarsi un film senza che il monitor si addormenti basta inserire le direttive 2 e 3 in ~/.config/lxsession/LXDE/autostart:
Quote:
debian@localhost:~$ cat .config/lxsession/LXDE/autostart
@synclient TapButton1=1
@synclient TapButton2=2
@synclient TapButton3=3
@synclient MaxTapTime=100
@setxkbmap -layout "us,it" -option "grp:alt_shift_toggle"
@xset s 0
@xset dpms 30000 50000 50000

@yeahconsole
Segnalo che i comandi in tale file non vanno seguiti mai da '&' e che a inizio riga e' stato messo il carattere '@' perche' come dice l'ottima Arch wiki:
Quote:
if a line begins with a @ symbol, the command following the @ will be automatically re-executed if it crashes. For example, to execute lxterminal and leafpad automatically at startup:

~/.config/lxsession/LXDE/autostart

@lxterminal
@leafpad

Note: The commands do not end with a & symbol.

There is also a global autostart file at /etc/xdg/lxsession/LXDE/autostart. If both files are present, all entries in both files will be executed.
Per maggiori informazioni:
https://wiki.archlinux.org/index.php...start_Programs
__________________
Enermax Staray CS-046 ECA3170-BL, Cooler Master RS-700-AMBA-D3, ASUS P6X58D-E, Core i7 950, Kingston 6GB DDR3 1600 HyperX, Gainward GTX 460 1GB GS, LG BH10LS30, 1TB WD1002FAEX, 2TB WD20EARS, 3TB WD30EZRX, 4TB WD40EFRX, 2x2TB WDBAAU0020HBK, Samsung SCX-3200, Netgear DGN2200
[Debian 7.0 Wheezy] Installazione, consigli e trucchi
vampirodolce1 è offline   Rispondi citando il messaggio o parte di esso