Page 1 of 2 12 LastLast
Results 1 to 10 of 15

Thread: [How-To] Move Nautilus 3+ Back & Forward Buttons to the Left of the Location Bar

  1. #1
    Join Date
    Feb 2008
    Beans
    20

    Talking [How-To] Move Nautilus 3+ Back & Forward Buttons to the Left of the Location Bar

    OK, so I'm no Linux developer or even an expert of Linux, but I like to tinker and hack. Since upgrading to 11.10, I've been frustrated with new location of the back and forward buttons. It just didn't make any sense and isn't uniform with any other interface for browsing. I don't really care about the search button, because I've never used it in my life. Any way, I decided to dabble with the source code and I think I fixed it. I've been using Nautilus the past few days without a hiccup with the back and forward buttons on the left, before the location/path bar.

    Example before:



    Example after:



    It's really easy to do, and I've got the easy Terminal instructions below. BTW, the version of Nautilus current as of this post is 3.2.1. You will probably need to do this any time Nautilus gets updated through Update Manager. The exact line number of the code that needs to change may vary as well. If this is the case, just use find as I instruct below.

    Warning: I am not a professional and am not responsible for anything going wrong. These instructions are simply a guide for how I personally managed to fix this annoyance. Use at your own risk.

    First off, you may need to enable the "Source code" repository. To do this in Ubuntu, press the Super/Windows key and type "Source". Open the "Software Sources" application from the results. Check the box before "Source code", then click close.

    From Terminal:

    Code:
    mkdir ~/Desktop/nautilus-mod
    
    cd ~/Desktop/nautilus-mod
    
    sudo apt-get update
    
    apt-get source nautilus
    
    sudo apt-get build-dep nautilus
    
    cd ~/Desktop/nautilus-mod/nautilus-3*
    
    gedit src/nautilus-toolbar.c
    Now, scroll down to line 132 or do a "find" for "gtk_toolbar_insert (GTK_TOOLBAR (self->priv->toolbar), item, 0)" and change the "0" to a "2". So change the original line from:

    Code:
    	gtk_toolbar_insert (GTK_TOOLBAR (self->priv->toolbar), item, 0);
    To:

    Code:
    	gtk_toolbar_insert (GTK_TOOLBAR (self->priv->toolbar), item, 2);
    When you're done, click save and close Gedit.

    Back in Terminal, run the following:

    Code:
    ./configure --prefix=/usr
    
    make
    
    sudo killall nautilus
    
    sudo make install
    
    nautilus &
    At this point, I would actually recommend logging out and back in or just restarting.

    To undo the changes and revert back to stock Nautilus, you can either change the "2" back to a "0", re-make and re-install, or you can simply run:

    Code:
    sudo apt-get --reinstall install nautilus
    You might want to remove the required dev packages also, but be careful not to remove something that may have already been there and is needed.
    Last edited by nyteryder79; December 1st, 2011 at 04:04 PM. Reason: Instructions for source repositories added.

  2. #2
    Join Date
    Aug 2011
    Beans
    108

    Re: [How-To] Move Nautilus 3+ Back & Forward Buttons to the Left of the Location Bar

    Nice job! and thanks for sharing

  3. #3
    Join Date
    Feb 2008
    Beans
    20

    Re: [How-To] Move Nautilus 3+ Back & Forward Buttons to the Left of the Location Bar

    Quote Originally Posted by gennatolls View Post
    Nice job! and thanks for sharing
    No problem. Hope it helps! It drove me nuts enough to figure this out. It's just funny that all you have to change is one single character in code. It makes me wonder why this isn't something that could be changed with dconf editor or similar.

    This could easily be made into a script that does it all for you, but I have no idea how to parse the C file, replace the one character, and re-write the file. If anyone does, please let me know and I'll try to make a simple script to do this all in one step.

  4. #4

    Re: [How-To] Move Nautilus 3+ Back & Forward Buttons to the Left of the Location Bar

    Quote Originally Posted by nyteryder79 View Post
    No problem. Hope it helps! It drove me nuts enough to figure this out. It's just funny that all you have to change is one single character in code. It makes me wonder why this isn't something that could be changed with dconf editor or similar.

    This could easily be made into a script that does it all for you, but I have no idea how to parse the C file, replace the one character, and re-write the file. If anyone does, please let me know and I'll try to make a simple script to do this all in one step.
    use the patch utility

  5. #5
    Join Date
    Aug 2008
    Beans
    108
    Distro
    Kubuntu 9.04 Jaunty Jackalope

    Arrow Re: [How-To] Move Nautilus 3+ Back & Forward Buttons to the Left of the Location Bar

    Quote Originally Posted by nyteryder79 View Post
    No problem. Hope it helps! It drove me nuts enough to figure this out. It's just funny that all you have to change is one single character in code. It makes me wonder why this isn't something that could be changed with dconf editor or similar.

    This could easily be made into a script that does it all for you, but I have no idea how to parse the C file, replace the one character, and re-write the file. If anyone does, please let me know and I'll try to make a simple script to do this all in one step.
    What you're looking for is creating a diff file with the diff tool and apply it in a script with the patch tool.

    Edit: And giowck ninja'd me. But I have links, so I'll leave this post here.

  6. #6
    Join Date
    Dec 2008
    Location
    /home/chenxiaolong&/root
    Beans
    474
    Distro
    Ubuntu Development Release

    Re: [How-To] Move Nautilus 3+ Back & Forward Buttons to the Left of the Location Bar

    Nice! But instead of running:

    Code:
    ./configure --prefix=/usr
    make
    sudo make install
    you can run:

    Code:
    dpkg-buildpackage -us -uc -b
    which will compile and generate a proper DEB file in the parent directory.

    EDIT: Also nautilus has a parameter '-q' that restarts itself:

    Code:
    nautilus -q
    Laptop broke ...

  7. #7
    Join Date
    Aug 2011
    Beans
    108

    Re: [How-To] Move Nautilus 3+ Back & Forward Buttons to the Left of the Location Bar

    Cool you made omgubuntu s blog. Look forward to more "hacks" like this.

  8. #8
    Join Date
    Oct 2008
    Beans
    83

    Re: [How-To] Move Nautilus 3+ Back & Forward Buttons to the Left of the Location Bar

    Nice - thanks - much better

  9. #9
    Join Date
    Oct 2011
    Beans
    8

    Re: [How-To] Move Nautilus 3+ Back & Forward Buttons to the Left of the Location Bar

    I have created a PPA for this if someone feels it's too much, just to get the navigation buttons on left side.

    It's for Oneiric (Ubuntu 11.10) only!
    Code:
    $ sudo add-apt-repository ppa:iammuneeb/nautilus-leftnav
    $ sudo apt-get update
    $ sudo apt-get install nautilus
    $ nautilus -q
    To revert back:
    Code:
    $ sudo apt-get install ppa-purge
    $ sudo ppa-purge ppa:iammuneeb/nautilus-leftnav
    $ sudo apt-get update
    $ sudo apt-get --reinstall install nautilus
    $ nautilus -q
    Last edited by iammuneeb; December 5th, 2011 at 09:22 PM. Reason: Added commands to revert back

  10. #10
    Join Date
    Feb 2008
    Beans
    20

    Re: [How-To] Move Nautilus 3+ Back & Forward Buttons to the Left of the Location Bar

    Quote Originally Posted by iammuneeb View Post
    I have created a PPA for this if someone feels it's too much, just to get the navigation buttons on left side.

    It's for Oneiric (Ubuntu 11.10) only!
    Code:
    $ sudo add-apt-repository ppa:iammuneeb/nautilus-leftnav
    $ sudo apt-get update
    $ sudo apt-get install nautilus
    $ nautilus -q
    Very nice! Thank you! Will this work for both 32bit and 64bit?

Page 1 of 2 12 LastLast

Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •