metisse - poprawione

Przemysław Iskra sparky w servek.sparky.homelinux.org
Nie, 17 Paź 2004, 04:17:22 CEST


 
> ok, bawię się teraz w dodawanie do scryptu startowego aby sam w razie
> porzeby potrafił sobie uruchomić Xwnc, jak skończę podeślę
chyba się udało, raczej nic nie spierniczyłem, jest kompatybilność z
tym bo w metisse jest normalnie

opcje można podawać w pliku konfiguracyjnym lub przy starcie

a dla Zusera: działa to jak zwykły Window Manager - Aut Of Dy Boks


-- 
 ____ Przemysław Iskra  -  Sparky{PI] _   ___   _   _  Kto ma w życiu pe-
/____)  ___   ___   _ _  ||          |   | _ \ | |   | cha oraz zmartwień
\____\ | -_) '___|  ||^' ||// \\//  <    |  _/ | |   | kupę może złamać rę
(____/ ||    (_-_|_ ||   ||\\  ||    |_  |_|   |_|  _| -kę podcierając d*.
-------------- następna część ---------
# $Revision:$, $Date:$
Summary:	A 3D X Desktop
Summary(pl):	Biurko w 3D
Name:		metisse
Version:	0.3.3
Release:	1
License:	GPL
Group:		X11/Window Managers
Source0:	http://insitu.lri.fr/~chapuis/software/metisse/%{name}-%{version}.tar.bz2
# Source0-md5:	9b20d959d6039dd632bc48f3e893650d
# Source0-size:	4162155
Source1:	%{name}.desktop
Source2:	%{name}-xsession.desktop
Patch0:		%{name}-ac_am_fixes.patch
Patch1:		%{name}-startXwnc.patch
URL:		http://insitu.lri.fr/~chapuis/metisse/
BuildRequires:	XFree86-OpenGL-devel
BuildRequires:	autoconf
BuildRequires:	automake
BuildRequires:	fribidi-devel
BuildRequires:	gnome-libs-devel
BuildRequires:	libstdc++-devel
BuildRequires:	libstroke-devel
BuildRequires:	nucleo-devel
BuildRequires:	readline-devel
BuildRequires:	rplay-devel
BuildRoot:	%{tmpdir}/%{name}-%{version}-root-%(id -u -n)

%define	_wmpropsdir	/usr/share/wm-properties

%description
Metisse is an experimental X desktop with some OpenGL capacity. It
consists of a virtual X server called Xwnc, a special version of FVWM,
and a FVWM module FvwmAmetista. Xwnc is a mix of Xvnc and XDarwin. It
draws nothing on your screen; everything is drawn into pixmaps.
Similarly to Xvnc, but with a different protocol, Xwnc can send these
pixmaps (and other information) to a "viewer". FvwmAmetista is such a
viewer; it uses OpenGL for rendering the X desktop into a window of a
"regular" 3D accelerated X server.

%description -l pl
Metisse to eksperymentalny X desktop z możliwościami OpenGL. Składa
się z wirtualnego serwera o nazwie Xwnc, specialnej wersji FVWM oraz
modułu FvwmAmetista do FVWM. Xwnc to połączenie Xvnc i XDarwin. Nie
rysuje nic na ekranie; wszystko jest rysowane do obrazów.
Podobnie do Xvns, lecz przy użyciu innego portokołu, Xwnc wysyła te
obrazy (i inne informacje) do "przeglądarki". Tą przeglądarką jest
FvwmAmetista; używa OpenGL do wyświetlania biurka X w oknie "zwykłego"
serwera X z akceleracją 3D.

%prep
%setup -q
%patch0 -p1
%patch1 -p1
find -name "*sv_SE*" -exec rename sv_SE sv "{}" ";"

%build
%{__aclocal}
%{__autoconf}
%{__automake}
cd fvwm-insitu
%{__aclocal}
%{__autoconf}
%{__automake}
cd ..
%configure \
	--enable-freetype \
%ifarch %{ix86}
	--enable-glx-x86
%else
	--enable-glx
%endif
%{__make}

%install
rm -rf $RPM_BUILD_ROOT
install -d $RPM_BUILD_ROOT{%{_datadir}/xsessions,%{_wmpropsdir}}

%{__make} install \
	DESTDIR=$RPM_BUILD_ROOT

install %{SOURCE1} $RPM_BUILD_ROOT%{_wmpropsdir}
install %{SOURCE2} $RPM_BUILD_ROOT%{_datadir}/xsessions/%{name}.desktop

%find_lang %{name} --all-name

%clean
rm -rf $RPM_BUILD_ROOT

%files -f %{name}.lang
%defattr(644,root,root,755)
%doc AUTHORS ChangeLog NEWS README TODO
%attr(755,root,root) %{_bindir}/*
%attr(755,root,root) %{_libdir}/*
%{_datadir}/%{name}
%{_datadir}/fvwm-insitu
%{_datadir}/xsessions/%{name}.desktop
%{_wmpropsdir}/%{name}.desktop
%{_mandir}/*/*


%define date	%(echo `LC_ALL="C" date +"%a %b %d %Y"`)
%changelog
* %{date} PLD Team <feedback w pld-linux.org>
All persons listed below can be reached at <cvs_login>@pld-linux.org

$Log: $

-------------- następna część ---------
[Desktop Entry]
Encoding=UTF-8
Name=Metisse
Exec=metisse-start-fvwm
TryExec=metisse-start-fvwm

[Window Manager]
SessionManaged=true
# vi: encoding=utf-8
-------------- następna część ---------
[Desktop Entry]
Encoding=UTF-8
Type=XSession
Exec=metisse-start-fvwm
TryExec=metisse-start-fvwm
Name=Metisse
Comment=3D Window Manager
Comment[pl]=Trójwymiarowy zarządca okien
# vi: encoding=utf-8
-------------- następna część ---------
diff -Nur metisse-0.3.3.orig/fvwm-insitu/configure.in metisse-0.3.3/fvwm-insitu/configure.in
--- metisse-0.3.3.orig/fvwm-insitu/configure.in	2004-06-14 14:51:44.000000000 +0200
+++ metisse-0.3.3/fvwm-insitu/configure.in	2004-10-15 12:35:18.075035168 +0200
@@ -803,7 +803,7 @@
 AC_SUBST(FVWM_PERLLIB)
 
 dnl ******* gettext
-ALL_LINGUAS="ar de fr sv_SE zh_CN"
+ALL_LINGUAS="ar de fr sv zh_CN"
 FVWM_DOMAIN="fvwm"
 FVWMTASKBAR_DOMAIN="FvwmTaskBar"
 FVWMSCRIPT_DOMAIN="FvwmScript"
diff -Nur metisse-0.3.3.orig/fvwm-insitu/modules/FvwmGtk/Makefile.am metisse-0.3.3/fvwm-insitu/modules/FvwmGtk/Makefile.am
--- metisse-0.3.3.orig/fvwm-insitu/modules/FvwmGtk/Makefile.am	2004-06-14 13:32:14.000000000 +0200
+++ metisse-0.3.3/fvwm-insitu/modules/FvwmGtk/Makefile.am	2004-10-15 12:36:07.006596440 +0200
@@ -9,7 +9,7 @@
 # generate an install rule for man pages unless one of them is an existing file
 # name.  Use a hand made rule to install the man page instead.
 #man_MANS = @MANFVWMGTK@
-man_onedir = $(DESTDIR)$(mandir)/man1
+man_onedir = $(mandir)/man1
 man_one_DATA = @MANFVWMGTK@
 EXTRA_DIST = FvwmGtk.1
 
-------------- następna część ---------
diff -Nur metisse-0.3.3.orig/bin/metisse-start-fvwm.in metisse-0.3.3/bin/metisse-start-fvwm.in
--- metisse-0.3.3.orig/bin/metisse-start-fvwm.in	2004-06-15 16:30:47.000000000 +0200
+++ metisse-0.3.3/bin/metisse-start-fvwm.in	2004-10-17 02:30:28.710319024 +0200
@@ -14,11 +14,15 @@
     echo "Usage:
 
   metisse-start-fvwm [ options ] -- [FvwmAmetista options] -- [fvwm options]
+         -- [Xwnc options]
 
 metisse-start-fvwm options:
 
   -h        show this help and exit
   -c  path  user fvwm config dir (default ~/.fvwm-metisse)
+  -Xwnc     start Xwnc (if needed) 
+  -killXwnc kill Xwnc when session is closed (and if -Xwnc)
+  -no-Xwnc -no-killXwnc  don't start or kill even if specified in config file
   -wd :x    display number of the Xwnc server (default :1)
   -wh host  the host of the Xwnc server (default 127.0.0.1)
   -wp pass  passowrd for Xwnc (no password by default)
@@ -39,7 +43,25 @@
 
 user_config_dir=$HOME/.fvwm-metisse
 
+startXwnc=yes
+killXwnc=if_start
+XwncConfig=$user_config_dir/XwncConfig
+[ -f $XwncConfig ] && . $XwncConfig
+
 WDPY=":1"
+for Xlock in /tmp/.X*-lock; do
+	if [ -O $Xlock ]; then
+		XPID=$(cat $Xlock)
+		if ps $XPID | grep -q Xwnc; then
+			XWNC_STARTED=1
+			break
+		fi
+	fi
+done
+if [ -n "$XWNC_STARTED" ]; then
+	WDPY="$(ps $XPID | tr " " "\n" | sed -n "/^:[0-9]*$/p")"
+	echo "Xwnc already started on 127.0.0.1$WDPY (PID:"$XPID")"
+fi 
 WHOST="127.0.0.1"
 WPASS="no"
 XWNC_DISPLAY="wnc://$WHOST$WDPY"
@@ -56,6 +78,8 @@
 			whoseArgs="ametista"
 		elif [ "$whoseArgs" = "ametista" ]; then
 			whoseArgs="fvwm"
+		elif [ "$whoseArgs" = "fvwm" ]; then
+			whoseArgs="xwnc"
 		fi
 	;;
 	*)
@@ -75,6 +99,8 @@
 				ametistaArgs="$ametistaArgs $1"
 			;;
 			esac
+		elif [ "$whoseArgs" = "xwnc" ]; then
+			xwncArgs="$xwncArgs $1"
 		else
 			case "$1" in
 			--wdisplay|--wd|-wd)
@@ -104,6 +130,18 @@
 				shift
 				fvwmExe="$1"
 			;;
+			--Xwnc|-Xwnc)
+				startXwnc=yes
+			;;
+			--killXwnc|-killXwnc)
+				killXwnc=if_start
+			;;
+			--no-Xwnc|-no-Xwnc)
+				startXwnc=no
+			;;
+			--no-killXwnc|-no-killXwnc)
+				killXwnc=no
+			;;
 			-r|--r)
 			    reInstallConfig=1
 			;;
@@ -149,8 +187,8 @@
     echo "WARNING:"
     echo "WARNING: cannot found fvwm metisse config file(s):"
     echo "WARNING: $not_found"
-    echo "WARNING: do you make install?
-    echo "WARNING: ABORT!
+    echo "WARNING: do you make install?"
+    echo "WARNING: ABORT!"
     echo "WARNING:"
     exit 1
 fi
@@ -214,6 +252,45 @@
     touch $user_config_dir/.aconfig
 fi
 
+#start Xwnc
+if [ "$startXwnc" == "yes" ]; then
+	XwncConfig=$user_config_dir/XwncConfig
+	[ -f $XwncConfig ] && . $XwncConfig
+	if [ "$WHOST" != "127.0.0.1" ]; then
+		echo "WARNING: -Xwnc option passed, but Xwnc host is not localhost: $WHOST"
+		echo "WARNING: Will not try to start Xwnc"
+	else
+		if [ ! -n "$xwncArgs" ]; then
+			[ -n "$XwncOptions" ] && xwncArgs="$XwncOptions"
+			[ ! -n "$xwncArgs" ] && xwncArgs="-ac"
+		fi
+		echo "$xwncArgs" | egrep -vq ":[0-9]" && \
+			xwncArgs="$xwncArgs $WDPY"
+		
+		if [ -n "$XWNC_STARTED" ]; then
+		  sXwncArgs=$(ps $XPID | sed -n "/Xwnc/{s/^.*Xwnc //;p}"| xargs)
+		  [ "$(echo $xwncArgs | xargs )" != "$sXwncArgs" ] && cat << EOF
+WARNING[Xwnc] Passed Xwnc arguments: $xwncArgs
+WARNING[Xwnc] differs from started Xwnc arguments: $sXwncArgs
+WARNING[Xwnc] but will not start other Xwnc
+EOF
+		else
+		  if [ -e /tmp/.X$(echo $WDPY | cut -c 2-)-lock ]; then
+		    for DPY_for_Xwnc in 1 2 3 4 5 6 7 8; do
+		      if [ ! -e /tmp/.X$DPY_for_Xwnc-lock ]; then
+			xwncArgs="$(echo "$xwncArgs" | \
+				sed "s/$WDPY/:$DPY_for_Xwnc/")"
+		        break
+		      fi
+		    done
+		  fi
+		  echo "Starting Xwnc with args $xwncArgs"
+		  Xwnc $xwncArgs &
+		  [ "$killXwnc" == "if_start" ] && killXwnc=yes
+		fi
+	fi	
+fi
+
 FVWMAMETISTA_ARGS="-d $FVWMAMETISTA_DISPLAY -w $XWNC_DISPLAY $ametistaArgs"
 export FVWMAMETISTA_ARGS
 export METISSE_FVWM_CONFIG_DIR
@@ -221,3 +298,13 @@
 echo "Start fvwmi with args $FVWMAMETISTA_ARGS for FvwmAmetista"
 
 env FVWM_USERDIR=$user_config_dir $fvwmExe -display $FVWM_DISPLAY $fvwmArgs
+
+if [ "$killXwnc" == "yes" ]; then
+	pid=$(cat /tmp/.X$(echo $WDPY | cut -c 2-)-lock)
+	if ps $pid ; then
+		kill -TERM $pid
+		sleep 0.1
+		ps $pid && sleep 3 && ps $pid && \
+			kill -KILL $pid
+	fi
+fi
diff -Nur metisse-0.3.3.orig/FvwmAmetista/config/Makefile.am metisse-0.3.3/FvwmAmetista/config/Makefile.am
--- metisse-0.3.3.orig/FvwmAmetista/config/Makefile.am	2004-01-28 00:03:47.000000000 +0100
+++ metisse-0.3.3/FvwmAmetista/config/Makefile.am	2004-10-17 02:32:24.450723808 +0200
@@ -6,7 +6,7 @@
 configdir = $(METISSE_FVWM_CONFIG_DIR)
 
 CONFIG_FILES = ametistarc applications background bindings bindings-functions \
-	desks extra fonts menus menustyle modules styles
+	desks extra fonts menus menustyle modules styles XwncConfig
 
 config_DATA = scripting.pl config-files-list fvwm2rc $(CONFIG_FILES)
 
diff -Nur metisse-0.3.3.orig/FvwmAmetista/config/XwncConfig metisse-0.3.3/FvwmAmetista/config/XwncConfig
--- metisse-0.3.3.orig/FvwmAmetista/config/XwncConfig	1970-01-01 01:00:00.000000000 +0100
+++ metisse-0.3.3/FvwmAmetista/config/XwncConfig	2004-10-17 02:31:59.613499640 +0200
@@ -0,0 +1,8 @@
+# start Xwnc ? (yes, no) default: yes
+startXwnc=yes
+# Xwnc options ? (Xwnc --help) default: "-ac :1"
+#XwncOptions=
+# kill Xwnc when session ends ? (yes, no, if_start) default: if_start
+# if "no" you can close session and then back without loosing anything
+# (but whis is memory waste)
+killXwnc=if_start


Więcej informacji o liście dyskusyjnej pld-devel-pl