Cannot change Audio Devices with pactl command via keyboard shortcut. Probably missing something easy

Garuda-inxi:

╭─mantis@MantiCore in ~ took 2s
 ╰─λ garuda-inxi
System:
  Kernel: 6.8.1-zen1-1-zen arch: x86_64 bits: 64
    compiler: gcc v: 13.2.1 clocksource: tsc
    avail: hpet,acpi_pm
    parameters: BOOT_IMAGE=/@/boot/vmlinuz-linux-zen
    root=UUID=b225399e-b446-44a3-8b22-18f49dfe84d5 rw
    rootflags=subvol=@ quiet loglevel=3 ibt=off
  Desktop: KDE Plasma v: 6.0.2 tk: Qt v: N/A
    info: frameworks v: 6.0.0 wm: kwin_wayland with: krunner
    vt: 1 dm: SDDM Distro: Garuda base: Arch Linux
Machine:
  Type: Desktop Mobo: ASUSTeK model: STRIX Z270E GAMING
    v: Rev 1.xx serial: <superuser required> part-nu: SKU
    uuid: <superuser required> UEFI: American Megatrends
    v: 1302 date: 03/15/2018
CPU:
  Info: model: Intel Core i7-7700K bits: 64 type: MT MCP
    arch: Kaby Lake gen: core 7 level: v3 note: check
    built: 2018 process: Intel 14nm family: 6
    model-id: 0x9E (158) stepping: 9 microcode: 0xF8
  Topology: cpus: 1x cores: 4 tpc: 2 threads: 8
    smt: enabled cache: L1: 256 KiB
    desc: d-4x32 KiB; i-4x32 KiB L2: 1024 KiB
    desc: 4x256 KiB L3: 8 MiB desc: 1x8 MiB
  Speed (MHz): avg: 4600 min/max: 800/4500:4600 scaling:
    driver: intel_pstate governor: performance cores:
    1: 4600 2: 4600 3: 4600 4: 4600 5: 4600 6: 4600
    7: 4600 8: 4600 bogomips: 67200
  Flags: avx avx2 ht lm nx pae sse sse2 sse3 sse4_1
    sse4_2 ssse3 vmx
  Vulnerabilities: <filter>
Graphics:
  Device-1: NVIDIA GA106 [GeForce RTX 3060]
    vendor: Micro-Star MSI driver: nvidia v: 550.67
    alternate: nouveau,nvidia_drm non-free: 545.xx+
    status: current (as of 2024-02; EOL~2026-12-xx)
    arch: Ampere code: GAxxx process: TSMC n7 (7nm)
    built: 2020-2023 pcie: gen: 3 speed: 8 GT/s lanes: 16
    link-max: gen: 4 speed: 16 GT/s ports: active: none
    off: DP-1,DP-2,HDMI-A-1 empty: DP-3 bus-ID: 01:00.0
    chip-ID: 10de:2503 class-ID: 0300
  Display: wayland server: X.org v: 1.21.1.11
    with: Xwayland v: 23.2.4 compositor: kwin_wayland
    driver: X: loaded: nvidia
    unloaded: modesetting,nouveau alternate: fbdev,nv,vesa
    gpu: nvidia d-rect: 4080x4920 display-ID: 0
  Monitor-1: DP-1 pos: bottom-c res: 1920x1080 size: N/A
    modes: N/A
  Monitor-2: DP-2 pos: top-right res: 1080x1920
    size: N/A modes: N/A
  Monitor-3: HDMI-A-1 pos: middle-l res: 1080x1920
    size: N/A modes: N/A
  API: EGL v: 1.5 hw: drv: nvidia platforms: device: 0
    drv: nvidia device: 2 drv: swrast gbm: drv: nvidia
    surfaceless: drv: nvidia wayland: drv: nvidia x11:
    drv: zink inactive: device-1
  API: OpenGL v: 4.6.0 compat-v: 4.5 vendor: nvidia mesa
    v: 550.67 glx-v: 1.4 direct-render: yes renderer: NVIDIA
    GeForce RTX 3060/PCIe/SSE2 memory: 11.72 GiB
    display-ID: :1.0
  API: Vulkan v: 1.3.279 layers: 11 device: 0
    type: discrete-gpu name: NVIDIA GeForce RTX 3060
    driver: nvidia v: 550.67 device-ID: 10de:2503
    surfaces: xcb,xlib,wayland device: 1 type: cpu
    name: llvmpipe (LLVM 17.0.6 256 bits)
    driver: mesa llvmpipe v: 24.0.3-arch1.2 (LLVM 17.0.6)
    device-ID: 10005:0000 surfaces: xcb,xlib,wayland
Audio:
  Device-1: Intel 200 Series PCH HD Audio vendor: ASUSTeK
    driver: snd_hda_intel v: kernel alternate: snd_soc_avs
    bus-ID: 00:1f.3 chip-ID: 8086:a2f0 class-ID: 0403
  Device-2: NVIDIA GA106 High Definition Audio
    vendor: Micro-Star MSI driver: snd_hda_intel v: kernel
    pcie: gen: 3 speed: 8 GT/s lanes: 16 link-max: gen: 4
    speed: 16 GT/s bus-ID: 01:00.1 chip-ID: 10de:228e
    class-ID: 0403
  Device-3: Blue Microphones Yeti Stereo Microphone
    driver: hid-generic,snd-usb-audio,usbhid type: USB
    rev: 1.1 speed: 12 Mb/s lanes: 1 mode: 1.1
    bus-ID: 1-6.1:5 chip-ID: b58e:9e84 class-ID: 0300
    serial: <filter>
  Device-4: Creative Sound Blaster X3
    driver: cdc_acm,hid-generic,snd-usb-audio,usbhid
    type: USB rev: 2.0 speed: 480 Mb/s lanes: 1 mode: 2.0
    bus-ID: 1-6.3:8 chip-ID: 041e:3264 class-ID: 0102
    serial: <filter>
  API: ALSA v: k6.8.1-zen1-1-zen status: kernel-api
    with: aoss type: oss-emulator tools: N/A
  Server-1: PipeWire v: 1.0.4 status: active with:
    1: pipewire-pulse status: active 2: wireplumber
    status: active 3: pipewire-alsa type: plugin
    4: pw-jack type: plugin
    tools: pactl,pw-cat,pw-cli,wpctl
Network:
  Device-1: Intel Ethernet I219-V vendor: ASUSTeK
    driver: e1000e v: kernel port: N/A bus-ID: 00:1f.6
    chip-ID: 8086:15b8 class-ID: 0200
  IF: enp0s31f6 state: up speed: 1000 Mbps duplex: full
    mac: <filter>
  Device-2: Qualcomm Atheros QCA6174 802.11ac Wireless
    Network Adapter vendor: ASUSTeK driver: ath10k_pci
    v: kernel pcie: gen: 1 speed: 2.5 GT/s lanes: 1
    bus-ID: 04:00.0 chip-ID: 168c:003e class-ID: 0280
    temp: 45.0 C
  IF: wlp4s0 state: down mac: <filter>
  IF-ID-1: wg0-mullvad state: unknown speed: N/A
    duplex: N/A mac: N/A
  Info: services: NetworkManager, systemd-timesyncd,
    wpa_supplicant
Bluetooth:
  Device-1: TP-Link UB500 Adapter driver: btusb v: 0.8
    type: USB rev: 1.1 speed: 12 Mb/s lanes: 1 mode: 1.1
    bus-ID: 1-11:6 chip-ID: 2357:0604 class-ID: e001
    serial: <filter>
  Report: btmgmt ID: hci0 rfk-id: 0 state: up
    address: <filter> bt-v: 5.1 lmp-v: 10 status:
    discoverable: no pairing: no class-ID: 6c0104
RAID:
  Hardware-1: Intel SATA Controller [RAID mode]
    driver: ahci v: 3.0 port: f020 bus-ID: 00:17.0
    chip-ID: 8086:2822 rev: class-ID: 0104
Drives:
  Local Storage: total: 3.87 TiB used: 1.15 TiB (29.8%)
  SMART Message: Unable to run smartctl. Root
    privileges required.
  ID-1: /dev/nvme0n1 maj-min: 259:0 vendor: Samsung
    model: SSD 990 PRO with Heatsink 2TB size: 1.82 TiB
    block-size: physical: 512 B logical: 512 B
    speed: 63.2 Gb/s lanes: 4 tech: SSD serial: <filter>
    fw-rev: 3B2QJXD7 temp: 38.9 C scheme: GPT
  ID-2: /dev/sda maj-min: 8:0 vendor: Seagate
    model: ST2000DM001-1ER164 size: 1.82 TiB block-size:
    physical: 4096 B logical: 512 B speed: 6.0 Gb/s
    tech: HDD rpm: 7200 serial: <filter> fw-rev: CC26
    scheme: GPT
  ID-3: /dev/sdb maj-min: 8:16 vendor: Samsung
    model: SSD 850 EVO 250GB size: 232.89 GiB block-size:
    physical: 512 B logical: 512 B speed: 6.0 Gb/s
    tech: SSD serial: <filter> fw-rev: 2B6Q scheme: GPT
Partition:
  ID-1: / raw-size: 232.59 GiB size: 232.59 GiB (100.00%)
    used: 25.78 GiB (11.1%) fs: btrfs dev: /dev/sdb2
    maj-min: 8:18
  ID-2: /boot/efi raw-size: 300 MiB
    size: 299.4 MiB (99.80%) used: 584 KiB (0.2%) fs: vfat
    dev: /dev/sdb1 maj-min: 8:17
  ID-3: /home raw-size: 232.59 GiB
    size: 232.59 GiB (100.00%) used: 25.78 GiB (11.1%)
    fs: btrfs dev: /dev/sdb2 maj-min: 8:18
  ID-4: /var/log raw-size: 232.59 GiB
    size: 232.59 GiB (100.00%) used: 25.78 GiB (11.1%)
    fs: btrfs dev: /dev/sdb2 maj-min: 8:18
  ID-5: /var/tmp raw-size: 232.59 GiB
    size: 232.59 GiB (100.00%) used: 25.78 GiB (11.1%)
    fs: btrfs dev: /dev/sdb2 maj-min: 8:18
Swap:
  Kernel: swappiness: 133 (default 60)
    cache-pressure: 100 (default) zswap: no
  ID-1: swap-1 type: zram size: 31.28 GiB
    used: 366.5 MiB (1.1%) priority: 100 comp: zstd
    avail: lzo,lzo-rle,lz4,lz4hc,842 max-streams: 8
    dev: /dev/zram0
Sensors:
  System Temperatures: cpu: 68.0 C mobo: N/A
  Fan Speeds (rpm): N/A
Info:
  Memory: total: 32 GiB available: 31.28 GiB
    used: 14.26 GiB (45.6%)
  Processes: 447 Power: uptime: 10h 13m
    states: freeze,mem,disk suspend: deep avail: s2idle
    wakeups: 0 hibernate: platform avail: shutdown,
    reboot, suspend, test_resume image: 12.47 GiB
    services: org_kde_powerdevil,upowerd Init: systemd
    v: 255 default: graphical tool: systemctl
  Packages: pm: pacman pkgs: 1747 libs: 525
    tools: octopi,paru Compilers: clang: 17.0.6 gcc: 13.2.1
    Shell: garuda-inxi default: fish v: 3.7.0
    running-in: alacritty inxi: 3.3.33
Garuda (2.6.23-1):
  System install date:     2024-03-12
  Last full system update: 2024-03-27 ↻
  Is partially upgraded:   No
  Relevant software:       snapper NetworkManager dracut nvidia-dkms
  Windows dual boot:       No/Undetected
  Failed units:

Apologize for the inconvenience. I recently reinstalled Garuda due to running into issues after the Wayland update. After install everything works perfectly except this.

I made a short script to change between my headphones and my soundbar. When clicked on they work as intended, when set as a shortcut they do not work.

For Headphones:

#!/bin/bash

pactl set-default-sink alsa_output.usb-Creative_Technology_Ltd_Sound_Blaster_X3_FA182CDA70AD66A1-03.analog-stereo

For Soundbar:

#!/bin/bash

pactl set-default-sink alsa_output.pci-0000_00_1f.3.iec958-stereo.2

I have made both files executable as well. I attempted to set it as a shortcut command via shortcuts to no avail. If I manually type in the command for either they work.

I feel like I am missing something very rudimentary that is going to make me feel stupid and I know it.

I have tried the following.

  1. Setting each command in shortcuts as a Command
  2. Creating the script.sh files and setting those in Shortcuts

I have been searching for hours and I just cant find what I am missing to make this work. There was a program that worked in X11 that i used, but it is no longer viable in Wayland.

All help is greatly appreciated, thank you all for this amazing OS, and for all the past (and present) help. :slight_smile:

i think you might have same issue as i do, are you using wayland session, have you tried that with x11?
for wayland keyboard shortcurts are not working properly on plasma 6 but i think its more issue of wayland because x11 works for me

i have setup dummy python script to a keyboard shortcut CTRL + SHIFT + Y, after executing it works

on bottom screenshot, at bottom right is a rounding icon,
image

but what i have checked previously it will only work when you focus (click on shortcut window and it’s opened) on window, on x11 it works normally but on wayland not

1 Like

Yes to Wayland
Yes it does work in X11
When focusing it works as intended as well.

I have set several scripts on X11 and they all work as intended. Trying to not go back to X11 if i have to. For now, I have set a macro on my keychron keyboard to open a terminal and type the command to change it as a work around for now.

Apologies on the late reply as well. I will try and keep a better eye on the thread haha. :sweat_smile:

1 Like

No issues at least you have responded. Yes i have the same issue because obs studio on wayland is not working with shortcuts so i cannot record anything, but when that will be resplved i have no idea, hopefully soon

I am not having the issue with OBS. Just flameshot and this. I managed to fix flameshot with custom window rules and OBS just decided to work after a reinstall. Fingers crossed this is fixed relatively soon. My muscle memory is very angry right now.

I was able to make shortcuts of the volume switchers and pin them to my task bar. thats been a work around so far.

1 Like

Okay i will try also reinstalling the obs