Showing posts with label ubuntu. Show all posts
Showing posts with label ubuntu. Show all posts

Saturday, December 10, 2016

Windows 10 update broke my Ubuntu linux and boot-repair didn't work [SOLVED]

Today I logged into Windows on my dual-boot Ubuntu 16.04 / Windows 10 laptop, which I don't do very often, and Windows installed a heap of updates.
Seemed very fine to me until I restarted and tried to start my faithful Ubuntu - and to my dismay got stranded in a primitive text-only screen with a few lines of text that ended in:
grub>

So, as had happened before, Windows again borked my boot loader. Sigh. (And some profanities which I won't repeat here).

I already had repaired my boot loader in similar circumstances before, using Boot-Repair, but couldn't find my Boot-Repair Live USB so decided to boot into a Ubuntu 16.04 live USB and start Boot-Repair from there (following the "2nd option: install Boot-Repair in Ubuntu" on the Boot-Repair wiki page).

I did "Recommended repair" in Boot-Repair, but at the end I got a message that it had not worked due to "Locked-ESP detected", and I was recommended to create a /boot/EFI partition at the start of the disc, using eg. gParted.

I launched gParted and saw that there was already a /boot/efi partition on my hard drive, but I also saw little key icons next to the names of all the partitions - which rung a bell with the "Locked-ESP" message.

So I right-clicked the partitions one by one in gParted and selected "unmount", which made the key icons disappear.

I then started boot-repair again, with the Recommended Repair option, and lo and behold, it fixed my system neatly.


I do feel that it should be explained on the Boot-Repair wiki page that the hard drive has to be unmounted before attempting to run Boot-Repair with the 2nd option (installing it in Ubuntu"), but for this one edit to the wiki I can't find the courage to go through the process of getting the right account and permissions on the Wiki. So hopefully someone that already has those, will do the job...


Thursday, January 1, 2015

Shrink volume in Windows 7

In order to install Ubuntu on a new HP Probook 430 G2, with Windows 7 pre-installed, I wanted to shrink the C: volume in order to make more space for Ubuntu.

So I did the usual:
- in Start Menu search box, I typed "partition"
- click on "Create and format hard disk partitions"
- I right-clicked on the C: volume and chose "Shrink volume"
- in the following window I could shrink the C: volume to about half its size. But the problem was that I wanted to shrink my partition more than what was allowed.

To cut short to the solution, here's how I unblocked the remaining space:

In short:

  • I disabled virtual memory
  • I disabled file indexing and deleted the index files
  • I also deleted shadow copies
  • Restart, shrink partition as desired
  • As far as desired, re-enable virtual memory and/or file indexing and make a restore point.

In long and detailed:
  • I disabled virtual memory (first steps are copied from Microsoft site):
    • Open System by clicking the Start button Picture of the Start button, right-clicking Computer, and then clicking Properties.
    • In the left pane, click Advanced system settings.  Administrator permission required If you're prompted for an administrator password or confirmation, type the password or provide confirmation.
    • On the Advanced tab, under Performance, click Settings.
    • Click the Advanced tab, and then, under Virtual memory, click Change.
    • Clear the Automatically manage paging file size for all drives check box.
    • Click on "No paging file" (further down in the same window)
    • Restart
  • Note: It might be necessary to disable also the creation of Recovery Points, which in my case wasn't active to begin with, so I can't help you here.
  • Upon restart, I still had the same problem. So I tried manually shrinking the volume using Diskpart (to find info on this, start the partition manager as explained at the beginning of this article, right-click on C: volume, choose "Shrink partition", and in the following popup window click the link that says "See Shrink a basic volume" which brings you to a help page with all explanations). 
    • Diskpart didn't succeed in shrinking the volume more than the graphical interface did, of course, but it did write an event in the system logs. As explained in Windows help about shrinking volumes, in the Application logs you can search for event 259 which details the file that blocks further shrinking. So click on Start Menu, type "log" in the search box and choose "view event logs". There, under "Event viewer" -> "Summary page events" in the section "Information", look for event ID 259 and, at the right (in the "actions" pane, click on "view all instances of this event). Click on the last one, chronologically, and there you should see the file name of the file blocking the further shrinking.
    • So here I found out that the indexing service was involved. 
  • So I disabled the windows indexing and deleted the index files:
    • To disable the service:
      • in Start Menu, type "services" and click above on "services"
      • Look for "Windows Search", right-click on it, stop the service and and put "startup service" to "disabled" so on restart it doesn't start again.
    • Then I deleted the index files:
      • first find out where they are
        • in Start Menu type "regedit" in the search box and click on "regedit" above.
        • find HK_LOCAL_MACHINE -> SOFTWARE -> Microsoft -> Windows Search and click on it. To the right, next to DataDirectory, you'll find the right directory (in my case %ProgramData%\Microsoft\Search\Data).
      • Then delete them as administrator: I opened a Windows Explorer window as administrator (type "explorer" in Start menu search field, right-click on Windows Explorer and select "Run as administrator"). Then I typed in the directory box on top "%ProgramData%\Microsoft\" (without the quotation marks), right-clicked on the "Search" subdirectory and chose "delete".
  • I deleted shadow copies:
    • I opened a command prompt as administrator (Start Menu -> All Programs -> Accesories -> Command prompt -> right-click and select: "run as administrator")
    • Typde "vssadmin list shadows" in command prompt
    • Typed "wmic" in command prompt and pressed enter. Then typed "shadowcopy delete" and at the prompt, selected "'Y" for every shadow copy.
  • Then I restarted and was able to shrink the partition to the desired size.


If you appreciated this article for some reason or another, please share it (see the buttons below), and, of course, don't forget to Flattr! (Why?)

Sunday, August 3, 2014

Keyboard layout incorrect in unity

Problem: keyboard layout in Unity appears to be BE (azerty) (as shown in the icon in Unity panel top right), but when typing it turns out to be EN (querty). I just have to click on the BE-icon and "choose" BE again for the keyboard layout to be correct. But the problem returns after every reboot.
System: Ubuntu 14.04.1 (fresh install) on a HP Envy dv7 laptop

Solution:

  • as found in the comments on bug #1238346
    • delete the ~/.config/ibus folder with the command:
      rm -rf ~/.config/ibus
    • then type ibus-setup and in the window that appears, in the "Advanced" tab, tick "use sytem keyboard layout"
    • close all windows and reboot.

Saturday, August 2, 2014

Beats audio on HP envy dv7, Ubuntu 14.04.1

Problem: Only two speakers working on HP Envy dv7 7390eb laptop with Beats Audio
System: Ubuntu 14.04.1 fresh install
  • Everything I tried relating to changes in /etc/modprobe.d/alsa-base.conf, like adding the line options snd-hda-intel model=ref or variations on this, did not work
  • Following this thread I did
    gksudo gedit /etc/pulse/default.pa
    and added the line
    load-module module-combine channels=6 channel_map=front-left,front-right,rear-left,rear-right,front-center,lfe
  • reboot
  • Click on volume control icon (top right of Unity) and choose Sound Settings (or click on the gear icon -> system settings -> Sound, which brings you to the same)
  • In the tab "Output' an entry "Simultaneaous output to Built-in Analog Stereo" has appeared. Click on this, then click on the "Test Sound" button to the right. In my case 6 speakers appear: front-left, front-center, front-right, rear-left, rear-right and subwoofer. Testing them 5 out of 6 work, only the subwoofer remains silent. Which is acceptable for me, for the time being, and a big step forward from only two speakers...

If you appreciated this article for some reason or another, please share it (see the buttons below), and, of course, don't forget to Flattr! (Why?)


Tuesday, July 29, 2014

Inkscape and the Alt key in Unity (Ubuntu 14.04.1 LTS)

System: Ubuntu 14.04.1 LTS
Problem: Unity "steals" the Alt-key so that it doesn't function as it should in Inkscape.

Solution:

  • install dconf-tools
  • launch it
  • go to org -> gnome -> desktop -> wm -> preferences
  • set "mouse-button-modifier" to "<Super>" (without the quotation marks).
    DO NOT SET IT TO "none" or leave the field empty, or you won't be able to left-click normally anymore anywhere in Unity (I know because I made the mistake, had to log out and log in to Xfce to correct it, Unity was totally messed up).
(With thanks to this post but take caution not to set the value to "none"!)

Monday, July 28, 2014

[SOLVED] Brightness control broken on Ubuntu

OS: Ubuntu 12.04 LTS
Hardware:  HP Envy dv7 7390eb laptop
Problem: brightness control broken on kernel upgrade from "precise" to "trusty"

Explanation:

I received a notification in Update Manager that my "current Hardware Enablement Stack (HWE) is going out of support" so I did the proposed upgrade.

I had some problems with dependencies which I solved according to these instructions:

"Command:
amd64:
apt-get install -V libglapi-mesa-lts-trusty libgl1-mesa-glx-lts-trusty xserver-xorg-lts-trusty xserver-xorg-input-all-lts-trusty xserver-xorg-video-all-lts-trusty libgl1-mesa-dri-lts-trusty x11-xserver-utils-lts-trusty libglapi-mesa-lts-trusty:i386 libgl1-mesa-dri-lts-trusty:i386 libgl1-mesa-glx-lts-trusty:i386 libgles2-mesa-lts-trusty libglapi-mesa-lts-trusty mesa-vdpau-drivers-lts-trusty
i386:
apt-get install -V libglapi-mesa-lts-trusty libgl1-mesa-glx-lts-trusty xserver-xorg-lts-trusty xserver-xorg-input-all-lts-trusty xserver-xorg-video-all-lts-trusty libgl1-mesa-dri-lts-trusty x11-xserver-utils-lts-trusty mesa-vdpau-drivers-lts-trusty libgles2-mesa-lts-trusty libglapi-mesa-lts-trusty"
found in the comments on this bug report.

Everything seemed to be OK after reboot, apart from the fact that the brightness control on my HP Envy dv7 laptop was broken. The function keys for brightness did move the brightness slider that appears on screen, but brightness itself was not affected and stayed at 100%.

After testing some different workarounds that didn't work, I found a solution on this blog post (I copy it here for completeness):

"Open terminal ( Ctrl+Alt+T ) and type:
sudo gedit /etc/default/grub
You will find this line in the new opened window:
Change it to:
Save and close the window and type this in the terminal:
sudo update-grub
This will update your grub and while rebooting your PC, it will set an extra parameter on the grub menu during boot."

Happy Ubuntuing!

Saturday, August 24, 2013

A working jack configuration (Ubuntu 12.04 LTS)

For my own reference, and possibly yours, I put here a working jack configuration, on Ubuntu 12.04 LTS on a HP Envy DV7 laptop with an UGM96 USB sound card. (The UGM96 device worked right out of the box, by the way).

So here are the four tabs of the "setup" screen of QjackCtl (the last three tabs are just default values):




I succeeded also in breaking my setup by pushing the parameters too far, trying to achieve a better latency. Well, breaking is a big word, in fact jack just didn't work anymore, but finally I got it back putting the parameters as they should, rebooting, cursing and tweaking a bit.

To start jack, just push the "start" button on QjackCtl and it should work (I don't use the "play" button and don't even know what it's for). Then you have to connect your inputs and outputs between applications of course, i.e. in another application called Patchage, or in QjackCtl itself (less intuitive).

I also have pulseaudio-module-jack installed.

When I start jack using the QjackCtl application, the message I get is the following. I post it here because there are "error messages", but apparently they can be ignored, it works just fine:

07:45:40.364 Patchbay deactivated.07:45:40.382 Statistics reset.07:45:40.389 ALSA connection change.07:45:40.396 D-BUS: Service is available (org.jackaudio.service aka jackdbus).Cannot connect to server socket err = No such file or directory
Cannot connect to server socket
jack server is not running or cannot be started
07:45:40.403 ALSA connection graph change.07:45:47.201 D-BUS: JACK server is starting...Cannot connect to server socket err = No such file or directory
Cannot connect to server socket
jack server is not running or cannot be started
07:45:47.216 D-BUS: JACK server was started (org.jackaudio.service aka jackdbus).Sat Aug 24 07:45:47 2013: Starting jack server...
Sat Aug 24 07:45:47 2013: JACK server starting in realtime mode with priority 10
Sat Aug 24 07:45:47 2013: control device hw:1
Sat Aug 24 07:45:47 2013: control device hw:1
Sat Aug 24 07:45:47 2013: Acquired audio card Audio1
Sat Aug 24 07:45:47 2013: creating alsa driver ... hw:1|hw:1|128|2|44100|0|0|nomon|swmeter|soft-mode|32bit
Sat Aug 24 07:45:47 2013: control device hw:1
Sat Aug 24 07:45:47 2013: configuring for 44100Hz, period = 128 frames (2.9 ms), buffer = 2 periods
Sat Aug 24 07:45:47 2013: ALSA: final selected sample format for capture: 24bit little-endian
Sat Aug 24 07:45:47 2013: ALSA: use 2 periods for capture
Sat Aug 24 07:45:47 2013: ALSA: final selected sample format for playback: 24bit little-endian
Sat Aug 24 07:45:47 2013: ALSA: use 2 periods for playback
Sat Aug 24 07:45:47 2013: graph reorder: new port 'system:capture_1'
Sat Aug 24 07:45:47 2013: New client 'system' with PID 0
Sat Aug 24 07:45:47 2013: graph reorder: new port 'system:capture_2'
Sat Aug 24 07:45:47 2013: graph reorder: new port 'system:playback_1'
Sat Aug 24 07:45:47 2013: graph reorder: new port 'system:playback_2'
Sat Aug 24 07:45:47 2013: New client 'PulseAudio JACK Sink' with PID 2289
Sat Aug 24 07:45:47 2013: Connecting 'PulseAudio JACK Sink:front-left' to 'system:playback_1'
Sat Aug 24 07:45:47 2013: Connecting 'PulseAudio JACK Sink:front-right' to 'system:playback_2'
Sat Aug 24 07:45:47 2013: New client 'PulseAudio JACK Source' with PID 2289
Sat Aug 24 07:45:47 2013: Connecting 'system:capture_1' to 'PulseAudio JACK Source:front-left'
Sat Aug 24 07:45:47 2013: Connecting 'system:capture_2' to 'PulseAudio JACK Source:front-right'
07:45:49.262 JACK connection change.07:45:49.264 Server configuration saved to "/home/bart/.jackdrc".07:45:49.265 Statistics reset.07:45:49.268 Client activated.07:45:49.272 JACK connection graph change.Sat Aug 24 07:45:49 2013: Saving settings to "/home/bart/.config/jack/conf.xml" ...
Sat Aug 24 07:45:49 2013: New client 'qjackctl' with PID 3418


Friday, June 14, 2013

Set compose key in Xfce

General help can be found on this article on Compose key. It didn't work for me however in Xfce.

The command
setxkbmap -option compose:lwin
works perfectly however. After this, I can for instance type the inverted question mark by pressing the left Windows key, releasing it, and then typing 2 normal question marks.

To make the command run at every startup, I did the following.
Make a file "setcomposekey.sh", put the following text in it:
#!/bin/sh
setxkbmap -option compose:lwin
echo "Compose key set to left Windows key."
sleep 2
and save the file where you can find it afterwards.

Then, in a terminal, navigate to the directory where you saved it, and type the command:
chmod +x ./setcomposekey.sh
to make it executable.
Now, go to Xfce "Applications Menu", choose "Settings" -> "Session and Startup", tab "Application Autostart", and add your little script to the programs to run at startup.

BTW, you have to do this for every user (login as that user and do the same routine).

Check hard disk Ubuntu 12.04.2

- Start from live USB
- in terminal, do
sudo fsck -c -v -p /dev/sdb1
where /dev/sdb1 is the partition you need to check. Fsck does not work on disks, only on partitions, so you have to do this for every partition you want to check.
To see your partition, use gparted.

Sunday, June 2, 2013

Ubuntu 12.04 LTS on a HP Envy dv7 7390eb laptop (Windows 8 UEFI)

UPDATE 2014-07-30: Post on Ubuntu 14.04.1 here...

Here are the steps I took so far for getting Ubuntu Precise Pangolin 12.04.2 LTS to work on my HP Envy dv7 7390eb laptop. (Take care, I'm not an expert, just an average user sharing his experiences! Always back up important data before installing or tweaking!)
The laptop comes with Windows 8 UEFI pre-installed.

I have to say that, in general, Ubuntu 12.04 works pretty well out of the box on this laptop, but needs a bit of tweaking to get every detail working - still a work in progress that I intend to log here.

So...

Step 1: installing Ubuntu

Pretty straightforward, I encountered no problems. You have to do some extra steps to have a working boot manager because of the UEFI system (see further), but if you follow the instructions you should not encounter any problems.

The laptop comes with two 1 TB hard disks. Disk 1 contains Windows, Disk 2 is partitioned as "DATA". I decided to use disk 1 for Windows + Windows DATA and disk 2 for Linux.

First, from within Windows, I deleted the "DATA" partition, then shrunk the "OS" partition to make room for a new "DATA" partition on disk 1, which I then created. For instructions about all this, see for instance here or do a search on internet with keywords "Windows 8 shrink volume".
Do not create a partition on Disk 2 from within Windows, just leave it "unallocated" (free) and reboot on your Linux Live USB. Linux will take care of everything.

Then just do a standard Ubuntu "install alongside Windows" automatic install (see general installation instructions via the links on the Ubuntu page), then follow the steps outlined in "Installing Ubuntu Quickly and Easily via Trial and Error" on the UEFI-page of help.ubuntu.com. You will have to restart from Live-USB and do a boot-repair, it's all explained on the pages I mentioned.

To install Ubuntu from live USB I did not have to disable SecureBoot; however once installed and the boot-repair executed (as outlined on the Ubuntu UEFI page, see above link), I had to disable it to be able to boot into Windows. Weird, but true. So I just keep SecureBoot disabled for the moment, although with Linux it does work. 

After the install I decided I wanted a bigger swap in linux. Default installed is 16GB, same as RAM and I wanted double for extra safety so as to be sure that suspend would work. This may or may not be necessary or a good idea, but it's what I did and it seems to work. Apparently I could have just installed a swap file - more info and detailed instructions on the SwapFaq page of Ubuntu help.
I didn't write down the steps I took, but, from memory, I did the following.  
  • rebooted with live-USB, 
  • ran Gparted, 
  • right-click on swap partition (16GB at this moment) -> swapoff
  • right-click on swap partition -> delete
  • apply
  • right-click on main linux partition -> resize to about 17 GB less
  • apply
  • new unallocated space is 32 GB, right-click on it -> new -> extended
  • right-click in extended partition -> new, choose type "linux-swap"
  • apply
Now boot into your installed linux (on hard drive) and
  • run Gparted (install first if necessary)
  • right-click on swap partition -> swapon
  • then follow instructions here (chapter "How do I add more swap") to edit /etc/fstab.
I did get an error message on first reboot after the Live-USB, probably because I did "swapon" from within the LiveUSB without editing /etc/fstab, but it didn't cause any further problems, and I never got it again. Which makes sense, as I edited /etc/fstab.

Step 2: adding TLP and Bumblebee

TLP is a tool that runs in the background to optimize battery-life. See installation instructions on the TLP-homepage.

Bumblebee is a package that enables NVIDIA Optimus in Linux. This laptop comes with two graphics cards, one that uses little power but is not very good for 3D, and another one (NVidia) that is a lot better for 3D but consumes more power and generates more heat. The Nvidia Optimus technology is designed to optimize battery life by disabling the NVidia card when not necessary. After installing Bumblebee, if I understand correctly, the default card used is the "simple" one (not Nvidia), unless you start the program in question in a terminal and put "optirun" in front of the program name (see the Bumblebee wiki for all details). More info on the Bumblebee homepage, installation instructions here.
I tested running "glxspheres" and "optirun glxspheres" and there was indeed a notable difference in performance.

Step 3: Wifi

Wifi actually works out of the box (kind of) but you may need to have a look at this thread here to get it up and running. Basically I have to use the command
sudo rfkill unblock all 
at every boot to activate the device, after this I can turn on or off the wifi and bluetooth using the net applet. I also installed wifi-radar.

Step 4: get Beats Audio working

Learning from this thread, I did in a terminal:
gksudo gedit /etc/modprobe.d/alsa-base.conf
and added the following line at the bottom:
options snd-hda-intel model=ref
Save the file. Then reboot, not perfect, but sounds better.

Step 5: non-free codecs / Playing encrypted DVDs

The prime source of information is here: RestrictedFormats/Playing DVDs on Ubuntu help.

What I did was:
Go to medibuntu.org, follow instructions and install especially the lib- and non-free-packages. I installed them almost all. Reboot.
At first I still got error messages when trying to play a certain DVD (Ironman 2 in my case - great movie by the way).
Then I used regionset to set the region of my DVD-player to 2 (Europe). Reboot.
The DVD played, but garbled. Finally I deleted the ~/.dvdcss/ folder (I opened my home folder as root in Thunar), rebooted, and then everything worked.


If you appreciated this article for some reason or another, please share it (see the buttons below), and, of course, don't forget to Flattr! (Why?)


Thursday, May 16, 2013

Synaptic unable to start

I had problems with apt-get and synaptic, stating "read error".
The solution I found here, and that worked for me, was typing in a terminal:
sudo rm -rf /var/lib/apt/lists/*
sudo apt-get update

Remapping a graphic tablet in Linux (using xinput)

This is how I set up my second hand Wacom Intuos 1 graphic tablet (old but very satisfying hardware) under Ubuntu 12.04.


4:3 to 16:9 conversion

The Xinput command

In fact it worked all "plug'n'play", except for the fact that my screen is 16:9 and my old Wacom Intuos 1 tablet is 4:3. This meant that when I drew a circle on my tablet, it was an ellips on screen.

In Linux this can be remedied by the "xinput" command. Without going into too much detail, what you should do is the following. (I found the basic info I needed on the "Calibrating Touchscreen" page on the Archlinux wiki).

First, with your tablet connected (it has to be connected before boot), type in a terminal (no need to be root or use sudo):
xinput list
The output in my case is, concerning the tablet,
  • Wacom Intuos 9x12 stylus
  • Wacom Intuos 9x12 eraser
  • Wacom Intuos 9x12 cursor
These are the devices you should remap, all three (or more or less in your case) of them.


The command for remapping for instance the "stylus" device is the following:
xinput set-prop "Wacom Intuos 9x12 stylus" --type=float "Coordinate Transformation Matrix" 1 0 0 0 1.33333 0 0 0 1
where
  • "Wacom Intuos 9x12 stylus" is the device in question
  • 1.33333 is the factor by which the tablet is horizontally "diminished". Underlying math, for those interested:
    • 4:3 = 16:12 (multiply numerator and denominator by 4)
    • conversion 16:12 -> 16:9 : the x conversion factor is 12/9 = 1.33333
This "deactivates" a horizontal border at the bottom of your graphic tablet (near you); the remaining active field has the desired widescreen 16:9 ratio.


If you prefer, as I do, to rather deactivate the top border so that your active drawing field is as close as possible to you, you should use an offset factor. The command then becomes (note the -0.33333 value):
xinput set-prop "Wacom Intuos 9x12 stylus" --type=float "Coordinate Transformation Matrix" 1 0 0 0 1.33333 -0.33333 0 0 1
You have to execute this command not only for the "stylus", but for every of your tablet "sub-devices", in my case:
xinput set-prop "Wacom Intuos 9x12 stylus" --type=float "Coordinate Transformation Matrix" 1 0 0 0 1.33333 -0.33333 0 0 1
xinput set-prop "Wacom Intuos 9x12 eraser" --type=float "Coordinate Transformation Matrix" 1 0 0 0 1.33333 -0.33333 0 0 1
xinput set-prop "Wacom Intuos 9x12 cursor" --type=float "Coordinate Transformation Matrix" 1 0 0 0 1.33333 -0.33333 0 0 1

Making changes persistent throughout reboots

Now the problem is that these changes are not persistent throughout reboots, so you have to re-enter the commands every time you restart your computer. There is of course a simple solution for this: making a simple shell-script and getting your linux to run it at boot.

1. Making the script

For the shell script open a text-editor (i.e. GEdit or Mousepad or other), and type:
#!/bin/sh
xinput set-prop "Wacom Intuos 9x12 stylus" --type=float "Coordinate Transformation Matrix" 1 0 0 0 1.33333 -0.33333 0 0 1
xinput set-prop "Wacom Intuos 9x12 eraser" --type=float "Coordinate Transformation Matrix" 1 0 0 0 1.33333 -0.33333 0 0 1
xinput set-prop "Wacom Intuos 9x12 cursor" --type=float "Coordinate Transformation Matrix" 1 0 0 0 1.33333 -0.33333 0 0 1
Save it as (for instance) wacom.sh in your home-directory or any other place where you can find it afterwards.

2. Make the script executable

Now you need to make it executable. One way is to use Nautilus, the file browser, right click on the file, choose "Properties" (at the bottom) and in the "Permissions" tab, check the checkbox at the bottom that says "allow execution".
Or, in a terminal, navigate towards the directory where you saved wacom.sh and type:
chmod +x ./wacom.sh
At this stage your script is ready. You can test it out by typing in a terminal, while you're still in the right directory:
./wacom.sh
You should see the changes directly when you use your tablet.

3. Auto-execute the script on boot

Now the only thing left is to make linux run the script at every boot.

For this, launch the program "Startup Applications" (should be installed by default). Click on "Add" and fill in the form. The name and optional commentary you can choose freely, the most important is the command:
/path/wacom.sh
where "path" is of course your particular path, the directory where the script is saved, i.e.
/home/jeff/wacom.sh

That's it. Reboot and test... Good luck!


Making the active field smaller

I bought a big graphic tablet and found that actually a smaller one is more useful for my type of work. So instead of buying a smaller one, I used again the xinput command to "make" it smaller (that way, if I need it bigger, I just change the xinput values and I have a big one again). How to do this:

If we represent the Coordinate Transformation Matrix used in the above commands (i.e. 1 0 0 0 1.33333 -0.33333 0 0 1) as a1 a2 a3 b1 b2 b3 c1 c2 c3, and the conversion factor for widescreen correction as Cf then:
  • always b2=a1*Cf, this way the widescreen conversion is correct at all times. (If you don't need to do this conversion, then for you Cf = 1).
  • the bigger a1 is, the smaller your active field becomes on your tablet. 
    • If a1=1, then your active field is at it's biggest, full size
    • If a1=2, then it becomes half this size
    • If a1=3, then it becomes one third this size
    • and so on
  • a3 and b3 are resp. the horizontal and vertical offset.
    • If these values are 0, then your active field is placed at the top left of your tablet
    • to move your active field towards the bottom right, these values need to be negative. You should experiment a bit with values. To put a small active field in the bottom left corner of my tablet (taking into account the widescreen conversion, see above), I had to use the matrix: 2 0 0 0 2.666666667 -1.666667 0 0 1.
So finally I made two scripts, wacom_A4.sh and wacom_A5.sh. According to the desired configuration, I execute one or the other.


If you appreciated this article for some reason or another, please share it (see the buttons below), and, of course, don't forget to Flattr! (Why?)