unify amixer command
This commit is contained in:
@@ -27,6 +27,8 @@ namespace
|
|||||||
time_point<system_clock> next_update;
|
time_point<system_clock> next_update;
|
||||||
bool has_child;
|
bool has_child;
|
||||||
Proc child;
|
Proc child;
|
||||||
|
|
||||||
|
Cmd amixer("amixer");
|
||||||
}
|
}
|
||||||
|
|
||||||
extern "C"
|
extern "C"
|
||||||
@@ -189,7 +191,7 @@ extern "C"
|
|||||||
catch(...){ cerr << "EXCEPT\n"; }
|
catch(...){ cerr << "EXCEPT\n"; }
|
||||||
|
|
||||||
// Volume
|
// Volume
|
||||||
string amix_out = $(Cmd("amixer", "get", AUDIO_DEV));
|
string amix_out = $(amixer + "get" + AUDIO_DEV);
|
||||||
size_t vol_bracket = amix_out.find('[');
|
size_t vol_bracket = amix_out.find('[');
|
||||||
|
|
||||||
if(vol_bracket != string::npos)
|
if(vol_bracket != string::npos)
|
||||||
@@ -314,21 +316,21 @@ extern "C"
|
|||||||
|
|
||||||
void vene_inc_vol(const Arg*)
|
void vene_inc_vol(const Arg*)
|
||||||
{
|
{
|
||||||
Cmd inc_vol("amixer", "-q", "set", AUDIO_DEV, "3%+");
|
Cmd inc_vol(amixer + "-q" + "set" + AUDIO_DEV + "3%+");
|
||||||
child = inc_vol.detach();
|
child = inc_vol.detach();
|
||||||
has_child = true;
|
has_child = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
void vene_dec_vol(const Arg*)
|
void vene_dec_vol(const Arg*)
|
||||||
{
|
{
|
||||||
Cmd dec_vol("amixer", "-q", "set", AUDIO_DEV, "3%-");
|
Cmd dec_vol(amixer + "-q" + "set" + AUDIO_DEV + "3%-");
|
||||||
child = dec_vol.detach();
|
child = dec_vol.detach();
|
||||||
has_child = true;
|
has_child = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
void vene_toggle_vol(const Arg*)
|
void vene_toggle_vol(const Arg*)
|
||||||
{
|
{
|
||||||
Cmd toggle_vol("amixer", "-q", "set", AUDIO_DEV, "toggle");
|
Cmd toggle_vol(amixer + "-q" + "set" + AUDIO_DEV + "toggle");
|
||||||
child = toggle_vol.detach();
|
child = toggle_vol.detach();
|
||||||
has_child = true;
|
has_child = true;
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user