Automate Linux and Android

[linkstandalone] First of all, I should probably explain myself as I haven't posted really since I started my site. To be honest I have been very busy starting a new job, keeping up with uni, and developing some stuff when I have the chance. On top of this, I've been trying to learn how I 'should be' doing things by reading a few C# and C books (which I will probably talk about at some point too). So what better way to kick this back off with some tricks to help keep organized when I'm busy? Chances are you already know there are a number of GUI and cloud-based options for keeping your Android and Linux stuff organized so I will not be covering that. Instead, lets do it the fun way (and actually own our files in the process).

File Syncing

If you really want, you could always use a dedicated server to host files relatively cheaply (with a Pi or an old system) however I personally prefer to sync my files. This means that when a file is updated on one device, it synced to those connected to the same network. For example, if I had a shopping list I made on my phone - I could put it in my Sync folder and it would be available on my computer when I need it. I can then use my computer to edit the file, and changes will effectively be saved on both devices when they sync. The program I like to use is called Syncthing, which can be downloaded from pretty much any package manager and is also available on Android through F-droid.. There are a few ways to use Syncthing on Linux including solely through the CLI, in the browser, or by using a GUI application. Personally, I use QSyncthingTray. This gives you a nice little icon in your tray that you can glance at to make sure everything isn't broken.


One of the most handy TUI applications I use almost daily is Calcurse. This lets you add events and to-do lists to a file using a really quite nice ncurses interface. While this is very handy alone, it would be better if you could get the same events and notes on your phone. Luckily, using Syncthing, there is a neat way to do this. By using calcurse --export you can create an ics file that a good number of calendar apps on android use. The app I'm using currently is Simple Calendar (actually I'll recommend the entirety of Tibor's 'Simple' apps) which just so happens to have a function to import and export ics files. So, using syncthing, we can export the calendar to the sync directory (such as by running calcurse --export /home/$USER/Sync/calendar.ics where it will be available to import through the app. I'm still trying to find a way to run the import function automatically, however I havent found a way to do that as of yet - however it is as easy as tapping the import button whenever you want to refresh the calendar. This works both ways too, you can export the calendar to the sync directory on your phone where you can use a command to import the updated calendar back to calcurse: calcuse --import ~/Sync/calendar.ics. To make things easy, I like to leave this command somewhere in my .xinitrc to import the calendar every time I start dwm.

Other Stuff

As you can probably guess, calendar files aren't the only thing that can be synced. Other ideas include sharing notes files, pictures, and password files that can be used in keepass.