[TxMt] tmTheme: Slate
Andreas Wahlin
andreaswahlin at bredband.net
Thu Nov 10 15:22:59 UTC 2005
Nah, i have a lot of themes that i don't like installed, rather
do randomize from given list
list equals
slate.tmtheme
twilight.tmtheme
magic workbench.tmtheme
...
end equal
god, that is horrible code, even for pseudo :)
what was described was a way of having a toggle between two files,
but i want a toggel between n files.
ANdreas
On Nov 10, 2005, at 13:24 , Allan Odgaard wrote:
> On 10/11/2005, at 12.03, Andreas Wahlin wrote:
>
>> Could one expand the list in some way and just increment that
>> final digit there?
>
> Like a cycle? You would need to store the value somewhere, e.g. in
> a file. It could be made… meanwhile I had some fun creating this
> script:
>
> IFS=$(echo -e "\n\r")
> themes=($(find /Applications/TextMate.app/Contents/SharedSupport/
> Themes -name "*.tmTheme"))
> rand=$(dd </dev/random bs=1 count=1 2>/dev/null|hexdump -e '/1 "%u"')
> total=${#themes[@]}
> open "${themes[$((rand % total))]}"
>
> It picks a random theme from what's included by default.
> Unfortunately I see that a lot of the default themes have a plist
> extension, for which it doesn't work. So currently will only pick
> random from 4 themes, but I'll have that corrected in next build.
>
> Also be aware, if the default theme has an equivalent in ~/Library,
> TM will ask if it should overwrite (instead of switching), since it
> thinks you're opening a new version of the theme -- for users with
> a lot of custom themes, it'd probably be better to just let it
> randomly pick from what's in ~/Library.
>
>
>
> ______________________________________________________________________
> For new threads USE THIS: textmate at lists.macromates.com
> (threading gets destroyed and the universe will collapse if you don't)
> http://lists.macromates.com/mailman/listinfo/textmate
More information about the textmate
mailing list