I have a program called gamemode, and to check if it's running, you can use gamemode -s, which outputs either "gamemode is active" or "gamemode is inactive".

I want to change "gamemode is active" to "<an icon that doesn't show on this website>" and change "gamemode is inactive" to some other icon.

2 Answers 2


sed would be easiest:

gamemode -s | sed -e 's/gamemode is active/<active icon>/' -e 's/gamemode is inactive/<inactive icon>/'
  • Thanks! This works great!
    – Eysse
    May 21 at 9:48
  • @Eysse if this answer works for you best, please accept it with the tick mark (✓)
    – roaima
    May 21 at 18:07
gamemode -s | awk '{print (/inactive/ ? <inactive icon> : <active icon>)}'

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.