Example #1
0
def save_distro_record( distro_rec = None, mountpoint = '/' ):
    assert( distro_rec is not None )
    original_status_lst = distro_rec.status_lst
    try:
        distro_rec.status_lst = original_status_lst[-5:]
    except ( IndexError, SyntaxError ):
        logme( 'Unable to truncate status_lst. Bummer, man...' )
    dct_to_save = {'name':distro_rec.name, 'branch':distro_rec.branch, 'dct':distro_rec.__dict__}
    pickle.dump( dct_to_save, open( '%s/etc/.distro.rec' % ( mountpoint ), "wb" ) )
    if os.path.exists( '%s/etc/lxdm/lxdm.conf' % ( mountpoint ) ):
        configure_lxdm_behavior( mountpoint, distro_rec.lxdm_settings )
Example #2
0
def save_distro_record(distro_rec=None, mountpoint='/'):
    assert (distro_rec is not None)
    original_status_lst = distro_rec.status_lst
    try:
        distro_rec.status_lst = original_status_lst[-5:]
    except (IndexError, SyntaxError):
        logme('Unable to truncate status_lst. Bummer, man...')
    dct_to_save = {
        'name': distro_rec.name,
        'branch': distro_rec.branch,
        'dct': distro_rec.__dict__
    }
    pickle.dump(dct_to_save, open('%s/etc/.distro.rec' % (mountpoint), "wb"))
    if os.path.exists('%s/etc/lxdm/lxdm.conf' % (mountpoint)):
        configure_lxdm_behavior(mountpoint, distro_rec.lxdm_settings)
Example #3
0
    os.system( 'rm -f /tmp/.yes_greeter_is_running' )
    if load_distro_record().lxdm_settings['use greeter gui']:
        os.system( 'touch /tmp/.yes_greeter_is_running' )
        logme( 'ersatz_lxdm.py --- using ersatz_lxdm gui' )
        if len( sys.argv ) <= 1 or sys.argv[1] != 'X':
            logme( 'ersatz_lxdm.py --- starting XWindow and asking it to run the ersatz_lxdm gui' )
            write_oneliner_file( '/usr/local/bin/ersatz_lxdm.rc', 'exec python3 ersatz_lxdm.py X' )
            res = os.system( 'startx /usr/local/bin/ersatz_lxdm.rc' )
            os.system( 'rm -f /usr/local/bin/ersatz_lxdm.rc' )
            logme( 'ersatz_lxdm.py --- back from calling XWindow to run ersatz_lxdm gui; res=%d' % ( res ) )
        else:
            logme( 'ersatz_lxdm.py --- actually running ersatz_lxdm gui' )
            res = os.system( '/usr/local/bin/greeter.sh' )
            logme( 'ersatz_lxdm.py --- back from actually running ersatz_lxdm gui; res=%d' % ( res ) )
        if res != 0:
            logme( 'ersatz_lxdm.py --- ending sorta prematurely; res=%d' % ( res ) )
            sys.exit( res )
    if not os.path.exists( '/tmp/.already.initialized.network.stuff' ):
        do_audio_and_network_stuff()
        os.system( 'touch /tmp/.already.initialized.network.stuff' )
    logme( 'ersatz_lxdm.py --- MAIN LOOP' )
#    while 'english' != 'british':
    logme( 'ersatz_lxdm.py --- configuring lxdm behavior' )
    configure_lxdm_behavior( '/', load_distro_record().lxdm_settings )  # This is silly. Modify record, save record, then make me reload record? (See next line.)
    distro = load_distro_record()
    logme( 'ersatz_lxdm.py --- calling lxdm; FYI, wm=%s' % ( load_distro_record().lxdm_settings['window manager'] ) )
    res = os.system( 'lxdm' )
    logme( 'ersatz_lxdm.py --- back from lxdm' )
    sys.exit( res )

Example #4
0
            os.system('rm -f /usr/local/bin/ersatz_lxdm.rc')
            logme(
                'ersatz_lxdm.py --- back from calling XWindow to run ersatz_lxdm gui; res=%d'
                % (res))
        else:
            logme('ersatz_lxdm.py --- actually running ersatz_lxdm gui')
            res = os.system('/usr/local/bin/greeter.sh')
            logme(
                'ersatz_lxdm.py --- back from actually running ersatz_lxdm gui; res=%d'
                % (res))
        if res != 0:
            logme('ersatz_lxdm.py --- ending sorta prematurely; res=%d' %
                  (res))
            sys.exit(res)
    if not os.path.exists('/tmp/.already.initialized.network.stuff'):
        do_audio_and_network_stuff()
        os.system('touch /tmp/.already.initialized.network.stuff')
    logme('ersatz_lxdm.py --- MAIN LOOP')
    #    while 'english' != 'british':
    logme('ersatz_lxdm.py --- configuring lxdm behavior')
    configure_lxdm_behavior(
        '/',
        load_distro_record().lxdm_settings
    )  # This is silly. Modify record, save record, then make me reload record? (See next line.)
    distro = load_distro_record()
    logme('ersatz_lxdm.py --- calling lxdm; FYI, wm=%s' %
          (load_distro_record().lxdm_settings['window manager']))
    res = os.system('lxdm')
    logme('ersatz_lxdm.py --- back from lxdm')
    sys.exit(res)