Re: [sshmenu] Sort Menu?
Brought to you by:
grantm
From: Grant M. <gr...@mc...> - 2008-11-17 22:50:32
|
On Mon, 2008-11-17 at 17:46 -0400, James Eicholz wrote: > is there anyway to sort the list of connections alphabetically outside > of moving the entires around in the list manually yourself? There isn't any way to do that using the SSHMenu preferences dialog, but the config is stored in a plain text (YAML) file so you can modify that using any tools you want. I'd strongly recommend making a backup of the .sshmenu file in your home directory, eg: with this command: cp ~/.sshmenu ~/.sshmenu.backup then you could run a command like this: ruby -r yaml -e 'm = YAML.load_file(ARGV[0]); m["items"].sort!{|a,b| %Q(#{a["title"]}) <=> %Q(#{b["{title"]}) }; puts m.to_yaml' ~/.sshmenu.backup > ~/.sshmenu That should sort the top-level entries but not submenus. If you modify ~/.sshmenu directly, there's no need to restart the applet. Any changes should be reflected immediately when you click to display the menu. If your modifications screw up the menu you can put back the original like this: cp ~/.sshmenu.backup ~/.sshmenu Cheers Grant |