Skip to content

Instantly share code, notes, and snippets.

@siso
Created June 23, 2015 03:10
Show Gist options
  • Save siso/c257a1ac5f6dc56d4930 to your computer and use it in GitHub Desktop.
Save siso/c257a1ac5f6dc56d4930 to your computer and use it in GitHub Desktop.
Wallpaper with IPv4 infor for Raspberry Pi, Rapbian, LXDE
#!/usr/bin/env sh

export DISPLAY=:0.0

CANVAS=$(mktemp).jpg
WALLPAPER=$(mktemp).jpg

# Create white background image
convert -size 1280x800 xc:white $CANVAS

# Create IP image
convert $CANVAS \                                                                                                                                                  -pointsize 80 -fill blue -draw "text 0,150 'IPv4: $(ip -4 a s eth0 | grep -Eo 'inet [0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}' | awk '{print $2}')'" \
        -pointsize 60 -fill grey -draw "text -0,250 'Hostname: $(uname -n)'" \
        -pointsize 60 -fill grey -draw "text -0,500 'Date $(date)'" \
        $WALLPAPER

# Uncomment this one if you're not using gnome:
# feh --bg-scale $WALLPAPER
# and place a # (hash) for the following rule:
# gconftool -t string -s /desktop/gnome/background/picture_filename $WALLPAPER
#
# Rarpbian and LXDE:
#
#       - set `wallpaper_mode=1` in `ui` stanza in `~/.config/pcmanfm/LXDE-pi/pcmanfm.conf`
#       - uncomment the following line
pcmanfm --set-wallpaper=$WALLPAPER --wallpaper-mode=screen
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment