#!/bin/sh first=true i3subscribe mode | while read -r x; do if $first; then first=false x=default #XXX: i3 does not expose method to get mode, assume fi x=${x#mode:} [ "$1" = "hide-default" -a "$x" = "default" ] && echo || echo "$x" done