-
-
Save mkim0710/241396c4a6bb005bc9e921dc388c71b8 to your computer and use it in GitHub Desktop.
A bash script to setup OneDrive integration with GNOME on Ubuntu.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/sh | |
# onedrive-ubu.sh | |
# A BASH script to set up OneDrive integration with GNOME on Ubuntu | |
# Copyright (C) 2018 Garrett Mills ([email protected]) | |
# This software is licensed under the MIT License. | |
# This sofware is provided without warranty or even any implied intent of purpose. | |
# | |
# OnedriveD: https://github.com/xybu/onedrived-dev | |
# | |
# NOTE: This script downloads the NGROK binary from http://glmdev.tech/ngrok | |
# You can replace the download URL with your own, or install it manually from the NGROK website. | |
clear | |
echo "Setting up OneDrive for Ubuntu GNOME..." | |
sleep 1 | |
echo "Authorize sudo..." | |
sudo echo "Success!" | |
echo "Verifying dependencies..." | |
sleep 1 | |
sudo apt update > /dev/null | |
sudo apt install -y git build-essential python3-dev libssl-dev inotify-tools python3-pip python3-dbus > /dev/null | |
echo "Removing any old versions of onedrived..." | |
sudo pip3 uninstall -y onedrive_d onedrived > /dev/null | |
sudo rm -rf ~/.onedrive ~/.onedrived ~/.odd | |
echo "Downloading onedrived..." | |
git clone --quiet https://github.com/xybu/onedrived-dev.git ~/.odd > /dev/null | |
cd ~/.odd | |
echo "Installing onedrived..." | |
sudo python3 ./setup.py install > /dev/null | |
echo "Configuring onedrived..." | |
echo "Configuring account..." | |
onedrived-pref account add | |
echo "Configuring drive..." | |
onedrived-pref drive set | |
echo "Checking for ngrok..." | |
if ! which ngrok ; then | |
echo "Downloading ngrok... (this may take a while)" | |
cd /tmp | |
wget --quiet http://glmdev.tech/ngrok > /dev/null | |
sudo mv ngrok /usr/bin/ngrok | |
sudo chmod +x /usr/bin/ngrok | |
done | |
echo "Starting OneDrive daemon..." | |
onedrived start | |
echo "Modifying default user directories..." | |
rm -rf ~/.config/user-dirs.dirs | |
echo ' | |
# This file was written by an automatic generator while | |
# setting up the OneDrive integration with onedrived. | |
XDG_DESKTOP_DIR="$HOME/OneDrive/Desktop" | |
XDG_DOWNLOAD_DIR="$HOME/Downloads" | |
XDG_TEMPLATES_DIR="$HOME/Templates" | |
XDG_PUBLICSHARE_DIR="$HOME/OneDrive/Public" | |
XDG_DOCUMENTS_DIR="$HOME/OneDrive/Documents" | |
XDG_MUSIC_DIR="$HOME/OneDrive/Music" | |
XDG_PICTURES_DIR="$HOME/OneDrive/Pictures" | |
XDG_VIDEOS_DIR="$HOME/OneDrive/Videos" | |
' > ~/.config/user-dirs.dirs | |
rm -rf ~/.config/user-dirs.conf | |
echo "enabled=false" > ~/.config/user-dirs.conf | |
echo "Creating auto-start entry..." | |
echo " | |
[Desktop Entry] | |
Name=OneDrive Daemon Autostart | |
Exec=onedrived start | |
Type=Application | |
X-GNOME-Autostart-enabled=true | |
" > ~/.config/onedrive_daemon.desktop | |
echo "Success!" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment