A bash one-liner for rapidly switching the active Ghost theme from terminal

When developing Ghost themes, or testing things I’m working on, I tend to change themes a lot.

Today I went looking for a faster way to do it, and didn’t find one, so I wrote a bash one-liner that I’m pleased with, which allows me to rapidly hot-swap the active theme, by updating a symlink — with a pleasant FZF-powered theme-selector UI :nerd_face:

The end result:

ln -sfn "$(find content/themes -maxdepth 1 -type d -print | fzf | xargs basename)" content/themes/current

Here’s the full tutorial:

1 Like

That’s awesome. The only thing that would be more perfect is a command that swaps sqllite and routes.yaml too.

1 Like

Thank you @Cathy_Sarisky! That’s a great idea. I don’t know why I didn’t think of it.

(P.S. I’ve been enjoying your blog posts + tips for a while. Subscribed via RSS :)

1 Like