Files
dotfiles/.scripts/rsync.sh
Sravan Balaji ab0b36e06e Snap Sync Systemd Service
- Add service and timer for snap-sync
- Remove rsync scripts for phone (covered by syncthing)
  and external hdd (covered by snap-sync)
- Remove options for laptop and phone rsync scripts
  in rsync rofi menu
- Re-organize some sections of README.org
2022-08-16 16:39:48 -04:00

43 lines
896 B
Bash
Executable File

#!/bin/bash
help_menu() {
echo "Main menu to launch run rsync scripts. Use only one argument at a time."
}
rofi_menu() {
declare -a options=(
"   - rsync-laptop-to-cloud"
" Back - back"
" Quit - quit"
)
choice=$(printf '%s\n' "${options[@]}" | rofi -dmenu -i)
option=$(printf '%s\n' "${choice}" | awk '{print $NF}')
if [[ "$option" == "quit" ]]; then
killall rofi
elif [[ "$option" != "back" ]]; then
main "--$option" && killall rofi
fi
}
main() {
if [ $# -eq 0 ]; then
# No arguments
help_menu
else
case $1 in
--help | -h)
help_menu
;;
--rsync-laptop-to-cloud)
kitty --hold /home/sravan/.scripts/rsync_laptop_to_cloud.sh
;;
--rofi)
rofi_menu
;;
esac
fi
}
main $@