Locked

Syncing custom commands with Dropbox

Jun
19
2013

Linux

Anybody that have used Linux for more than a while knows about the power of shell scripting.
I have currently 97 custom scripts in my bin folder. Most of these are just small combination of commands that I frequently use, but I've also have some more complicated scripts such as a script for switching the display to my TV screen and starting various HTPC services, increasing fonts on terminals and editors and so on.

As I'm running Arch Linux on several machines I looked for a way to sync my scripts and also have them always available.

The way I solved this was very simple. First I created a folder in my Dropbox called bin, then I added that folder to my $PATH variable.
You can do this either locally by adding
PATH="${PATH}:${HOME}/Dropbox/bin"

to your .bashrc file or you could add it globally by creating a new script in the /etc/profiles.d folder containing
#!/bin/bash
export PATH=$PATH:/home/username/Dropbox/bin

where username is the name of the user that has Dropbox configured.