Posts Tagged ‘beryl’

Rotate Beryl/Compiz cube from command line

Tuesday, February 19th, 2008

We are about to have a stand in a show in Israel. To pull some attention, I have searched for a method to automate a random rotation of the famous Beryl/Compiz cube.

An extension of the method provided in here (using macros) is demonstrated below, using a script.

This is a bit more complicated, as I have used the motions of the mouse to achieve a “show” out of it (just changing desktops isn’t enough nowadays…)

Check out below for the full script.

#!/bin/bash
# This script will rotate the cube one click on each direction each predefined
# timer.
# Written by ezaton at tournament.org.il
# Check out my technical blog “Running Systems” at http://www.tournmament.org.il/run

# Set timer (seconds)
TIMER=10
VERT_TIMER=1

# Possible directions? 4 (up, down, left, right. will be marked from 0 to 3)
# Addition – set it to give higher priority to side-stepping. So max is 10, and only 0&1 represent
# up/down
# Added 10 to represent 2xleft and 11 to represent 2xright
POSS=12

# Temp command file
TMP_FILE=/tmp/rotate.macro

function create_file {
# This function will create and secure the macro file
rm $TMP_FILE
if [ -f $TMP_FILE ]; then
echo “$TMP_FILE still exists”
exit 1
fi
echo “” > $TMP_FILE
chmod 700 $TMP_FILE
}

function run_macro {
# Run the actual macro
cat $TMP_FILE | xmacroplay $DISPLAY &>/dev/null
}

function left {
# This function will build the macro file for the “left” command
echo > $TMP_FILE
echo “MotionNotify 100 380” >> $TMP_FILE
echo “KeyStrPress Alt_L” >> $TMP_FILE
echo “KeyStrPress Control_L” >> $TMP_FILE
echo “ButtonPress 1” >> $TMP_FILE
echo “MotionNotify 100 380” >> $TMP_FILE
echo “MotionNotify 130 380” >> $TMP_FILE
echo “MotionNotify 150 380” >> $TMP_FILE
echo “MotionNotify 170 380” >> $TMP_FILE
echo “MotionNotify 190 380” >> $TMP_FILE
echo “MotionNotify 210 380” >> $TMP_FILE
echo “MotionNotify 230 380” >> $TMP_FILE
echo “MotionNotify 250 380” >> $TMP_FILE
echo “MotionNotify 270 380” >> $TMP_FILE
echo “MotionNotify 290 380” >> $TMP_FILE
echo “MotionNotify 310 380” >> $TMP_FILE
echo “MotionNotify 330 380” >> $TMP_FILE
echo “ButtonRelease 1” >> $TMP_FILE
echo “KeyStrRelease Control_L” >> $TMP_FILE
echo “KeyStrRelease Alt_L” >> $TMP_FILE
run_macro
}

function up {
# This function will build the macro file for the “up” command
echo > $TMP_FILE
echo “MotionNotify 100 100” >> $TMP_FILE
echo “KeyStrPress Alt_L” >> $TMP_FILE
echo “KeyStrPress Control_L” >> $TMP_FILE
echo “ButtonPress 1” >> $TMP_FILE
echo “MotionNotify 100 100” >> $TMP_FILE
echo “MotionNotify 100 120” >> $TMP_FILE
echo “MotionNotify 100 140” >> $TMP_FILE
echo “MotionNotify 100 160” >> $TMP_FILE
echo “MotionNotify 100 180” >> $TMP_FILE
echo “MotionNotify 100 200” >> $TMP_FILE
echo “MotionNotify 100 220” >> $TMP_FILE
echo “MotionNotify 100 240” >> $TMP_FILE
echo “MotionNotify 100 260” >> $TMP_FILE
echo “MotionNotify 100 280” >> $TMP_FILE
echo “MotionNotify 100 300” >> $TMP_FILE
echo “MotionNotify 100 320” >> $TMP_FILE
echo “ButtonRelease 1” >> $TMP_FILE
echo “KeyStrRelease Control_L” >> $TMP_FILE
echo “KeyStrRelease Alt_L” >> $TMP_FILE
run_macro
}

function right {
# This function will build the macro file for the “right” command
echo > $TMP_FILE
echo “MotionNotify 340 380” >> $TMP_FILE
echo “KeyStrPress Alt_L” >> $TMP_FILE
echo “KeyStrPress Control_L” >> $TMP_FILE
echo “ButtonPress 1” >> $TMP_FILE
echo “MotionNotify 340 380” >> $TMP_FILE
echo “MotionNotify 320 380” >> $TMP_FILE
echo “MotionNotify 300 380” >> $TMP_FILE
echo “MotionNotify 280 380” >> $TMP_FILE
echo “MotionNotify 260 380” >> $TMP_FILE
echo “MotionNotify 240 380” >> $TMP_FILE
echo “MotionNotify 220 380” >> $TMP_FILE
echo “MotionNotify 200 380” >> $TMP_FILE
echo “MotionNotify 180 380” >> $TMP_FILE
echo “MotionNotify 160 380” >> $TMP_FILE
echo “MotionNotify 140 380” >> $TMP_FILE
echo “MotionNotify 120 380” >> $TMP_FILE
echo “ButtonRelease 1” >> $TMP_FILE
echo “KeyStrRelease Control_L” >> $TMP_FILE
echo “KeyStrRelease Alt_L” >> $TMP_FILE
run_macro
}

function down {
# This function will build the macro file for the “down” command
echo > $TMP_FILE
echo “MotionNotify 100 330” >> $TMP_FILE
echo “KeyStrPress Alt_L” >> $TMP_FILE
echo “KeyStrPress Control_L” >> $TMP_FILE
echo “ButtonPress 1” >> $TMP_FILE
echo “MotionNotify 100 330” >> $TMP_FILE
echo “MotionNotify 100 310” >> $TMP_FILE
echo “MotionNotify 100 290” >> $TMP_FILE
echo “MotionNotify 100 270” >> $TMP_FILE
echo “MotionNotify 100 250” >> $TMP_FILE
echo “MotionNotify 100 230” >> $TMP_FILE
echo “MotionNotify 100 210” >> $TMP_FILE
echo “MotionNotify 100 190” >> $TMP_FILE
echo “MotionNotify 100 170” >> $TMP_FILE
echo “MotionNotify 100 150” >> $TMP_FILE
echo “MotionNotify 100 130” >> $TMP_FILE
echo “MotionNotify 100 110” >> $TMP_FILE
echo “ButtonRelease 1” >> $TMP_FILE
echo “KeyStrRelease Control_L” >> $TMP_FILE
echo “KeyStrRelease Alt_L” >> $TMP_FILE
run_macro
}

function fix_vert {
# Fixes a case of vertical extention (non-viewable screen)
sleep $VERT_TIMER
case “$1” in
1) down
;;
0) up
;;
esac
}

# Verify we have xmacroplay
which xmacroplay
if [ “$?” -ne “0” ]; then
echo “Missing xmacroplay. Install it”
echo “Use apt get install xmacro”
exit 1
fi

# Do we use X and have a defined display? Won’t work otherwise…
if [ -z “$DISPLAY” ]; then
echo “DISPLAY is not defined. Exiting”
exit 1
fi

create_file

# We start where all is viewable

while true; do
# Select direction
DIRECTION=$RANDOM
let “DIRECTION %= $POSS”
# Debug:        echo “*** $DIRECTION ***”
case “$DIRECTION” in
0) up
fix_vert 1
;;
1) down
fix_vert 0
;;
[2-5]) left
;;
[6-9]) right
;;
10)     left
left
;;
11)     right
right
;;
esac
sleep $TIMER
done

exit 0

Hello Edgy, goodbye Feisty!

Tuesday, July 3rd, 2007

I had a rough experience upgrading Edgy to Feisy.

Hardware listing, for generations to come: Motherboard Abit IB9, including on-board IDE controller IT8211 with firmware 1.3.1.67 and no BIOS upgrade in the near future.

Nvidia 7700 with 256MB RAM on PCIe

Problems:

1. With IDE controller enabled in BIOS system hangs during startup. This is correct for the livecd as well.

2. XGL requires the flag “–use-copy” or it will show only the “white cube of death”. Performance is far from being optimal.

3. I was unable to use Xorg AIGLX, but only the generic NVIDIA interface.

4. With NVIDIA movement is slow and jittery. System is not stable, beryl tends to consume around 100% CPU, and the black-windows problem (which usually has to do with lack of video memory) is quite common.

I have downgraded to Edgy yesterday. Besides a (bug?) weird behavior with my existing software raid (the installer hung while trying to reconfigure the md device with a black box flashing fast in the left lower corner of the screen. I was able to use console but not to continue the install) which required me to backup everything and create the raid from console before the installer got to it, installation went as expected. The interesting thing is that I can say that my hardware works better, and I don’t think it has to do only with the kernel version.

I followed my past post about the post configuration required for Edgy, and it saved me some searches. However, there are several updated which I will show here:

1. Skype has a new version – 1.4 beta, which, for now, seems not to be affected by the “open sound device” hanging. This seems great. I have installed it from the dynamic package, which had dependencies. To satisfy dependencies, I used a tool I can recommend called getlibs. It installed Feisy packages on my system but it was quite OK.

2. Mplayer requires using the multiverse repository. While I thought I have opened it, it appears I was required to state it in addition manually… Added the following line to my /etc/apt/sources.list:
deb http://us.archive.ubuntu.com/ubuntu/ edgy multiverse

3. Beryl packages for Edgy become quire rare nowadays. I had to dig some to find it. I have used the repository:
deb http://ubuntu.beryl-project.org edgy main
following beryl’s guide which was posted by me before, but this repository works one minute, and doesn’t on the next. When it does, though, it has what you need. I’m using the same NVidia driver as before, with XGL alright, and it’s working fast and stable. Can’t complain.

4. I have created a package for Pidgin for Edgy, version 2.0.2. This was the original reason I have upgraded to Feisty… It can be downloaded from here. Notice – this is a crude package, just for my purpose. You can use it, and you can use the “getlibs” util from above to satisfy the binary’s requirements, as I didn’t add them in. pidgin_2.0.2-1_amd64.deb

I’m a happy camper.

Painful upgrade from Edgy x86_64 to Feisty x86_64

Sunday, June 24th, 2007

If it works, don’t touch it. This is one of my mottoes. I have broken this rule just yesterday when I decided that I was too lazy to install Pidgin from source, and decided I wanted it to be installed directly from deb. Unfortunately, there was no pidgin deb for Edgy. None that I was able to find.

My computer has been suggesting to be upgraded for a while now – ever since Feisty was available. I was cautious and avoided upgrading up until now. I have already installed Feisty on my laptop, on one of my servers (installed Edgy and then upgraded to Feisty with no special events), so I was somehow more at ease. This was, of course, a complete disaster.

Upgrading Edgy to Feisty went OK. Nothing really special, no external sources, nothing. After upgrade, the system failed to reboot – just hung there. It appears (and I have yet to post a bug) that my IT8212 IDE controller (which is connected to my CDROM) hangs the computer.

Not only that, but even when disabled, it appears that Feisty’s kernel has an issue with sata_iix. The issue was solved using post #59 from this bug report. Do not follow, though, this recommendation (all_generic_ide) as you will experience a noticeable performance hit.

I was able to boot my system. No CDROM, but working. I have installed NVidia drivers manually, as the restricted modules were too old. I was required to remove the nvidia entries in /etc/modprobe.d/lrm-video (probably because I’ve installed restricted modules and later on removed it). Had X running, but didn’t have Beryl working. Past experience taught me that AIGLX or direct NVidia DRI are slower than XGL. Attempting to use XGL, I get the white-screen-of-death. Following this guide, I was able to setup XGL correctly, as it seems. It did not solve my white-screen-of-death, however, using –use-copy flag things worked, and seemed to be responding fast enough.

Still have to open a bug about the IT8212 device. Hope for the best.

AIGLX or XGL?

Monday, April 9th, 2007

As you can see in my previous posts, I have an NVidia card. It worked quite well while using XGL, but due to XGL’s memory consumption (it takes a lot of memory), I have decided to try for AIGLX, which is part of the X.org system.

In my previous post you can see that (and how) it was done. However, my overall experiance is that AIGLX, at least where it comes to Xorg 7.2 and NVidia (Driver 1.0-9755) is that XGL is much much faster.

The slow responses of the system during the several hours I used AIGLX (while trying somehow to increase performance) just made me go back to XGL. AIGLX is not good enough.

I’ve read several posts about it, and still, the results are undetermined. That’s why I post my own software versions here. AIGLX may perform better when using older or newer versions of NVidia’s driver, or Xorg, or whatever, but for me now – XGL does it well.

My menuscript for a happy Ubuntu 64 bit installation

Monday, March 19th, 2007

I have been extremely busy for the last few weeks and couldn’t find time to update my blog, so apologies are in place. I am sorry, and I will add later this week several tips and tricks about BASH scripting, which might save time and effort for those of you who use if for more complicated tasks.

But alas – This post is about the things need to be done after new installation of Ubuntu Dapper (6.10) x86_64 has just been done, including, of course, links.

First – This is PentiumD 2.8GHz, Duo, on Abit IB9 Mobo (which I wasn’t too impressed with), 2x 320GB Sata2 HDDs, 2GB RAM and NVidia 7100 Dual-Head (I didn’t want ATI due to their limitations with max accelerated resolution, and the limitations it imposed on my Dual-head setup).

Initial installation as follows:

Edgy Server x86_64, created software mirror (raid1) for /boot, 2x 2GB swap spaces (one on each HDD), and LVM2 VG on mirror on the rest of the disk. Created LV for “/” (10GB XFS) and LV for “/home” (30GB Reiserfs).

During installation the Mobo didn’t recognize my IDE CD, and as the quickest remedy I have used USB-to-IDE adapter with additional CDROM which worked just fine.

Post installation I had to fix /etc/fstab to point to the correct (and now working) IDE CDROM.

To install full Ubuntu desktop, I have used “sudo aptitude ubuntu-desktop”. Sound worked out of the box.

Requirements:

– Skype

– Hebrew TTF Fonts

– mplayer

– Beryl (+XGL because of NVidia)

– Flash in Firefox

Skype:

Skype website has allowed me to download the statically compiled Skype package. It didn’t work, of course, since it was 32bit only. I have installed the following additional packages:

ia32-libs ia32-libs-gtk lib32asound2 lib32objc1 linux32 lib32ncurses5 ia32-libs-sdl

Extracted the archived Skype package, moved its contents to /usr/lib/skype and created symlink from /usr/lib/skype/skype to /usr/bin/skype

Hebrew TTF Fonts:

It was a bit more tricky. I had to get these fonts from some Windwos machine. I got them from one of my licensed desktops, and copied them (only .TTF and .ttf) to /usr/share/fonts/truetype/ttf-windows – a directory created for this purpose. I have then created a symlink for every ttf file in this directory to /var/lib/defoma/x-ttcidfont-conf.d/dirs/TrueType , which gets included in the default xorg.conf. After restarting X, it worked like a charm.

mplayer:

I have installed mplayer using the restricted and multiverse repositories. I was surprised when I was able to play movies out of the box. Maybe my common codecs are just enough… I will look into it later.

XGL:

I have installed the latest NVidia driver for amd64 from NVidia’s site, and configured Dual-Head setup per my already-existing-too-messy xorg.conf file. xorg.conf.nvidia

Followed the Beryl Wiki for Ubuntu, by the letter. Mind you – I was aiming at XGL with Gnome.

I was so delighted when it turned out to work with my Dual-Head at a total resolution of 2560×1024

Flash in Firefox:

That was to trickier one. I managed to find this guide in Ubuntu forums which was more than enough for me. I did not notice on the first attempt, however, that there are two RPM packages required, and thus failed the procedure. When I have noted it, I was able to complete the task flawlessly.

So, now I have a completely working system, per my needs and requirements. I’m very happy, and I hope I gave good pointers to others who want to use their new 64bit system in a normal manner, even when some vendors do not supply 64bit compatible binary software.

Remember the power of the open source – If it is required to work under 64bit environment it wil be ported to one, while commercial software companies tend to fall behind with new, and sometimes not too popular, propriety systems.