Thursday, August 25, 2016

Check screensaver remotely in Linux Mint


  1. SSH in.
  2. export DISPLAY=:0 ; cinnamon-screensaver-command -q
  3. For more information: man cinnamon-screensaver-command .

Tuesday, August 23, 2016

Ideas for right click menu items


  • Join multi part .avi files together using avimerge.
  • Join split files. e.g. file.001, file.002, file.003
  • Upload to cloud storage.
  • Run an md5sum and check against saved md5sum lists so see if a duplicate is already in storage.
  • shred or srm
  • Make an .iso or .img
  • Move an .nzb file to the Sabnzbd watch directory.

Adding menu items to Nemo (Linux Mint file manager)

So, I'm running Linux Mint 18. Its default file manager is Nemo (Version 3.0.6)

I'm trying out right-click context menu options in Nemo.

STEP 1:
Create a test script in Perl. I've saved it as /home/sbb/bin/nemotest.pl, and chmod +x 'd it. Its sole purpose is to print out the given arguments.


1:  #!/usr/bin/perl  
2:    
3:  use strict;  
4:  use warnings;  
5:    
6:  while (my $e=shift) {  
7:   print "$e\n";  
8:  }  
9:  sleep 10;  

STEP 2:
Create an action script in ~/.local/share/name/actions . Call it test.nemo_action  (The file extension is important).

1:  [Nemo Action]  
2:  Name=Test  
3:  Comment=  
4:  Exec=gnome-terminal -x /bin/sh -c "/home/sbb/bin/nemotest.pl %U %F %P %p"  
5:  Selection=s  
6:  Extensions=any;  
7:  EscapeSpaces=true  

STEP 3:
Try it. Fire up Nemo, right-click on a file.


If all goes well, the result should be:


We can now see the output produced by each of the % variables in the .nemo_action file. Note that spaces in the file name are handled nicely.

STEP 5:
More reading.
Here's a link with some useful information.

I've tried multiple selections as well. Selection=m in the nemo_action file will make the menu item apply to multiple selections. In this case, the %U and %F substitutions will put multiple items on the command line.

Directories too. Extensions=dir; and you're right clicking with directories.

A handy note: Nemo reads the .nemo_action files on the fly, so you don't have to exit and restart Nemo each time you make a change to the files.

Another handy note: http://codeformatter.blogspot.com.au/ does the code formatting.