nwg-panel 0.9.23
Added Common settings -> 'Run programs through compositor" check button. When checked, makes the panel run programs through either swaymsg exec <cmd>
or hyprctl dispatch exec <cmd>
. Turned on by default, makes us sure that runned processed are detached from the panel.
On compositors other than sway or Hyprland, the command will be executed the old way.
def cmd_through_compositor(cmd):
cs_file = os.path.join(get_config_dir(), "common-settings.json")
common_settings = load_json(cs_file)
if "run-through-compositor" not in common_settings or common_settings["run-through-compositor"] :
if os.getenv("SWAYSOCK"):
cmd = f"swaymsg exec '{cmd}'"
elif os.getenv("HYPRLAND_INSTANCE_SIGNATURE"):
cmd = f"hyprctl dispatch exec '{cmd}'"
return cmd