Riffing on tmux

You never know what happens when you admit you're starting to learn something in public...

In case you've not gotten this far, here's a bash script you might enjoy. But note I don't supply any of the text (.txt) files referenced. Change those names as you like, and put files with the names you've chosen under “dir” (whose value you'll likely change as well).

I haven't gotten very far, so this script is wonderful. Thanks Inquiry! I've decided to remix the script for use with TabFS. The cool thing about TabsFS is that your web browser becomes a file system, so every tab becomes a directory. Within that directory is a text file of the tab's content. What you can do then, is use Inquiry's bash script to open each tab's text file as a tmux vertical pane.



tabs=$(ls $dir)

for tab in $tabs
  tmux split-window -h less "$dir/$tab/text.txt"

tmux select-layout even-horizontal
tmux select-pane -t 0

That way you can look at all of your open tabs at once!

There are other applications and changes of the script that could be used to best use TabsFS. I can imagine grabbing the url.txt file of each tab, throwing it in nano, and editing the url on the fly if you want to switch to another site. Will have to just keep playing around with the script & tmux in general.

Reminds me of jamming with other musicians back in school. The common currency we shared were riffs. It could be a couple of notes. That's all it could take to lead to a fun improv session or a song we'd perform later on.

Perhaps this is why I've gravitated towards one-liners and smaller scripts. They're the riffs of programming, allowing you to easily iterate and create something more personal. You can simply change a variable or subsume them into a bigger program. Their portability and changeability create so many possibilities. Makes me think of Github's Gists, where I've discovered riffs aplenty that I've incorporated here & there. I should've thanked those folks. Might as well start now...

Thanks again Inquiry for the bash riff!