JAMES Ley had never heard of Lavender Menace when he won an LGBT History Month Scotland Cultural Commission award to write a new play. While Edinburgh's pioneering gay book shop that existed between 1982 and 1987 before reinventing itself in new premises as West and Wilde wasn't on Ley's radar, he had vaguely heard of the Gentlemen's Head Quarters, the nickname for the public toilet that existed at the east end of Princes Street outside Register House. He was also half aware of Fire Island, the legendary gay nightclub that existed at the west end of Princes Street in a space that now forms the top floor of Waterstone's book shop

As he discovered, Fire Island was a central focal point for what was then a still largely underground gay scene in Edinburgh's capital. Alongside the likes of the Laughing Duck pub on Howe Street, Fire Island was one of the few places where HI-NRG music could be heard in what would these days be dubbed a safe space for gay men and women to congregate. It was here that was essentially the first incarnation of Lavender Menace took root in a stall in the club cloakroom.

All of this forms the backdrop to Love Song to Lavender Menace, Ley's new play. The result of his LGBT History Month commission. Ley's timely rediscovery of a largely undocumented history of Edinburgh's recent radical past opens at the Royal Lyceum Theatre in Edinburgh tonight in the theatre's intimate rehearsal room space before going out on a short Scotland-wide tour.

“That whole world was fascinating,” says Ley of the background to the play. “It just seemed like such a different world back then, and I was really keen to look at what was going on in Edinburgh back then, at a time when in Scotland, homosexuality had only been made legal as recently as 1980. It was a time as well when everything was really political in a way that maybe the gay scene isn't so much today, and which can tend to be forgotten.”

Love Song to Lavender Menace was originally presented as a performed reading at the Leith-based Village Pub Theatre, which Ley co-founded as a grassroots venture. The play is set during the last days of the shop's tenure in Forth Street before moving to new premises in Dundas Street. As the staff pack up, a fictionalised relationship between two of the shop's co-workers looks like it might also be moving on. As a symbol of the end of an era, the play's message is plain.

“One of the big parts of the story is how community spaces are disappearing,” says Ley. “There used to be more spaces in the centre of the city, but which have all been bought over now. Waterstone's becomes important in the play in quite a big way in terms of the impact it had on Fire Island. When they came along and bought the building, it's like an image of capitalism taking over what had once been this really important radical space.”

The roots of Lavender Menace, which named itself after stem from the First of May, the radical bookshop run collectively on Candlemaker Row. One of the collective, Bob Orr, teamed up with Sigrid Neilson to run a bookstall in the Scottish Homosexual Rights Group on Broughton Street. Originally trading as Lavender Books, they named the bookstall Open Gaze. A schism typical of such a militant era over what should or shouldn't be stocked in Open Gaze saw Orr and Nilson depart Broughton Street. They briefly opened up in the Fire Island cloakroom before moving into the basement of 11A Forth Street beneath the premises for the Scottish Campaign to Resist the Atomic Menace (SCRAM) and the local Green Party HQ.

The rise of Waterstone's and the relative ease with which gay literature could be found in mainstream shops also had an impact. With the eventual demise of both West and Wilde and the First of May, radical book shop Word Power opened in 1994, before more recently being reinvented under new management as Lighthouse.

In researching the play, Ley interviewed Orr and Nielsen,who named their shop after an informal group of lesbian radical feminists formed in New York in 1970 to protest the exclusion of lesbians and lesbian issues from the feminist movement. Ley also spoke to key players based around Edinburgh's gay scene, which also included Millionaires, now the site of Whistlebinkies, and the more discreet New Town bar. Fire Island, however, was the nearest Edinburgh would get to Studio 54. The club was opened by Bill Grainger in the once notorious International Club. Up until 1978 when Fire Island moved in, 'The Nash', as it was better known, frequently had its licence threatened following various violent incidents on the premises instigated by a less enlightened clientele.

“Edinburgh is fairly safe now compared to how it used to be at the time the play is set,” Ley points out. “On one level that's an improvement, but we also seem to have lost some of the more interesting strands of culture that existed then. Everything was so political then, and there were so many divisions among those involved in things, because they all had such really different views on things. Everyone was aware of the details of what they were fighting for, whereas now everything's become mainstream, there's no real centre, and it seems to be a kind of mush. There seems to be a lot of compromise these days, whereas you wouldn't have got away with that then.”

Fire Island's closure in 1988 left a gap in Edinburgh's gay culture which marked the changes as much as Lavender Menace's regeneration into West and Wilde, named after writers Vita Sackville West and Oscar Wilde. The gap was eventually filled by nights such as Taste, which became another clubbing institution. This chimed with a time when the rise of House music, techno and the all that went with these then revolutionary sounding forms of dance music was being embraced by a new breed of clubber at numerous gay and gay friendly nights.

Broughton Street and Forth Street can no longer be regarded as hot-beds of underground activity, with the radical co-ops that once occupied them now out-priced by gentrification. Venues such as CC Bloom's, The Street and Planet, however, are clustered a stone's throw away at the top of Leith Walk in a way that once would have been unimaginable.

If Love Song to Lavender Menace is an elegy to both the shop and the era it was at the vanguard of, a sense of radicalism has trickled down the generations with a new wave of activity at nights such as Hot Mess and Dive's Queer Party. For all Ley points to a lack of a centre, the same sort of political will that fired Lavender Menace seems to have been rediscovered by a new generation, unafraid to be loud and proud. It is these younger gay activists and artists that Love Song to Lavender Menace is for as much as those who helped shift the landscape.

“I think it's important to look at a part of Edinburgh's social history that's been largely undocumented,” says Ley, “and to not forget that history. It feels great to be part of that, and to be able to talk to people who lived through that period and made these things happen, and who know the details of what happened. In the current political climate, it's important that there is as much a record of everything that happened as possible. Lavender Menace was much more than a bookshop. It helped create a community in a way that needs preserved, and hopefully the play can go some way to doing that.”

Love Song to Lavender Menace, Royal Lyceum Theatre, Edinburgh, October 12-21, then tours.