Results 1 to 7 of 7

Thread: nautilus not remember folder views.

  1. #1
    Join Date
    Jan 2008
    Beans
    239

    nautilus to not remember folder views.

    Is there a way to set nautilus to reset folder view upon restart? / Not remember folder views?

    I've looked through gconf and found nil.



    - Arand
    Last edited by Arand; April 22nd, 2008 at 03:40 PM. Reason: clarified title

  2. #2
    Join Date
    Dec 2006
    Beans
    1,482
    Distro
    Ubuntu Jaunty Jackalope (testing)

    Re: nautilus to not remember folder views.

    Are you looking to change the default folder view? that can be done in edit->preferences. I'm not sure there's a standard way to make it forget the views (for individual folders I assume is what you mean).

    If that's what you want, you'd have two options as far as I see, either just delete the entire nautilus config on boot/login, which would mean it doesn't remember any settings, or, figure out where it keeps track of which folders have what views, and write a script to clear that out every time you login. It probably wouldn't be to difficult to do with bash, a little creative grep-ing and piping as long as you figure out where it is.
    Sharing Wifi Is Caring Wifi {o,o} Ubuntu Community Docs..
    |)__)
    -”-”-
    O RLY?

  3. #3
    Join Date
    Jan 2008
    Beans
    239

    Thumbs down Re: nautilus not remember folder views.

    Alright, it seems this data is stored in /home/user/.nautilus/metadata [EDIT: Wrong, correct path is /home/user/.nautilus/metafiles]

    And here deleting the file related to a certain folder will reset the settings to default for that folder, after a 'relogin' is done.

    So, that'll be an easy enough script I guess, now I'll just have to find out how to autorun it at login or logout...

    *Goes HowTo-hunting*

    -Arand
    Last edited by Arand; April 25th, 2008 at 05:00 PM.

  4. #4
    Join Date
    Jan 2008
    Beans
    239

    Question Re: nautilus not remember folder views.

    Okay, could I have someone's opinion on this before I shove it in for execution at shutdown.

    This is what it looks like:
    Code:
    #!/bin/bash
      # This is a script which deletes
      # all folder-specific view-settings
      # for nautilus. Excluding
      # view-settings for the Desktop.
      # this will only take effect in
      # nautilus upon user login.
    find ~/.nautilus/metafiles/ -name "file:%2F%2F%2F*.xml" -not -name "file:%2F%2F%2Fhome%2Fmw%2FDesktop.xml" | xargs -r rm
    Also how exactly do I make it execute at shutdown?

    Do I copy this script (after making it executable) to /ect/init.d and then just do:
    Code:
    sudo update-rc.d this_script start 90 0 6
    ??

    - Arand

  5. #5
    Join Date
    Nov 2005
    Location
    Scandinavia
    Beans
    939

    Re: nautilus not remember folder views.

    This is an old thread, but it still deserves an answer, so...
    Do I copy this script (after making it executable) to /ect/init.d and then just do:
    Code:
    sudo update-rc.d this_script start 90 0 6
    No. That is system wide, run with escalated privilegies (e.g. root). Also ~/ would expand to /root since that is root's home folder...

    What you want to do is place that script in say /usr/local/bin;
    Code:
    sudo gedit /usr/local/bin/nautilus-cleanup-metafiles.sh
    And paste that code there. Then make it executable;
    Code:
    sudo chmod +x /usr/local/bin/nautilus-cleanup-metafiles.sh
    Then preferably run it at login by adding it to autostart, Preferences>Sessions>Add. Name it whatever you want, put
    Code:
    nautilus-cleanup-metafiles.sh
    as the command to run.
    - "though It seems that I know that I know, what I would like to see Is the I that sees me, when I know that I know that I know" / Alan Watts

  6. #6
    Join Date
    Jan 2008
    Beans
    239

    Re: nautilus not remember folder views.

    Quote Originally Posted by pelle.k View Post
    This is an old thread, but it still deserves an answer, so/.../
    Tackar så mycket Pelle!

    I made a slight modification in implementation though:

    Code:
    sudo chmod ug+x /usr/local/bin/nautilus-cleanup-metafiles.sh
    and
    Code:
    sudo chown root:1000 /usr/local/bin/nautilus-cleanup-metafiles.sh
    To disable other (guest account!) users than current (1000) from executing this script.

  7. #7
    Join Date
    Nov 2005
    Location
    Scandinavia
    Beans
    939

    Re: nautilus not remember folder views.

    Varsågod!
    If that's what you're after, there are other ways of accomplishing that as well.

    1. To block other than <username> (put this at the top of your script);
    Code:
    if [ "$(whoami)" != "<username>" ]; then
            exit 1
    fi
    2.To block other than <user id> (put this at the top of your script);
    Code:
    if [ "$(id -u)" != "<user id>" ]; then
            exit 1
    fi
    3. If you create the folder "bin" in your home directory, it's gonna be in your (and only your) $PATH, which means you can run the script from a terminal, but not anyone else (unless the specifically run /home/<username>/bin/nautilus-cleanup-metafiles.sh).
    I think this last solution is the most elegant in this case.
    - "though It seems that I know that I know, what I would like to see Is the I that sees me, when I know that I know that I know" / Alan Watts

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
  •