WelcomeWelcome | FAQFAQ | DownloadsDownloads | WikiWiki

Author Topic: JWM problems; partial solution and suggestions  (Read 2231 times)

Offline socks

  • Newbie
  • *
  • Posts: 15
JWM problems; partial solution and suggestions
« on: June 06, 2010, 01:52:32 AM »
Hi I'm new here

First, thanks to Roberts, the TC team and the regular contributors for the fruit of your untiring efforts which I've followed off and on since circa DSL2.4 when I first grappled with Linux.

I would like to set up a TC based system as my main day to day OS.
TC with flwm would do, except that its not easy to replace the fonts flwm uses.
So I've been setting up a system using MC2.11.2, jwm and some fonts I find easy to read, using beaver and emelfm as workhorses.
 
Initially I found a confusing circle of faults/conflicts partly due to the way jwm starts.
As it stands, if you back up all jwms config files to save your settings, the apps menu grows every time you restart jwm. The auto generated stuff is added to the previous list.
On the other hand if you add .jwmrc to .xfiletool.lst, the apps menu is stabilised but all the jwm config files are overwritten by the versions from /etc/skell when jwm is resarted.

While looking into how jwm starts, I found some problems with /usr/bin/jwm_initmenu which starts :

#!/bin/sh
# (c) Robert Shingledecker 2009
# Called to setup jwm tce menu

. /etc/init.d/tc-functions
. /usr/bin/jwm_menu_common

USER="$(cat /etc/sysconfig/tcuser)"

for F in `ls -1 /etc/skel/.jwm*`; do
  [ -f /home/"$USER"/"${F##/*/}" ] || cp /etc/skel/.jwm* /home/"$USER"
done

SYSMENU=/home/"$USER"/.jwmrc

TCEMENU="/usr/local/tce.menu/menu"
cp /usr/share/jwm/tce/menu_template "$TCEMENU"
chown "$USER".staff "$TCEMENU" /home/"$USER"/.jwm*
chmod g+w "$TCEMENU" /home/"$USER"/.jwm*

The obvious typo (. for :) in the chown line probably has no effect since menu_template is already tc:staff.
The stanza starting "for F in ...." acounts for the observed behaviour i.e. if any config file is absent from /home/tc, all are overwritten by defaults. Probably not what was intended.
I changed this to :

for F in `ls -1 /etc/skel/.jwm*`; do
  [ -f /home/"$USER"/"${F##/*/}" ] || cp /etc/skel/"${F##/*/}" /home/"$USER"
done

so that only absent files are copied from /etc/skel. Is the construction {F##/*/} an 'ash' thing or more general ? I've not seen it before but I'm a raw beginner at shell scripts.

Now my tweaked configs were available and the apps menu was held in check provided .jwmrc is not backed up. A remaing problem is that .jwmrc contains layout data for the spacing of items in the menu.
It would be better if all the layout data was in .jwmrc-theme.

That left the chicken and egg problem that arrises when adding fonts via ~/.fonts/myfonts
and an "xset +fp ... " line in .xsession. It seems that xset in ineffective before jwm starts and although xset works OK after jwm starts, jwm can only use the fonts after a restart.

Looking futher into jwm I noticed that its default font is courier r14, not avaiable in TC.
I would suggest that this be changed in the source or perhaps aliased to a font that is in TC
as partof jwm.tcz. I would vote for helvetica r18.

In the end I added my fonts directly to Xlibs.gz, following the the remaster steps in the Wiki.

The chicken and egg thing could be solved if a wm start could be emulated.
Then .xsession could have
...
wm-em
xset +fp ...
wm-em stop (?)
jwm

Does anyone know how to do this, short of starting a real wm then killing it ?

Next I'd like to change the fonts in appbrowser and appsaudit.
Any clues would welcome.

socks

PS could not see how to get a code box.

Offline roberts

  • Retired Admins
  • Hero Member
  • *****
  • Posts: 7361
  • Founder Emeritus
Re: JWM problems; partial solution and suggestions
« Reply #1 on: June 06, 2010, 02:51:07 AM »
Talking about 2.x repo version, you are right about the loop, any one missing, all are then defaulted from /etc/skel.

Should be:
for F in `ls -1 /etc/skel/.jwm*`; do
  [ -f /home/"$USER"/"${F##/*/}" ] || cp "$F" /home/"$USER"
done

The construct "${F##/*/}" is shell string chopping and is not unique to ash.

The System Tools menu is dynamically created upon each boot, so as to reflect any changes we might make. Since the System Tools is merged into .jwmrc, .jwmrc should be in .xfiletoo.lst  I suppose it, System Tools, could be another include file in .jwmrc to give the user more control. But then I suppose one can constantly tweak this extension. I don't use jwm. I would be happy if one that does would adopt this extension. Likely would produce better results, than I who makes adjustments based on those who do use jwm..

The fonts, afaik, are specified in .jwmrc_theme and are all currently set to helvetica-r12

I will make the loop change and repost.




10+ Years Contributing to Linux Open Source Projects.

Offline roberts

  • Retired Admins
  • Hero Member
  • *****
  • Posts: 7361
  • Founder Emeritus
Re: JWM problems; partial solution and suggestions
« Reply #2 on: June 06, 2010, 03:34:30 AM »
After further consideration, I went ahead and make System Tools an include to .jwmrc as well as the loop correction.

Reposted now in the 2.x repository..
10+ Years Contributing to Linux Open Source Projects.

Offline Juanito

  • Administrator
  • Hero Member
  • *****
  • Posts: 14761
Re: JWM problems; partial solution and suggestions
« Reply #3 on: June 06, 2010, 03:37:22 AM »
..looks like between lucky13 and socks we should be able to do something serious with jwm  :P

Offline ^thehatsrule^

  • Retired Admins
  • Hero Member
  • *****
  • Posts: 1726
Re: JWM problems; partial solution and suggestions
« Reply #4 on: June 06, 2010, 04:04:14 AM »
The obvious typo (. for :) in the chown line probably has no effect since menu_template is already tc:staff.
The . is still compatible syntax, although I suppose : would be recommended.

Quote
PS could not see how to get a code box.
Use [ code ] [ / code ] tags (remove the spaces), or the Insert Code icon.