Tag 'terminal':

Terminal Color Support in Makefiles
Jul 21st, 2015

colors frustrating make project management terminal
Annual hours saved: 5

I just spent a good 20 minutes trying to figure out how to have a makefile conditionally color its output depending on the current terminal’s level of color support. Long story short, there were a number of make idiosyncrasies that I wasn’t expecting / had forgotten about. So, for future reference, here’s a quick recap:

  • Conditional syntax requires parentheses when comparing evaluated (i.e. $(...)) values
  • Terminal commands are invoked using the $(shell ...) function
  • The default shell is sh, not bash, so echo evaluates escapes by default
  • During assignment, := evaluates immediately, while = does not
  • As in most terminals, un-assigned variables evaluate without error as empty strings

[Read More]

Hex to ANSI
May 20th, 2015

ANSI colors conversion hexidecimal script terminal
Annual hours saved: 2

Gist – This is a pretty low-tech bash function to convert a hex color code (e.g. #f83a22) to an ANSI foreground or background color (e.g. \e[38;5;202m).

Bash Dashboard
Apr 21st, 2015

awesome development environment information linux system terminal


This is a simple dashboard that can run in your spare Tmux/Screen panes. You invoke it with a list of sub-panels you wish to include (e.g. news feed, email synopsis, weather report, system stats, etc.), and it will gather the data and fit it to the size of its pane. You can, of course, run it outside of Tmux, but it does take up the whole terminal, so unless you have multiple terminals natively (Linux/Mac), this is pretty limiting. [Read More]

Your E-Sheep:

( change )

Recent Posts:

10/14 - ADHOC Changelog
8/19 - And now… random puppies!
8/3 - Check Braces
7/23 - Make Limits Java Heap Size on 32-bit Linux
7/21 - Terminal Color Support in Makefiles

Top Tags:

aaaaargh! algorithms automatic awesome colors config development environment documentation frustrating java linux make parsing project management random syntax-highlighting terminal types

Random Quote:

There are only two hard things in computer science: cache invalidation, naming things, and off-by-one errors.
anonymous (variant of original by Phil Karlton)

Powered By:

2017 - Creative Commons 3.0