16

I have many users at the place I work, expressing the notion of switching to Ubuntu. Most of them, for whatever weird reason wanting to know if its possible to have refresh added when you right click on the desktop.

Is that possible?

Radu Rădeanu
  • 166,822
  • 48
  • 327
  • 400
Mitch
  • 106,657
  • 24
  • 210
  • 268

2 Answers2

12

To add refresh command to right click context menu in Ubuntu 11.10 , install nautilus – refresh by running following commands in the terminal.

sudo add-apt-repository ppa:nae-team/ppa
sudo apt-get update
sudo apt-get install nautilus-refresh

Once the package is installed, run following commands to restart nautilus or log out and log back in to see the changes.

nautilus -q
Jorge Castro
  • 70,934
  • 124
  • 466
  • 653
dlin
  • 3,740
  • 3
  • 29
  • 45
  • When I try the first command I get, E: Unable to locate package lineakd – Mitch Jun 30 '12 at 07:31
  • Can you supply a link? Everything I tried is not working. – Mitch Jun 30 '12 at 07:52
  • when I try to install using USC, I get an error about unmet dependencies. – Mitch Jun 30 '12 at 08:18
  • I updated my answer which a more simple approach.Try that instead :) – dlin Jun 30 '12 at 08:48
  • 1
    Lubuntu doesn't ship Nautilus, so I can't imagine how it works perfectly... – Radu Rădeanu Sep 21 '13 at 19:24
  • Obviously he has Nautilus installed... – dlin Sep 27 '13 at 18:46
  • @Nick Even if, will not work... Not even he will set it as default browser. You are free to test it. :) Your answer might fit better [here](http://askubuntu.com/questions/343719/how-to-get-a-refresh-right-click-action?lq=1). Sincerely, ... – Radu Rădeanu Sep 27 '13 at 18:59
  • @Mitch Please, can you make some light relating to [this comment](http://askubuntu.com/questions/156201/how-to-add-refresh-option-to-right-click-menu-in-lubuntu/345149#comment449552_157536)? This method worked for you in Lubuntu if you have installed Nautilus? If yes, I would like to know how, because for me it doesn't... – Radu Rădeanu Sep 28 '13 at 05:48
  • @RaduRădeanu that was done in lubuntu 11.10, I don;t know that it will work with newer releases of lubuntu or Nautilus for that matter. Back then I tried, and it worked, even 2 people switched to Ubuntu because of it. – Mitch Sep 28 '13 at 06:38
5

The default file browser in Lubuntu is PCManFM. So, if there are some possibilities to "refresh" desktop in Lubuntu, these should act on PCManFM. Thus, looking at the manual page of PCManFM (man pcmanfm), I found that running the following command(s) in terminal (lxterminal), the desktop will refresh

pcmanfm --desktop-off && pcmanfm --desktop --profile lubuntu

So far, so good; there is only left to do somehow to run this command from right click menu from the desktop. This can be done in 3 steps:

  1. Create a new small script, let say refresh.sh, with the following two lines inside:

    #!/bin/sh
    pcmanfm --desktop-off && pcmanfm --desktop --profile lubuntu
    

    Don't forget to make it executable:

    chmod +x /path/to/script/refresh.sh
    
  2. On the desktop, right click and select Desktop Preferences, click Advanced in the new opened window and tick Show menus provided by window managers when desktop is clicked.

    desktop preferences

  3. Using the following command in terminal:

    sudo -i leafpad /usr/share/lubuntu/openbox/menu.xml
    

    edit the opened file /usr/share/lubuntu/openbox/menu.xml as follow (you only have to add the bold text and to use the right path for the script created at 1st step):

...
  <separator label="System" />
  <menu id="system-menu" icon="/usr/share/icons/gnome/48x48/categories/applications-system.png" />
  <item label="Refresh">
    <action name="Execute">
      <command>/path/to/script/refresh.sh</command>
    </action>
  </item>
  <item label="Log Out">
    <action name="Execute">
      <command>lubuntu-logout</command>
    </action>
  </item>
</menu>

</openbox_menu>

The result, as I tested in Lubuntu 13.04: (Make sure that you logout, and log back in for changes to take effect).

refresh desktop in lubuntu

(Sorry for the low quality of the animated gif, but I just don't have time to find something better for the moment)

Mitch
  • 106,657
  • 24
  • 210
  • 268
Radu Rădeanu
  • 166,822
  • 48
  • 327
  • 400
  • This is great. Does it only work on 13.04? I just tried it on 12.10, but no go. Any thoughts? – Mitch Sep 13 '13 at 16:53
  • @Mich As I said, I tested in Lubuntu 13.04. Try to play with `pcmanfm --desktop --profile lubuntu`, use only `pcmanfm --desktop` or another profile... After editing `/usr/share/lubuntu/openbox/menu.xml` file a re-login is required. – Radu Rădeanu Sep 13 '13 at 17:03
  • Yes it does. 12.10, and 12.04. Thanks. – Mitch Sep 13 '13 at 17:37