GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — GitHub - dagelf/media-hotkeys: Audio pause/cycle hotkeys for Linux: pause all MPRIS players, cycle one music or video source at a time, and mute instantly. PipeWire, PulseAudio and ALSA; Omarchy, Hyprland and IceWM keyboard bindings. Companion to Vampire Slayer and the graphic equalizer.

BranchesTags
Open more actions menu

Latest commit

 

History

4 Commits
4 Commits

Folders and files

NameName
Last commit message
Last commit date
.gitignore
.gitignore
 
 
LICENSE
LICENSE
 
 
README.md
README.md
 
 
audio_output.py
audio_output.py
 
 
media-cycle
media-cycle
 
 
media-pause
media-pause
 
 
test_media.py
test_media.py
 
 

Repository files navigation

Audio pause/cycle hotkeys for Linux

One key to pause everything, then cycle through your music and video players one at a time. Another key to pause all players and mute the output immediately. Small Python scripts for Omarchy, Hyprland, IceWM, Wayland and X11, using MPRIS and playerctl; no resident daemon.

media-cycle first pauses all players. Further presses play each available source in order, then return to silence. If another player starts outside the cycle, the next press pauses everything again. It waits for players to pause before starting another. Jukebox-owned mpv children are excluded to preserve the jukebox's own state.

media-pause pauses all MPRIS players and mutes the default output. Cycling to a player unmutes it. Output control tries PipeWire/WirePlumber (wpctl), PulseAudio (pactl), then ALSA (amixer). Players must expose MPRIS; arbitrary browser audio and calls may not.

Install

Requires Python 3, playerctl and systemd's busctl, plus one of the output controls above. On Omarchy, WirePlumber supplies wpctl. Install missing packages using your package manager.

git clone https://github.com/dagelf/media-hotkeys
cd media-hotkeys
install -Dm755 media-cycle ~/.local/bin/media-cycle
install -Dm755 media-pause ~/.local/bin/media-pause
install -Dm644 audio_output.py ~/.local/bin/audio_output.py

Keep ~/.local/bin on PATH. No configuration is overwritten and no service is installed. Remove those three installed files to uninstall. Cycle state lives in $XDG_RUNTIME_DIR and expires with the login session.

Keyboard shortcuts

Choose unused keys or deliberately replace your existing mappings. The examples use Super+P for cycle and Super+Q for pause/mute.

Omarchy Quattro (~/.config/hypr/bindings.lua):

o.bind("SUPER + P", "Cycle audio player", "media-cycle")
o.bind("SUPER + Q", "Pause and mute audio", "media-pause")

Use o.rebind instead of o.bind to replace an existing Omarchy mapping.

Hyprland versions using .conf configuration:

bind = SUPER, P, exec, ~/.local/bin/media-cycle
bind = SUPER, Q, exec, ~/.local/bin/media-pause

IceWM (~/.icewm/keys):

key "Super+p" media-cycle
key "Super+q" media-pause

For other desktops, add custom keyboard shortcuts running these commands.

Related Linux desktop tools

  • Vampire Slayer: background browser and app idle suspend. Chrome or Firefox eating CPU while you're out for lunch, even when they have nothing to do? Vampire Slayer to the rescue. An Omarchy plugin that suspends idle browser and Electron app families, with media exemptions and ignore lists.
  • Graphic equalizer / PipeWire web EQ: ten-band stereo graphic equalizer, preamp, presets, per-output settings, application mixer and MPRIS media controls.
  • Linux CLI utilities: original home of these hotkeys.

Search terms: audio pause, audio cycle, pause/cycle hotkeys, media hotkeys, keyboard shortcuts, MPRIS, playerctl, PipeWire, PulseAudio, ALSA, Omarchy, Hyprland, Wayland, X11, IceWM, graphic equalizer, Chrome, Firefox, background browser, idle suspend.

Validation and license

Run python3 -m unittest -v. The tests exercise cycle transitions and output fallback without changing desktop audio. MIT; see LICENSE.

About

Audio pause/cycle hotkeys for Linux: pause all MPRIS players, cycle one music or video source at a time, and mute instantly. PipeWire, PulseAudio and ALSA; Omarchy, Hyprland and IceWM keyboard bindings. Companion to Vampire Slayer and the graphic equalizer.

Topics

alsaaudiocyclehotkeyshyprlandicewmkeyboard-shortcutslinuxmediamprisomarchypausepipewireplayerctlpulseaudiowaylandx11

Resources

Readme
MIT license
Activity

Stars

0 stars

Watchers

0 watching

Forks

0 forks
Report repository

Releases

Packages

Contributors

Languages

You are visitor 01402792 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.