Skip to content

Instantly share code, notes, and snippets.

@m4tm4t
Created March 31, 2013 12:31
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save m4tm4t/5280466 to your computer and use it in GitHub Desktop.
Save m4tm4t/5280466 to your computer and use it in GitHub Desktop.
#!/usr/bin/env ruby
# Ecryptfs Openbox pipemenu
# Usage: <menu id="ecryptfs" label="Dossiers cryptés" execute="~/.config/openbox/ecryptfs-menu Documents" />
def mount_menu
print <<EOF
<openbox_pipe_menu>
<item label="Monter le dossier privé">
<action name="Execute">
<command>xfce4-terminal -e "ecryptfs-mount-private"</command>
</action>
</item>
</openbox_pipe_menu>
EOF
end
def umount_menu
print <<EOF
<openbox_pipe_menu>
<item label="Démonter le dossier privé">
<action name="Execute">
<command>xfce4-terminal -e "ecryptfs-umount-private"</command>
</action>
</item>
</openbox_pipe_menu>
EOF
end
if Dir.exists?("/home/#{ENV['USER']}/#{ARGV[0]}")
umount_menu()
else
mount_menu()
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment