Skip navigation.

rantshoutwhisper

Quick Fluxbox tip: how to have a unlocked Opera

, , , ...

When Opera runs on Linux it creates a lock file. The lock file prevents another instance of Opera starting up, which I guess is good, but if Opera suddenly crashes, then starting Opera again can be problematic. Occasionally the e-mail won't start up and you get a warning about the lock file being active.

A quick search produces the answer [bring up a terminal, type killall opera: go into the .opera directory, delete the lock file: start up Opera again] but it'd be easier if you could stop it from happening ever again.

And you can [well, I can in Fluxbox, anyway]. Replace your menu entry for Opera with

[MacroCmd {Exec killall opera} {Exec rm ./.opera/lock} {Exec opera}] (opera)

replacing ./.opera/lock for wherever your lock file actually is [but it's likely to be there].

Note I'm not using killall -9. That's because the system by default does a system clean-up after a normal killall command; but using killall -9 doesn't do this tidying. Also, it's a bit excessive for stopping a process: the standard command will do fine.

Fluxbox: The Deco Bitmask Mystery Solved!

, , ,

It took me ages to get this, and another discussion with mark-t on the IRC chat. Again, because I can't put this on the Fluxbox wiki [although there are signs this might be a menu option!] I'm sticking it here in the hope it helps someone out. In the apps file for Fluxbox you can control many variables. There's a pretty complete wiki page for this, but one of the things not fully explained is

[Deco] {NONE|NORMAL|TOOL|TINY|BORDER|TAB} Specify the decoration state. There are several predefined decoration sets:

  • NORMAL - standard decorations
  • NONE - no decorations
  • BORDER - like NONE except keep the X window border
  • TINY - titlebar with an iconify button
  • TOOL - titlebar only
  • TAB - like NONE except show external tabs only
A bitmask can also be used for fine-grained control. The bits are (from "1" to 1<<10): titlebar, handle/grips, border, iconify button, maximize button, close button, menu enabled, sticky button, shade button, tabbing enabled, focus enabled.

What's a bitmask? I kept asking. What does "1" to 1<<10 MEAN? What am I supposed to put? Each bit-property is given a value that's based on a power of 2 in ascending order:
Property Value
titlebar 1
handle/grips 2
border 4
minimize button (called iconify) 8
maximize button 16
close button 32
enable window menu 64
sticky button 128
shade button 256
enable tabbing 512
enable focus 1024
You pick the things you want and then add up the values. So if I wanted a titlebar with just a close button I'd do 1 + 32 = 33 and then enter [Deco] {33} in my apps file. Although I suspect it won't work if you've set where your titlebar buttons should be in a style... But as proof it DOES work, here's a picture of a terminal with just a border [exaggerated so you can see it: unfortunately I haven't found a way to set the border width per window]... and yes, I could have just used the keyword, but you just have to check these things sometimes.

Displaying iCal events in Conky WITHOUT Google Calendar

, , ,

Conky is used to write various bits of information to your desktop/workspace. It has lots of scripts written for it which will display weather, news and a whole lot more...

...except iCalendar events from a local file. There is a workaround by signing up to Google Calendar and downloading any of the various scripts; but I can't really see the point in signing up to a calendaring service when you have a calendar already.

So I found a simple, crude way of getting what I want. I can't format it [and perhaps someone can help with that?] but at least it works. Simply get Calcurse and import your iCal file into it [you have to run Calcurse from a terminal]. Then go to your .conkyrc file and add

${execi 3600 calcurse -a -r 7}

Under the TEXT section. This will display your appointments for the next seven days. You can find other options by reading the Calcurse documentation, which is well-written.

XTerm: copying to the clipboard an easy way

, ,

Xterm is the simple commandline window that comes with most distibutions of Linux. Copying and pasting are not obvious, to say the least. Text just has to selected with the mouse to be copied; but that text goes somewhere called the primary buffer. From reading this, I suspect it's a standard. But it has to be said that I don't really understand it, and I'm not certain I should have to.

There are pages that will tell you how to change the behaviour so that your text goes to the clipboard: but these didn't work for me. So if they aren't working for you, here's another solution.

You'll need to edit your menu. I'm on Fluxbox, so I open up a text-editor and open up ~/.fluxbox/usermenu. I suspect you could use Alacarte or Kmenu for Gnome and KDE respectively.

Find the entry for xterm and replace what you have with

xterm -xrm 'XTerm*selectToClipboard: true'



So in Fluxbox the entry would be

[exec] (terminal) {xterm -xrm 'XTerm*selectToClipboard: true'}



Then save. When you open xterm and select text with a mouse, it goes to the clipboard. Where you thought it would go in the first place. You can still paste the text into another terminal with Shift+Insert: but you can paste into pretty much everything else with Ctrl+v.

I read the man page for xterm, which is how I thought of doing this. But the fact that I had to think about it, read the man page and then guess until it worked is quite frustrating.

Fluxbox: combining commands in a user menu

, , ,

Yes, this should be on the Fluxbox wiki... but asking for an account is long and slow.

I wouldn't have known about this unless I hadn't had a long IRC with a user called mark-t, who was helpful enough to finally give me the answer, but not so that he (or she, perhaps? Who can tell with the Internet?) wanted to tell anyone else.

SO...

The basic Fluxbox menu will probably not suit your needs, and it's a very easy thing to build your own. There is a basic guide at http://fluxbox-wiki.org/index.php?title=Editing_the_menu which tells you MOST of what you need to know.

What is not clear from the page is that there is a way to have more than one program started up at the same time; and also a way to have a toggled state.

The (much more complete) man page hints to this: it states that any legal key command can be used as a menu item. The difference (which is also not explained in the man page!) is that it has to be written in the form

[command {Exec program_1}...{Exec program_n}](label)



The two commands you might be interested in here are MacroCmd, which allows you start two processes one after another; and ToggleCmd, which gives you a switch (although you won't be able to see the state of the switch - maybe a Fluxbox wish?)

So, if I wanted to launch Psi and Opera at the same time, my menu entry would be

[MacroCmd {Exec psi} {Exec opera}](psi-opera-megasymbiotic-launcher)



And if I wanted to toggle JACK:

[ToggleCmd {Exec jackd} {Exec pkill jackd}] (Jack)



Simple really. Just not explained. Welcome to Linux!

Automatic realtime IRQ priorities using rtirq

, , , ...

When using audio on Linux, you have to be aware of the the realtime priorities of the system. And even though you may have edited the /etc/security/limits.conf file, the thread priorities of the sound card will not be set.

Rui Nuno Capela [creator of qjackctl and the excellent qtractor] wrote a script to help set the priorities of the most likely IRQs for your system. It didn't require any tweaking; however, when I first tried to use it there were no instructions as to how to apply it. SO...

  • Download the script from http://www.rncbc.org/jack/ (you'll need to head to the end of the page)
  • Extract the tar file. For this I used my file browser, PCManFM. No need for the terminal. Yet.
  • NOW open a terminal.
  • Become root by typing su and the root password.
  • Enter cd {path to rtirq script} - this takes you to where the script is.
  • Then cp rtirq.conf /etc/ - this copies rtirq's config file to /etc/
  • Then cp rtirq.sh /etc/init.d/rtirq - this copies rtirq.sh to the /etc/init.d/ folder, making it a system script. It then renames it as rtirq
  • Now enter insserv /etc/init.d/rtirq - this installs the script for the system on startup
  • Lastly, enter ln -s /etc/init.d/rtirq /sbin/rcrtirq -this turns the script into a command


Now when you enter rcrtirq you'll get

Usage /sbin/rcrtirq {[re]start|stop|reset|status}



You can only use the command as root unfortunately, but it doesn't matter because this script will now start when you switch your computer on - which means you don't have to think about it!

Lime for Linux: a small and esoteric guide

, , , ...

In case you didn't know, I'm a musician and composer. That's my main job (I also work in a bookshop a couple of days a week) and I work in the fields of contemporary music and jazz.

This does not make for a multi-million pound lifestyle. And music can be an expensive profession. I made the switch - fairly painfully, as it happens, but quite successfully in the end - to a Linux system. It was painful because even though there are a lot of resources to generally help with a generic system, you do have to read each bit of help you find the help you need for your specific system. This takes time, which is where (for a new user) Linux is very expensive indeed.

But on the plus side, my time fixing a system so that it works well for me doesn't actually cost me money. As money is the thing in which I'm deficient (I can always find time to do something else!) then Linux is a very good choice for a self-employed musician. More and more distributions are being made with audio applications in mind, and I strongly feel that musicians inputting knowledge to the work would only strengthen it.

That said, there was one piece of software from my old Windows system that I haven't been able to let go of. Lime is a music notation editor that I've used for the last five years. I bought my version at a ridiculously good £45; it's done a lot of good work for me over the years and I highly recommend it, especially if you can touch-type as it gives each pitch a keypress of its own (LIKE A PIANO! unlike most other notation editors, for which you enter a note {a, b, c, &c.} and then enter the sharp or flat as an alteration).

I dallied with the various notation solutions for Linux and realised that

  1. I don't like entering code to write Western notation (Lilypond, CMN). In fact, I think it's weird. We're dealing with the visual medium. It's quicker to write it by hand.
  2. I don't like frontends that don't offer the full range of options that the backend can deliver (Denemo, Rosegarden, Noteedit, Nted - and yes, that's almost all of them).
  3. I don't want to enter two keys for one note (all of them including Musescore which apart from that and the fact that it crashes openSUSE 11 fairly regularly, is very good)
  4. I want total control of the number of lines on a stave (unlike any of them except Musescore - but only after the first measure - and Canorus. Unfortunately, this was the only aspect of Canorus I liked and could use)


So, I headed back to Lime and set about making it work. There exists a Microsoft compatibility application called WINE: it does all the really hard work of getting Lime to run, but the notes didn't display at all. So I re-encoded the fonts so that they would display, and give a small guide to get it to work. The only thing you will need (that I cannot supply) is the Symbol font from Microsoft Windows. But you should be able to pull it off an existing Windows system, like I did. With luck, it'll join the other MS core fonts in time. Who knows?

Anyway, the caveat: I'm using openSUSE 11.0 and Fluxbox. I'm not a programmer. I don't know enough about Linux to help you out in advanced cases. It's working here. I HOPE it works for you.

  1. Copy the Symbol font to the fonts directory of your WINE installation (this may be at /home/(username)/.wine/drive_c/windows/fonts/)
  2. Download and install Lime (it doesn't matter where as long as you know where it is - for this example I'm going to say it's at /home/corey/Lime/)
  3. Download this zip file with the modified fonts and extract it into the Lime directory


Now we need to add Lime to the Fluxbox menu. To do this
  1. Open up /home/(username)/.fluxbox/usermenu in a text editor
  2. Since my path to Lime.exe is at /home/corey/Lime/ I would add

    [exec](Lime) {wine /home/corey/Lime/Lime.exe}

    to the file
  3. Save usermenu. On my version of Fluxbox (1.1.1) this updates the menu automatically so you can see if it works straightaway


To actually hear the output from Lime, you'll need Timidity, which allows you to hear MIDI events through your soundcard. I decided to have Timidity start up when Lime did, through a keypress: I went to /home/corey/.fluxbox/keys using a text editor and added the line

Mod4 F9 :MacroCmd {Exec timidity -iA D} {Exec wine /home/corey/Lime/Lime.exe}



Every time I hold down the Windows key and hit F9, Timidity starts up, then Lime. I'm then ready to write and can hear the stuff I've done.

Lime uses the Alt key to select annotations and chord symbols - this cannot be changed inside the program, and for Fluxbox users the Alt key is normally used to move a window. Luckily Fluxbox allows you to change this behaviour. Open up the keys file again and scroll down to the area that says

# alt + left/right click to move/resize a window
OnWindow Mod1 Mouse1 :MacroCmd {Raise} {Focus} {StartMoving}
OnWindow Mod1 Mouse3 :MacroCmd {Raise} {Focus} {StartResizing NearestCorner}



And change Mod1 to Mod4.

It's all very nifty, and didn't take me all that long to do after I'd got the fonts re-encoded. Of course, I'm still waiting for the day that I can happily use an open source notation tool as well as Lime... but until then...

Let's talk a bit about the United States of America. Then let's talk a lot about here.

, , , ...

I suspect a lot of us are going to remember where we were on 4th November. For my part, I'd woken up at 3 o'clock in the morning, wondering why I couldn't sleep. I then went to the computer and remembered why.

I watched it online, eight tabs on Opera with stats aplenty, but then settled onto BBC's coverage. At four, California came home and I leapt out of my seat. I did a gig the next day with Cleveland Watkiss, who hosted it as a tribute to Barack Obama, saying "Doesn't the world feel a better place right now?" And y'know, it does: it really does.

I'm extremely happy that the U.S. decided to pick a relatively young, intelligent man who is part of a party that isn't keen on blowing away large chunks of the world willy-nilly. He seems to want people to live. That kind of thing sways my preferences.

But I don't live over there; I live here. And I still have to cope with the negative aspects of U.S. cultural imperialism that spread through the black community like a wildfire. Sadly, another innocent is dead in Derby.

Now, I've written about this before and it was quite a bit closer to home for me that time. But it doesn't affect what I said last time - it still holds. Everybody's been shouting about the example Obama has set for the African and Caribbean diaspora over here - and all I can see is that the examples of change really have to come from over here, and fast.

But if we're going to appropriate North American culture from now, let's not celebrate that there's a black guy in the White House; let's rejoice in the fact that there's a chap there that prefers dialogue to fighting and WANTS PEOPLE TO LIVE.

I have no idea what's needed. All the role models, special songs, youth schemes &c. don't seem to have helped these people. They seem to be keen on blowing away large chunks of our world willy-nilly and wanting people to die. To me there seems to be a lack of respect for self and others, and a lack of knowledge* about the world and society that is almost insurmountable.


But as I've said before, these people are in the minority; why are we allowing them to be the main reflection of who we are through the media? Blaming the media doesn't help, since they are there to report the news; if these idiots didn't give them the news in the first place then there'd be nothing to report.

And again, all the families suffer. And we suffer. Because of five people with nothing better to do than ruining our world.

*Speaking of which, I'd heard there's a lot of fuss about Jeremy Paxman giving Dizzee Rascal a verbal kicking on Newsnight over Obama winning. I started watching it on YouTube. And what I saw was:


  1. Paxman asks a question

  2. Dizzee attempts to answer the question

  3. Dizzee can't really answer the question and starts talking about something else

  4. Paxman helps Dizzee kick himself repeatedly



I then stopped watching.




Black history = British history: 14

,

Haven't been on here for ages: had a site overhaul and work's been coming in... but I thought you might want to take a look at this site. It's incredibly clear and informative.

www.nationalarchives.gov.uk/caribbeanhistory

a small moment of pleasure

,

I've just got in, and found this greeting me, smiling...

http://news.bbc.co.uk/1/hi/world/americas/5328592.stm

So the question arises again: why did we go, Tony??
Download Opera, the fastest and most secure browser