Monday, July 18, 2011

X with xmonad without KDE/gnome, continued

This is the setup I settled upon in the end, it's working great. It has heavily based on this wiki page.

The .xsession file:

#!/bin/bash

# Load resources

xrdb -merge .Xresources

# Set up an icon tray

trayer --edge top --align right --SetDockType true --SetPartialStrut true \
--expand true --width 10 --transparent true --tint 0x191970 --height 12 &

# Set the background color 

xsetroot -solid midnightblue 


# Fire up apps 


xscreensaver -no-splash & 


if [ -x /usr/bin/nm-applet ] ; then nm-applet --sm-disable & fi 


if [ -x /usr/bin/gnome-power-manager ] ; then sleep 3 gnome-power-manager & fi


#xset b off 


eval `gpg-agent --daemon` 
eval `ssh-agent --daemon` 


setxkbmap -option compose:caps 


exec xmonad

In order to have X execute the .xsession isof starting the window manager itself, choose the "System default" as session type in gdm or kdm.

This is my .Xresource file:


# red cursor Color, looks great in combination with xmonad
xterm*cursorColor: red

# save tons of lines
xterm*saveLines: 100000

# triple click like in konsole/gnome-termimal
xterm*on3Clicks: regex [^ \n]+
xterm*on4Clicks: line

# use fancy terminus font
xterm*FaceName: terminus-10


This is the .xmobarrc file:


Config { font = "-*-Fixed-Bold-R-Normal-*-13-*-*-*-*-*-*-*"
, bgColor = "black"
, fgColor = "grey"
, position = TopW L 90
, lowerOnStart = True
, commands = [
Run Weather "EBDT" ["-t"," C","-L","64","-H","77","--normal","green","--high","red","--low","lightblue"] 36000,
Run Cpu ["-L","3","-H","50","--normal","green","--high","red"] 10,
Run Memory ["-t","Mem: %"] 10,
Run Swap [] 10,
Run Date "%a %b %_d %H:%M" "date" 10,
Run StdinReader
]
, sepChar = "%"
, alignSep = "}{"
, template = "%StdinReader% }{ ancalagon %cpu% | %memory% * %swap% %date% | %EBDT%"
}


ancalagon is the name of my laptop.

Finally, this is the .xmonad/xmonad.hs file:



import XMonad
import XMonad.Hooks.DynamicLog
import XMonad.Hooks.ManageDocks
import XMonad.Util.Run(spawnPipe)
import XMonad.Util.EZConfig(additionalKeys)
import System.IO

main = do
xmproc <- spawnPipe "xmobar" xmonad $ defaultConfig { manageHook = manageDocks <+> manageHook defaultConfig
, layoutHook = avoidStruts $ layoutHook defaultConfig
, logHook = dynamicLogWithPP xmobarPP
{ ppOutput = hPutStrLn xmproc
, ppTitle = xmobarColor "green" "" . shorten 50
}
--, modMask = mod4Mask -- Rebind Mod to the Windows key
} `additionalKeys`
[ ((controlMask .|. shiftMask, xK_z), spawn "xscreensaver-command -lock")
, ((controlMask, xK_Print), spawn "sleep 0.2; scrot -s")
, ((0, xK_Print), spawn "scrot")
]



With big thanks to John Goerzen for providing the excellent information.

Sunday, July 10, 2011

configuring X with xmonad without KDE/gnome

While configuring X11 to use the xmonad tiling window manager instead of the more usual KDE or GNOME, some things were somewhat less then obvious, and I document them here.

.xsession configuration


These are settings that all can be made permanent by adding them to the
.xsession file in your home directory.

disable CAPS, enable Compose


setxkbmap -option compose:caps


Now you can use the Caps Lock key to compose special characters. E.g.



  • <Caps> 'e   gives é
  • <Caps> e=  gives €
  • ...
... and as a bonus you can't accidentally press the Caps Lock key any more!



disable beep globally


xset b off



start gpg-agent on startup



eval `gpg-agent --daemon`


start ssh-agent on startup

eval `ssh-agent --daemon`

other things

dmenu

Install the suckless-tools package for dmenu among things.
Just use <alt>-p to quicklanch apps with dmenu.

xterm

I want to use plain xterm as terminal emulator as the tabbing of gnome-terminal and konsole is rather pointless in combination with the tiling.
The default font size was to small. To solve this I did a dirty hack like this:

  • update-alternatives -config xterm and change it to uxterm to have an UTF-8 terminal by default
  • edit /usr/bin/uxterm and change the last line by adding -fn 10x20 to it.


email

At the moment I'm still using kmail as email client (and accidentally akregator as RSS feed agregator). I'm still thinking about switching that as well.

... to be continued ...

Friday, July 1, 2011

one month with a makerbot thing-o-matic, some musings

I've been meaning to write up more about my learning experience with the makerbot thing-o-matic 3D printer, but for now a short summary is already better then nothing:

construction


I bought the printer as an assembly kit from robosavvy.co.uk. It took me about 12 hours spread over about 10 evenings to build the printer. Had to redo a few steps, some steps were not very clear. Should've made notes of that but didn't. Guess I was to eager to finish!

shortage of wire

One issue I had is that some cables were to short to fit comfortably and be able to survive the movement of the printer platform. I extended them with some wire I had lying around.

printing

Finally after finishing the construction I installed the software, did basic calibration of the machine and did a first print. It actually somewhat worked already!

calibration


After some playing around I noticed the Z axis motor got really hot, soo I did a full calbration as described
at  http://wiki.makerbot.com/thingomatic-doc:calibration . This solved the heat issue.

ABS & warping


I started printing with the roll of black ABS supplied with the printer.
These are the relevant settings:

  • platform temperature: 125°C
  • heater temperature: 225°C
Printing goes fine but the plastic warps really easily. This is due to the ABS getting solid again really fast as it cools down.

PLA

I ordered some PLA from german supplier 2printbeta. PLA is a compost-able plastic that is made from corn waste and has some interesting properties. The most important one is that PLA doesn't get solid as fast as ABS as it cools down. This seems to avoid warping all together. PLA also comes in beautiful transparent variants.

These are the settings I use for the PLA I bought, but be sure to check the recommendations of the vendor:
  • platform temperature: 75°C
  • heater temperature: 195°C
PLA and higher temperatures

Some people recommend using PLA at way higher temperatures like 235°C. This is really dangerous as the PLA will become liquid all the way up into the plastic transport part of the printing head and could bond to the plastic up there. I had to re-assembly the head after I tried that.

plastic not moving anymore

One of the most common issues is that the plastic is no longer pushed down in the head. This could be because the nut got loose due to excessive shaking of the printer, but I also had another issue:

Z-axis calibration

This is vitally important. The Z axis should have a correctly configured max height.
The issue I had was that the max height was slight altered due to moving the machine around a lot and this caused the head to start printing too close to the platform. This causes pressure to build up in the head and the stepper-motor starts skipping. If this happens to you be sure to check the Z-axis setting!

white plastic

For some bizar reason both the white ABS and white PLA I have causes the stepper to skip at times. I don't know why yet but for now I'm not using white plastic anymore.

modelling

Of course in the beginning it is fun just to print the calibration cubes and stuff found on thing-i-verse but after a while I wanted to start making something myself.

It was quite a bummer to find out that google sketchup doesn't work under Linux. Then I found openSCAD, which is a declarative programming language for constructing objects. It works quite ok for simple things.

conclusion

  • I still have a lot to learn about 3D printing. Documentation is quite sparse still.
  • It is fun and I already made some items that are in use. 
  • The thing-o-matic printer requires a willingness to maintain the machine or it will give issues.