Much ado about scripting, Linux & Eclipse: card subject to change

Showing posts with label xfce. Show all posts
Showing posts with label xfce. Show all posts

2011-06-06

HOWTO: get xorg.conf to work w/ 1600x1200 res and an old Intel card

  1. Check your hardware spec, and determine how much memory your card has[1]:
    # lspci -vv | grep "Intel" -A7 | grep "VGA controller" -A7 | egrep "controller|Region"
    00:02.0 VGA compatible controller: Intel Corporation 82852/855GM Integrated Graphics Device (rev 02) (prog-if 00 [VGA controller])
     Region 0: Memory at e0000000 (32-bit, prefetchable) [size=128M]
     Region 1: Memory at d0000000 (32-bit, non-prefetchable) [size=512K]
  2. Use the above values to configure your /etc/X11/xorg.conf file - I suspect much of this is not needed, but here's what I have:
    Section "Device"
     Identifier "Intel"
     Option "AccelMethod" "UXA"
     VideoRam 130560
     #Driver      "intel"
     Driver      "vesa"
     VendorName  "Intel Corporation"
     BoardName   "82852/855GM Integrated Graphics Device"
     BusID       "PCI:0:2:0"
    EndSection
    
    Section "Monitor"
     Identifier "VGA"
     ModelName    "Sceptre 24"
            HorizSync    31 - 80
            VertRefresh  55 - 76
            Option      "DPMS" "true"
    EndSection
    
    Section "Screen"
     Identifier "Default Screen"
     Device "Intel"
     Monitor "VGA"
     DefaultDepth 16
            SubSection "Display"
                   Depth           16
                   Modes           "1920x1440_60" "1920x1200_60" "1920x1080_60" "1680x1050_59.883" "1360x768_59.8" "1600x1200_60" "1280x1024_60" "1024x768_60"
                   #Modes           "1920x1440" "1600x1200" "1280x1024" "1280x768"
            EndSubSection
    EndSection 
    
    Section "DRI"
            Mode         0666
    EndSection
    
    Section "Extensions"
            Option      "Composite" "Enable"
    EndSection
    
    Section "Module"
            Load  "dri"
    EndSection
  3. In /boot/grub/menu.lst, add the correct vga mode for 1600x1200 (vga=8). If you enter what you think is the correct mode based on this table, you'll be told it's wrong and can manually correct it, boot up, then fix the file & reboot.
    default=0
    timeout=5
    splashimage=(hd0,0)/grub/splash.xpm.gz
    
    
    title Fedora (2.6.34.7-56.fc13.i686)
     root (hd0,0)
     kernel /vmlinuz-2.6.34.7-56.fc13.i686 ro root=/dev/mapper/vg_xlappy-lv_root rd_LVM_LV=vg_xlappy/lv_root rd_LVM_LV=vg_xlappy/lv_swap rd_NO_LUKS rd_NO_MD rd_NO_DM LANG=en_US.UTF-8 SYSFONT=latarcyrheb-sun16 KEYBOARDTYPE=pc KEYTABLE=us rhgb quiet vga=8
     initrd /initramfs-2.6.34.7-56.fc13.i686.img
    
    title Fedora (2.6.34.7-56.fc13.i686) cmdline only, vga=8 = 1600x1200x16
     root (hd0,0)
     kernel /vmlinuz-2.6.34.7-56.fc13.i686 ro root=/dev/mapper/vg_xlappy-lv_root rd_LVM_LV=vg_xlappy/lv_root rd_LVM_LV=vg_xlappy/lv_swap rd_NO_LUKS rd_NO_MD rd_NO_DM LANG=en_US.UTF-8 SYSFONT=latarcyrheb-sun16 KEYBOARDTYPE=pc KEYTABLE=us init=3 init 3 vga=8
     initrd /initramfs-2.6.34.7-56.fc13.i686.img

See also:

2009-01-25

Capturing Screenshots Made Easy: Scripting With xfce4-screenshooter

Since moving to Fedora 10 and casting off my old ties to Kubuntu, I've been rather frustrated with the available options for capturing screenshots under Gnome.

I've tried the gnome-screenshot tool, docked as a panel applet, but it only allows me to capture the desktop or selected window. No click-and-drag region select?

When I've needed to capture only a part of my screen or overlapping windows (eg., Eclipse dialogs) I've been forced to capture the whole screen then crop it down w/ GIMP. Or, launch GIMP first and let it do the region capture - but GIMP never remembers my settings from last time, so to capture a region after a 2-second delay, it's 8 clicks every time I start GIMP. Lame.

In both cases, it's cumbersome, and I always have to select the directory where I want to save, and then name the file.

This weekend, I discovered xfce4-screenshooter, which is significantly better in that I can capture an area of the screen and auto-save to a file without needing to specify a filename each time.

It can even redirect the capture to an application or the clipboard rather than a file, and provides all the dialog options as commandline flags so it can be scripted, too.

So, now, I simply wrap that application with a bash script that runs the screenshooter then opens my snapshot folder with Thunar, so I can preview the result with Ristretto or edit it with GIMP if necessary. One click to start the process, one click-and-drag to create the image. And no unnecessary dialog configuration, file system browsing, or clicking!

Here's the scriptlet, which I've set up as a Gnome panel shortcut to run /home/nboldt/bin/snap.sh:

#!/bin/bash
/usr/bin/xfce4-screenshooter -s /home/nboldt/Screenshots/ -h -r && \
  thunar /home/nboldt/Screenshots/ &

And here's my desktop, captured with only 2 clicks:

One might argue that it's too bad that these three tools can't just be merged into one. I'd argue that it's great that if you don't like one tool, you can find two others, each incrementally better than the next. Screenshot integration in GIMP is very handy, as is automatic capture to file (with incremental file naming). And, unlike in the Windows and Mac worlds, if the best tool for the job isn't available for one window system, I can simply cherry pick from another.

Still, nothing beats the feature set and usability of HyperSnap, but that's sadly a closed-source Windows application, and far from free. Proving that in this world, ultimately, you get what you pay for -- but there are some excellent free & open source alternatives.

2008-07-22

xubuntu 8.04: easy enough for grandma

I'm in love with the newest ubuntu for xfce, xubuntu. So much so that I've decided to install it on my mother-in-law's desktop (which keeps getting virii and trojans). Yes, it's really that grandma-friendly. (Time will tell whether I'm on crack or if they agree.)

However, I have a few minor complaints -- the usual "close-but-no-cigar" usability tweaks.

1. If you log in two users in parallel (it lets you switch between them) for some reason there's a pc speaker (system bell / system beep) every couple seconds once the second user logs in. This is of course incredibly annoying, but there's an easy fix.

First, disable it:

modprobe -r pcspkr

Then, turn it off for good by blacklisting the pcspkr module in /etc/modprobe.d/blacklist:

blacklist pcspkr

2. I immediately installed OpenOffice 2.4 (because abiword and gnumeric suck) and upgraded the Firefox 3 beta to the full release.

3. I also combined the two default taskbars (top and bottom of screen) into a single one on the bottom, because that's less weird for Windows people.

4. I had to manually force mounting of their old C and D drives (in /etc/fstab), just in case they need them. Thunar is great for adding quick shortcuts into the file browser (see screenshot below).

/dev/sda1 /media/sda1 vfat rw,noexec,nosuid,nodev,quiet,uhelper=hal,utf8,shortname=winnt,uid=999,gid=100,umask=007 0 0 /dev/sda3 /media/sda3 vfat rw,noexec,nosuid,nodev,quiet,uhelper=hal,utf8,shortname=winnt,uid=999,gid=100,umask=007 0 0

5. I had to add the volume control applet to the taskbar. Sure, having to add it is nowhere as annoying as having to remove MEPIS/KDE's fish tank app, but c'mon -- shouldn't this be there by default?

6. Firefox doesn't come with the Flash player pre-installed, for obvious licensing reasons. However, the latest Firefox, combined with the latest xubuntu, lets me install the whole thing without having to revert to apt-get or tar -xzf. Finally, the Plugin Finder Service in Firefox actually works! It finds the plugin, prompts for password (to run the install as root), downloads it, and installs it. And on restart of Firefox -- YouTube works.

But other than these minor tweaks, it's pretty much xubuntu out of the box, and a viable replacement for Windows XP and its non-stop barrage of virii & trojans.

Because really, what does your grandma need on a computer? Firefox, Thunderbird, OpenOffice, a file browser like Thunar, and of course, some card games (thanks, PySol!).