WelcomeWelcome | FAQFAQ | DownloadsDownloads | WikiWiki

Author Topic: .xsession and .profile  (Read 12596 times)

Offline mikshaw

  • Sr. Member
  • ****
  • Posts: 368
Re: .xsession and .profile
« Reply #15 on: February 17, 2009, 12:23:48 PM »
Thanks.  I'm now killing the Xvesa process after running the window manager (removed "exec")
Code: [Select]
Xvesa -br -mouse /dev/psaux,5 -screen 1024x768x32 -shadow -nolisten tcp -I >X.log 2>&1 &
xpid=$!
aterm -e tail -f $HOME/windowmanager.log $HOME/X.log &
sleep 1
xsri --color=\#000000 --color2=\#444444 --emblem=$HOME/image/paper/dwm-bg.png --emblem-alpha=120 --geometry=363x671+0-0
xmodmap $HOME/.Xmodmap
f=$HOME/.myfonts
xset b off +fp $f/artwiz,$f/lfp-fix,$f/proggy,$f/sgi,$f/terminus
dwm >windowmanager.log 2>&1
kill $xpid
I don't know for sure, but adding another command or two befor the xmodmap and xset commands seems to give it enough time to work.  It's fixed, so I'm not going to think about it any more for now.

I switched back to using Bash as my main shell, after discovering that the subshell inMidnight Commander apparently doesn't work if SHELL is ash.

Everything seems to be working as expected now. Next step is to try cramming all of compiletc and other things into /usr/local =o)

Thanks!

Offline tobiaus

  • Suspended
  • Hero Member
  • *****
  • Posts: 599
Re: .xsession and .profile
« Reply #16 on: February 19, 2009, 09:55:30 AM »
ooh, does that mean you might create a mc extension? instead of listing bash as a dep, you could simply mention: "subshell features depend on gnu utils." i would be happy using it with ash, unless it's too weird or limited. (if it really is, maybe add bash as a dep.)

Offline mikshaw

  • Sr. Member
  • ****
  • Posts: 368
Re: .xsession and .profile
« Reply #17 on: February 19, 2009, 10:52:27 AM »
Quote
does that mean you might create a mc extension?
If I can get it to work as well on TC as it does on my other distros, I probably will, including your suggestion for addressing the subshell issue.  I don't really care to deal with dependencies, at least for now, so I may not bother packaging anything that can't run on its own.  That would leave optional apps, such as Bash in the case of a Midnight Commander extension, in the hands of the user.  The subshell is the only thing I've noticed that is different between bash and ash, but the subshell is vital to me.

I just discovered last night that I have a new problem with mc related to audio.  I was testing OSS by playing mp3 files with mpg123 and mpg321 (to make sure the problem was not with mpg123) within mc.  When pressing Ctrl+c to quit the player (had to press it twice, for some reason), mc went back to its file listing as usual, but would not respond to any further input.   I had to force it to quit using the window manager.  There were no error messages, so I don't have a clue what's wrong right now.  It *might* have something to do with the fact that I also have the Alsa files installed, but haven't yet configured the system to use it (for some reason the setup script doesn't recognize my ES1371...a common soundblaster).  My next try I'll probably remove Alsa first and see if that helps.   Also haven't yet tested to see if it does the same with ogg123.  I'm thinking I might need to enable syslog if there is trouble outside the apps themselves.
EDIT: silly me.  I didn't notice that alsa_modules is a tcem...as with OSS.tcem I believe it needs to be loaded as an extension rather than simply extracted into my tclocal directory .  I guess I'll reboot and test it out again....

There's also still the weird issue of mc taking several seconds to start in tty.  I'm thinking there might be a permission problem, since it doesn't do this as root.  I had the same issue when using ash as SHELL, so Bash wasn't the problem.

I use Midnight Commander constantly...it's always open, sometimes two or three instances of it. It's one of my  must-have applications, so I have to make sure it is as good as can be if it's ever going to be an extension.
« Last Edit: February 19, 2009, 11:15:38 AM by mikshaw »

Offline tobiaus

  • Suspended
  • Hero Member
  • *****
  • Posts: 599
Re: .xsession and .profile
« Reply #18 on: February 19, 2009, 04:29:38 PM »
oh take your time, i'd rather you submit an extension that you'd actually want to use. i don't care if it includes bash or not, it works better with it, but it sounds like for most purposes it's fine without it (people can always add it if they prefer.)

Offline mikshaw

  • Sr. Member
  • ****
  • Posts: 368
Re: .xsession and .profile
« Reply #19 on: February 20, 2009, 05:23:30 AM »
This thread has become a TCE subject now, but I just wanted to post my progress on mc.

I tested the mpg321 binary from DSL along with the mc binary I'd built for DSL, and I got the same result, so I'm thinking the problem may have something to do with the way mc or the player interacts with the terminal specifically in TC.

Also found that using Ctrl+c to stop playback, and then Ctrl+d (instead of a second Ctrl+c) to return to the file list doesn't result in a broken mc (and subsequently the terminal itself after mc is forced to quit).  So I'm guessing mc doesn't get told that the process has finished, or maybe it doesn't finish by using Ctrl+c as it should, so it doesn't return to its file list until you manually send EOF signal.  The second Ctrl+c might have been killing a needed process.

There may be a configuration change I can make to .ashrc and .bashrc that will fix this, but I'm still fumbling in the dark at this point.

Offline tobiaus

  • Suspended
  • Hero Member
  • *****
  • Posts: 599
Re: .xsession and .profile
« Reply #20 on: February 20, 2009, 12:01:57 PM »
you may solve your problems using mp3blaster instead of mpg123. naturally you'll have to create an extension for it first and use it in a backgrounded script... it also plays ogg files though. i tried mpg123 first when looking for a command line player. i like it, i didn't like ogg123. trying to squeeze this post in without making it more offtopic.

Offline mikshaw

  • Sr. Member
  • ****
  • Posts: 368
Re: .xsession and .profile
« Reply #21 on: February 20, 2009, 12:51:49 PM »
I tried mp3blaster a couple years ago, but it seemed a little buggy...froze up a few times and often would not display the interface properly.  I use mocp a lot for interactive play, but still prefer mpg321 for playing single files. Besides that, using a different application only  ignores the trouble.  I'd like to fix the problem instead.  I have yet to install sox for wav playing, and to see if the same thing happens there...haven't got any ogg files on my harddrive as far as I can tell, so haven't tested ogg123 yet.  Oh...My UT2004 directory has some...i'll check that out a little later =o)
Once I install mplayer I can test that as well, since I believe it plays most audio files.

I read that the subshell in mc supports only bash, zsh, and tcsh, so that explains that part.  If you have ash set as the login shell and have bash installed, you can start mc with "SHELL=/usr/local/bin/bash mc" to use bash only for the subshell.  I'm not positive of this, though, since I already had bash added to /etc/shells...not sure if that is necessary.

More off topic...my remaster is quickly growing farther away from the point where I can boot into a vanilla TC system.  In fact I think it's already beyond that point...I think I'll need to have two copies of TC installed =op

Offline vyp08

  • WikiUser
  • *
  • Posts: 7
Re: .xsession and .profile
« Reply #22 on: April 09, 2009, 09:52:42 PM »
Good day!

I'm try use terminus fonts and get trouble with .xsession:

1. Boot from CD with tinycore_1.2.iso.
2. Download (from FTP) terminus fonts and unpack them to /usr/local/share/fonts/terminus.
3. In aterm run commands:
   xset +fp /usr/local/share/fonts/terminus/
   xlsfonts
All ok, I can see and use terminus fonts.
4. Add command "xset +fp /usr/local/share/fonts/terminus/" to ~/.xsession
    before "exec jwm".
5. pkill Xvesa.
6. startx
7. Run aterm and xlsfonts:
    no terminus fonts in out :(

Offline mikshaw

  • Sr. Member
  • ****
  • Posts: 368
Re: .xsession and .profile
« Reply #23 on: April 09, 2009, 10:20:04 PM »
it might be as simple as removing the slash from the end of your font patyh, but that's just a guess.  So far I haven't had any trouble adding X fonts with xset.
Did you run mkfontdir in /usr/local/share/fonts/terminus?

Offline vyp08

  • WikiUser
  • *
  • Posts: 7
Re: .xsession and .profile
« Reply #24 on: April 10, 2009, 12:49:43 AM »
>it might be as simple as removing the slash
With '/' or without '/' - no difference.

Im too no have problem with adding fonts from running wm & aterm.

>Did you run mkfontdir in /usr/local/share/fonts/terminus?
No, file fonts.dir already exists and correct (some years ago).

PS. Im run TC on VMware.

Offline mikshaw

  • Sr. Member
  • ****
  • Posts: 368
Re: .xsession and .profile
« Reply #25 on: April 10, 2009, 09:05:03 AM »
Quote
4. Add command "xset +fp /usr/local/share/fonts/terminus/" to ~/.xsession
    before "exec jwm".
5. pkill Xvesa.
6. startx
Keep in mind that teh x server has to be started before xset will work.  Sorry I didn't notice that earlier.
In .xsession, make sure the Xvesa line is before the xset line.

Offline vyp08

  • WikiUser
  • *
  • Posts: 7
Re: .xsession and .profile
« Reply #26 on: April 12, 2009, 09:43:08 PM »
$ cat .xsession
exec >/home/tc/X.log
exec 2>&1
set -x

DESKTOP="$(awk '/wm:/{print $2}' .desktop)"
Xvesa -br -mouse /dev/psaux,5 -screen 1024x768x32 -shadow -nolisten tcp -I 2>&1 > /dev/null &
xset +fp /usr/local/share/fonts/terminus
rc="$?";
echo "$0: xset return $?.";
n="`xlsfonts|grep terminus|wc|awk '{print($1)}'`";
echo "$0: founded Terminus fonts: $n."
exec "${DESKTOP:=jwm}"

$ cat X.log
+ awk /wm:/{print $2} .desktop
+ DESKTOP=jwm
+ Xvesa -br -mouse /dev/psaux,5 -screen 1024x768x32 -shadow -nolisten tcp -I 2>&1 > /dev/null &
(WW) Could not open RGB file "/usr/lib/X11/rgb.txt"; will use built-in copy.
+ xset +fp /usr/local/share/fonts/terminus
Could not init font path element /usr/lib/X11/fonts/TTF/, removing from list!
Could not init font path element /usr/lib/X11/fonts/Speedo/, removing from list!
Could not init font path element /usr/lib/X11/fonts/Type1/, removing from list!
Could not init font path element /usr/lib/X11/fonts/CID/, removing from list!
Could not init font path element /usr/lib/X11/fonts/100dpi/, removing from list!
+ rc=0
+ echo /home/tc/.xsession: xset return 0.
/home/tc/.xsession: xset return 0.
+ xlsfonts
+ grep terminus
+ wc
+ awk {print($1)}
Could not init font path element /usr/lib/X11/fonts/TTF/, removing from list!
Could not init font path element /usr/lib/X11/fonts/Speedo/, removing from list!
Could not init font path element /usr/lib/X11/fonts/Type1/, removing from list!
Could not init font path element /usr/lib/X11/fonts/CID/, removing from list!
Could not init font path element /usr/lib/X11/fonts/100dpi/, removing from list!
+ n=0
+ echo /home/tc/.xsession: founded Terminus fonts: 0.
/home/tc/.xsession: founded Terminus fonts: 0.
+ exec jwm
Could not init font path element /usr/lib/X11/fonts/TTF/, removing from list!
Could not init font path element /usr/lib/X11/fonts/Speedo/, removing from list!
Could not init font path element /usr/lib/X11/fonts/Type1/, removing from list!
Could not init font path element /usr/lib/X11/fonts/CID/, removing from list!
Could not init font path element /usr/lib/X11/fonts/100dpi/, removing from list!
JWM: warning: /home/tc/.jwmrc[31]: invalid entity: "&& imlib"
JWM: warning: /home/tc/.jwmrc[31]: invalid entity: "& imlib2"
Using /home/tc/.wbar config file.
Using a Super Bar.

Offline mikshaw

  • Sr. Member
  • ****
  • Posts: 368
Re: .xsession and .profile
« Reply #27 on: April 13, 2009, 06:52:10 AM »
Might be the same problem I was having.  Try adding "sleep 1" after the Xvesa line.  This is not usually required, but tc doesn't run X in the usual way.  It seems like pausing for a second before running xset gives Xvesa a better chance to start up.

I'm curious what those first three lines are
Code: [Select]
exec >/home/tc/X.log
exec 2>&1
set -x

Offline vyp08

  • WikiUser
  • *
  • Posts: 7
Re: .xsession and .profile
« Reply #28 on: April 13, 2009, 10:14:38 PM »
1.
I'm already add sleep 1|10|20 - no difference.

2.
>I'm curious what those first three lines are
For this three lines busybox(ash) == bash == POSIX shell.

exec >/home/tc/X.log
  redirect standard output to file ~/X.log

exec 2>&1
  redirect standard error to standard output, i.e. to file ~/X.log
About redirect see man bash, REDIRECTION, line 1590 (GNU bash, version 3.2.39(1)-release (i386-redhat-linux-gnu))

set -x
  man bash, line 4380 (GNU bash, version 3.2.39(1)-release (i386-redhat-linux-gnu))
[.. skip ..]
-x      After expanding each simple command, for command, case command, select command,  or
              arithmetic  for command, display the expanded value of PS4, followed by the command
              and its expanded arguments or associated word list.
[.. skip ..]

3.
.xsession work fine now :)

$ cat .xsession
exec >/home/tc/X.log
exec 2>&1
set -x
DESKTOP="$(awk '/wm:/{print $2}' .desktop)"
Xvesa -br -mouse /dev/psaux,5 -screen 1024x768x32 -shadow -nolisten tcp -I 2>&1 > /dev/null &
jwm&
#aterm&
xset +fp /usr/local/share/fonts/terminus
rc="$?";
echo "$0: xset return $?.";
n="`xlsfonts|grep terminus|wc|awk '{print($1)}'`";
echo "$0: founded Terminus fonts: $n."
#jwm
#aterm&
sleep 4294967295

Fonts added correct, if xset is AFTER jwm&|aterm&|...
Its a magic :) !

Offline vyp08

  • WikiUser
  • *
  • Posts: 7
Re: .xsession and .profile
« Reply #29 on: April 14, 2009, 12:13:12 AM »
In version 1.3 .xsession work from box. Thanks!