xfskin and freebsd
H.R. ter Veer
terveer at subdimension.com
Wed Mar 6 16:04:24 CET 2002
On Wed, 06 Mar 2002 13:40:50 +0000
David Wijnants <dwijnants at askalix.com> wrote:
Thanks for your support.
This is my first tcl app, and still have to learn a lot.
> For simplicity, just use tcl_platform(os) to get the operating system
> name :
>
> $ tclsh
> %
> % parray tcl_platform
> tcl_platform(byteOrder) = littleEndian
> tcl_platform(machine) = i686
> tcl_platform(os) = Linux
> tcl_platform(osVersion) = 2.4.9-31
> tcl_platform(platform) = unix
> tcl_platform(user) = dave
> %
> % set uid $tcl_platform(user)
yes, this is fast & internal. Tried in on digital unix, but it doesn't work on that system,
so for now, i leave it as it is. in fact: the diff between
set sysname [string tolower [exec uname]]
set sysname [string tolower $tcl_platform(os)]
is not that big.
> dave
> %
>
> And here's another way to find out the pid of xfwm running under your id
> (no -a option) - should work on Linux and BSD :
>
well, we can try to find out lots of ways to finally kill the app, but i need one that works for BSD.
the current works fine one linux & Solaris,
while the one you suggest doesn't work on Solaris. ( thats why i want to know the system os).
in my script it gets to look something like:
proc restartXFCE {} {
global exitinst
set sysname [string tolower [exec uname]]
set uid [exec sh -c "id |cut -f 2 -d =|cut -f 1 -d \\("]
switch $sysname \
"linux" { set pid [string trim [exec sh -c "ps -U $uid |grep xfwm"]] } \
"freebsd" { set pid [string trim [exec sh -c "ps U $uid |grep xfwm"]] } \
default { set pid [string trim [exec sh -c "ps -U $uid |grep xfwm"]] }
set pid [string range $pid 0 [expr [string first \ $pid] -1]]
exec kill -USR1 $pid
if {$exitinst} {
exit
}
}
in this way, we can also add different OS-es, like Win32? etc.
> set pid [ exec ps -x -opid,command |\
> egrep {(xfwm$)|(xfwm )} |\
> grep -v grep |\
> cut -b1-5 ]
>
>
> Dave.
>
>
>
> "H.R. ter Veer" wrote:
> >
> > On Sat, 02 Mar 2002 10:55:09 +0100
> > "Giancarlo Rosso" <giancarlo_rosso at hotmail.com> wrote:
> >
> > Hi,
> >
> > I'm trying to alter the script for better (platform independent) support,
> > but i don't have a freeBSD to test (parts) of the script on.
> > can you try running attached script ( in a shell), and mail the results?
> >
> > thanks.
> _______________________________________________
> Xfce mailing list
> Xfce at moongroup.com
> http://moongroup.com/mailman/listinfo/xfce
--
------------------------------------------------
You don't need eyes to see, you need vision
------------------------------------------------
More information about the Xfce
mailing list