aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMattias Andrée <maandree@kth.se>2024-07-12 12:24:33 +0200
committerMattias Andrée <maandree@kth.se>2024-07-12 12:24:33 +0200
commite0c5d9738c8b5bf387c21b6d60128464ecda4d4f (patch)
tree1da9c8fee857e7868055965b5818476529113e32
parentFix building of xkbdbind (diff)
downloaddotfiles-e0c5d9738c8b5bf387c21b6d60128464ecda4d4f.tar.gz
dotfiles-e0c5d9738c8b5bf387c21b6d60128464ecda4d4f.tar.bz2
dotfiles-e0c5d9738c8b5bf387c21b6d60128464ecda4d4f.tar.xz
Fix amixer choosing the wrong card
Signed-off-by: Mattias Andrée <maandree@kth.se>
Diffstat (limited to '')
-rw-r--r--xorg-server/xkbdbind.config.h.gpp10
1 files changed, 6 insertions, 4 deletions
diff --git a/xorg-server/xkbdbind.config.h.gpp b/xorg-server/xkbdbind.config.h.gpp
index 716d49a..a832b4c 100644
--- a/xorg-server/xkbdbind.config.h.gpp
+++ b/xorg-server/xkbdbind.config.h.gpp
@@ -6,14 +6,16 @@
#define A MOD_ALT
#define H MOD_HYPER
+#define AMIXER_DEFAULT_CARD "$(cat ~/.asoundrc 2>/dev/null | sed -n '/^defaults\\..*\\.card /s/^.* \\([0-9]\\{1,\\}\\)$/-c \\1/p' | head -n1)"
+
static struct hotkey hotkeys[] = {
{XK_F1, MOD | S, 0, CMD("c")},
{XK_F2, MOD | S, 0, CMD("brave")},
{XK_F4, MOD | S, 0, CMD("xkill")},
- {XK_F9, MOD | S, 0, CMD("sh", "-c", "amixer -- set \"${MAIN_ALSA_MIXER}\" 0%")},
- {XK_F10, MOD | S, 1, CMD("sh", "-c", "amixer -- set \"${MAIN_ALSA_MIXER}\" 5%-")},
- {XK_F11, MOD | S, 1, CMD("sh", "-c", "amixer -- set \"${MAIN_ALSA_MIXER}\" 5%+")},
- {XK_F12, MOD | S, 0, CMD("sh", "-c", "amixer -- set \"${MAIN_ALSA_MIXER}\" 100%")},
+ {XK_F9, MOD | S, 0, CMD("sh", "-c", "amixer "AMIXER_DEFAULT_CARD" -- set \"${MAIN_ALSA_MIXER}\" 0%")},
+ {XK_F10, MOD | S, 1, CMD("sh", "-c", "amixer "AMIXER_DEFAULT_CARD" -- set \"${MAIN_ALSA_MIXER}\" 5%-")},
+ {XK_F11, MOD | S, 1, CMD("sh", "-c", "amixer "AMIXER_DEFAULT_CARD" -- set \"${MAIN_ALSA_MIXER}\" 5%+")},
+ {XK_F12, MOD | S, 0, CMD("sh", "-c", "amixer "AMIXER_DEFAULT_CARD" -- set \"${MAIN_ALSA_MIXER}\" 100%")},
{XK_u, MOD, 0, CMD("unicode")},
{XK_i, MOD, 0, CMD("ipa")},
{XK_p, MOD, 0, CMD("dmenu_run")},