Categories
Arch Linux Fedora HowTo Linux Posts Ubuntu

Linux Media Players And Flash Not Stopping The Screensaver

It’s a pretty common problem, one which could be solved by pretty much the following sentence: ‘[Insert Linux Distro], [Insert Media Player] not stopping screen saver when playing videos.’ And, yeah, it’s very annoying. Something that should have been fixed thousands of releases ago, just like most common Linux problems. Luckily though there is a fix, it’s easy and it’s awesome.

Introducing: Caffeine, “An application to temporarily prevent the activation of both the screen saver and the “sleep” powersaving mode.” – https://launchpad.net/caffeine

Essentially what this program does is look for processes running on your machine (you can do this too, just run ‘ps -A’ in a terminal emulator to see a list of everything), so you set process names which the program should look out for, for example ‘vlc’ and when there is a process with this name Caffeine disables the screensaver, when the process stops the screensaver is re-enabled. It even comes with a little tray icon which allows you to manual enable or disable the screensaver/power management with a single click.

Installation (Ubuntu):
sudo add-apt-repository ppa:caffeine-developers/ppa
sudo apt-get update
sudo apt-get install caffeine
Usage:

You’ll be able to see if caffeine is running by the tray icon the first time you use it (this can be disabled in the settings).

Caffeine Running (Screensaver / Power Management Enabled)
Caffeine Running (Right Click Settings)
Caffeine Running (Screensaver / Power Management Disabled)
Adding Processes:

To add a process which will disable the screensaver from being activated, for example VLC so we can watch a movie without constantly having to wiggle the mouse:

First, run VLC (or whatever other media player you wish and just replace VLC for that for the other few steps)

Next, right click on the Caffeine tray icon and select “Preference”.

Click the “Add” button.

List of processes already disabling the screensaver, note Totem is added here.

You should be greeted by a list of the running processes, select the name of the media player (this case, vlc) if it isn’t there check under the “Recent Processes” tab or alternatively just write the command you would use to run this program from the command line.

Adding VLC to processes to disable the screensaver.

Finally click the “Add” button and close the preferences window, that pesky screensaver should no longer be bothering you!

Stopping Flash from enabling the screensaver:

Okay, this is actually really easy, if you’re using Chromium or Google Chrome or Firefox, you’ll just want to add the processes ‘npviewer.bin’ to list, you can use the above instructions to do so.

Categories
Arch Linux Blog Command Line Fedora Linux Posts Ubuntu

Switching Between Two Resolutions in Linux

I have a TV and my monitor connected to my PC by a VGA switch box but what’s annoying is they aren’t the same resolution. This causes problems because I can’t see what I’m doing when I have switched to TV and usually have to leave the setting manager open so that when I change between them I just have to hit return and the resolution changes. That’s great and all but it’s far more effort than I want for something I do fairly often.

My plan was initially to create two xorg.conf files and switch between them using a script, I figured this would be the easiest way even though I haven’t messed around with xorg stuff for a few years ever since things just started working better in Linux. Turns out I couldn’t even find where they keep the xorg.conf file, it sure isn’t in /etc/X11 where it was the last time I looked..

On the search for this file though I came across another useful tool called xrandr, which essentially allows you to change the resolution from the command line.

Xrandr is used to set the size, orientation and/or reflection of the outputs for a
screen. It can also set the screen size.

If invoked without any option, it will dump the state of the outputs, showing the
existing modes for each of them, with a ‘+’ after the preferred mode and a ‘*’
after the current mode.

There are a few global options. Other options modify the last output that is spec‐
ified in earlier parameters in the command line. Multiple outputs may be modified
at the same time by passing multiple –output options followed immediately by
their corresponding modifying options.

For more information on xrandr check out the manual page (or type man xrandr in terminal).

It turns out it’s an extremely easy tool to use, with a command as simple as the following changing the resolution:

xrandr --output VGA1 --mode 1440x900

So the next thing I did was create the following script which allows the resolution to switch between 1440×900 and 1360×768 (my monitor and my TV native resolutions).

#!/bin/bash

TV="1360 x 768"
MONITOR="1440 x 900"

TEST="$(xrandr | grep current | sed -e 's/.*current //;s/, maximum.*//')"

#echo $TEST

if [ "$TEST" == "$MONITOR" ]
        then
                xrandr --output VGA1 --mode 1360x768

elif [ "$TEST" == "$TV" ]
        then
                xrandr --output VGA1 --mode 1440x900

else

        exit

fi

This script simply checks what the current resolution is being used and then toggles between the two set resolutions.

Categories
Command Line Linux Posts Ubuntu

Xfce4 Installed on Ubuntu 11.10, Global Menu Remains.

After installing Ubuntu 11.10 I headed straight for an install of gnome-shell, I’ve been using it for a couple of months without any issue and got used to it enough that it wouldn’t impede on my workflow. That was until this release, when it was officially supported by Canonical and all of a sudden it’s broken and mostly useless. So off to Xfce I go, it’s like gnome2 but way more customisable and actually pretty sweet.

However because I installed from a clean Ubuntu install rather than an xubuntu install I noticed that I still have the global menu (or appmenu-*) floating at the top under the default panel. To remove it, since it’s doing nothing and it looks plain stupid with transparency added to the panel.

It’s pretty simple to uninstall, just open up a terminal window and use the following command:

sudo apt-get remove appmenu-gtk3 appmenu-gtk appmenu-qt

Now just re-start X (log out and in again, restart the computer) and when you return, it should be gone.

And if you ever feel the need to want it back, maybe you want to give unity another try then use the following command:

sudo apt-get install appmenu-gtk3 appmenu-gtk appmenu-qt

Source: http://www.addictivetips.com/ubuntu-linux-tips/how-to-disable-global-menu-in-ubuntu-11-10-tip/

Categories
Linux Posts Ubuntu

How to Install the ‘gnome-shell-extensions-mediaplayer’ Extension

The mediaplayer widget found on github, created by eonpatapon – (https://github.com/eonpatapon/gnome-shell-extensions-mediaplayer).

I’ve been searching for a while for a good, solid widget style thing that’ll sit in the top of the gnome-shell panel which can control the music that’s playing in banshee, rhythmbox or whatever else you want to use to play your tunes.

 

Installation:

1. First you’ll need to grab some dependencies:
sudo apt-get install git gnome-common gnome-tweak-tool
2. Next download the files from the git repository as below (this will download the folder to whatever directory you’re currently in, in terminal):
git clone https://github.com/eonpatapon/gnome-shell-extensions-mediaplayer.git
3. Once it’s finished download (it shouldn’t take too long it’s only about 2.30MB as of writing this guide), you’ll want to install using the following commands:
cd gnome-shell-extensions-mediaplayer
./autogen.sh --prefix=/usr
make
sudo make install
4. That’s it, it’s installed. Next you’re going to want to enable it, run gnome-tweak-tool and under extensions slide the newly installed extension to ON and it should appear next to the “Universal Access Settings” in the top right.

Categories
Linux Posts Ubuntu

Steam in Wine, Repeated Windows

After installing Steam on my linux machine in wine I noticed a really annoy bug, the windows of steam are tiled across my screen as shown in the screenshot below.

Fix:

I managed to fix this by opening up the ‘Configure Wine’ program that comes with wine and under the Applications tab switching from Windows XP mode to Windows 7, this fixed this bug and I now also have system borders on the steam windows.

Installing Wine:

If you’re interested in getting steam installed I used this guide – https://wiki.ubuntu.com/UbuntuMagazine/HowTo/InstallingSteam – It’s pretty simple and only takes a few minutes to do. Below is a quick, simple breakdown of what that guide says to do.

Download wine:

sudo apt-get install wine

Download the steam installer from here:

http://www.steampowered.com/v/index.php

Copy over the tahoma.ttf font from a Windows install (or Download it here – http://source.winehq.org/source/fonts/tahoma.ttf ). Do this command from the folder you downloaded the font to.

 cp tahoma.ttf ~/.wine/drive_c/windows/fonts/

(If it doesn’t work and says the folder is missing or somthing like that do the following and then re-do the cp)

 mkdir ~/.wine/drive_c/windows/fonts/

Finally install Steam (Do this command in the directory you downloaded the Steam installer to):

msiexec /i SteamInstall.msi
Categories
Android Linux Posts Ubuntu

Flashing Samsung Galaxy S (I9000) ROMs with Heimdall

This Tutorial is just a documentation of how I flashed my Samsung Galaxy S (I9000) using heimdall with Darky’s Rom v10.1, follow the steps at your own risk. I am in no way liable for any damage caused to your phone following these steps. I would advise reading up on flashing before proceeding along with pre-reading the guide first.

If you don’t know what you’re doing, you should probably not do it.

For more information, help and most anything check out xdadevelopers forum and DarkysRom.com

This guide is using a fresh install of Ubuntu 11.04 on a memory stick, I was unable to get heimdall installed on Fedora 15 or Ubuntu 10.04.
For this guide I will use Darkys Rom v10.1, however it should work for all ROMs that come with the correct files, as shown below.

Installing Heimdall

First install the Qt Gui libraries:

 sudo apt-get install libqtgui4

Once that’s installed head over to the heimdall website and download heimdall and the frontend for it, here I went for version 1.1.1 as the latest version (as of writing this guide 1.2.0 does not have a frontend).

Here simply download the .deb file and run it once it’s downloaded, you should be able to install them no problem.

(direct links for the version used in this guide)
Heimdall – https://github.com/downloads/Benjamin-Dobell/Heimdall/heimdall_1.1.1-1_i386.deb
Heimdall-frontend – https://github.com/downloads/Benjamin-Dobell/Heimdall/heimdall-frontend_1.1.1-1_i386.deb

Getting The Files

Download the ROM you wish to flash your phone with, for example download Darky’s Ressurection v10.1.

Extract Darky_Resurrection_10.1_i9000.zip
Inside also extract Darky_Resurrection_10.1.tar

You should have the following files:

Darky_Resurrection_10.1_i9000 (folder)

  • Darky_Resurrection_10.1 (folder)
    • boot.bin
    • cache.rfs
    • dbdata.rfs
    • factoryfs.rfs
    • modem.bin
    • param.lfs
    • Sbl.bin
    • zImage
  • Odin3 v1.3,exe
  • Odin3 v1.7.exe
  • s1_odin_20100512.pit

Preparing Your Phone

Make sure you have full battery and disabled all lagfixes.

Flashing The Phone

Press Alt+F2 and then type “heimdall-frontend” and hit enter.

Add the files to the correct heidmall options as so:

Repartition

PIT : s1_odin_20100512.pit

PDA/Code

FactoryFS : factoryfs.rfs
Kernel(zImage) : zImage
Param.lfs : param.lfs
Primary BootLoader : boot.bin
Secondary Bootloader : Sbl.bin

CSC

Cache : cache.rfs
Database Data : dbdata.rfs

Other

Modem : modem.bin
Recovery :

Finally put your phone into download mode.

Once your phone is in downloadd mode, make sure it’s connected via USB and then press start on Heimdall.

After a few minutes your Heimdall will say Finished. Boom you’re done. Just wait for your phone to finish doing whatever it’s doing and you should end up back at the home screen soon enough.

Categories
Fedora Linux Posts

GNOME 3 – Delete Key Not Deleting/Working in Nautilus

In GNOME 3 it seems that the keyboard shortcut to delete a file in Nautilus is actually Ctrl+Delete, this is fine I guess if it’s trying to stop people accidentally deleting files or something but it’s pretty annoying.

To change the keyboard shortcut from Ctrl+Delete back to the usual Delete do the following:

Open a terminal and type:

dconf-editor

If you don’t have it, install it the usual way.

In the application that just opened, on the sidebar click:

org > gnome > desktop > interface

And check the box entitled: can-change-accels.

Now, leave this window open and open up Nautilus.

Select a file that you want deleting and then click on Edit in the Nautilus menu, hover over the Move To Trash button and here press the button you wish to assign to the action, so for example Delete. You may have to press it twice (the first time it will remove the old key-binding and the second will assign it the new one.)

Go back to dconf-editor and uncheck the can-change-accels option to stop any other keyboard shortcuts being changed and you’re all done!

Categories
HowTo Linux Posts Ubuntu

OpenShot, libmp3lame and Ubuntu

If you’re getting the following error while trying export a video under several different codecs in OpenShot including AVI, MOV and MPEG using (mpeg2, mpeg4 or h.264) chances are this might help you with that error.

The following formats/codecs are missing from your system:

libmp3lame

You will not be able to use the selected export profile. You will need to install the missing formats/codecs or choose a different export profile.

This is a simple fix:

  • Open up Synaptic Package Manager
  • Search “libavformat”,
    • If the current package installed is “libavformat52” select “libavformat-extra-52” (alternativly “libavformat-unstripped-52” should also work).
    • Else the package might be “libavformat53” so simply change to “libavformat-extra-53”, basically it might end in different numbers, it should work the same.
  • Hit Apply and approve the changes.
Categories
Arch Linux Blog Command Line HowTo Linux Posts Ubuntu

HowTo: Remove Every Other Line in Text Files – Linux

Let’s say you’ve got a text file, of any size, big or small, and you want to remove every other line of that file, well here are a few commands in Linux that allow you to do this.

Example, you want to get from this:

1
2
3
4
5
6
7
8
9
10

To this:

1
3
5
7
9

The sed way:

 sed -n "p;N;" file.txt > newfile.txt

The awk way:

 awk 'NR%2 != 0' file.txt > newfile.txt

Here you can actually specify N lines, replace 2 in the above command and you’ll be able to take out every N’th number. As an example, here’s the above replaced with a 3 on the file:

1
2
4
5
7
8
10

Easy as pie, right?

Categories
Linux Posts Ubuntu

Error: “end_request: I/O error, dev sr0, sector xxxxx” – Linux

Error:

end_request: I/O error, dev sr0, sector 537392

If you’re getting a similar error filling your screen once you’ve installed Ubuntu, don’t panic. It’s pretty common which is basically because Ubuntu (or any other Linux distro) can’t control your CD/DVD drive properly, it’s probably trying to open/close it but doesn’t know if it has or not. The problem is that you don’t get to see what Ubuntu wrote before because it’s filled your screen up with this error.

If you’ve just installed Ubuntu this probably happened when it wanted you to take the disc out and close the cd tray (if there is one) then hit Enter to finish the installation, so just do that and ignore this error.