Alex Bepple

Posts tagged ubuntu

1 note &

Automatically emptying trash on Ubuntu

The most common mechanism for automating tasks on Ubuntu is the cron daemon. You can schedule tasks with crontab -e or you can make your life easier by using Scheduled Tasks, a graphical frontend for crontab. You might need to install gnome-schedule for that.

Now, how do we actually empty the trash? The most commonly recommended way is rm -r ~/.local/share/Trash/files/*. This, however, leaves some garbage in ~/.local/share/Trash/info, where Ubuntu keeps metadata about the contents of the Trash, including the original location and the deletion date. Merely deleting the contents of Trash/files will leave you with orphaned metadata.

A better way is to use the utilities from the trash-cli package:

trash
list-trash
restore-trash
empty-trash

The best bit is that you can provide empty-trash with a parameter. So

empty-trash 5

will permanently delete all files that have been in the Trash for more than 5 days.

Filed under ubuntu

2 notes &

Natural lighting for your monitor

I used to discard programs that promise natural lighting for computers as something quite out there. Not sure what hit me, but last weekend I decided to give it a try, after reading about a new release of F.lux on Omg Ubuntu. Well, F.lux did not work on my Ubuntu installation at all, but Redshift, an alternative, did.

Now, just a week later, I find any monitor without “natural” lighting irksome. So I encourage you to try it too. If you are on OS X or Windows, go with F.lux, if you are on Ubuntu, I recommend Redshift.

Installing is trivial:

sudo add-apt-repository ppa:jonls/redshift-ppa
sudo apt-get update && sudo apt-get install redshift

Some Redshift tips

redshift is the commandline program, gtk-redshift is its equivalent that sits in the notification area.

Redshift adjusts the lighting according to the time of day. To this end, by default, it asks the clock for your location. If you do not have a clock in your Gnome panel, gtk-redshift fails silently. So get your settings right with redshift first.

You can manually pass a location to Redshift. Find your latitude and longitude here. For Hamburg the parameters are:

redshift -l 53.6:10.0

Redshift has two color temperature settings: one for the day and one for the night. According to the time of day, it adjusts the color temperature on the continuum between the two. I found Redshift’s default temperature for the night to be too dark. You can adjust that too. So my settings look like this:

redshift -l 53.6:10.0 -t 5500K:4400K

Now go add a new entry to Startup Applications and forget all about what you just read.

Filed under ubuntu