mirror of
https://github.com/Raymo111/i3lock-color.git
synced 2024-12-02 14:05:43 -05:00
Support for XF86AudioMicMute (#273)
* Feature: Add XF86AudioMicMute to passed media keys * Feature: Add shell command option for XF86AudioMicMute
This commit is contained in:
parent
aeb9982ded
commit
f1903bdaf0
4 changed files with 18 additions and 1 deletions
|
@ -91,6 +91,7 @@ _i3lock() {
|
|||
"--cmd-audio-mute"
|
||||
"--cmd-volume-up"
|
||||
"--cmd-volume-down"
|
||||
"--cmd-mic-mute"
|
||||
"--cmd-power-down"
|
||||
"--cmd-power-off"
|
||||
"--cmd-power-sleep"
|
||||
|
|
|
@ -93,6 +93,7 @@ _i3lock() {
|
|||
"--cmd-volume-up[Command for XF86AudioRaiseVolume]"
|
||||
"--cmd-volume-down[Command for XF86AudioLowerVolume]"
|
||||
"--cmd-power-down[Command for XF86PowerDown] "
|
||||
"--cmd-mic-mute[Command for XF86AudioMicMute]"
|
||||
"--cmd-power-off[Command for XF86PowerOff]"
|
||||
"--cmd-power-sleep[Command for XF86Sleep]"
|
||||
# Bar mode
|
||||
|
|
5
i3lock.1
5
i3lock.1
|
@ -383,7 +383,8 @@ passing them through:
|
|||
.RS
|
||||
.IP \[bu] 2
|
||||
media - XF86AudioPlay, XF86AudioPause, XF86AudioStop, XF86AudioPrev,
|
||||
XF86AudioNext, XF86AudioMute, XF86AudioLowerVolume, XF86AudioRaiseVolume
|
||||
XF86AudioNext, XF86AudioMute, XF86AudioLowerVolume, XF86AudioRaiseVolume,
|
||||
XF86AudioMicMute
|
||||
.IP \[bu]
|
||||
screen - XF86MonBrightnessUp, XF86MonBrightnessDown
|
||||
.IP \[bu]
|
||||
|
@ -422,6 +423,8 @@ volume\-up - XF86AudioRaiseVolume
|
|||
.IP \[bu]
|
||||
volume\-down - XF86AudioLowerVolume
|
||||
.IP \[bu]
|
||||
mic\-mute - XF86AudioMicMute
|
||||
.IP \[bu]
|
||||
power\-down - XF86PowerDown
|
||||
.IP \[bu]
|
||||
power\-off - XF86PowerOff
|
||||
|
|
12
i3lock.c
12
i3lock.c
|
@ -276,6 +276,7 @@ char* cmd_media_prev = NULL;
|
|||
char* cmd_audio_mute = NULL;
|
||||
char* cmd_volume_up = NULL;
|
||||
char* cmd_volume_down = NULL;
|
||||
char* cmd_mic_mute = NULL;
|
||||
|
||||
char* cmd_power_down = NULL;
|
||||
char* cmd_power_off = NULL;
|
||||
|
@ -784,6 +785,12 @@ static void handle_key_press(xcb_key_press_event_t *event) {
|
|||
return;
|
||||
}
|
||||
break;
|
||||
case XKB_KEY_XF86AudioMicMute:
|
||||
if (cmd_mic_mute) {
|
||||
system(cmd_mic_mute);
|
||||
return;
|
||||
}
|
||||
break;
|
||||
case XKB_KEY_XF86PowerDown:
|
||||
if (cmd_power_down) {
|
||||
system(cmd_power_down);
|
||||
|
@ -816,6 +823,7 @@ static void handle_key_press(xcb_key_press_event_t *event) {
|
|||
case XKB_KEY_XF86AudioMute:
|
||||
case XKB_KEY_XF86AudioLowerVolume:
|
||||
case XKB_KEY_XF86AudioRaiseVolume:
|
||||
case XKB_KEY_XF86AudioMicMute:
|
||||
xcb_send_event(conn, true, screen->root, XCB_EVENT_MASK_BUTTON_PRESS, (char *)event);
|
||||
return;
|
||||
}
|
||||
|
@ -1674,6 +1682,7 @@ int main(int argc, char *argv[]) {
|
|||
{"cmd-audio-mute", required_argument, NULL, 640},
|
||||
{"cmd-volume-up", required_argument, NULL, 641},
|
||||
{"cmd-volume-down", required_argument, NULL, 642},
|
||||
{"cmd-mic-mute", required_argument, NULL, 643},
|
||||
|
||||
{"cmd-power-down", required_argument, NULL, 650},
|
||||
{"cmd-power-off", required_argument, NULL, 651},
|
||||
|
@ -2276,6 +2285,9 @@ int main(int argc, char *argv[]) {
|
|||
case 642:
|
||||
cmd_volume_down = optarg;
|
||||
break;
|
||||
case 643:
|
||||
cmd_mic_mute = optarg;
|
||||
break;
|
||||
|
||||
case 650:
|
||||
cmd_power_down = optarg;
|
||||
|
|
Loading…
Reference in a new issue