Now that we can log in without too much ugliness, let's set things up a little more personally. There are a combination of bits of software that I like that require a few PPAs (Personal Package Archives) to be set up as repositories.
I've already installed CellWriter, but we also need EasyStroke, WacomRotate (a little daemon that auto-rotates the pen input when any app rotates the screen orientation) and the patched versions of Xournal and CellWriter -- and no matter how nicely set up it is, I don't care for Network Manager. I want WICD.
All three of those links have instructions for how to add the repositories. After the repositories were set up, I updated the list, then upgraded CellWriter, installed WacomRotate, Xournal, WICD and (I'll explain later) aumix-gtk. Installing WICD will cause Network Manager to be uninstalled -- yay!
I'm going to keep very short something that actually took a while -- I also installed build-essential, intltool, checkinstall and libgtk2.0-dev (and all their dependencies) so I could build gvolwheel which you can find here. GvolWheel is a replacement for volwheel which doesn't react well to the pen -- its window closes too quickly for use. GvolWheel is virtually identical, but more stable and has some nice, simple preferences. It pairs really well with aumix-gtk, above, as it's mixer.
Briefly, to build:
- Extract the archive.
- Open a terminal in the folder.
- Type ./configure --prefix=/usr and let it run its course. If anything borks, look to see what it was looking for, then use Synaptic to install it.
- Once it configures properly, type make
- After it makes, close any Synaptic windows and type sudo checkinstall
- Answer the questions: yes to make the docs, and describe GvolWheel
- Once it installs the application, copy the newly-created DEB file (in the folder you unarchived) somewhere you won't lose it. You can then delete the folder and the archive. You will probably need to delete them as root.
- Done
I also uninstalled evince and installed epdfview. Virtually identical, the latter doesn't require Gnome libraries. I also have wacom-tools installed, may have done it at the same time -- and it's necessary, to run wacomcpl for configuring the pen.
You're going to need to restart, so that WICD settles in (if you're doing this too, that is -- otherwise, well, no, you won't.) You'll likely see Network Manager complain. But before you do restart, let's fix up Fluxbox's startup file so things will be congruent, and we'll be starting some good stuff.
Open ~/.fluxbox/startup with Mousepad and change the following:
- Find the words "kill apps to prevent 2 instances running in case of FB crash" -- on the next line change nm-applet to wicd-client and change volwheel to gvolwheel.
- Find nm-applet & and change it to wicd-client &
- Find and change volwheel & to gvolwheel &
- Add wacomrotate &
- Add sh ~/.xinitrc & (I'll explain in a minute.)
- Add cellwriter --hide-window & (for pen input, minimized to tray)
- Add easystroke & (it will start in tray)
While it's rebooting, here's what's up with sh ~/.xinitrc: that file is where wacomcpl writes the configuration data. It needs to be re-run on every log in, or you have to reset it. You may not have one until you run the configurator, so do so. While you're in wacomcpl, you can calibrate the digitizer, and if you have an eraser pen like me, (did I mention that finally arrived?) you can change your button settings to the following:
- Stylus | Button 1: Left, Button 2: Middle, Button 3: Right
- Eraser | Button 1: Right
We'll save easystroke and Xournal for later. CellWriter is pretty straightforward -- just train each symbol 5 times, middle-click will wipe out your training on a particular letter, or you can right-click for a popup menu. I did a basic training, but I think I'm going to go back and convert it to graffitti strokes, just for simplicity.
Most of my time today was spent with scripting. There are instructions here for using xbindkeys to convert the silk-screened pen-activated buttons (Rotate, Journal and Text Input) into something that Xorg will understand. Fortunately we don't have to do that as Fluxbox has its own keybinder built in.
Edit ~/.fluxbox/keys and add the following to the bottom:
# Mouse actions for the pen-activated buttonsThese are all the codes for the various buttons. The only one we're going to work with in this post is Mouse30, the pen-activated Rotate button on the front. All the rest are commented out by placing a # in front, keeping them from being used. Later I'll add more programs to them -- I've found two different Q-Menu programs, and we've already installed both CellWriter and Xournal, so they'll be easy to set up. I expect the complicated one to be the External Monitor Button -- but you never know, it might not be too bad.
#
# Rotate Button (right)
Mouse30 :ExecCommand /usr/bin/flip
#
# Tablet Input Panel (middle)
#Mouse31 :ExecCommand
#
# Journal (left)
#Mouse32 :ExecCommand
# Key configs for side buttons
#
# Q Button
#XF86Launch1 :ExecCommand
#
# External Monitor Button
#XF86Launch2 :ExecCommand
The Rotate button should do exactly what it's name describes. There are a lot of scripts out there for this; most either fail to deal with rotating the pen input so that it matches the screen orientation (it's very hard to match your pen to the screen when they are misaligned by 90 degrees) or they do deal with it by sending xsetwacom commands.
The wacomrotate package we installed from Tom Jaeger's PPA, that we set Fluxbox to start for us will watch for any change in rotation and match the pen input to that change -- whether it's the script attached to that button, the nVidia Setting program, a command-line instruction or that horrible, horrible Gnome applet that you insist on using. Pretty nifty.
I've adapted some scripts, (I think mostly from here) and come up with two versions: flip, and rotate. Copy them both to your /usr/bin directory and make them executable. In the ~/.fluxbox/keys file above, pick either /usr/bin/flip or /usr/bin/rotate as your command. flip swaps back and forth between rotating left 90 degrees and normal rotation. rotate will migrate through all four possible rotations.
I may write a simple button-pushing popup script later. xmessage makes that pretty simple, and it's a default installed package. I may even make a script to choose which of the three you want to use, too, if I can get my sed skills up to snuff. Fluxbox is inspiring that way.
Here are the scripts. As always, check for Blogspot-induced errors. First, flip:
#!/bin/shAnd rotate:
ORIENTATION=`xrandr | grep "default connected"`
case $ORIENTATION in
"default connected 768x1024+0+0 left"*)
xrandr -o normal
;;
"default connected 1024x768+0+0 inverted"*)
xrandr -o normal
;;
"default connected 768x1024+0+0 right"*)
xrandr -o normal
;;
*)
xrandr -o left
;;
esac
#!/bin/shOn the desktop, right-click and select System|Fluxbox|Reload Config and your pen should now be able to flip or rotate the orientation. Pretty easy, huh?
ORIENTATION=`xrandr | grep "default connected"`
case $ORIENTATION in
"default connected 768x1024+0+0 left"*)
xrandr -o inverted
;;
"default connected 1024x768+0+0 inverted"*)
xrandr -o right
;;
"default connected 768x1024+0+0 right"*)
xrandr -o normal
;;
*)
xrandr -o left
;;
esac
The last thing we have to take care of is the fact that when we suspend while rotated, all our wacomcpl settings will disappear. The script from here wasn't working at first, nor the adaptation I made, nor the script it originally was adapted from. But it will work, if you add the secret sauce.
As root create /etc/pm/sleep.d/10_calibrate.sh, make it executable and add the following to it:
#!/usr/bin/env bashThat script is a mix of the first and second link, with a minor tweak or two from me. One of the problems is that root cannot access the display that xsetwacom is working on. Here's how to fix that:
# file locations
FILE=/tmp/suspend_wacom_calibration_data
XSETWACOM=/usr/bin/xsetwacom
# standard display
DISPLAY=:0.0
# get the list of pen devices (stylus, eraser, etc.)
DEVS=`su $USER -c "xsetwacom --display $DISPLAY list dev |\ sed -e 's/ *$//g' -e 's/\(.*\) .*/\1/g' -e 's/ *$//g'"`
# Get the current calibration data
# and write the restore command for it
# to the temp file
function store_value()
{
value=`$XSETWACOM --display :0.0 get $1 $2`
echo "$XSETWACOM --display :0.0 set $1 $2 $value" >> $FILE
}
# Store current calibration of all devices
function store_devices_calibration()
{
>$FILE
for DEV in $DEVS; do
store_value $DEV "topx"
store_value $DEV "topy"
store_value $DEV "bottomx"
store_value $DEV "bottomy"
done
}
# Restore calibration of all devices
function restore_devices_calibration()
{
if [[ -e $FILE ]]
then
( sleep 1; $FILE )&
fi
}
MODE=$1
case "$MODE" in
hibernate|suspend)
store_devices_calibration
;;
thaw|resume)
restore_devices_calibration
;;
*) exit $NA
;;
esac
- Open ~/.bashrc and add: xhost local:root
- Save it, log out and log back in
- Now root has access to the display when you're logged in
So I'm going to come up with a method of configuring in all four orientations, then saving back the proper one. This will probably involve wrapping wacomcpl in a script, then brute-copying the right settings. Next post, I think. It's tired, and I'm late.
m a r
PS: it turns out that this is a known bug with the wacom driver.
No comments:
Post a Comment