Skip to content

Instantly share code, notes, and snippets.

@Keshava11
Created March 2, 2017 06:39
Show Gist options
  • Save Keshava11/f52783e00ad2003b24afbda5d56eb402 to your computer and use it in GitHub Desktop.
Save Keshava11/f52783e00ad2003b24afbda5d56eb402 to your computer and use it in GitHub Desktop.
Simple bash script providing options for few utility functions like restarting nautilus, starting dropbox, syncing some file into the dropbox etc (Linux only).
#!/bin/sh
# Prerequisites :
# Following script is a collection of utility that I need in my machine. You can personalize it for your own requirement
# System must have installed nautilus(for 1st option), dropbox(for 2nd option), python with dropbox sdk setup (for 3rd option as given here https://goo.gl/1d8RC3)
# Read input selection from the listview
input_opt=$(zenity --list \
--title="Choose the option to continue" \
--column="Option No." --column="Description" \
1 "Restart Nautilus" \
2 "Open Dropbox" \
3 "Sync Random")
echo "Selected option is $input_opt"
# Simple switch implementation to check the selection and provide implementation accordingly
case "$input_opt" in
1) echo "Kills Nautilus"
killall nautilus
;;
2) echo "Starts Dropbox app"
python <path_to_directory_containing>/dropbox.py start
;;
3) echo "Syncs a file to the dropbox"
/usr/bin/python3.5 <path_to_directory_containing>/SFileUploader.py
;;
*) echo "Good Bye! Figure out what you want."
;;
esac
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment