#!/bin/sh filename="/tmp/herbstluftwm-gap" while read -r line do gap=$line if [ "$gap" -le 90 ] then gap=$((gap+7)) herbstclient set window_gap $gap echo $gap > $filename fi done < "$filename"