From: Ryan V. <sim...@ya...> - 2005-09-28 17:31:23
|
--- n0dalus <n0...@gm...> wrote: > On 9/28/05, Buzz <bu...@os...> wrote: > > Why not have two different lircd.conf files, one that has all remote > buttons > > mapped to a code, and the other that has only 1 mapped. > > > > * In the first file, one of the buttons has a code that triggers irexec to > > run a bash script that a) copies the other lircd.conf into place over the > > first and b) restarts lircd. > > * In the second lircd.conf, only one button is mapped to a code at all, and > > that one code triggers a very similar irexec based bash script that a) > > copies the original lircd.conf back into place, and b) restarts lircd. > > > > That aught to do it. :-) > > > > Buzz. > > > > Unfortunately if I restart lircd it will disconnect it's connection to > any program using it (mplayer,xmms,etc.) I guess I can use SIGHUP to > do a soft reload... would that work? > > n0dalus. There is a MUCH simpler way to do this with your .lircrc file, create a mode that doesn't have any of the other buttons mapped to anything, if you want to see exactly how a working .lircrc file would work for this, check out http://denonline.sf.net/files/lircmenu.tbz2 its a small set of scripts and a corrosponding .lircrc file that uses modes for every application, this prevents applications that support lirc from recieving eachothers input, and allows you to have modes where you just want to use irexec or irxevent in certain mapped ways heres the jist of it -----BEGIN LIRCRC----- begin normal #... normal button definitions ... begin button = ignoreme mode = ignore #the flags are important, without them lirc would not switch modes #and would also parse the things down below immediatly, which would #prevent us from staying in that mode, you may wish to play with repeat #also to tweak how sensitive it is to your remote flags = mode quit end end normal begin ignore begin #here we switch back button = ignoreme mode = normal flags = mode quit end end ignore begin mplayer ... end mplayer begin xine ... end xine ... #here is the tricky part we must have that same button outside of all modes #to go back to the default one, just so that we don't end up in a situation #where we can't see any buttons, you could in fact rearrange the modes to #prevent this if you normally only have one mode, i'll show you how down below begin button = ignoreme mode = normal flags = mode quit end ------END LIRCRC------ the only real disadvantage of using modes like that is at first programs won't start using their buttons you'd have to switch between them all the time to keep them in sync, unless the program automatically supports lirc (in the case of irxevent this doesn't matter) then you can name the modes after the program name (the prog= directive) and the program will choose that mode to start with. anyway heres another sample that'll have an ignoring mode, and a default one that should work fine, but require a bit more work. -----BEGIN LIRCRC----- begin ignore begin button = ignoreme flags = mode quit mode = someinvalidname end #... blank definitions for EVERY BUTTON, just like this begin button = 1 end end ignore #you're normal config, except for the ignore button which will match the ones above ------END LIRCRC------ either of these setups should do exactly what you are after without some convoluted shell scripts and signals, you can even using XOSD or something similar to pop up a message stating that you're now ignoring the remote, the url i gave you has a nice little menu system i created (and a .lircrc files that works with it) using xosd for my 24 button credit card sized remote. -----BEGIN GEEK CODE BLOCK----- Version: 3.12 Updated: 2005-04-19 GCS/CM/M/S d-(--) s:+ a-->->>+>++>+++$>?$ C+++(++)>++++$ ULB+++(++)>++++$ P++++>++++$ L++++ E----(@) W+++ N++ o? K? w---(--) O-- !M V? PS+ PE Y++ PGP++(+++@) t+(++) 5 X+++(++@) R(+) !tv() DI++++ b+ D++ G++ e*()>++>++++$ h(*)>---- r++@>+++ !y?(**) ------END GEEK CODE BLOCK----- -----BEGIN GEEK CODE BLOCK----- Version: 3.12 Updated: 2005-04-19 GCS/CM/M/S d-(--) s:+ a-->->>+>++>+++$>?$ C+++(++)>++++$ ULB+++(++)>++++$ P++++>++++$ L++++ E----(@) W+++ N++ o? K? w---(--) O-- !M V? PS+ PE Y++ PGP++(+++@) t+(++) 5 X+++(++@) R(+) !tv() DI++++ b+ D++ G++ e*()>++>++++$ h(*)>---- r++@>+++ !y?(**) ------END GEEK CODE BLOCK----- __________________________________ Yahoo! Mail - PC Magazine Editors' Choice 2005 http://mail.yahoo.com |