WelcomeWelcome | FAQFAQ | DownloadsDownloads | WikiWiki

Author Topic: [solved] smaller bind alternative??  (Read 6526 times)

Offline mb

  • Jr. Member
  • **
  • Posts: 69
[solved] smaller bind alternative??
« on: December 18, 2011, 10: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?
« Last Edit: December 19, 2011, 02:26:46 PM by mb »

Offline gerald_clark

  • TinyCore Moderator
  • Hero Member
  • *****
  • Posts: 4254
Re: smaller bind alternative??
« Reply #1 on: December 18, 2011, 10:33:47 PM »
Bind.tcz is the Berkley Internet Name Domain.
This has nothing to do with key binding.

Perhaps you want keyutils.

Offline curaga

  • Administrator
  • Hero Member
  • *****
  • Posts: 11044
Re: smaller bind alternative??
« Reply #2 on: December 19, 2011, 04:02:13 AM »
Keyutils appears to be about encryption? actkbd should still listen to keys ;)
The only barriers that can stop you are the ones you create yourself.

Offline mb

  • Jr. Member
  • **
  • Posts: 69
Re: smaller bind alternative??
« Reply #3 on: December 19, 2011, 10: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']

Offline curaga

  • Administrator
  • Hero Member
  • *****
  • Posts: 11044
Re: smaller bind alternative??
« Reply #4 on: December 19, 2011, 10: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`
The only barriers that can stop you are the ones you create yourself.

Offline mb

  • Jr. Member
  • **
  • Posts: 69
Re: smaller bind alternative??
« Reply #5 on: December 19, 2011, 11:31:40 AM »
OK.. (actkbd 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)

Offline curaga

  • Administrator
  • Hero Member
  • *****
  • Posts: 11044
Re: smaller bind alternative??
« Reply #6 on: December 19, 2011, 11: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.
The only barriers that can stop you are the ones you create yourself.

Offline mb

  • Jr. Member
  • **
  • Posts: 69
Re: smaller bind alternative??
« Reply #7 on: December 19, 2011, 11: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.)
« Last Edit: December 19, 2011, 11:55:42 AM by mb »

Offline curaga

  • Administrator
  • Hero Member
  • *****
  • Posts: 11044
Re: smaller bind alternative??
« Reply #8 on: December 19, 2011, 12:13:07 PM »
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.
The only barriers that can stop you are the ones you create yourself.

Offline mb

  • Jr. Member
  • **
  • Posts: 69
Re: smaller bind alternative??
« Reply #9 on: December 19, 2011, 02:26:11 PM »
Thanks! ..works much better than bind did before. 8)

Offline mb

  • Jr. Member
  • **
  • Posts: 69
Re: [solved] smaller bind alternative??
« Reply #10 on: December 19, 2011, 10: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) ??
« Last Edit: December 19, 2011, 10:31:03 PM by mb »

Offline gerald_clark

  • TinyCore Moderator
  • Hero Member
  • *****
  • Posts: 4254
Re: [solved] smaller bind alternative??
« Reply #11 on: December 19, 2011, 10:47:34 PM »
Please spend some time reading the wiki.

Offline mb

  • Jr. Member
  • **
  • Posts: 69
Re: [solved] smaller bind alternative??
« Reply #12 on: December 19, 2011, 11:01:20 PM »
I have read a fair bit of the wiki. I guess you were refering to this, 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?

Offline gerald_clark

  • TinyCore Moderator
  • Hero Member
  • *****
  • Posts: 4254
Re: [solved] smaller bind alternative??
« Reply #13 on: December 19, 2011, 11: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.