Linux

Installing Snapper-GUI on Ubuntu: A GUI for BTRFS Snapshots

Snapper GUI is a great program and one you absolutely need if you are using Snapper on a desktop. Snapper is a program that helps manage snapshots on the btrfs filesystem. This quick guide will go over how to install it on Ubuntu.

Snapper-GUI on Ubuntu
Snapper-GUI on Ubuntu

Run the following in a terminal.

First install the packages you will need to run:
sudo apt-get install python3 libgtksourceview-3.0-1 python3 python3-dbus python3-setuptools git

Then clone the snapper-gui GIT repo somewhere:
git clone --depth=1 https://github.com/ricardomv/snapper-gui.git

cd into the snapper-gui folder GIT created and run:
sudo python3 setup.py install

Now run the program:
snapper-gui

If you haven’t made a config with snapper first run:
snapper create-config /

Now that you have it installed you can use apt-btrfs-snapper to take a snapper snapshot every time you do an apt-get transaction.

Advertisements
Bash Scripts, Elementary OS, Linux

Updated Desktop Slideshow script for ElementaryOS

ElementaryOS logo A few days ago I released a desktop wallpaper slideshow script for ElementaryOS. A user pointed out that it wasn’t changing the login screen wallpaper. I added a fix and now your login screen will have a random background; the same one as the desktop slideshow. If there is a big demand for them to be independant of eachother I may make the desktop slideshow differ from the login screen.

You can still use the -bootonly flag to only set only one random wallpaper once when you log in to ElementaryOS. This will now also change your login screen’s wallpaper.

If you rather not change the login screen background from the default ElementaryOS one you can use the –nologin flag.

To change the login screen you will need qdbus. You can install it with apt-get install qdbus.

I added a bunch of logging which is useful if you give the desktop slideshow script a large number of files to work with. Occasionally you may see an x on your desktop indicating that an image couldn’t load. You can then check the logs with tail -f /var/log/syslog and see what image is giving you issues. Then you can delete it or move it. You must enable logging with the –log flag for this to work.

As always you can get the wallpaper slideshow script from Github. Check out the last post for more information on installing and running the Wallpaper Slideshow script. Let me know if you encounter any issues. Its always good to hear feedback.

Bash Scripts, Linux

Get the size of your BTRFS Snapshots

If you want to get the size of your BTRFS snapshots you would probably use btrfs qgroup show.  This only shows you a list of IDs and the sizes are in bytes. I wrote a script that will convert the sizes from bytes to kilobytes, megabytes or gigabytes. It will combine the IDs with the name of each snapshot or subvolume from btrfs subvolume list to make each row a lot more meaningful.

In the end instead of seeing a list like this:
Screenshot from 2015-05-26 15:47:24

You’ll see:

Detailed information of each BTRFS snapshot
Detailed information of each BTRFS snapshot

Instead of meaningless IDs you now have the name of your BTRFS subvolumes or snapshots. Instead of a hard to decipher string of bytes it converts each amount into the most appropriate unit of measurement. You can also see the total amount of data that is being used by the snapshots.

For this to work you first need to enable  quotas. Run this command to enable quotas if you haven’t done so already:

sudo btrfs quota enable /

You can clone the project from github by running:
git clone https://github.com/agronick/btrfs-size.git

Or you can just go a wget on the script:
wget https://raw.githubusercontent.com/agronick/btrfs-size/master/btrfs-size.sh

Set it to executable with:
chmod +x ./btrfs-size.sh

Now you can just run the script with: ./btrfs-size.sh

All the columns are pretty self explanatory. The Total column will tell you how much data is in that BTRFS subvolume. The Exclusive Data column is how much data is exclusive to that subvolume. Since BTRFS is a “copy on write” filesystem none of the data is replicated when you create a snapshot. It only needs to make a copy when something changes.

Leave your feedback here to let me know how it worked for you.

Elementary OS, Linux

Elementary OS Slideshow Wallpaper

Elementaryos logo I set out to code a lightweight script that will make your desktop background change at a preset interval. It changes the background with a fade turning your wallpaper into a slideshow. Having a desktop slideshow seems to be a desired feature in Elementary OS and this method does it using hardly any memory. This should work on any Gtk based distro but I’ve only used it on Elementary OS. Even if you don’t want a slideshow you can use the script to load a random background on each boot up or whenever you run the script. Just use the –bootonly option.

You can find the script on my Github or do a simple wget put the script wherever you want:

wget https://raw.githubusercontent.com/agronick/Wallpaper-Slideshow/master/wallpaper_slideshow.sh

Once it is saved just set it to executable with:

chmod +x ./wallpaper_slideshow.sh

There are a few parameters you can use:

Usage: ./wallpaper_slideshow.sh [FOLDER] [MINUTES]…

  • [FOLDER] Set a folder with images. If it has other files they will be ignored.
  • [MINUTES] (Optional default:2) Set the number of minutes that you want to wait before changing to the next image.
  • [–bootonly] Set this if you want to change to a random image on boot and then exit.
  • [–wait] Do a delay of however minutes you set MINUTES to before switching to the first image.
  • [–log] Display information to the console and log it to syslog.
  • [–help] Display a help message and then exit.

If you just want to see it cycle the default Elementary OS wallpapers every two minutes run ./wallpaper_slideshow.sh without any parameters.

Here is a sample command: ./wallpaper_slideshow.sh ~/Pictures/Backgrounds/ 2 --log

Once you found a setup you like you can append –makecmd to show you a command you can copy and paste into Elementary OS’s startup application settings.

Setting it up for startup in Elementary OS
You need to go to Applications > System Tools > System Settings > Applications > Startup

Elementray OS Startup Applications

Once there click the + in the bottom left. You can then paste the command given to you by –makecmd in the highlighted box.

That’s it. You’ll now have a slideshow wallpaper on your desktop. The script is programmed to load a random set of images and display them as desktop wallpaper sequentially. When it gets to the end it will shuffle the list and start displaying from the beginning.

Update: If you’ve downloaded in the past you probably want to redownload. Elementary OS wasn’t killing the script when it ended a session. Now the script will kill itself if it spends 10 minutes disconnected to a desktop.

Update2: The script now supports changing your ElementaryOS’ login screen. There is a post detailing the changes.

If you are looking for a great collection of wallpaper you can find one here: http://chromecastbg.alexmeub.com/ Click Download in the top right to get them all.