Take the 2-minute tour ×
Ask Ubuntu is a question and answer site for Ubuntu users and developers. It's 100% free, no registration required.

I read the following dev email Removing 'Backgrounds and Emblems' and when i read this part:

Note that this does not completely remove the ability for extensions
(e.g. Dropbox) to add emblems programmatically by using the
libnautilus-extension library, just the user-added emblems from the
properties dialog/emblems sidebar.

There is ability to bring emblems programmatically. So, How can i use libnautilus-extension library to add some emblems like Dropbox does? Or is there any tweak tool for this?

share|improve this question

6 Answers 6

up vote 7 down vote accepted

enter image description here

How to...

From the Unity Dash, search for software sources and enable the "Multiverse Repository"

Now in a terminal copy and paste (one line at a time)

sudo add-apt-repository ppa:dr3mro/nautilus-actions-extra
sudo apt-get update
sudo apt-get install nautilus-actions-extra
nautilus -q

Use the following option to emblemize your file/folder:

enter image description here

notes

  1. This installs 70Mb of various packages. More importantly, you can see it installs many nautilus extras. You can remove any of the installed scripts via the tool nautilus-actions-config-tool
  2. You have to hit F5 to refresh the Nautilus folder contents for the emblem to appear.

source

share|improve this answer

Lol, I just read an article about adding emblems back into Nautilus and I come here and find this question. Anyways, yes, you can add emblems back into Nautilus, and here's how:

Follow these instructions (source: http://www.webupd8.org/2011/12/how-to-manually-add-emblems-in-nautilus.html):

First, install python-nautilus. In Ubuntu, use the following command:

sudo apt-get install python-nautilus

Second, download the python script from HERE, extract the downloaded archive and copy the nautilus_emblems_menu.py file to /usr/share/nautilus-python/extensions/ (To be able to do this, open Nautilus as root: "gksu nautilus /usr/share/nautilus-python/extensions/").

Third, restart Nautilus:

nautilus -q

Now when you right click a file or folder in Nautilus, you should see a new item called "Emblems".

Please make sure that you read the original source article in which I got this information from (link is given above), as it contains information on how to add even more emblems to Nautilus.

share|improve this answer
1  
In alternative to putting script in /usr/share (global), you can also put in user folder: ~/.local/share/nautilus-python/extensions –  Pisu Feb 20 '12 at 8:48

enter image description here

How to...

  • Copy the script below and paste into gedit. Save the file into a known location - for example your home folder emblem.sh
  • give the script execute permissions

i.e.

chmod +x ~/emblem.sh
  • Download and install either the 32bit or 64bit nautilus-actions package. N.B. the default package in 11.10 does not work (it crashes)
  • Download and install the package for your platform of liblineak and lineakd. (lineakd is not in Oneiric repository anymore. I couldn't figure out why not.)

i.e.

cd ~/Downloads
sudo dpkg -i nautilus-actions*.deb
sudo dpkg -i liblineak*.deb
sudo dpkg -i lineakd*.deb
  • Run in a terminal

i.e.

nautilus-actions-config-tool
  • Set up a new action as follows:

enter image description here

enter image description here

  • Logout and login

Open nautilus and right-click and file and define your emblem as per the first screenshot.

emblem.sh

#!/bin/bash

# change emblem's in Nautilus with nautilus-actions
# add a new action in nautilus-actions-config-tool with
# Path /path/to/this/script.sh
# Parameter %F

# Germar Reitze <germar.reitze(AT)gmx.de> Nov 2011
# 2011-12-12 Germar Reitze - bugfix and new function to remove emblems in multiple files
# 2011-12-14 Germar Reitze - automatic refresh Nautilus after change

emblem="art cool danger default desktop development documents downloads draft favorite important mail marketing money new nowrite \
ohno OK package people personal photos pictures plan presentation readonly shared sound symbolic-link system \
ubuntuone-unsynchronized ubuntuone-updating unreadable urgent videos web"
#debug=1
xsendkeycode=$(which xsendkeycode)

# ask which emblem to add
pick_emblem() {
   emblem_list=""
   for i in $emblem; do
        if [ $(echo "$@" | grep -c $i) -eq 1 ]; then
           emblem_list="$emblem_list TRUE $i"
        else
           emblem_list="$emblem_list FALSE $i"
        fi
   done
   if [ "$multiple_files" == "true" ]; then
        text="Which embleme to add to files?"
        emblem_list="FALSE DELETE_ALL_EMBLEMS $emblem_list"
   else
        text="Which embleme to set?"
   fi
   # if lineakd is not installed remind to press F5
   if ! [ -x "$xsendkeycode" ]; then
      text="$text \nDon't forget to press [F5] after OK"
   fi
   zenity  --list  --text "$text" --checklist  --column "Pick" --column "Emblem" $emblem_list --separator=" " --height=700 --width=300
   return $?
}

# do we already have emblem's?
get_used_emblem() {
   a=$(gvfs-info "$1" -a metadata::emblems)
   err=$?
   b=${a#*[}
   b=${b%]*}
   echo "$b" | sed -e 's/,//g'
   return $err
}

# emblem won't show without
set_icon_view_auto_layout() {
   if [ $(gvfs-info "$1" -a metadata::nautilus-icon-view-auto-layout | grep -c true) -lt 1 ]; then
        [ $debug ] && echo "SET: metadata::nautilus-icon-view-auto-layout true"
        gvfs-set-attribute -t string "$1" metadata::nautilus-icon-view-auto-layout true
        return $?
   else
        [ $debug ] && echo "metadata::nautilus-icon-view-auto-layout already set"
        return 0
   fi
}

set_emblem() {
   file="$1"
   shift
   gvfs-set-attribute -t stringv "$file" metadata::emblems $@
   return $?
}

del_emblem() {
   gvfs-set-attribute -t unset "$1" metadata::emblems
   return $?
}

report_error() {
   zenity --error --text "Failed in $1"
}


multiple_files=false
if [ $# -gt 1 ]; then
   multiple_files=true
fi

if [ "$multiple_files" == "true" ]; then
   add_emblem=$(pick_emblem)
   err=$?
   if [ $err -gt 0 ]; then
        [ $debug ] && echo "cancel"
        exit 1
   fi
   [ $debug ] && echo "embleme to add: $add_emblem"

   # process every file separate
   while [ $# -gt 0 ]; do
        if [ $(echo "$add_emblem" | grep -c DELETE_ALL_EMBLEMS) -eq 1 ]; then
           [ $debug ] && echo "$1: delete emblems"
           del_emblem "$1"
           err=$?
           [ $err -gt 0 ] && report_error "$1" && exit 1
        else
           used_emblem=$(get_used_emblem "$1")
           err=$?
           [ $err -gt 0 ] && report_error "$1" && exit 1
           emblem_list=""
           for i in $emblem; do
                if [ $(echo "$used_emblem $add_emblem" | grep -c $i) -ne 0 ]; then
                   emblem_list="$emblem_list $i"
                fi
           done
           set_icon_view_auto_layout "$1"
           err=$?
           [ $err -gt 0 ] && report_error "$1" && exit 1

           if [ "$emblem_list" != "" ]; then
                [ $debug ] && echo "$1: $emblem_list"
                set_emblem "$1" $emblem_list
                err=$?
                [ $err -gt 0 ] && report_error "$1" && exit 1
           fi
        fi
        shift
   done
else
   # we only have one file
   add_emblem=$(pick_emblem $(get_used_emblem "$1") )
   err=$?
   if [ $err -gt 0 ]; then
        [ $debug ] && echo "cancel"
        exit 1
   fi
   [ $debug ] && echo "embleme to add: $add_emblem"

   set_icon_view_auto_layout "$1"
   err=$?
   [ $err -gt 0 ] && report_error "$1" && exit 1

   if [ "$add_emblem" != "" ]; then
        [ $debug ] && echo "$1: $add_emblem"
        set_emblem "$1" $add_emblem
        err=$?
   else
        [ $debug ] && echo "$1: delete emblem"
        del_emblem "$1"
        err=$?
   fi
   [ $err -gt 0 ] && report_error "$1" && exit 1
fi

# refresh Nautilus if lineakd is installed
if [ -x "$xsendkeycode" ]; then
   $xsendkeycode 71 1
   $xsendkeycode 71 0
fi
share|improve this answer
    
@Achu should work now. Sorry. fossfreedom thank you for your support and the nice howto! –  Germar Dec 14 '11 at 21:28

Try Nautilus actions. Just press Ctrl+Alt+T on your keyboard to open Terminal. When it opens, run the commands below.

sudo add-apt-repository ppa:nae-team/ppa

sudo apt-get update

sudo apt-get install nautilus-emblemize

sudo apt-get install nautilus-advanced-menu

Once that is done, you can right click on a folder, and click on either the Advance option or the set emblem option.

enter image description here

Once you choose either you will see

enter image description here

And then, here is the outcome.

enter image description here

Let me know if it works for you.

share|improve this answer
    
Thanks you its worked! It previously doesn't worked because I was using gnome-fallback-session. I logged out and open unity and there it worked fine. Again I logged out and logged into gnome-fallback-session and viola its worked. –  Ravi Aug 1 '12 at 14:48

NEW ANSWER

The easiest way to do it is to install thunar (from the Xubuntu distro --- should be as easy as apt-get install thunar). The Thunar developers have left the emblems option. Once you have set them with thunar, they are visible in nautilus too... so no need to change the default file browser if you do not want.

OLD ANSWER

There is another option, see https://github.com/allefant/Nautilus-Emblems-Menu-Extension/blob/master/nautilus_emblems_menu.py (instruction and plea for help in the same file).

You can drop the file also in .local/share/nautilus-python/extensions directory, no need to go superuser.

Sad, I like emblems. If someone knows how to lobby for that...

(By the way, I tried. I was answered WONTFIX. See https://bugzilla.gnome.org/show_bug.cgi?id=665735 )

You can also add the emblems via command line. To see the emblems a file/dir has associated with it, issue

gvfs-info -a metadata::emblems file_or_dir

To set the emblems cool and default on a file/dir:

gvfs-set-attribute -t stringv file_or_dir metadata::emblems cool default

To clear the emblems on file/dir

gvfs-set-attribute -t unset file_or_dir metadata::emblems

Still looking for a gvfs command to list the available emblems...

share|improve this answer

I notice that above posted scripts remove elder emblems, so here is my solution:

gvfs-set-attribute -t stringv "$arg" metadata::emblems $(gvfs-info "$arg" | grep "metadata::emblems:" | sed s/\metadata::emblems:// | tr -d [,]) new-emblem

where $arg is file/directory name and new-emblem is name of additional emblem

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.