Go to:
Gentoo Home
Documentation
Forums
Lists
Bugs
Planet
Store
Wiki
Get Gentoo!
Gentoo's Bugzilla – Attachment 9185 Details for
Bug 17177
Command line desktop environment selector for X
Home
|
New
–
[Ex]
|
Browse
|
Search
|
Privacy Policy
|
[?]
|
Reports
|
Requests
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
The python script that comprises dsx v0.1
dsx-0.1 (text/plain), 2.17 KB, created by
Ryan Grange
on 2003-03-09 19:26:13 UTC
(
hide
)
Description:
The python script that comprises dsx v0.1
Filename:
MIME Type:
Creator:
Ryan Grange
Created:
2003-03-09 19:26:13 UTC
Size:
2.17 KB
patch
obsolete
>#!/usr/bin/env python ># dsx is Mandrakesoft's Xtart modified to work with a Gentoo Linux system. ># Gentoo doesn't use a wmsession.d directory, so we're going to accept the ># /etc/X11/Sessions executables as our menu and our command parameters. ># I also tried to increase the robustness of the entry checking and make the ># error messages less condescending. ># The 0 option for "no wm" was removed. I altered it to run option 1 instead. > >### Original copyright / license message from Xtart... ### ># This is an official linux-mandrake extension of the X windowing system for ># the benefit of Declan Moriarty Copyright 2001 by civileme@mandrakesoft all ># rights reserved. Use is hereby granted under the GNU General Publoic ># License version 2 or any future version of said license at the user's option ># ># No Warranty of course. ># This program is designed for those who want to work in concole and ># occasionally boot into window managers or who want to avoid theme ># persistence from one WM to another. >################ >import sys >import os >import popen2 >import string >import math >def complain(): > print 'X initiation aborted on invalid selection.' > sys.exit(0) > return >print >print 'Welcome to the Desktop Selector for X' >print >fspc=os.path.expanduser('~')+'/' >io=popen2.Popen3('ls /etc/X11/Sessions',1) >L=io.fromchild.readlines() >Sessions={} >Sessionkeys=[] >primekey=0 >for k in L: > primekey+=1 > name=k[:-1] > command='/etc/X11/Sessions/'+k[:-1] > Sessions[primekey]=(name, command) >Sessionkeys=Sessions.keys() >Sessionkeys.sort() >for j in Sessionkeys: > if os.system('[ -x '+Sessions[j][1]+' ]') == 0: > print j, Sessions[j][0] > pass >print >sys.stdin.flush() >s=raw_input('Enter the number of your desired desktop environment [1]: ') >if len(s)==0: > s='1' >if s=='0': > s='1' >for j in range(len(s)): > if string.find(string.digits,s[j]) == -1: > print "'" + s[j] + "' isn't a digit." > complain() >if len(s)>int(math.log10(primekey))+1: > print "That number is too big." > complain() >well=int(s) >wellformed=Sessions.has_key(well) >if wellformed: > os.execvp('xinit',Sessions[well]) >else: > print > print 'Your selection was invalid.' > print > complain() >
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Raw
Actions:
View
Attachments on
bug 17177
:
9183
|
9184
| 9185