Ceci est une ancienne révision du document !
Two months ago I wrote about using SSH and Rsync. This month, I'd like to introduce you all to a trick I've recently started using for wirelessly syncing my android tablet, as well as outline a few other useful tricks I use, which others might find useful. Specifically, how to display a custom date in a foreign language (in Conky), how to spruce up your Vim interface (and PS1 prompt), and a script to randomly select an image for your background every 15 minutes. I realize that GNOME can probably take care of your backgrounds for you, but someone may still find a use for it. For anyone who wants an idea of the date and PS1 adjustments, check out this month's screenshot on my deviantart page (http://lswest.deviantart.com/#/d4se2tv) Android The things you'll need for this are as follows: On the Android device: QuickSSHd (as far as I remember, it's free). Once it's installed, simply check the IP address of the device, and give it a password/port. To start the server, hit the button that says “off” (so that it reads “on”). On your PC: sshfs, and a mount-point (preferably in your home folder) for the device.
A brief explanation of the process: I simply mount the sdcard folder using sshfs, and then copy files over as I would using USB (which never worked very well for me and my Asus TF101 Transformer eeePad for media files). As for how to do this, see below. Mounting can be done with: sshfs root@127.0.0.1:/sdcard/ ~/tf101 -p 2222 Just like with rsync, you need to specify the path after a colon, and to avoid input/output errors on the mounted folder, you must have a closing slash at the end of the path. The second path is the mountpoint, and the -p 2222 is simply the port that QuickSSHd is listening on. After this, copy the files to the folder with whichever method you prefer. As an optional final step, I find that my Music app does not refresh after these files are added. The only way I've found to fix this is to go to the File Manager, and rename the copied file/folder, forcing the tablet to re-load the information.
Custom date I've been learning Japanese for a while now, and decided to display the date in Japanese (both for practice, and to save space). However, it was not so easily done, as I use Conky for my status bar in XMonad. My solution to this is to write the following code-segment, which I call every few seconds from my conkyrc. You may need to run the following command to get the right formatting (this applies to any locale you may decide to use). locale-gen ja_JP.UTF-8 Code-segment: #!/bin/sh LC_ALL=“” LC_TIME=ja_JP.UTF-8 date +'%A, %-d日%B%Y年 %H:%M' You'll of course need to change the date format into the string you'd like (thoroughly documented in the man page). Vim & PS1 (Powerline) Powerline homepage: https://github.com/Lokaltog/vim-powerline
The easiest way to install Powerline is to use vundle. Instructions for installing Vundle are on the github page, here: http://github.com/gmarik/vundle. Once you've installed it, you'll need to add the following three lines to your .vimrc: set rtp+=~/.vim/bundle/vundle/ call vundle#rc() Bundle 'Lokaltog/vim-powerline' After which you'll need to open vim and type :InstallBundle (requires git to install) Once you've installed it, you'll need to patch the font you're using with the script found under the folder fontpatcher (full path will be something like ~/.vim/bundle/vim-powerline/fontpatcher). The readme file there will guide you through the patching.
Once your font is patched (and your font-cache reloaded with the command fc-cache), you can add the final line to your .vimrc to get arrow shapes. let g:Powerline_symbols='fancy' If you find this to be something you want for your prompt as well, you simply need to make sure you're using the patched font, and copy the arrow from the vim line into your .bashrc prompt line, which I sadly can't supply, as it would require a patched font. Make sure you set the background behind the arrow glyph to the next color, and the foreground to the previous, to achieve the arrow appearance.
Wallpaper This script, as I have it written, requires fluxbox to be installed (for the fbsetbg program). However, if you know of a command-line wallpaper setter that offers a random option, feel free to replace it. The script: #!/bin/bash while true do fbsetbg -R ~/Pictures/Hyperion/Wallpapers/Guitars sleep 15m done The script runs in an infinite loop, calling the random command on my guitar wallpaper folder every 15 minutes. If anyone has any adjustments (or improvements upon the script), feel free to send me an email about it! Hopefully some of you will find some of these tips useful (and hopefully I've interested one or two readers into using Vim a bit more). If anyone has any questions, comments, or suggestions, I can be reached at lswest34@gmail.com. Any emails should include “C&C” or “FCM” in the subject line, so that I don't overlook it. Happy customizing!