diff options
author | David Baudens <baudens@mandriva.com> | 2002-07-31 13:13:50 +0000 |
---|---|---|
committer | David Baudens <baudens@mandriva.com> | 2002-07-31 13:13:50 +0000 |
commit | 607df97dcfcb5aa24eec9322dfdfce6f15e2058c (patch) | |
tree | 66f66b93dbad3b11a949a989abcdc805d9a9977c /bin | |
parent | 42423eaa29e6996493f9943f075e33c17c07e441 (diff) | |
download | common-data-607df97dcfcb5aa24eec9322dfdfce6f15e2058c.tar common-data-607df97dcfcb5aa24eec9322dfdfce6f15e2058c.tar.gz common-data-607df97dcfcb5aa24eec9322dfdfce6f15e2058c.tar.bz2 common-data-607df97dcfcb5aa24eec9322dfdfce6f15e2058c.tar.xz common-data-607df97dcfcb5aa24eec9322dfdfce6f15e2058c.zip |
Update
Diffstat (limited to 'bin')
-rwxr-xr-x | bin/DrakWM | 132 | ||||
-rw-r--r-- | bin/createbackground.sh | 43 |
2 files changed, 0 insertions, 175 deletions
diff --git a/bin/DrakWM b/bin/DrakWM deleted file mode 100755 index 2af7b18..0000000 --- a/bin/DrakWM +++ /dev/null @@ -1,132 +0,0 @@ -#!/usr/bin/perl -# -*- Mode: cperl -*- -# Copyright (C) 2000 by Chmouel Boudjnah <chmouel@mandrakesoft.com>, -# MandrakeSoft Inc. -# Redistribution of this file is permitted under the terms of the GNU -# Public License (GPL) -# $Id$ -###################### -# Description: Launch window manager according to -# /etc/X11/window-manager with various options. - -use Getopt::Long; - -my ($wm, $command, $window_mgr_file); -my (@lf); - -my @getopt_args = ('l|list-active-session', - 'i|xinit', - 'a|alias', - 'm|window-manager-file=s', - 'g|with-file-manager=s', - 'p|picture=s', - 'x|with-xterm', - 'h|help', - 'F|fallback', - ); -GetOptions(\%options, @getopt_args) || usage(1); -usage() if $options{h}; - -$window_mgr_file = $options{'m'} ? $options{'m'} : '/etc/X11/window-managers'; -die "$window_mgr_file don't exist\n" unless -r $window_mgr_file; -parse_file($window_mgr_file); - -if ($options{l}){ - print "\t\t\tActive Sessions:\n"; - list_sessions(); - exit(0); -} - -if ($options{a}) {print "alias $_=\'$0 -i $_\';" for @lf; exit 0;} - -unless ($ARGV[0]) { - print STDERR "\n\t\tYou need to specify a Window Manager\n\n"; - usage(1); -} else { $wm = $ARGV[0] } - - -if (!$exec{$wm} && !$options{F}) { - print STDERR "I can't find an entry for $wm\n"; - print STDERR "This is the list of active sessions:\n\n"; - list_sessions(1); - print STDERR "\nVerify your installation or adjust $window_mgr_file\n"; - exit 1; -} - -# Launching -if ($options{p} and $options{b}) { - print STDERR "option -p and -b are incompatible\n"; - exit 1; -} else { - system("xsetroot", "-solid", $options{b}) if $options{b}; -} - -if ($options{g} =~ /KFM/i) { - system("kfm &"); -} elsif ($options{g} =~ /GMC/i) { - system("gmc &"); -} elsif ($options{g} =~ /SFM/i) { #Special Pixel. - system("sfm &"); -} else { - if ($options{g}) { - print STDERR "You need to specify KFM or GMC to --with-filemanager"; - exit(1); - } -} - -if ( $options{p} and ! -x '/usr/X11R6/bin/xsetbg') { - print STDERR "Can't find xli installed, please adjust your installation\n"; - exit(1); -} else { system("xsetbg", $options{p}) if $options{p}; } -if ($options{x}) { - my $xterm = $ENV{XTERM} ? $ENV{XTERM} : "xterm -bg black -fg white"; - system("$xterm &"); -} - -# END -if (!$options{i}) { - $command = $script{$wm} ? $script{$wm} : $script{shift @lf}; - exec ("/bin/sh", "-c", "$command"); -} else { - exec ("xinit $exec{$wm}"); -} - -sub parse_file { - my $f=shift @_; - local *F; - my ($e, $s, $n, $i, $d); - open F, $f or die "Can't open $f\n"; - local $/ = "--@@--"; - while (<F>) { - $n = $1 if /^NAME=(.*)/m; - $e = $1 if /^EXEC=(.*)/m; - $d = $1 if /^DESC=(.*)/m; - $i = $1 if /^ICON=(.*)/m; - $s = $1 while /SCRIPT:(.*?)$/gs; - if (-x $e) { $script{$n} = $s; $exec{$n} = $e; push @lf, $n; } - } -} - -sub list_sessions{my $e=shift @_;for(@lf){print{$e ? STDERR : STDOUT}"$_\n";}} - -sub usage { - my $e = shift @_; - (my $basename = $0) =~ s|.*/||; - print { $e ? STDERR : STDOUT } << "EOF"; -Usage: $0 [-Faixh] [ -b color ] [ window-manager session] -Window-Manager launcher - - -i --xinit: Launch with xinit. - -a --alias: Product alias for bourne shell. - -b=COLOR --background=COLOR: Specify a background color. - -g --with-file-manager: Launch with a filemanager [ KFM | GMC ] - -x --with-xtermM: Display an xterm. - -p=PIC --picture=PIC: Pictures to display in background. - -l --list-active-session: List active sessions. - -F --fallback: Try to fallback between window-managers - if failing to launch the specified one. - -h --help: Display this message. - -EOF - exit($e); -} diff --git a/bin/createbackground.sh b/bin/createbackground.sh deleted file mode 100644 index a825ff2..0000000 --- a/bin/createbackground.sh +++ /dev/null @@ -1,43 +0,0 @@ -#!/bin/sh - -# (c) 2000 - MandrakeSoft - Frederic CROZAT <fcrozat@mandrakesoft.com> - -if [ $# != 2 ] ; then - echo "Usage : $0 <location for backgrounds> < extension for background> ]" - exit 1 -fi - -if [ -z $DISPLAY ] ; then - echo "Must be run in an X session" - exit 1 -fi - -backgroundhome=$1 -extension=$2 - -if [ ! -d $backgroundhome ] ; then - mkdir -p $backgroundhome -fi - -# Set backgrounds -width=$(/usr/X11R6/bin/xdpyinfo | grep dimensions | cut -c 18-26 | sed "s/x.*//") -vertype=$(cat /etc/sysconfig/system | grep META_CLASS | sed "s/META_CLASS=//" | tr A-Z a-z) - - -if [ -z "$vertype" ] || [ $vertype = "powerpack" ] ; then - backgroundtype=PP -elif [ $vertype = "desktop" ] ; then - backgroundtype=DKP -else backgroundtype=PP -fi - -if [ $width ] ; then - for num in 1 2 3 4 5 6 7 ; do - file=/usr/share/pixmaps/backgrounds/linux-mandrake/$backgroundtype$num-$width.$extension - if [ -s $file ] ; then - ln -sf $file $backgroundhome/linux-mandrake-background$num.$extension ; - else - echo "File $file does not exist or is not readable" - fi - done ; -fi |