prasanthrangan / hyprdots

// Aesthetic, dynamic and minimal dots for Arch hyprland
GNU General Public License v3.0
7.64k stars 894 forks source link

[Bug]: Multiple processes of Cava #2000

Closed s0m3th1ng-r4nd0m closed 1 week ago

s0m3th1ng-r4nd0m commented 1 week ago

Description

When switching from a waybar style that uses Cava to one that doesn't and then back again to one that does, it doesn't kill the previous Cava process and creates a new one again which results in multiple useless Cava processes running in background.

Steps to Reproduce

  1. switch Waybar style to one that uses Cava
  2. change it again to one that doesn't use Cava
  3. switch it again to the Waybar style that uses Cava
  4. See that there are multiple instances of Cava running in the background

Expected Behavior

It should kill the Cava process when it is no longer needed like when switching to a Waybar style that doesn't have Cava module.

or

It should check if a Cava process is already running and use that process instead of making a new one again.

Actual Behavior

There's multiple useless processes of Cava running in the background each using around 9-10 MBs of RAM.

Screenshots

241115_14h24m22s_screenshot.png

Environment

kRHYME7 commented 1 week ago

thanks for noticing, @s0m3th1ng-r4nd0m

@keth-real please check it out

kRHYME7 commented 1 week ago

@s0m3th1ng-r4nd0m can you please make a PR and remove this

https://github.com/prasanthrangan/hyprdots/blob/main/Configs%2F.local%2Fshare%2Fbin%2Fwaybar_cava.sh#L130-L131

instead of


cava -p "$config_file" | sed -u "${dict}" &
disown

use


cava -p "$config_file" | sed -u "${dict}"

Moreover

It should check if a Cava process is already running and use that process instead of making a new one again.

It's quite complex and slow to do it in bash.

keth-real commented 1 week ago

@kRHYME7 Gotta push it here #1988

kRHYME7 commented 1 week ago

@s0m3th1ng-r4nd0m Fixed on #1988