quick commit
This commit is contained in:
@@ -5,7 +5,9 @@
|
||||
#include <regex>
|
||||
#include <sigc++/functors/mem_fun.h>
|
||||
|
||||
#include "helpers/systemHelper.hpp"
|
||||
#include "helpers/command.hpp"
|
||||
|
||||
#include "giomm/applicationcommandline.h"
|
||||
|
||||
VolumeWidget::VolumeWidget() : Gtk::Box(Gtk::Orientation::HORIZONTAL) {
|
||||
set_valign(Gtk::Align::CENTER);
|
||||
@@ -21,7 +23,7 @@ VolumeWidget::VolumeWidget() : Gtk::Box(Gtk::Orientation::HORIZONTAL) {
|
||||
click->set_button(GDK_BUTTON_PRIMARY);
|
||||
click->signal_released().connect([this](int, double, double) {
|
||||
try {
|
||||
(void)SystemHelper::get_command_output(
|
||||
(void)CommandHelper::exec(
|
||||
"wpctl set-mute @DEFAULT_SINK@ toggle");
|
||||
} catch (const std::exception &ex) {
|
||||
std::cerr << "[VolumeWidget] failed to toggle mute: " << ex.what()
|
||||
@@ -44,8 +46,7 @@ VolumeWidget::~VolumeWidget() {
|
||||
|
||||
void VolumeWidget::update() {
|
||||
try {
|
||||
const std::string out =
|
||||
SystemHelper::get_command_output("wpctl get-volume @DEFAULT_SINK@");
|
||||
const std::string out = CommandHelper::exec("wpctl get-volume @DEFAULT_SINK@");
|
||||
|
||||
std::smatch m;
|
||||
std::regex r_percent(R"((\d+(?:\.\d+)?)%)");
|
||||
|
||||
Reference in New Issue
Block a user