Available languages

Useful links
Читать на русском

Saturday, April 14, 2012

How to disable alt drag Ubuntu Unity

With Unity-2D, this is controlled using the /apps/metacity/general/mouse_button_modifier GConf key. To disable Alt+Click dragging, run
gconftool-2 --set /apps/metacity/general/mouse_button_modifier --type string disabled
To re-enable it, run
gconftool-2 --set /apps/metacity/general/mouse_button_modifier --type string ''
Note that this GConf key controls several mouse shortcuts:
  • Alt+Click: Move windows
  • Alt+Middle Click: Resize windows
  • Alt+Right Click: Open a generic window menu
N.B: Disabling the modifier in this way can lead to the Alt+Drag behavior when no modifier keys are pressed (Every drag behaves like Alt+drag) Setting the modifier to '' makes the Super/Windows key the modifier. Alt+Drag can then be used by applications, and Super+Drag to move the window.
gconftool-2 --set /apps/metacity/general/mouse_button_modifier --type string '
 
Link:
http://askubuntu.com/questions/80623/how-to-disable-altclick-from-moving-windows 

Ubuntu Sublime Text 2 as default text editor | Ubuntu Notepad++ Replacement | Bash script can handle filenames with spaces

Short description:
We install "Sublime Text 2" in steps 1 to 4.
We set "Sublime Text 2" as default text editor in step 5.

1. Download Sublime Text 2 from its official site or from my mirror.

2. Extract obtained archive somewhere. Rename the folder you've got to "SublimeText2".

3. Open terminal in the directory where "SublimeText2" folder is located and run the following command: 
sudo mv SublimeText2 /usr/lib/

4. Download sublimetext and sublimetext.desktop from my mirror. Open terminal in the directory where these files are located and run the following commands: chmod +x sublimetext sublimetext.desktop
sudo mv sublimetext /usr/bin/
sudo mv sublimetext.desktop /usr/share/applications/

5. Create an empty file without extension, ie: Open your home directory in nautilus, select menu item File -> Create New Document -> Empty Document, press Enter. Right-click on just created "Untitled Document" -> Properties -> tab "Open with" -> Show other applications -> find "sublimetext" in the list -> Set as default. Close. Now, you may delete "Untitled Document".

That's it.

UPD: You can also just edit ~/.local/share/applications/mimeapps.list to set default applications. See an example of mimeapps.list under the cut.

Wednesday, April 11, 2012

Ubuntu Touchpad Synaptics Multitouch HP625

I own an hp625 and I run Ubuntu 11.10 on it (it will be 12.04 very soon).
Nowadays you should know very much things in order to do simple things with your hardware if you're running GNU/Linux distribution.

I have noticed that my Synaptics Touchpad has very much possibilities and a very nice Windows tool to configure them. But for GNU/Linux there are not so much graphical tools to do it and they do not cover all the options. It's a real adventure to configure it a little bit. :D

Now, my touchpad is able to simulate
"next" button if I click in the right-top corner
"prev" button if I click in the left-top corner
middle button if I click with two thingers
right button if I click in the right-bottom corner
circular scrolling
scrolling with two fingers
edge scrolling (continuous)
show move/resize window dialog if I click with 3 fingers
move if I click with 3 fingers and move with 3 fingers

Maybe I'll try to set up some more features.
Maybe there will be a nice graphical tool in the future.

I have already tried
 - standard Mouse and Touchpad configuration tool
 - gpointing-device-settings
 - synclient (manual configuration)

For me this combination was just fine(it could be better).
I should run some commands in order to get some keys to work as I want them.

synclient TapButton1=1 TapButton2=2 TapButton3=3
After this command middle and right buttons are fine (see above).

synclient VertEdgeScroll=1 HorizEdgeScroll=1
After this command edge scrolling works much better.

synclient LTCornerButton=8 RTCornerButton=9
After this command "Next" and "Previous" buttons are fine (see above).

Related links:
Finding the Mouse Button Codes Navigate in Ubuntu Nautilus Using the Mouse Back/Forward Buttons :: Chris Jean
Touchpad Synaptics - ArchWiki
Touchpad Synaptics (Русский) - ArchWiki
Touchpad Synaptics/10-synaptics.conf example - ArchWiki
Synaptics Touchpad - Gentoo Linux Wiki
Synaptics Touchpad/Xorg 7.3 - Gentoo Linux Wiki

Problematic things:
 - /etc/rc.local does not start at boot time
   Do no try to fix it. You'd better write a bash script and add it to StartUp Applications (graphical ubuntu tool).
 - xbindkeys does not work. I did not even need it. I did not fixed it.

Tuesday, April 10, 2012

/* NO COMMENTS */

MY BIG NOTE : THIS SCRIPT IS NEVER EXECUTED at boot time IN UBUNTU 11.10. NO MATTER WHAT YOU DO.

/etc/rc.local

#!/bin/sh -e
#
# rc.local
#
# This script is executed at the end of each multiuser runlevel.
# Make sure that the script will "exit 0" on success or any other
# value on error.
#
# In order to enable or disable this script just change the execution
# bits.
#
# By default this script does nothing.
RETURNVALUE=0
synclient TapButton2=2 TapButton3=3
RETURNVALUE=$(($RETURNVALUE + $?))
echo $RETURNVALUE > /home/ted/rc.local.executed
exit $RETURNVALUE