1

First issue:

So, in my sxhkd config, I have these lines:

super + i; b
    export b=$(acpi); notify-send -t 2000 $b

super +  i; r
    export r=$(free -h | awk '{print $6}' | sed 's/available//'); notify-send -t 2000 'Available memory' $r

The first one (battery info), works pretty well, while the second one returns just 'Available memory'. If I run the second command from the terminal, i.e., export r=$(free -h | awk '{print $6}' | sed 's/available//'); notify-send -t 2000 'Available memory' $r, it works right as well. Is their some problem with my syntax in sxhkd? I am on Arch.

Second issue:

Well, when the above lines are present in the config, pressing just r or b triggers the notify-send commands. How to get the hotkey chord chain right?

Thanks!!

Akshat Vats
  • 439
  • 2
  • 8
  • 21

1 Answers1

0

Alright, it was a silly mistake. I had to escape the braces in awk.

export  r=$(free -h | awk '\{print $6\}' | sed 's/available//'); notify-send -t 2000 'Available memory' $r

This works.

Akshat Vats
  • 439
  • 2
  • 8
  • 21