Monday, July 1, 2013

Configure Logitech MX Revolution Mouse in Arch/Manjaro Linux

I switched over to Arch and spent a long time trying to get my mouse working properly. Here is a quick and easy guide to getting Logitech MX Revolution mouse working.

Install the needed software
# pacman -S  xbindkeys xvkbd xautomation

- xbindkeys is a program that allows you to launch shell commands with your keyboard or your mouse under X Window. It links commands to keys or mouse buttons, using a configuration file.

- xvkbd is a virtual (graphical) keyboard program for X Window System which provides facility to enter characters onto other clients (softwares) by clicking on a keyboard displayed on the screen.

- xautomation Control X from the command line for scripts, and do "visual scraping" to find things on the screen. The control interface allows mouse movement, clicking, button up/down, key up/down, etc,


Edit you xorg.conf file
# /etc/X11/xorg.conf

Insert this text in the mouse section
   Section "InputDevice"
       Identifier  "Mouse0"
       Driver      "mouse"
       Option      "Protocol" "auto"
       Option      "Device" "/dev/input/mice"
       Option      "ZAxisMapping" "4 5"
       #Option      "XAxisMapping" "6 7"  #uncomment if you want horizontal scrolling with mouse wheel
       Option      "Buttons"    "17"
   EndSection


Create your xbindkeys configuration file
# touch ~/.xbindkeysrc

Edit your xbindkeys configuration file
#   ~/.xbindkeysrc

Here is my file:
# forward
"/usr/bin/xvkbd -text "\[Alt_L]\[Left]""
m:0x0 + b:8

# back
"/usr/bin/xvkbd -text "\[Alt_L]\[Right]""
m:0x0 + b:9

# next tab
"/usr/bin/xvkbd -text "\[Control_L]\[Page_Up]""
m:0x0 + b:13

# previous tab
"/usr/bin/xvkbd -text "\[Control_L]\[Page_Down]""
 m:0x0 + b:15

# undo closed tab
"/usr/bin/xvkbd -text "\[Control_L]\[Shift]\[t]""
 m:0x0 + b:16

# mouse wheel left middle click
"xte 'mouseclick 2'"
b:6

# mouse wheel right middle click
"xte 'mouseclick 2'"
b:7


- I used xvkbd to emulate key combinations on my controller
 and xte to emulate middle click
- use these examples to configure your own system


I didn't enjoy the search button so I turned it into a middle click button also

Add the foll0wing to
# /etc/sysctl.conf

# Enable mouse button emulation
dev.mac_hid.mouse_button_emulation = 1
# Set 2nd button to 217 - the middle button of MX Revolution mouse.
dev.mac_hid.mouse_button2_keycode = 217



Here is a reference for all the MX Revolution
   # b:1    -    left mouse button
   # b:2    -    left and right mouse button together
   # b:3     -    right mouse button
   # b:4    -    mouse wheel up
   # b:5    -    mouse wheel down
   # b:6    -    mouse wheel left
   # b:7    -    mouse wheel right
   # b:8    -    back button
   # b:9    -    forward button
   # b:10    -    -none-
   # b:11    -    -none-
   # b:12    -    -none-
   # b:13    -    media wheel up
   # b:14    -    -none-
   # b:15    -    media wheel down
   # b:16    -    -none-
   # b:17    -    media wheel press

Tuesday, January 29, 2013

Stop Chrome From Opening Up Web Links

I hate that once you install chrome on Ubuntu/Mint it takes over your system.

To resetthe default x-www-browser

run-
sudo update-alternatives --config x-www-browser

select the browser you'd like to open you x-www-browser links

Monday, January 21, 2013

Fix Plex Permissions

Plex Meida Server wasn't able to "see" or add the contents of my Video folder.

I had to change the permissions:


sudo chmod 755 /home/USERNAME/FOLDER PATH


replace the USERNAME or FOLDERPATH sections as necessary

As soon as I did that my media added itself.

Saturday, August 18, 2012

Remove old Kernels

In a terminal paste:

dpkg -l 'linux-*' | sed '/^ii/!d;/'"$(uname -r | sed "s/\(.*\)-\([^0-9]\+\)/\1/")"'/d;s/^[^ ]* [^ ]* \([^ ]*\).*/\1/;/[0-9]/!d' | xargs sudo apt-get -y purge

Monday, September 12, 2011

Setup HP LaserJet P1006 in Debian + Gnome

In the Gnome graphical printer interface
sudo apt-get install System-config-printer

Install the HP LaserJet drivers -
sudo apt-get install hplip

Configure the HP LaserJet printer -
sudo hp-setup -i

This will also work for many other HP printers.

Sunday, September 11, 2011

Apt-Pinning

Apt-Pinning allows you to install packages from testing/unstable/experimental on your Debian install without running into dependency and upgrade problems. It works by telling apt to give priority to one repository, in my case testing, and only install upgrades from it, while ignoring unstable and experimental unless I specifically request a package to be installed from them.

The Apt-Preferences Manual

You can find your apt-preference under /etc/apt/preferences

Debian installs do not come with a apt-preferences file.

To make apt-preference file:
sudo touch /etc/apt/preferences


My Apt Pining File -
Package: *
Pin: release o=Debian,a=testing
Pin-Priority: 900

Package: *
Pin: release o=Debian,a=unstable
Pin-Priority: 300

Package: *
Pin: release o=Debian,a=experimental
Pin-Priority: 100

Package: *
Pin: release o=Debian
Pin-Priority: -1

To Install packages from other repositories:

sudo apt-get install PACKAGE NAME/unstable  
- tries to install package trying to use the default (in my case testing) dependencies

sudo apt-get -t unstable install PACKAGE NAME
- installs the package using dependencies from unstable

*Replace unstable with experimental to install packages from Debian's experimental repository

Wednesday, June 15, 2011

Edit Webpages in Firefox

In the URL box enter: 
javascript:document.body.contentEditable='true'; document.designMode='on'; void 0