This is an old revision of the document!
Table of Contents
Nemo Tips
executable Text Files
By default, Nemo asks whether to display or run executable text files. As all files on Windows Samba shares are executable, this can become annoying very quickly. To change this:
Edit → Preferences → Behaviour → Executable Text Files → View executable text files when they are opened
Nemo keyboard shortcuts
By default, there is no keyboard shortcut to move files/directories from one pane to another (when working with multiple panes by pressing F3
). A lot of other functions don't have keyboard shortcuts either.
The shortcuts are stored in ~/.gnome2/accels/nemo
Create the folder and edit this file:
mkdir -p ~/.gnome2/accels vi ~/.gnome2/accels/nemo
or search for “Move to next pane” when the file exists (or any other function you require. Remove the preceding semicolon and define the shortcut key. In this example, the shortcut will be set to CTRL+j
;
(gtk_accel_path "<Actions>/DirViewActions/Move to next pane" "<Primary>j")
Quit nemo from the command line using:
nemo -q
NOTE: Ensure not to use a shortcut already defined for something else!
Nemo Context Menus
Nemo supports custom context menus by simply creating a file in an 'actions' folder. Nemo does not need to be restarted to pick up any new or changed actions.
Global action scripts need to be placed in /usr/share/nemo/actions
and user actions can be placed in ~/.local/share/nemo/actions/
. File extension has to be .nemo_action
.
A full description of the syntax is available in the sample file /usr/share/nemo/actions/sample.nemo_action
More examples can be found at https://wiki.archlinux.org/index.php/Nemo
The sample file is also here:
https://github.com/linuxmint/nemo/blob/master/files/usr/share/nemo/actions/sample.nemo_action
Mass renaming
sudo apt-get install gprename
- bulk-rename.nemo_action
[Nemo Action] Name=Bulk Rename Comment=Multiple Rename with GPRename. The action gets executed for the marked or the higher level directory. Exec=gprename %F Selection=m Extensions=any; EscapeSpaces=true Dependencies=gprename;
MP3 Tagging example scripts
- mp3-lyrics.nemo_action
[Nemo Action] Name=Add Lyrics to MP3s Comment=Add Lyrics to MP3s Exec=gnome-terminal -x sh -c "/home/wuff/getlyric/get_mp3_lyrics.py --sites genius.com --in_dir '%F' --write2tag" Icon-Name=gtk-cdrom Selection=s Extensions=dir; Quote=double EscapeSpaces=true
- mp3-lyrics-2.nemo_action
[Nemo Action] Name=Add Lyrics to MP3s Comment=Add Lyrics to MP3s Exec=gnome-terminal -x sh -c "/home/wuff/getlyric/get_mp3_lyrics.py --sites genius.com --in_dir '%P' --write2tag" Icon-Name=gtk-cdrom Selection=none Extensions=dir; Quote=double EscapeSpaces=true
- beets_import_album.nemo_action
[Nemo Action] Name=Import Album to Beets Comment=Import Album to Beets Exec=<beets_import_album.sh %F> Icon-Name=gtk-cdrom Selection=notnone Extensions=dir; #Quote=double EscapeSpaces=true Terminal=true
- beets_import_album.sh
for var in "$@" do folder=$(basename "$var") echo "Importing '$folder' into beets..." beet im "$var" done sleep 10
chmod 755 .local/share/nemo/actions/beets_import_album.sh
Nemo Performance
If opening folders with lots of images takes a long time, changes are a plugin is causing this:
disable the plugin “ChangeColorFolder+NemoPython” and restart nemo (nemo -q on command line) and start it again by opening any folder.
If opening folders with videos takes a long time, the thunbnailer for videos can be replaced with ffmpegthumbnailer which is faster (note that on updates of totem the config probably will be replaced):
sudo apt-get install ffmpegthumbnailer cd /usr/share/thumbnailers/ sudo cp totem.thumbnailer totem.thumbnailer.original sudo vi totem.thumbnailer #replace line 2-3 with: TryExec=/usr/bin/ffmpegthumbnailer Exec=/usr/bin/ffmpegthumbnailer -s %s -i %i -o %o -c png -f #exit nemo nemo -q
Save/Restore session
Execute nemo_save.sh to save list of opened nemo windows in ~/nemo.dat.
Launch nemo_restore.sh to reopen saved list of windows.
Restrictions : the script cannot save opened tabs, and won't save a folder whose name is too long. For special folders like Trash, you can replace the window title name in nemo_save.sh if you know the full path.
https://github.com/x-hgg-x/Utils/tree/master/Nemo%20save%20and%20restore%20session
- ~/.local/bin/nemo_save.sh
#!/bin/bash declare -x DISPLAY=":0.0" sleep 15 wmctrl -lx | grep nemo.Nemo && wmctrl -lx | grep nemo.Nemo | sed -e "s#Dossier\ personnel# - $HOME#" | awk -F' - /' '{print "/"$2}' > ~/nemo.dat
- ~/.local/bin/nemo_restore.sh
#!/bin/bash sleep 2 IFS=$'\n'; read -d '' -r -a dirs < ~/nemo.dat for dir in "${dirs[@]}"; do nemo "$dir" & sleep 0.5 done
chmod 755 ~/.local/bin/nemo_save.sh ~/.local/bin/nemo_restore.sh #Add to current user's crontab (crontab -l ; echo "*/5 * * * * /home/$USER/.local/bin/nemo_save.sh") | crontab -
Auto-save on Cinnamon shutdown:
echo "session-cleanup-script = /home/$USER/.local/bin/nemo_save.sh" | sudo tee -a /etc/lightdm/lightdm.conf.d/70-linuxmint.conf
Restore session on Cinnamon start:
cat > ~/.config/autostart/nemo_restore.desktop << EOD [Desktop Entry] Version=1.0 Type=Application Encoding=UTF-8 Name=Restore Nemo Session Exec=/home/$USER/.local/bin/nemo_restore.sh Terminal=false StartupNotify=false Categories=Application; X-GNOME-Autostart-enabled=true X-GNOME-Autostart-Delay=10 EOD