[PATCH] set absolute path to fbset in TOOLS/mpconsole
Hi! Under Debian fbset is under /usr/sbin/fbset and therefore not in the path of a normal user. Therefore TOOLS/mpconsole fails to run for me as normal user. I suspect that other distros have fbset under /usr/sbin/ also, but I cannot check that, I only have Debian. If you can confirm this for other distros, I will apply this trivial patch. Diego Index: TOOLS/mpconsole =================================================================== RCS file: /cvsroot/mplayer/main/TOOLS/mpconsole,v retrieving revision 1.1 diff -u -r1.1 mpconsole --- TOOLS/mpconsole 17 Jan 2002 00:39:27 -0000 1.1 +++ TOOLS/mpconsole 8 Oct 2002 23:51:17 -0000 @@ -4,7 +4,7 @@ # Written by Rich Felker. trap "tput cnorm ; exit 1" SIGQUIT SIGINT EXIT -res=`fbset | grep geometry | sed 's/^ *//'` +res=`/usr/sbin/fbset | grep geometry | sed 's/^ *//'` width=`echo "$res" | cut -d' ' -f2` height=`echo "$res" | cut -d' ' -f3` tput civis
On Wed, Oct 09, 2002 at 01:43:03AM +0200, Diego Biurrun wrote:
Hi!
Under Debian fbset is under /usr/sbin/fbset and therefore not in the path of a normal user. Therefore TOOLS/mpconsole fails to run for me as normal user. I suspect that other distros have fbset under /usr/sbin/ also, but I cannot check that, I only have Debian. If you can confirm this for other distros, I will apply this trivial patch.
Putting fbset here is nonsense, and hardcoding a path is not a good idea anyway. Fortunately, that code is mostly obsolete, since mplayer now automagically grabs the dimensions for /dev/fb0 or $FRAMEBUFFER (if possible) when using -vo fbdev or mga. I dunno about vesa/vidix stuff since I've never used it. Anyway, if you still want to 'fix' it, try something like: res=`PATH="$PATH:/usr/sbin" fbset | grep geometry | sed 's/^ *//'` Rich
On Tue, Oct 08, 2002 at 10:03:11PM -0400, D Richard Felker III wrote:
On Wed, Oct 09, 2002 at 01:43:03AM +0200, Diego Biurrun wrote:
Under Debian fbset is under /usr/sbin/fbset and therefore not in the path of a normal user. Therefore TOOLS/mpconsole fails to run for me as normal user. I suspect that other distros have fbset under /usr/sbin/ also, but I cannot check that, I only have Debian. If you can confirm this for other distros, I will apply this trivial patch.
Putting fbset here is nonsense, and hardcoding a path is not a good idea anyway. Fortunately, that code is mostly obsolete, since mplayer now automagically grabs the dimensions for /dev/fb0 or $FRAMEBUFFER (if possible) when using -vo fbdev or mga. I dunno about vesa/vidix stuff since I've never used it.
You are of course right, I was unhappy with hardcoding that path anyway. You can achieve the same effect with a much simpler script nowadays: setterm -cursor off clear mplayer -vo mga "$@" &> /dev/null setterm -cursor on Because as you say there is no need to "compute" the dimensions by hand anymore. But this gets asked over and over again, so it is kind of a shame to let this script go to waste. If it is really obsolete we should probably remove it entirely.
Anyway, if you still want to 'fix' it, try something like:
res=`PATH="$PATH:/usr/sbin" fbset | grep geometry | sed 's/^ *//'`
Sounds good, if nobody objects, I will make this change. Diego
On Wed, Oct 09, 2002 at 05:17:56AM +0200, Diego Biurrun wrote:
On Tue, Oct 08, 2002 at 10:03:11PM -0400, D Richard Felker III wrote:
On Wed, Oct 09, 2002 at 01:43:03AM +0200, Diego Biurrun wrote:
Under Debian fbset is under /usr/sbin/fbset and therefore not in the path of a normal user. Therefore TOOLS/mpconsole fails to run for me as normal user. I suspect that other distros have fbset under /usr/sbin/ also, but I cannot check that, I only have Debian. If you can confirm this for other distros, I will apply this trivial patch.
Putting fbset here is nonsense, and hardcoding a path is not a good idea anyway. Fortunately, that code is mostly obsolete, since mplayer now automagically grabs the dimensions for /dev/fb0 or $FRAMEBUFFER (if possible) when using -vo fbdev or mga. I dunno about vesa/vidix stuff since I've never used it.
You are of course right, I was unhappy with hardcoding that path anyway. You can achieve the same effect with a much simpler script nowadays:
setterm -cursor off clear mplayer -vo mga "$@" &> /dev/null setterm -cursor on
Don't do it this way. The trap is necessary to restore the cursor in case the user aborts with ^C, etc. Also &> is questionable; I dunno whether it's standard or a bash extension. >/dev/null 2>&1 is equivalent and definitely works everywhere.
Because as you say there is no need to "compute" the dimensions by hand anymore. But this gets asked over and over again, so it is kind of a shame to let this script go to waste. If it is really obsolete we should probably remove it entirely.
IMHO getch2 code in mplayer should disable and enable cursor. Then the script would be 100% obsolete.
Anyway, if you still want to 'fix' it, try something like:
res=`PATH="$PATH:/usr/sbin" fbset | grep geometry | sed 's/^ *//'`
Sounds good, if nobody objects, I will make this change.
Fine with me. Rich
On Wed, Oct 09, 2002 at 11:27:04PM -0400, D Richard Felker III wrote:
On Wed, Oct 09, 2002 at 05:17:56AM +0200, Diego Biurrun wrote:
On Tue, Oct 08, 2002 at 10:03:11PM -0400, D Richard Felker III wrote: You are of course right, I was unhappy with hardcoding that path anyway. You can achieve the same effect with a much simpler script nowadays:
setterm -cursor off clear mplayer -vo mga "$@" &> /dev/null setterm -cursor on
Don't do it this way. The trap is necessary to restore the cursor in case the user aborts with ^C, etc. Also &> is questionable; I dunno whether it's standard or a bash extension. >/dev/null 2>&1 is equivalent and definitely works everywhere.
That was just a quick hack as proof of concept. I tried &> with ash, it does not work, so I guess it is a bash extension. I will avoid it in the future.
Because as you say there is no need to "compute" the dimensions by hand anymore. But this gets asked over and over again, so it is kind of a shame to let this script go to waste. If it is really obsolete we should probably remove it entirely.
IMHO getch2 code in mplayer should disable and enable cursor. Then the script would be 100% obsolete.
Definitely. Any volunteers? :-)
Anyway, if you still want to 'fix' it, try something like:
res=`PATH="$PATH:/usr/sbin" fbset | grep geometry | sed 's/^ *//'`
Sounds good, if nobody objects, I will make this change.
Fine with me.
OK, done. Diego
On Thu, Oct 10, 2002 at 12:51:03PM +0200, Diego Biurrun wrote:
Because as you say there is no need to "compute" the dimensions by hand anymore. But this gets asked over and over again, so it is kind of a shame to let this script go to waste. If it is really obsolete we should probably remove it entirely.
IMHO getch2 code in mplayer should disable and enable cursor. Then the script would be 100% obsolete.
Definitely. Any volunteers? :-)
I can probably do it later if no one else wants to (and if no one objects). Rich
Under Gentoo: uhmmmm@uhmmmm uhmmmm $ type fbset fbset is /usr/bin/fbset uhmmmm@uhmmmm uhmmmm $ ls /usr/sbin/fbset ls: /usr/sbin/fbset: No such file or directory On Wed, Oct 09, 2002 at 01:43:03AM +0200, Diego Biurrun wrote:
Hi!
Under Debian fbset is under /usr/sbin/fbset and therefore not in the path of a normal user. Therefore TOOLS/mpconsole fails to run for me as normal user. I suspect that other distros have fbset under /usr/sbin/ also, but I cannot check that, I only have Debian. If you can confirm this for other distros, I will apply this trivial patch.
Diego
participants (3)
-
Bobby Bingham -
D Richard Felker III -
Diego Biurrun