Monday, February 25, 2013

Touchpad tweaks


[I've given this a general title because I'm probably going to add stuff in here with time]

Linux is customizable, and that is kinda awesome in a day and age where technology has become so advanced it can and is being "dumbed down."

This post is going to give you an easy way to enable a feature that while being -in my opinion- amazing in its simplicity makes messing around on your laptop a lot more satisfying.

Circular scrolling.

You probably got the gist of what it is from the name, you move your finger in a circular motion to scroll stuff up and down.
To me the old way of scrolling on the side of the touchpad was horrible, the dual-finger scroll improved on the concept, but laziness breeds laziness and the constant lifting of your finger(s) becomes a tedious task.
With circular scrolling you don't have that, and to be fair to Apple, they were smart to adopt the concept to their iPods.

It's an easy setup.
You'll need the gsynaptics package and its dependencies.
[EDIT MAY 5TH: Head further down for an updated approach to enable circular scrolling]

Open a terminal and type in

sudo apt-get install -y gsynaptics

When it's done, either open it by looking for it in the app launcher (search for "gpoint" if you want an easy time finding it) or in terminal type:

gpointing-device-settings

You'll have a window displaying pointing devices in the left pane and four tabs.
Make sure the touchpad is selected and in the General tab uncheck "Disable tapping and scrolling" if it's checked, it is by default for me.
Head to the Scrolling tab and check the "Enable Circular scrolling" box, then proceed to choose where on the pad you want to initiate scrolling.
I personally choose the mid-top position.

You might also want to check the bottom-most box for horizontal scrolling.

You're done, check it, love it, love life.

I've had the settings not being persistent though reboot on earlier versions of Ubuntu (I am currently running 12.10), if this is the case for you there will soon be an addition here showing how to set these settings on boot witha few simple commands.

[May 5th update]
Running a newer version of Ubuntu (and possily other distros), follow these very simple instructions to make permanent changes to how your touchpad works.

First, you need to find out which device your touchpad actually is, to do this open a terminal and type in the following command:
xinput list
 You will be presented with an output similar to this:

⎡ Virtual core pointer                     id=2 [master pointer  (3)]
⎜   ↳ Virtual core XTEST pointer               id=4 [slave  pointer  (2)]
⎜   ↳ ETPS/2 Elantech Touchpad                 id=12 [slave  pointer  (2)]
⎣ Virtual core keyboard                   id=3 [master keyboard (2)]
    ↳ Virtual core XTEST keyboard             id=5 [slave  keyboard (3)]
    ↳ Power Button                             id=6 [slave  keyboard (3)]
    ↳ Video Bus                               id=7 [slave  keyboard (3)]
    ↳ Sleep Button                             id=8 [slave  keyboard (3)]
    ↳ ASUS USB2.0 Webcam                       id=9 [slave  keyboard (3)]
    ↳ Asus WMI hotkeys                         id=10 [slave  keyboard (3)]
    ↳ AT Translated Set 2 keyboard             id=11 [slave  keyboard (3)]

The entry you will want to use later is your equivalent to my "ETPS/2 Elantech Touchpad"
Now, in your terminal once again type in the following two commands:

xinput set-prop "yourdevicehere" --type=int "Synaptics Circular Scrolling" 1
xinput set-prop "yourdevicehere" --type=int "Synaptics Circular Scrolling Trigger" 1
You now have circular scrolling enabled for the duration of your session, now to make that permanent.
You'll need a .sh file, my editor of choice is nano but use whatever you'd like, yet again in terminal type in:
nano ~/.config/TouchpadSettings.sh
You're now inside the/an editor, add these three lines to your document:
#!/bin/sh
xinput set-prop "yourdevicehere" --type=int "Synaptics Circular Scrolling" 1
xinput set-prop "yourdevicehere" --type=int "Synaptics Circular Scrolling Trigger" 1
Save the file by pressing [CTRL+X] > [Y] > [ENTER]
Your file is now created, there are two more steps and you're done. In the terminal for the last time, type in this command:
sudo chmod +x ~/.config/TouchpadSettings.sh
Your file is now made executable, and all that remains is finding startup applications and adding the file there. Startup applications you'll find the way you find any other installed program, depending on whether you're running Unity, Gnome, or whatever.

Note: The trigger can be set from 0 to 8, and they control from where your circular scrolling gesture should be triggered.
0 All Edges                       1 Top Edge
2 Top Right Corner          3 Right Edge
4 Bottom Right Corner     5 Bottom Edge
6 Bottom Left Corner       7 Left Edge
8 Top Left Corner

Should you wish to mess around with other touchpad settings, do a google search for "synaptics options" or similar, and you will find plenty of lists and descriptions of what various options do, but keep in mind you have some basic touchpad settings native in Ubuntu and won't need to set everything manually.

Wednesday, January 23, 2013

Netflix and Linux

The answer is: Yes!

Netflix are not going to release a Linux client, and according to Netflix it is because their partners claim Linux is a piracy-platform.
Frankly I think that's a load of BS, but opinions are as I understand

However, the developer Eric Hoover has created a port of the Windows Netflix app as a standalone Wine program for Linux, specifically Debian (which includes Ubuntu amongst others).

The best part of it? It's got 1080p playback, something Windows 7 does not have.
I assume it also supports surround, but I only have a stereo system and wouldn't know.

sudo apt-add-repository ppa:ehoover/compholio
sudo apt-get update && sudo apt-get install netflix-desktop
When you've finished installing Netflix is available for you to enjoy.
I'm sure Eric would love donations for his work, you can by him a beer with this link:


Want to make sure you're getting Full-HD? Or do you simply don't want to wait for the buffer?
Ctrl+Alt+Shift+S will bring up a small screen where you can manually select stream quality, the higher the better.

You'll be presented with a fullscreen window, that can be exited with F11, as it's using Firefox.

On a somewhat unrelated note:
Netflix is pretty bland for anyone outside the US, and most annoyingly the company from what I've understood receives their material from their partners hardcoded.
This means any texting done on their shows and films are at the mercy of the publisher, and as a Norwegian this is extremely annoying as 99% of all content has hardcoded subtitles.

The solution for me was using unblock-us' service, I've got a 25Mbit line that can pull FullHD across the atlantic anyway, and coupled with the fact subscription in the US is dirt cheap compared to the Norwegian it all worked out nicely.

'Till next year.
-K

Wednesday, May 9, 2012

Spotify for Linux, KDE, and global media keys.

You're reading my first ever blog post, and for that I'd just like to apologise in advance.









You love music, and what Spotify does for you, you say? As do I!
I also happen to enjoy playing around with Linux, and if you happened upon this blog, chances are so do you.

The two work fairly well together, but it also lacks a few things here and there; one of those things are global Media Hotkeys!

The solution is fairly simple in KDE after Spotify included D-bus support, and that's what I'll be showing you.

A python script exists that enables song notification and global hotkeys, but I don't know if it works 
with KDE, and the last version closes unexpectedly for me, so it might not even be working at all.

First, go to:
System Settings > Shortcuts and Gestures

Under "Custom Shortcuts" we'll be adding four entries, this is done by right-clicking the white field, and in the menu selecting:
New > Global Shortcut > D-Bus Command

Entry #1 "Spotify Play":
Having named and selected the new shortcut, you will have three tabs on the right:
[Comment] [Trigger] [Action]
Fairly straight forward right? The comment is just that, a comment; the trigger is what key or key-combo you will use to trigger the shortcut; "Action" is what the shortcut will do.

Head to the "Action" tab, here you will see four text fields:
Remote Application, Remote Object, Function, and Arguments.
We'll be using the first three fields.

Remote Applications:        org.mpris.MediaPlayer2.spotify
Remote Object:                /org/mpris/MediaPlayer2
Function:                          org.mpris.MediaPlayer2.Player.PlayPause

Now, head to the "Trigger" tab, here you will bind your preferred key.
Simply click once on the only button there, and then they key or key-combination you wish to bind it to.

Hit "Apply" in the lower right corner.

You have now successfully bound your Media Key "Play" as a global shortcut for spotify.

Entry #2 "Spotify Stop":
The only difference here is what function the shortcut has, and which key you bind.
Function:                          org.mpris.MediaPlayer2.Player.Stop

Entry #3 "Spotify Next":
 Function:                          org.mpris.MediaPlayer2.Player.Next

Entry #4 "Spotify Previous":
 Function:                          org.mpris.MediaPlayer2.Player.Previous