#!/bin/bash icon="🌐" layout="$(setxkbmap -query | grep layout | awk '{print $2}')" # fcitx state, 0 for close, 1 for inactive, 2 for active test $(fcitx5-remote) = 2 && layout="日本語" echo $icon$layout