#!/bin/sh
# test we are root
if [ "$(id -u)" != "0" ]; then
exit 1
fi
export CFLAGS="-mtune=generic -Os -pipe"
export CXXFLAGS="-mtune=generic -Os -pipe -fno-exceptions -fno-rtti"
# REFERENCES
# https://www.youtube.com/@miyolinux/videos for coordinates mainly
# https://wiki.archlinux.org/title/JWM mainly for $ jwm -p
# mainly errors for ActiveForeground/Background and fixing
# librsvg-dev deliberately removed to reduce dependency and save almost 7M
P=jwm-full
V=2.4.5
SRC1=jwm-$V
SRC2=squashfs-root
USER=`cat /etc/sysconfig/tcuser`
LIST="compiletc submitqc imagemagick libjpeg-turbo-dev libpng-dev libXmu-dev \
libXft-dev libXinerama-dev libXpm-dev pango-dev "
for Z in $LIST
do
su -c "tce-load -i $Z" $USER
done
cd /tmp
su -c "/usr/local/bin/wget -nc --no-check-certificate \
https://github.com/joewing/jwm/releases/download/v2.4.5/jwm-2.4.5.tar.xz \
http://tinycorelinux.net/15.x/x86_64/tcz/jwm-full.tcz " $USER
unsquashfs jwm-full.tcz
rm -rf jwm-full.tcz
########################
tar xvf jwm-$V*xz
cd $SRC1
./configure --prefix=/usr/local --disable-rsvg
# Confirm: yes
# Icon: yes
# Cairo: no
# RSVG: no
# PNG: yes
# JPEG: yes
# XBM: yes
# XPM: yes
# XFT: yes
# XRender: yes
# Pango: yes
# Shape: yes
# Xmu: yes
# Xinerama: yes
# Debug: no
make -j4 # 5s
make install DESTDIR=/tmp/$P # strip fails
cd /tmp
# doc
#####
mkdir -p $P-doc/usr/local/share
mv $P/usr/local/share/man $P-doc/usr/local/share/
# locale
#########
mkdir -p $P-locale/usr/local/share
mv $P/usr/local/share/locale $P-locale/usr/local/share
# main
#####
# svgs to pngs. The image increases but size of total due to less deps decreases MORE
cd $P/usr/local/share/jwm
convert jwm-blue.svg -resize 48x48 jwm-blue.png
convert jwm-gray.svg -resize 48x48 jwm-gray.png
convert jwm-orange.svg -resize 48x48 jwm-orange.png
convert jwm-red.svg -resize 48x48 jwm-red.png
rm -rf *.svg
cd /tmp
# Bin
######
strip --strip-unneeded $P/usr/local/bin/jwm
# move all roberts back to bin...no stripping as they are scripts
mv $SRC2/usr/local/bin/jwm_* $P/usr/local/bin
# even tho unpacked as root they became tc:staff fix
chown root:root $P/usr/local/bin/*
rm -rf $P/usr/local/bin/jwm_ondemand # has issue as per discovered by $ jwm -p
# Minor bin fixes
##########
sed 's|jwm_ondemand||' -i $P/usr/local/bin/jwm_initmenu
sed 's|aterm|xterm|' -i $P/usr/local/bin/jwm_menu_common
# add important roberts files but some need adjusting so some clean create
########################################################
mkdir -p $P/usr/local/share/jwm/tce
cp $SRC2/usr/local/share/jwm/tce/menu* $P/usr/local/share/jwm/tce/
cp $SRC2/usr/local/share/jwm/tce/.jwm* $P/usr/local/share/jwm/tce/
# theme issues and fix
######################
# XML Parsing Error: not well-formed Location: file:///home/tc/.jwmrc-theme Line Number 40, Column 13:
# I am redoing theme as
# $ jwm -p will reveal errors in independent desktop files....and various jwm files which shows
#JWM: warning: ./.jwmrc-theme[11]: invalid tag in Active: Text
#JWM: warning: ./.jwmrc-theme[12]: invalid tag in Active: Title
#JWM: warning: ./.jwmrc-theme[16]: invalid tag in WindowStyle: Inactive
#JWM: warning: ./.jwmrc-theme[26]: invalid tag in TaskListStyle: ActiveForeground
#JWM: warning: ./.jwmrc-theme[27]: invalid tag in TaskListStyle: ActiveBackground
#JWM: warning: ./.jwmrc-theme[43]: invalid tag in PagerStyle: ActiveForeground
#JWM: warning: ./.jwmrc-theme[44]: invalid tag in PagerStyle: ActiveBackground
#JWM: warning: ./.jwmrc-theme[51]: invalid tag in MenuStyle: ActiveForeground
#JWM: warning: ./.jwmrc-theme[52]: invalid tag in MenuStyle: ActiveBackground
# https://www.antixforum.com/forums/topic/updating-jwm-theme-scripts/
# eg Ubuntu-14:style=Regular:antialias=true
##########################################################################################################################3
rm -rf $P/usr/local/share/jwm/tce/.jwmrc-theme
cat > $P/usr/local/share/jwm/tce/.jwmrc-theme << "EOF"
sans-10:style=Regular:antialias=false
4
16
black
sans-12:style=Regular:antialias=false
black
#c5c5c5
black
#c5c5c5
#808488
sans-12:style=Regular:antialias=false
black
#c5c5c5
white
#4f5f82
sans-12:style=Regular:antialias=false
black
white
#000080
EOF
# update system config even tho we are not using it
######################
ETC=$P/usr/local/etc/system.jwmrc
sed 's|Audacious|mpg123|' -i $ETC
sed 's|audacious|mpg123|' -i $ETC
sed 's|image|mtpaint|' -i $ETC
sed 's|claws-mail|easymail|' -i $ETC # claws no longer here
sed 's|image|mtpaint|' -i $ETC
sed 's|Gimp|mtpaint|' -i $ETC
sed 's|gimp|mtpaint|' -i $ETC
sed 's|ROX|xfe|' -i $ETC
sed 's|rox|xfe|' -i $ETC
sed '9d' -i $ETC # no xcalc so delete
# update tray
##############
rm -rf $P/usr/local/share/jwm/tce/.jwmrc-tray
cat > $P/usr/local/share/jwm/tce/.jwmrc-tray << "EOF"
root:1
showdesktop
exec:apps
exec:xterm
exec:cpanel
exec:editor
exec:exittc
exec:flrun
exec:mnttool
exec:services
exec:screenshot.sh
EOF
# update keys
#############
rm -rf $P/usr/local/share/jwm/tce/.jwmrc-keys
cat > $P/usr/local/share/jwm/tce/.jwmrc-keys << "EOF"
up
down
right
left
left
down
up
right
select
escape
shade
close
maximize
minimize
showdesktop
resize
root:1
move
nextstacked
close
close
desktop#
root:1
window
exec:exittc
rdesktop
ldesktop
udesktop
ddesktop
restart
exec:xterm
exec:xterm -T "vim" -e vi
exec:apps
exec:exittc
exec:firefox
exec:xterm -e htop
exec:leafpad
exec:mnttool
exec:pcmanfm
exec:aterm -fn 12x24
EOF
# main rc---remove ondemand due to error $ jwm -p + no co-ordinates notification in moving floating app
########## also add more icon pathways
rm -rf $P/usr/local/share/jwm/tce/.jwmrc
cat > $P/usr/local/share/jwm/tce/.jwmrc << "EOF"
/usr/local/tce.jwm
/tmp/.jwm-sysmenu
./.jwmrc-tray
./.jwmrc-theme
/usr/local/share/pixmaps
/usr/local/share/icons
/usr/local/share/jwm
~/.local/share/icons
pcmanfm
400
2
click
border
outline
outline
./.jwmrc-keys
EOF
################################################################
mkdir -p $P/usr/local/share/doc/$P
cp $SRC1/LICENSE $P/usr/local/share/doc/$P
# tce.install
#############
mkdir -p $P/usr/local/tce.installed
cat >> $P/usr/local/tce.installed/$P <<'EOF'
#!/bin/sh
echo 'jwm' > /etc/sysconfig/desktop
EOF
chown -R root:staff $P/usr/local/tce.installed
chmod -R 775 $P/usr/local/tce.installed
# TCZ them
###########
LIST2="$P $P-doc $P-locale "
for Z in $LIST2
do
mksquashfs $Z $Z.tcz
md5sum $Z.tcz > $Z.tcz.md5.txt
cd $Z
find . -not -type d | cut -c 2- | sort > /tmp/$Z.tcz.list
cd /tmp
done
ls -hal
echo "Title: jwm-full-doc.tcz
Description: man page
Version: 2.4.5
Author: Joe Wingbermuehle
Original-site: http://joewing.net/projects/jwm
Copying-policy: accompanied
Size: 16K
Extension_by: aus9 @linuxquestions.org
Tags: window manager
Comments: see also
http://joewing.net/projects/jwm/config.html
http://joewing.net/projects/jwm/guide.html
Change-log: 2024/11/08 v 2.4.5 on 15x
Current: 2024/11/08" > $P-doc.tcz.info
echo 'man-db.tcz' > $P-doc.tcz.dep
echo "Title: jwm-full-locale.tcz
Description: language files
Version: 2.4.5
Author: Joe Wingbermuehle
Original-site: http://joewing.net/projects/jwm
Copying-policy: accompanied
Size: 52K
Extension_by: aus9 @linuxquestions.org
Tags: window manager
Comments: not tested by me
Change-log: 2024/11/08 v 2.4.5 on 15x
Current: 2024/11/08" > $P-locale.tcz.info
echo 'jwm-full.tcz' > $P-locale.tcz.dep
cat >> $P.tcz.info <<'EOF'
Title: jwm-full.tcz
Description: Joe's Window Manager
Version: 2.4.5
Author: Joe Wingbermuehle
Original-site: http://joewing.net/projects/jwm
Copying-policy: accompanied
Documentation: http://joewing.net/projects/jwm/config.shtml
Size: 128K
Extension_by: aus9 @linuxquestions.org
Tags: window manager
Comments: JWM is a floating desktop. Includes some scripts
(c) Robert Shingledecker. I am unable to test on libX
(UPDATERS) Delete all your $HOME/.jwm* files
Too many changes to list reasons/preferences/research in
changelog see build script under
http://tinycorelinux.net/15.x/x86_64/tcz/src/jwm-full
Main changes:
(keys) launch keys CA become Alt only
(keys) aterm becomes xterm to allow lxterminal execute too.
(theme) helvetica -> sans font
(theme) popup enabled for mouse hover over icons
(tray) understem now V to show desktops
(tray) height made 20 so I could see the icons on 22" monitor
(tray) add blue JWM icon for clickable menu
(tray) add most fltk clickable icons
(rc) stop showing coordinates in moving floating app
(rc) add more icon pathways to support icon launchers
(rc) delete support for ondemand due to error for $ jwm -p
(rc) add auto startup exe for example if not using ~/.X.d
If you add new tray icon launchers, you may need either lxde-icon-theme
or humanity-icon-theme as this update no longer has svg support.
Before making changes, backup target file...make changes then run $ jwm -p
Fix -> restart jwm from menu -> retest command.
BONUS if you use volumeicon it can appear and work as expected in your tray
but it may disappear if changing theme/settings see info for that TCE
Optional TCE=jwm-themes
Change-log: 2014/12/01 v 2.2.2 on 5x (maluvia)
Current: 2024/11/08 v 2.4.5 on 15x too many to list here (aus9)
EOF
readelf -d $P/usr/local/bin/jwm | grep 'NEEDED'
#libX11.so.6]libX11 libXext libXinerama
#libpng16.so.16]libpng freetype fontconfig libXft pango
#libjpeg.so.62]libjpeg-turbo
#libXft.so.2]libXft pango
#libXrender.so.1]libXrender libXft pango
#[libpangoxft-1.0.so.0]libpangoft2-1.0.so.0]libpango-1.0.so.0]pango
#libgobject-2.0.so.0 libglib-2.0.so.0 glib2 harfbuzz freetype fontconfig libXft pango
#libharfbuzz.so.0]harfbuzz freetype fontconfig libXft pango
#libfontconfig.so.1]fontconfig libXft pango
#libfreetype.so.6]freetype fontconfig libXft pango
#libXpm.so.4]libXpm
#libXext.so.6]libXext libXinerama
#libXmu.so.6]libXmu
#libXinerama.so.1]libXinerama
echo 'libXinerama.tcz
pango.tcz
libjpeg-turbo.tcz
libXpm.tcz
libXmu.tcz' > $P.tcz.dep
submitqc --libs
rm -rf *.zsync