0

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

1

sed would be easiest:

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

You must log in to answer this question.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.