Skip to content

warasugitewara/Shell-music-controller

Repository files navigation

Music Controller for Windows 11 & Nushell

Simple command-line controller for any media player on Windows using system media keys.

Copyright: © 2026 .Warasugi All Right Reserved

Features

  • Play/Pause - Toggle playback
  • Next/Previous - Skip tracks
  • Stop - Stop playback
  • Nushell Integration - Native shell commands
  • Lightweight - PowerShell based, no dependencies
  • Works with any media player - Apple Music, Spotify, VLC, Windows Media Player, etc.

Requirements

  • OS: Windows 10+
  • Shell: PowerShell (for mc.bat)
  • Optional: Nushell (for native mc command)

Usage

Command Line

mc play      - Play/Pause
mc next      - Next track
mc prev      - Previous track
mc pause     - Pause
mc stop      - Stop
mc help      - Show help

Nushell

After adding to PATH, simply use:

use music.nu *

mc play      # Play/Pause
mc next      # Next track
mc prev      # Previous track

Installation

The music-controller directory should already be in your PATH environment variable.

To verify:

echo $env:PATH

If not, add it:

[Environment]::SetEnvironmentVariable("PATH", "$env:PATH;C:\Users\waras\music-controller", "User")

File Structure

music-controller/
├── mc.bat               - Batch wrapper
├── mc.ps1               - PowerShell implementation
├── music.nu             - Nushell integration
├── music.lua            - Lua configuration
└── README.md            - This file

How It Works

Uses Windows API to send system media key codes directly to the system. Any media player that responds to system media keys will be controlled. This works regardless of whether the player is in the foreground.

Media Key Codes

  • Play/Pause: 0xB3 (VK_MEDIA_PLAY_PAUSE)
  • Stop: 0xB2 (VK_MEDIA_STOP)
  • Next: 0xB0 (VK_MEDIA_NEXT_TRACK)
  • Previous: 0xB1 (VK_MEDIA_PREV_TRACK)

Supported Players

  • ✅ Apple Music
  • ✅ Spotify
  • ✅ VLC
  • ✅ Windows Media Player
  • ✅ Any player that responds to system media keys

License

© 2026 .Warasugi All Right Reserved

About

コンソールから再生停止を可能にする

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published