Skip navigation.

rantshoutwhisper

Posts tagged with "fluxbox"

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.

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!

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...
Download Opera, the fastest and most secure browser