executeCommandWithArgs method

Future<bool> executeCommandWithArgs(
  1. List<String> args
)

Execute a command with custom arguments

Implementation

Future<bool> executeCommandWithArgs(List<String> args) async {
  try {
    final result = await Process.run('playerctl', args, runInShell: true);
    return result.exitCode == 0;
  } catch (e) {
    debugPrint('Error executing command with args $args: $e');
    return false;
  }
}