LinuxQuestions.org
Latest LQ Deal: Latest LQ Deals
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Slackware
User Name
Password
Slackware This Forum is for the discussion of Slackware Linux.

Notices


Reply
  Search this Thread
Old 07-16-2015, 04:25 PM   #1
shicky256
LQ Newbie
 
Registered: Jun 2015
Distribution: Slackware
Posts: 2

Rep: Reputation: Disabled
TPB (Thinkpad OSD Daemon) only works in runlevel 3


I run a ThinkPad T43, which has some media buttons and other hotkeys (brightness up/down, ThinkLight, etc), so it's nice to have a utility to monitor the status of the various buttons, especially because the computer's so old that they are for hardware so XFCE's built in OSD won't detect anything. Because of this, I use TPB, a program that works in every distro I've tried, and in Slackware-- but only when you make your default runlevel 3. I do all of my work in X, so when I make runlevel 4 the default (to show a display manager on startup) it doesn't work, and instead gives me a
Code:
Unable to initialize xosd. Running without onsceen [sic] display.
error. I'm running the newest xosd and newest tpb versions, and everything works fine in runlevel 3.
 
Old 07-16-2015, 05:46 PM   #2
Alien Bob
Slackware Contributor
 
Registered: Sep 2005
Location: Eindhoven, The Netherlands
Distribution: Slackware
Posts: 8,559

Rep: Reputation: 8106Reputation: 8106Reputation: 8106Reputation: 8106Reputation: 8106Reputation: 8106Reputation: 8106Reputation: 8106Reputation: 8106Reputation: 8106Reputation: 8106
How did you build that tpb package? When I had a T43 and used tpb, I needed to add a udev rule to fix the access permissions of the /dev/nvram file.

Note that in Slackware's runlevel 3 your user account is dynamically added to several groups that allow you to manage your hardware (after all, logging in to the console means you are _at_ your computer). Users who login at runlevel 4 are possibly remote users, and are by default not added to groups like floppy, audio, cdrom, video, scanner, power, plugdev etc... you will have to add your user account to these groups explicitly.
 
1 members found this post helpful.
Old 07-16-2015, 06:10 PM   #3
shicky256
LQ Newbie
 
Registered: Jun 2015
Distribution: Slackware
Posts: 2

Original Poster
Rep: Reputation: Disabled
Quote:
Originally Posted by Alien Bob View Post
How did you build that tpb package? When I had a T43 and used tpb, I needed to add a udev rule to fix the access permissions of the /dev/nvram file.

Note that in Slackware's runlevel 3 your user account is dynamically added to several groups that allow you to manage your hardware (after all, logging in to the console means you are _at_ your computer). Users who login at runlevel 4 are possibly remote users, and are by default not added to groups like floppy, audio, cdrom, video, scanner, power, plugdev etc... you will have to add your user account to these groups explicitly.
I just used the "./configure && make && sudo make install" instructions on the website. I get this error even when I run tpb as root, so /dev/nvram permissions shouldn't matter, and neither should group permissions.
 
Old 07-17-2015, 06:38 AM   #4
Alien Bob
Slackware Contributor
 
Registered: Sep 2005
Location: Eindhoven, The Netherlands
Distribution: Slackware
Posts: 8,559

Rep: Reputation: 8106Reputation: 8106Reputation: 8106Reputation: 8106Reputation: 8106Reputation: 8106Reputation: 8106Reputation: 8106Reputation: 8106Reputation: 8106Reputation: 8106
You can try my old SlackBuild script here: http://www.slackware.com/~alien/slackbuilds/tpb/build/
I just noticed that even in 2008 I already prepared my SlackBuild scripts for x86_64 ... amazing. I never used BlueWhite64 or Slamd64 myself.
 
Old 07-21-2015, 01:06 PM   #5
Totoro-kun
Member
 
Registered: Nov 2010
Location: Kaunas, Lithuania
Distribution: Slackware
Posts: 234

Rep: Reputation: 125Reputation: 125
NOTE: This not really work, please skip to next post

Hello,
I happen to have a ThinkPad X41 with Slackware-14.1 (32bit), which is technically close to T43, so decided to try out Alien's slackbuild of tpb. I had to install xosd dependency from slackbuilds.org first. Then SlackBuild worked and I've got the package.

It seems, that udev rule for nvram is outdated, because it shown errors. I do not know how to write these rules, so I've just removed it (rm /etc/udev/rules.d/01-nvram.rules).

Anyway, if you run tpb -d as root (in terminal), osd works! There for I've wrote rc.tpb file:

Code:
#!/bin/sh
start() {
	echo "Starting ThinkPad buttons daemon:  /usr/bin/tpb -d"
	if [ ! -e /var/run/tpb.pid ]; then
           /usr/bin/tpb -d
	   pidof tpb > /var/run/tpb.pid
	else
	echo "ThinkPad buttons daemon already running!"
	fi
}

stop() {
        echo "Stopping ThinkPad buttons daemon."
  	if [ -e /var/run/tpb.pid ]; then
    	   kill $(cat /var/run/tpb.pid)
    	   rm -f /var/run/tpb.pid
  	else
    	echo "ThinkPad buttons daemon is not running."
  	fi
}

restart() {
  stop
  sleep 1
  start
}


status() {
  	if [ -e /var/run/tpb.pid ]; then
   	echo "ThinkPad buttons daemon is running."
  	else
    	echo "ThinkPad buttons daemon is stopped."
    	   exit 1;
  	fi
}

case "$1" in
    start)
        start
        ;;
    stop)
        stop
        ;;
    restart)
        restart
        ;;
    status)
	status
	;;
    *)
        echo "Usage:  {start|stop|restart|status}"
        exit 1
        ;;
esac
Just place it in /etc/rc.d and then add these lines in /etc/rc.d/rc.local:
Code:
if [ -x /etc/rc.d/rc.tpb ]; then
  /etc/rc.d/rc.tpb start
fi
If you give x permission (chmod +x /etc/rc.d/rc.tpb) it will start tpb daemon on system boot.

There is even configuration file /etc/tpbrc. Nice!


Hope this helps

Last edited by Totoro-kun; 07-21-2015 at 02:19 PM.
 
Old 07-21-2015, 02:12 PM   #6
Totoro-kun
Member
 
Registered: Nov 2010
Location: Kaunas, Lithuania
Distribution: Slackware
Posts: 234

Rep: Reputation: 125Reputation: 125
Sorry, the above does not really work, since tpb has to be started while X is running. However, after some research I was able to make it work. Here are the steps:

1. Edit/create udev rule /etc/udev/rules.d/01-nvram.rules:
Code:
KERNEL=="nvram", GROUP="kmem", MODE="0660"
2. Add your user to kmem group:
Code:
# usermod -a -G kmem your_username
3. Find a way to austart following command via your DE (I use MATE so System -> Autostart applications -> Add):
Code:
tpb -d
4. Reboot and enjoy

Last edited by Totoro-kun; 07-21-2015 at 02:13 PM.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Can't reach runlevel 5: avahi-daemon fails baking-a-77 Linux - General 6 05-21-2011 11:33 AM
Notification-daemon vs notify-osd potuz Linux - Software 0 11-27-2009 04:58 PM
Tpb stops displaying osd on kubuntu 7.04 juokaz Linux - Software 0 04-30-2007 11:48 AM
Touchpad works in runlevel 3 anon209 Slackware 1 12-04-2005 06:21 PM
displaying popuo message by daemon process running in runlevel 5 using xmessage kalpesh_rathod8 Programming 2 11-22-2004 03:19 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Slackware

All times are GMT -5. The time now is 08:00 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration