Changing Gnome back to Unity

1,209

If the problem is the session manager, you can switch using the command:

sudo dpkg-reconfigure gdm

A dialogue will appear where you can chose between GDM and Lightdm.

The process is better explained here.

Share:
1,209

Related videos on Youtube

RubberDucky4444
Author by

RubberDucky4444

Updated on September 18, 2022

Comments

  • RubberDucky4444
    RubberDucky4444 over 1 year

    I am trying to run just a simple print function when the user moves the map around using gesture or search (moves the map in general) I've followed the apple ref guides and i get errors. Ive followed other stack overflow posts and other google search results. I don't know if it is because im using swift 2 or something in my code elsewhere that is contradicting. If somebody could help me that would be greatly appreciated. Here is my code

    import UIKit
    import MapKit
    import CoreLocation
    
    class ViewController: UIViewController, MKMapViewDelegate,   
    CLLocationManagerDelegate, UISearchBarDelegate
    {
    
    
    
    
    
    @IBOutlet weak var mapView: MKMapView!
    @IBOutlet weak var searchBar: UISearchBar!
    
    let locationManager = CLLocationManager()
    
    
    
    
    @IBAction func showSearchBar(sender: AnyObject) {
        searchController = UISearchController(searchResultsController: nil)
        searchController.hidesNavigationBarDuringPresentation = false
        self.searchController.searchBar.delegate = self
        presentViewController(searchController, animated: true, completion: nil)
    }
    
    
    @IBAction func locateMe(sender: AnyObject) {
    
        self.locationManager.delegate = self
        self.locationManager.desiredAccuracy = kCLLocationAccuracyBest
        self.locationManager.requestWhenInUseAuthorization()
        self.locationManager.startUpdatingLocation()
    
        self.mapView.showsUserLocation = true
    
    }
    
    @IBAction func photographer(sender: AnyObject) {
    }
    
    @IBAction func buyer(sender: AnyObject) {
    }
    
    
    
    
    
    
    
    var searchController:UISearchController!
    var annotation:MKAnnotation!
    var localSearchRequest:MKLocalSearchRequest!
    var localSearch:MKLocalSearch!
    var localSearchResponse:MKLocalSearchResponse!
    var error:NSError!
    var pointAnnotation:MKPointAnnotation!
    var pinAnnotationView:MKPinAnnotationView!
    
    
    
    
    override func viewDidLoad()
    {
        super.viewDidLoad()
    
    
    
    
        self.locationManager.delegate = self
        self.locationManager.desiredAccuracy = kCLLocationAccuracyBest
        self.locationManager.requestWhenInUseAuthorization()
        self.locationManager.startUpdatingLocation()
    
        self.mapView.showsUserLocation = true
    
    
        func mapView(mapView: MKMapView!, regionDidChangeAnimated animated: Bool) {
            hobo()
        }
    
    
    
    
    
    
    }
    
    override func didReceiveMemoryWarning()
    {
        super.didReceiveMemoryWarning()
        // Dispose of any resources that can be recreated.
    }
    
    
    
    
    
    
    //     MARK: - Location Delegate Methods
    
    func locationManager(manager: CLLocationManager, didUpdateLocations locations: [CLLocation])
    {
        let location = locations.last
    
        let center = CLLocationCoordinate2D(latitude: location!.coordinate.latitude, longitude: location!.coordinate.longitude)
        let region = MKCoordinateRegion(center: center, span: MKCoordinateSpan(latitudeDelta: 0.01, longitudeDelta: 0.01))
    
        self.mapView.setRegion(region, animated: true)
    
        self.locationManager.stopUpdatingLocation()
    }
    
    
    
    
    
    
    
    func locationManager(manager: CLLocationManager, didFailWithError error: NSError)
    {
        print("Error: " + error.localizedDescription)
    }
    
    
    
    
    
    func searchBarSearchButtonClicked(searchBar: UISearchBar){
        //1
        searchBar.resignFirstResponder()
        dismissViewControllerAnimated(true, completion: nil)
        if self.mapView.annotations.count != 0{
            annotation = self.mapView.annotations[0]
            self.mapView.removeAnnotation(annotation)
        }
        //2
        localSearchRequest = MKLocalSearchRequest()
        localSearchRequest.naturalLanguageQuery = searchBar.text
        localSearch = MKLocalSearch(request: localSearchRequest)
        localSearch.startWithCompletionHandler { (localSearchResponse, error) -> Void in
    
            if localSearchResponse == nil{
                let alertController = UIAlertController(title: nil, message: "Place Not Found", preferredStyle: UIAlertControllerStyle.Alert)
                alertController.addAction(UIAlertAction(title: "Dismiss", style: UIAlertActionStyle.Default, handler: nil))
                self.presentViewController(alertController, animated: true, completion: nil)
                return
            }
            //3
            self.pointAnnotation = MKPointAnnotation()
            self.pointAnnotation.title = searchBar.text
            self.pointAnnotation.coordinate = CLLocationCoordinate2D(latitude: localSearchResponse!.boundingRegion.center.latitude, longitude:     localSearchResponse!.boundingRegion.center.longitude)
    
    
            self.pinAnnotationView = MKPinAnnotationView(annotation: self.pointAnnotation, reuseIdentifier: nil)
            self.mapView.centerCoordinate = self.pointAnnotation.coordinate
            self.mapView.addAnnotation(self.pinAnnotationView.annotation!)
        }
    }
    
    
    
    
    
    func hobo(){
        print("testing")
    }
    
    
    
    }
    
    • Sparhawk
      Sparhawk almost 11 years
      So what do you see in your session manager? Usually you can select the DE from a drop-down list.
    • Sparhawk
      Sparhawk almost 11 years
      I use lightDM too, although I think it's a KDE variant. In my system, /etc/X11/default-display-manager contains /usr/sbin/lightdm. I guess you can try changing this first, then see if your selection of DE sticks. I used gdm once, and I seem to recall that it automatically made the last-selected DE as the default for next time, but I guess not. See if lightDM does this, though.
    • Sparhawk
      Sparhawk almost 11 years
      Well, it's just me at the moment (not "you all"), but I'm not really sure how to help you with that problem, since I use KDE not Unity. I'd suggest creating a new question, and then trying this fix later when you have a chance.
  • RubberDucky4444
    RubberDucky4444 over 8 years
    Sorry I am still kind of new to this language, can you explain what you mean about the first part of that answer?