Tumblelog by Soup.io
Newer posts are loading.
You are at the newest post.
Click here to check if anything new just came in.

November 01 2010

My Little Menu

One of the main reasons I was looking for a launch bar was that I created a menu for all my DOS games, using mygtkmenu. Once you create this menu, it just cries out for somewhere to attach it, and wbar fits the bill perfectly.

I have a bunch of old DOS (redundant much?) games that I decided to install. In addition to the ones I own (including the priceless Definitive Wargame Collection), the wonderful Good Old Games site ships several of theirs using DOSBox and even Steam uses it for classics like "X-COM : UFO".

First I would create a short script file to run the game. Due to a bug in the X.org driver, it required a work around; namely, telling SDL (the library used by DOSBox) to not "DGA" mouse (or draw directly to video memory). It seems to be fixed so i took it out.

#! /bin/bash
#export SDL_VIDEO_X11_DGAMOUSE=0
cd /mediax/games/MAGIC
dosbox -conf dosbox.conf

Then I would either grab a screenshot from the game (using Ctrl-F5) or search the web for an icon. And then edit my gamemenu.xml file and add an entry like this:

item = Master of Magic
cmd = "/home/jdarnold/bin/mom"
icon = /home/jdarnold/icons/masterofmagic.jpg
dosboxmenu1.pngFor my Definitive Wargame Collection, I created a slightly more generic batch file:

#! /bin/bash
cd /mediax/games/WARGAMES
dosbox -conf dosbox.conf $1/$2 -c "cd $1" -exit

Here I cd into the WARGAMES folder and it gets passed a directory and an executable, so mygtkmenu entry looks like this:

SUBMENU = Definitive Wargame Collection #1
icon = /home/jdarnold/icons/CompleteWargameCollection.jpg

item = Complete Games Menu
cmd = "/home/jdarnold/bin/wargames"
icon = /home/jdarnold/icons/CompleteWargameCollection.jpg

item = Decisive Battles of the Civil War
cmd = /home/jdarnold/bin/wargame1 ACW DB.EXE
icon = /home/jdarnold/icons/DecisiveBattles.png

So I've created a sub-menu off the main menu and I pass in the sub-directory and the executable for the app. In a later installment, I'll talk a little more about DOSBox, which is a really nice program. Here's a couple of shots of the final product:

dosboxmenu2.png

Related articles
Enhanced by Zemanta

October 27 2010

Openbox Time

Ooops - I forgot to mention in my Blue Period post what Window Manager I have been using. I had the post about 90% done and started playing with some of the cool new buttons in the MovableType post editor and things went haywire and I lost most of it :( I guess I forgot to add the window manager back in.

In keeping with the The Arch Way, I decided to stay away from big heavy "Desktop Environments" like KDE or GNOME and explored some of the lesser known and more lightweight Window Managers. I settled on Openbox. Not sure why exactly, as there are a plethora of choices, but Openbox seemed nicely compact and pretty popular with the Arch Linux crowd. And I haven't looked back really. It's pretty easily configurable, with a couple of XML files being the most prominent config files - rc.xml for most of the config and menu.xml for the right click menu. One particularly cool thing to use is a "pipe menu", where the results of a command build a menu on the fly. The very prolific Arch user Xyne has created obfilebrowser, which creates a menu based upon the folder you point it at, so you can use it like a little file browser. Another useful menu generation tool is menumaker, which you run once and it creates a menu.xml file for you. It scans all the "usual" places for apps, as well as having a few custom algorithms for finding those out of the way apps. Unfortunately, it seems to be abandoned, as I don't see any updates to it in several years, although it does seem to work okay.

Add the fairly lightweight and equally configurable tint2 & wbar and you've got yourself a very workable X Window environment.

Related articles
Enhanced by Zemanta
Tags: Note

October 21 2010

My Blue Periody

After getting tired of my green desktop on my Arch Linux box, I played a bit with some backgrounds and colors and came up with my Blue Period desktop:

Screenshot Blue.png(click for larger image)

So this is my new desktop, devoid of (almost) any windows. There's plenty of screen real estate, as I have 24" & 21" monitors running in Twinview mode, for a whopping 3600x1050 pixels. Here's what I'm showing, from left to right:
  • A wbar launch menu. It has some nice OSX-type animations. Funny, I was just thinking I wanted a launcher for a couple programs. I usually use Launchy but some of them I'd rather not. And then someone mentioned wbar in the addicting Screenshots topic in the Arch Linux forums. So I checked it out and despite the total lack of documentation, I figured out how to use it. Be sure to get wbarconf too, to help set up the menu.
  • The background is from the Desktopography 2009 exhibition. I was thinking I wanted an outerspace picture and this really fit in with that idea and going blue. And it came in a nice big size too.
  • The dropdown window is a Yakuake terminal window, my favorite terminal emulator. It hides away nicely.
  • At the bottom is a tint2 task manager. I used to have it go across both sreens but it made the sys tray apps to hard to get to, so I just have it go across one desktop now. I use tint2wizard to tame the multiple config options.
  • Top right is my fairly simple conky display. I need to get back to hacking on it again.
And here's a more "busy" display of my desktop:

Screenshot Blue Busy.pngClick for full display
Here's I'm running a few of my standard apps:
Related articles
Enhanced by Zemanta
Tags: Note

October 20 2010

Am I Back?

Just spent the morning moving my MovableType blogs (like Daemon Dancing) from MT 3.2 to MT 5.031. It's a bit of a pain, as you have to move one step at a time from one update to the next, so it took 4 (!) upgrades, but I think it is working. At least, if you see this it is working :) Now I hope to get back to more regular posting on my Linux adventures.

Anyway, here's a pretty funny video I came across. It has a special resonance, not just because I love writing code in C & C++, but also because I am reading the wonderful Bob Spitz biography on The Beatles.

Write in C - Let It Be Cover

Enhanced by Zemanta
Tags: Note

February 28 2010

Do It Sudo

I've come across a couple sudo tricks during the past few days and thought I would pass them along.

The first thing you need to know before using sudo is that you should use the visudo command to edit the sudo config file. This script does a number of useful things, like creating a lock to prevent mulitple editing, and doing some sanity check. But if you have the problem that setting $EDITOR and $VISUAL is ignored when running something with sudo (like sudo visudo or sudo crontab -e), that's a sudo config issue. Add the following in your /etc/sudoers file:

Defaults env_keep += "EDITOR VISUAL"

And you can use sudo from within your normal Emacs window by using the Emacs' Tramp Mode, which allows all kinds of editing, even remote editing. Just use the sudo "protocol" when editing a system file, like /etc/fstab:

Find file: /sudo::/etc/fstab

This will prompt you for your password (not the root password - remember, we're doing this via sudo, which wants your password, not root's). Type it in and you can edit the file in place, rather than running a special Emacs process as root. Very nice!

Tags: Note

Do It Sudo

I've come across a couple sudo tricks during the past few days and thought I would pass them along. The first thing you need to know before using sudo is that you should use the visudo command to edit the sudo config file. This script does a number of useful...
Tags: Note

February 15 2010

Org-ing in Emacs

I have been using emacs since the beginning of computer time, way back in the mid-80s. My .emacs file has been carried around for almost as long. Each major rev causes me headaches, as I never know what archaic options are going to break things. And yet, I'm still learning new things to do with it. I think it inspired Zawinski's Law of Software Envelopment:

Every program attempts to expand until it can read mail. Those programs which cannot so expand are replaced by ones which can.

My latest Emacs discovery was on an Arch Linux forum thread on note taking software. I use Remember The Milk for plenty of lists, but the web based nature of it makes it hard to be quick about doing a quick note. I started keeping a simple text file with notes on what I was doing, as I was finding whole hours at the keyboard disappearing into a black hole. I whipped up a quick Emacs macro that I bound to F7, which opened a file to prepend a new quick entry:

(setq logfile-name "/home/jdarnold/Dropbox/dailylog.txt")
(defun insert-new-log ()
  "Start a new log entry"
  (interactive)
  (find-file logfile-name)
  (beginning-of-buffer)
  (insert "==== ")
  (insert-now)
  (insert "\n\n")
  (previous-line)
  )

As you can see, I put the file in my Dropbox folder (use this link to sign up and we both get an extra 250gb of storage space), so no matter which computer I'm working on, I can jot a quick note that looks something like this:

==== Monday, January 25 2010 10:43 AM (1264434222)
after a couple of hours puttering around, including writing a review
for Goodreads, I'm back at work. Trying to figure out what I did to
break the video plugin
#insors

I have a few adhoc tags, stamp it with time date and Unix time, and tried to see what I was working. It's okay, but if I forgot to jot something down when I left the keyboard (which I often did), it lost a lot of its effectiveness.

Then I found out about org-mode in Emacs. It's been in the standard Emacs distribution for a couple of releases, but I'd never heard of it before. And wow, is it amazing! The PDF of the User Manual is nearly 200 pages! And it really does everything you could want in an organizer/todo manager/note taker. It even has a clock in/clock out/idle timeout paradigm, so it can notice when I've walked away from my computer. Unfortuantely, "real" idle only works on Mac OSX and Linux (after compiling x11dle.c). On Windows, it just notices when you are idle in Emacs, which, despite the fact I use Emacs alot on Windows, isn't quite the same thing.

So now I've changed my Emacs checkin macro to be:

(defun start-new-task ()
  "Start new journal task"
  (interactive)
  (find-file (concat dropbox-folder "org/" journalname))
  (end-of-buffer)
  (org-insert-heading)
  (org-clock-in)
  )

so it adds a new heading and starts the clock. And on my work machine, I set journalname to be a work journal and on my personal machine, I give it a different name. Still working out the kinks in the process, but it's closer to tracking what I've been doing.

I also intend on using org-mode to jot down my myriad project ideas. I'm always coming across interesting web sites, esp. for web APIs, that make me want to dabble in some projects, but I've never had anywhere to jot them down. I was using MindMeister.com, an online mind-mapping tool for it, but found it too structured. Given org-mode's flexibility, I should be able to find some easy way to just add my "brilliant" brainstorms to a file!

Tags: Note

Org-ing in Emacs

I have been using emacs since the beginning of computer time, way back in the mid-80s. My .emacs file has been carried around for almost as long. Each major rev causes me headaches, as I never know what archaic options are going to break things. And yet, I'm still learning...
Tags: Note

February 08 2010

Tumblings, Jan 24

A couple of links posted to my Linux Tumblr last week:

Tags: Note

Tumblings, Jan 24

A couple of links posted to my Linux Tumblr last week: Wicked Cheap Hosting - some great web hosting deals, courtesy of All About Linux TermBuilder - a simple web app to build a commandline command...
Tags: Note

February 07 2010

Arched

So early in December, I went on a quest for a new Linux distro. It wasn't so much that I was unhappy with my openSUSE 11.0 installation, but I knew I was probably going to install the new 11.2 version and so I figured I would cast about to see what's up with the other KDE distros. And given that Linux Format had just done a big review on the "best" KDE distros out there, it was good timing all around.

I didn't really have as complete a checklist of features as I have had in the past. Of course, it had to install on my beast of a machine, with its myriad hard drives, cd drives, dual monitors, and the like. I wanted an easy to use package manager, with plenty of packages available. I was't quite as sold on a "one size fits all" admin panel like openSUSE's Yast2. I'm feeling a little more adventurous, and hate to see my configs get changed without my knowledge. I wanted a KDE distro, as I find GNOME to be bizarre. I didn't want to get too far off the beaten path, as I like a popular, well documented distro.

First up was Sabayon, which has been getting lots of good press. I wasn't crazy about their home page - it was too hard to find even the download link. And there were a few kinks in the install process. It was a few months ago, so I don't remember exactly the problems, but they were enough to sour me on it a bit. It did have exactly the same problem I was going to find in all the rest of my installs, which is that the setup hard drive numbering for GRUB was always different than the final installation drive numbering, requiring me to reboot using the live disc and edit the /boot/grub/menu.lst file and change the hd0 to hd1. Not sure why that is, but I guess the mix of IDE & SATA hard drives makes it crazy.

So after dabbling a bit with Sabayon, I moved over to try Sidux, which really intrigued me with its cutting edge release and huge package library. It also had an incredibly clean install process and the desktop is stunning. Really a very polished and good looking release. It has a very nice community with lots of good info on the web site. I was a little turned off by its insistence that you drop down into single user mode to install any updates, which isn't something I like doing.

But I played with Sidux for a couple of days. It was nice, but I decided to give Arch Linux a try. It had been written up very nicely in the previous issue of Linux Format, in the "Remix Your Own Linux" article. It's overriding philosophy of "Keep It Simple" was really attractive, as was the very large package library. I found it amusing that the Live CD boots into a commandline, the installer is the old fashioned text-mode graphics and, even after installing, you end up with commandline! It doesn't even install X for you.

I found this a refreshing change and decided to jump right in. I even decided against installing KDE and just run openbox with a stripped down config. It's really been working nicely for me and I haven't looked back. Arch makes a great server install, as there is very little cruft installed by default. When I built my media server machine, with its 1tb software RAID, I only added Emacs & Samba and I know it is a lean, mean, serving machine.

The Arch wiki is incredibly informative and comes up early in many Google searches. The forums are active with intelligent discussions and it is a very nice, experienced, community. While I wouldn't use it for my Grandma's Linux, Arch is a great distro once you get some Linux experience and want to tailor a distro to your ideas, and not the other way around. Arch is also why the calls for fewer distros is misguided. It isn't for everyone but as long as each distro has a certain focus, and hues to it closely like Arch does, there's plenty of room out there. Next up - theme color changes!

Tags: Note

Arched

So early in December, I went on a quest for a new Linux distro. It wasn't so much that I was unhappy with my openSUSE 11.0 installation, but I knew I was probably going to install the new 11.2 version and so I figured I would cast about to see...
Tags: Note

February 02 2010

Linux Love Links

A few things I have recently thrown down on my Linux Love Tumblr blog, which I use for quick little Linux links and notes: 7 Best Linux Apps for Ripping CDs and DVDs | Maximum PC 50+ Ultimate Collections of Planet Wallpapers TermBuilder: a graphical Linux command line generator...
Tags: Note

February 01 2010

On Being Persistent

Those of us who have multiple hard drives in our computers will inevitably boot up one morning to find the naming scheme for these drives has changed. What was once /dev/sda is now /dev/sdb and vice versa. Your computer won't boot and fsck complains about an uknown or mismatched filesystem type. This is especially true after a kernel upgrade. Nothing really can be done about this random renaming, as it is all in the timing. But how can you fix the problem?

Actually, it's a pretty easy fix. Instead of using /dev/sd? in places like grub's menu.lst file and the all important /etc/fstab, use a special label that doesn't change. I find using UUID's to be the best solution.

There are a couple of ways to get the UUID of a hard drive. The easiest is to use the blkid command from the commandline. It lists all the hard drives, along with their UUID and TYPE:

$ blkid
/dev/sdb1: LABEL="ReiserData" UUID="0e9c1455-4993-4ddf-a86a-a3dac116a5cc" TYPE="reiserfs" 
/dev/sda1: UUID="a846c306-3114-403d-b893-a3e27704755a" TYPE="ext3" SEC_TYPE="ext2" 
/dev/sda3: UUID="c03ce6c7-32ab-41e9-b603-da09acc0fbab" TYPE="ext4" 
/dev/sda4: UUID="303889b7-ae78-436f-85ac-da95b2280596" TYPE="ext3" 
/dev/sda5: LABEL="/home" UUID="d6db1ae8-30d6-48ee-8a66-90912480e8be" TYPE="ext3" SEC_TYPE="ext2" 
/dev/sda6: UUID="71712106-eef9-48c3-840f-20fb77173a9d" TYPE="swap" 
/dev/sdb2: LABEL="GAMEY2" UUID="4B89-0200" TYPE="vfat" 
/dev/sdc1: UUID="59ac55ab-93f8-4466-804d-57d1148b76e5" TYPE="ext3" 
/dev/sdc2: UUID="260834A7083477BF" LABEL="Media" TYPE="ntfs" 

You can also get the UUID of paritions by using ls :

$ ls -l /dev/disk/by-uuid/
total 0
lrwxrwxrwx 1 root root 10 Feb  1 00:00 0e9c1455-4993-4ddf-a86a-a3dac116a5cc -> ../../sdc1
lrwxrwxrwx 1 root root 10 Feb  1 00:00 260834A7083477BF -> ../../sdb2
lrwxrwxrwx 1 root root 10 Feb  1 00:00 303889b7-ae78-436f-85ac-da95b2280596 -> ../../sda4
lrwxrwxrwx 1 root root 10 Feb  1 00:00 4B89-0200 -> ../../sdc2
lrwxrwxrwx 1 root root 10 Feb  1 00:00 59ac55ab-93f8-4466-804d-57d1148b76e5 -> ../../sdb1
lrwxrwxrwx 1 root root 10 Feb  1 00:00 71712106-eef9-48c3-840f-20fb77173a9d -> ../../sda6
lrwxrwxrwx 1 root root 10 Feb  1 00:00 a846c306-3114-403d-b893-a3e27704755a -> ../../sda1
lrwxrwxrwx 1 root root 10 Feb  1 00:00 c03ce6c7-32ab-41e9-b603-da09acc0fbab -> ../../sda3
lrwxrwxrwx 1 root root 10 Feb  1 00:00 d6db1ae8-30d6-48ee-8a66-90912480e8be -> ../../sda5

You can see that FAT32 and NTFS partitions have different kinds of UUIDs, but it should work for our purposes. Now you just need to replace all references to the various /dev/sd? names with the correct UUID. This will remove all "randomness" from the boot order. Even if you currently have only one hard drive, you really should go to this "persistent" method of naming partitions, as you never know when you might add another.

In the /etc/fstab, replace /dev/sd? with UUID="uuid", like this:

#/dev/sda4
UUID="303889b7-ae78-436f-85ac-da95b2280596" / ext3 defaults 0 1

and in the /boot/grub/menu.lst file, replace it with the /dev/disk/by-uuid path, like this:

kernel /boot/vmlinuz26 root=/dev/disk/by-uuid/303889b7-ae78-436f-85ac-da95b2280596 ro vga=773

The Arch Linux Wiki has a very nice page on Persistent block device naming here: http://goo.gl/GTWT.

Tags: Note

On Being Persistent

Those of us who have multiple hard drives in our computers will inevitably boot up one morning to find the naming scheme for these drives has changed. What was once /dev/sda is now /dev/sdb and vice versa. Your computer won't boot and fsck complains about an uknown or mismatched filesystem...
Tags: Note

December 02 2009

Glorious LXF126 Contest

Linux Format #126 Cover Image If you are the winner in my glorious Linux Format 2009 Christmas Issue giveaway, here's what you have to look forward to:

  • Ultimate eye candy

    - a pretty interesting article on how to get the most dazzling display, whether you use Compiz, KDE, or GNOME. Despite my general disdain for eye candy, I would try the Compiz/Emerald 3d window manager if it worked on dual monitors, but last I looked it didn't support them.
  • KDE distributions

    - coincidentally enough, just as I'm looking to move on up from my OpenSUSE 11.0 install, along comes LXF with their KDE distro Roundup. I wouldn't have to go too far afield if I stayed with their winner, which is OpenSUSE 11.2, but I'm trying out a couple of other ones they regard highly, like Sabayon and Sidux. I'm a KDE man, so it works out well.
  • Get to grips with /proc and /sysfs

    - this is an excellent overview of the virtual filesystems /proc and /sysfs.
  • DVD Coverdisc

    - the DVD coverdisc includes live previews of the latest versions of KDE and GNOME, which is pretty cool. It also includes Ubuntu Netbook Remix (which I think I'll try on my Dell Mini), Moblin 2.0 and Puppy Linux 4.3.

To enter my little contest, where I will mail you a pristine copy of LXF #126, along with the DVD coverdisc, just drop me an email at jdarnold@buddydog.org. On Monday, Dec. 7th, probably in the evening, I will randomly select one entry and email you back asking for your mailing address and soon it will show up on your doorstep. Open to both of my international readers too :)

Oh, and I also heartily endorse subscribing to the magazine. Yeah, it's pretty expensive, but if you do it via the TuxRadar web page, you can cut it down to US$99 for 13 issues. And, as a subscriber, you get access to all the back issues in PDF format and they really have gotten their act together with it. The PDFs look great and they have a nice HTML page linking it all together. You won't be disappointed.

Tags: Note

Contest and Projects

Due to a mix-up, I ended up with two copies of Linux Format #126, the Christmas 2009 issue. I figure I'll run my first ever contest here at Daemon Dancing - after over 6 years of writing on this blog, why not? Let's make it a simple one - just drop me an email at jdarnold@buddydog.org and next Monday, when I get back from my work trip, I'll randomly select one entry to mail it out to. No strings attached and, believe you me, I won't be keeping your emails around! And heck, I'll even make it open internationally, just to make it even more likely I'll get at least one email entry:)

So I get a 1.5 out of 4 for my holiday projects. I did get the girls' computer up and running. The new power supply took a bit of forcing to get it to fit into the old case, but then it was up and running just fine. I was bit stumped as to what to install for an OS on it. For obvious reasons, the old Windows XP installed on the hard drive failed to boot. Really, all they do is play flash games on it at this point, save for R10.4 playing some Day of Defeat with me and my clan buddies. So I moved her onto the Windows machine and had to pick a Linux for the new box. I went with OpenSUSE 11.2, as I'm most familiar with that and so it would require the least amount of thought. So far, so good.

I get a half a project because I did try to install a new Linux on my own box, but wasn't really happy with it. I installed the latest Sabayon (v5.0), after being pretty impressed with how well the Live CD ran. But I immediately ran into a problem after the installation - GRUB refused to boot it up.

Because I run my own boot manager (TerraByte's BootIt NG), I always install the GRUB boot loader onto the first block of the OS's boot partition. One test of an installer is just how hard this is to do, and I'm happy to report it wasn't too hard for the Sabayon installer - just select the Advanced Options and it was one of the choices. But on boot, I just saw "GRUB " and I knew immediately what the problem was. My machine is a homebrew one, with both old fashioned IDE drives and newfangled SATA drives and this isn't the first time an installer or LiveCD called the drives something different than what a full boot calls them.

Unfortunately, I had formatted the partition as an 'ext4' drive, so I couldn't get at it with my OpenSUSE 11.0 boot. And it may also have had something to do with why GRUB didn't work either. So I redid the install using 'ext3' and still had the problem. After rebooting the Sabayon Live CD, the usual GRUB steps to fix a broken GRUB install didn't quite work:

# grub
grub> find /boot/grub/stage1
 (hd0,0)
 (hd0,3)
grub> root (hd0)
grub> setup (hd0,3)
....
grub> quit

I do the ",3" part to (hd0,3) so that it installs in the root block of partition 3 and not the root block of that whole hard drive, to not overwrite my own boot manager. But I knew this was still wrong, because after a "normal" boot, the boot drive is hd1, not hd0. I think there is a way to tell grub this using another parameter to the setup command, but I had a better idea - I just booted into my OpenSUSE boot and changed all 'hd0's to be 'hd1'. After booting, things got a little further, until I realized that the setup command doesn't seem to fix the /boot/grub/menu.lst file, so I had the make the same s/hd0/hd1/g change there too.

Now I was able to boot into Sabayon. And because they aren't afraid to install binary drivers, I got the nVidia drivers and was quickly able to turn on my second display, which was nice. But the update process left me a little mystified. I couldn't really figure out how to get it to select packages and install the updates. And even when it was downloading, it was incredibly slow and, in the end, didn't seem to do anything.

So in this age of instant gratification, I sort of gave up. I think I'll try the Sidux distro next, although I should just stop wasting time and install OpenSUSE 11.2, as that is the one I like and use.

Tags: Note

Glorious LXF126 Contest

If you are the winner in my glorious Linux Format 2009 Christmas Issue giveaway, here's what you have to look forward to: Ultimate eye candy - a pretty interesting article on how to get the most dazzling display, whether you use Compiz, KDE, or GNOME. Despite my general disdain...
Tags: Note

November 30 2009

Contest and Projects

Due to a mix-up, I ended up with two copies of Linux Format #126, the Christmas 2009 issue. I figure I'll run my first ever contest here at Daemon Dancing - after over 6 years of writing on this blog, why not? Let's make it a simple one - just...
Tags: Note
Older posts are this way If this message doesn't go away, click anywhere on the page to continue loading posts.
Could not load more posts
Maybe Soup is currently being updated? I'll try again automatically in a few seconds...
Just a second, loading more posts...
You've reached the end.