Tiny Core Linux

Tiny Core Extensions => TCE Talk => Topic started by: mb on December 18, 2011, 07:06:49 PM

Title: [solved] smaller bind alternative??
Post by: mb on December 18, 2011, 07:06:49 PM
When i went to install the bind command i noticed it was 9MB even without any of the dependencies... almost the same as the whole microcore base. All i want from bind is to be able to run a command when i press one of the F-keys. Is there any less bloated alternative?
Title: Re: smaller bind alternative??
Post by: gerald_clark on December 18, 2011, 07:33:47 PM
Bind.tcz is the Berkley Internet Name Domain.
This has nothing to do with key binding.

Perhaps you want keyutils.
Title: Re: smaller bind alternative??
Post by: curaga on December 19, 2011, 01:02:13 AM
Keyutils appears to be about encryption? actkbd should still listen to keys ;)
Title: Re: smaller bind alternative??
Post by: mb on December 19, 2011, 07:41:00 AM
actkbd requires module 'evdev' which is not included.

[also it refers to 'actkbd.sample' in the info, which should be 'actkbd.conf.sample']
Title: Re: smaller bind alternative??
Post by: curaga on December 19, 2011, 07:48:54 AM
Just tested, actkbd works fine on 4.1. We even have a function to give you the keyboard device, ie

. /etc/init.d/tc-functions
sudo actkbd -D -d `getKeyEventDevice`
Title: Re: smaller bind alternative??
Post by: mb on December 19, 2011, 08:31:40 AM
OK.. (actkbd readme  (http://users.softlab.ntua.gr/~thkala/projects/actkbd/latest/README)said it required evdev)
Would you mind helping me figure it out..

how would i get to the point where, for example, pressing 'F1' would run 'mpc toggle'??

I created /usr/local/etc/actkbd.conf and tried various mutations of '59:::echo mpc toggle &' and ran 'sudo actkbd -D -d `getKeyEventDevice`' but with no luck. (note: 'getKeyEventDevice' doesn't work as a command for me?)

(scan codes (http://www.fastgraph.com/help/low_level_keyboard_handler.html))
Title: Re: smaller bind alternative??
Post by: curaga on December 19, 2011, 08:42:10 AM
We have the evdev module built in.

- did you source the functions file first?
- are you sure it's 59? actkbd has an option to show the key codes.
- when run as a daemon, you won't see the echo. Run without -D when testing.
Title: Re: smaller bind alternative??
Post by: mb on December 19, 2011, 08:51:50 AM
sorry for my noobness.. what do you mean did i source the functions file??.. /etc/init.d/tc-functions was present and i ran '/etc/init.d/tc-functions'.

I'm not certain its 59 (although the link agrees with all those mentioned in conf.sample); but i tried it with '42' (L Shift, listed in the sample) also in case of this and no change.

e: without '-D' i am returned 'failed to read event from getKeyEventDevice: Sucesss'
(evdev wasn't mentioned with an lsmod, which is why i thought it wasn't present.)
Title: Re: smaller bind alternative??
Post by: curaga on December 19, 2011, 09:13:07 AM
There's a dot and a space before /etc/... - this is shorthand for "source /etc/...." which makes those functions available.

To check the keycodes on your keyboard, run "sudo actkbd -s -d $(getKeyEventDevice)" and then press those keys. Control-C quits. The backticks have the same meaning as the $() syntax.
Title: Re: smaller bind alternative??
Post by: mb on December 19, 2011, 11:26:11 AM
Thanks! ..works much better than bind did before. 8)
Title: Re: [solved] smaller bind alternative??
Post by: mb on December 19, 2011, 07:16:29 PM
When running with '-D' is there any way out output text at all?

e: also how can i use hardware buttons, like the power button (and others) ??
Title: Re: [solved] smaller bind alternative??
Post by: gerald_clark on December 19, 2011, 07:47:34 PM
Please spend some time reading the wiki.
Title: Re: [solved] smaller bind alternative??
Post by: mb on December 19, 2011, 08:01:20 PM
I have read a fair bit of the wiki. I guess you were refering to this (http://wiki.tinycorelinux.net/wiki:using_acpid_to_control_your_pc_buttons), which i can't say i expected to be in the wiki.

what about the first part of my post? can you force text output when in daemon mode?
Title: Re: [solved] smaller bind alternative??
Post by: gerald_clark on December 19, 2011, 08:16:41 PM
Daemons have no tty, so they cannot do output.
Many daemons can be configured to log to files.
You need to read the documentation for each specific program.