Computer >> บทช่วยสอนคอมพิวเตอร์ >  >> ระบบ >> Linux

ทำให้ประสบการณ์ฟังเพลงบน Linux seamless ด้วยเครื่องมือเหล่านี้

สิ่งมหัศจรรย์ของ Linux desktops: integration มาก คุณไม่สามารถ customize ทุกแอปให้ลุคคล้ายกันบน Windows ได้! นอกจากสิ่งใหญ่ integration นี้มี perks ที่น่าสนใจน้อยกว่านั้นอีก

โดยเฉพาะ คุณควบคุมเพลงในสบายบนเดสก์ท็อป โดยไม่ต้องสัมผัส media player — ซ่อนได้ถ้าอยาก และใช้ media keys (Play, Pause, ฯลฯ) ควบคุมได้

คุยกับ Media Players ด้วย MPRIS

Linux apps เยอะ communicate ระหว่างกันได้ ทำผ่านซอฟต์แวร์พิเศษ D-Bus mediator สำหรับโปรแกรมเยอะ D-Bus ให้ Linux desktops integrate กับ media players ผ่าน MPRIS

The Media Player Remote Interfacing Specification (MPRIS) เป็น subset ของ D-BUS features ใช้ควบคุม media players หากอยากให้ music/video player integrate กับ desktop ต้องการตัวที่ support มัน ส่วนใหญ่รองรับแล้ว บางตัวต้อง tweak เปิดใช้

ทำให้ประสบการณ์ฟังเพลงบน Linux seamless ด้วยเครื่องมือเหล่านี้

Rule of thumb: video players ที่ต้องปรับ (VLC exception) ตัวอย่าง GNOME Videos เปิด MPRIS support ที่ Edit > Preferences > Plugins > MPRIS D-Bus Interface

ควบคุม media players ด้วย MPRIS จาก desktop ต้องแอปแยก กระบวนการต่างกันระหว่าง DEs แต่โดยทั่วไปเป็นส่วนหนึ่งของ desktop เอง

Integration กับ Plasma, Unity, และ Cinnamon

หลาย DEs integration มาพร้อม out of the box ถ้ามี media player รองรับ MPRIS ไม่ต้องทำอะไรเพิ่ม 3 desktops นี้มี controllers ยอดเยี่ยม ไม่ต้อง setup

Plasma

MPRIS controller ใน Plasma ซ่อนใน system tray เริ่ม media player ไป มันจะขึ้น คลิก controller: stop, start, เปลี่ยน playback เพิ่ม: pin icon มุม ขึ้น menu permanently ใช้เป็น miniature player

ทำให้ประสบการณ์ฟังเพลงบน Linux seamless ด้วยเครื่องมือเหล่านี้

ปิดฟีเจอร์ได้ที่ System Tray Settings > Media Player จดไว้: โดยไม่มีนี้ media keys จะไม่ทำงาน!

ทำให้ประสบการณ์ฟังเพลงบน Linux seamless ด้วยเครื่องมือเหล่านี้

Unity

MPRIS integration advanced กว่าใน Unity built-in ใน sound applet เปิด audio/video player ขึ้นเป็น entry ใน volume menu ให้ alternate way เริ่มต้นได้

ทำให้ประสบการณ์ฟังเพลงบน Linux seamless ด้วยเครื่องมือเหล่านี้

ถ้า sound menu ควบคุม video player เช่น VLC options น้อยกว่า: play, pause, back, forward Audio players malleable กว่า

Design นี้มี sense Video players visual experience ควบคุมจาก desktop โดยไม่ดู content ทำลาย purpose MPRIS ทำให้ media keys (บน Macbooks) ทำงานข้าม players ทั้งหมด ทางเลือกสะดวก

Cinnamon

เหมือน Unity Cinnamon มี MPRIS support built-in ใน sound applet เหมือนกัน เปิด media player ที่เลือกจาก volume menu ของ desktop ได้

ทำให้ประสบการณ์ฟังเพลงบน Linux seamless ด้วยเครื่องมือเหล่านี้

มีความต่างเล็กน้อย (mainly cosmetic) ชอบ album art ใหญ่? อาจชอบ Cinnamon มากกว่า Unity Applet menu ให้วิธี shutdown media player — feature สำหรับ dedicated music players โดยทั่วไป music players minimize ตอนปิด นี่ให้ surefire way kill พวกมัน

Advanced Integration ใน GNOME

ตอนนี้ GNOME desktop มี basic MPRIS integration: media key control อยาก advanced ต้องโหลด GNOME shell extension Media player indicator ติดตั้งตาม link นี้

ทำให้ประสบการณ์ฟังเพลงบน Linux seamless ด้วยเครื่องมือเหล่านี้

เปิดด้วย Firefox หรือ GNOME default web browser! ให้ install extension ผ่าน webpage (ON/OFF button ใหญ่) Firefox: enable Gnome Shell Integration plugin!

ทำให้ประสบการณ์ฟังเพลงบน Linux seamless ด้วยเครื่องมือเหล่านี้

ติดตั้ง extension เสร็จ จะขึ้นใน system menu ตอนเปิด MPRIS compatible media player ควบคุม playback ได้เหมือน Plasma widget

GNOME Tweak Tool ติดตั้งแล้ว customize extension behavior ได้ เช่น adjust media player volume levels ทำให้ persistent อยู่ใน system menu แม้ไม่มี MPRIS player เปิด

ใช้ MPRIS กับ XFCE

Lightweight desktop ต้อง install media player controller สำหรับ XFCE เป็น XFCE panel plugin xfce4-soundmenu-plugin เพิ่ม PPA repository จาก Xubuntu team ที่มีโปรแกรม:

sudo add-apt-repository ppa:xubuntu-dev/extras
sudo apt-get update
sudo apt-get install xfce4-soundmenu-plugin
ทำให้ประสบการณ์ฟังเพลงบน Linux seamless ด้วยเครื่องมือเหล่านี้

อนาคตอาจไม่ต้องทำแล้ว โปรแกรมใน repo อาจ integrated เข้า Ubuntu repo

เพิ่ม Plugin

ติดตั้ง plugin เสร็จ ยังต้อง add ไปที่ XFCE panels หนึ่ง เปิด Panel Preferences window ด้วย command:

xfce4-panel -p

ไปที่แท็บ Items คลิก Plus sign ได้รายการ plugins เพิ่มใน panel เลื่อนลงล่าง หา Sound menu Plugin เลือก กด Add จะปรากฏใน panel หนึ่ง

ทำให้ประสบการณ์ฟังเพลงบน Linux seamless ด้วยเครื่องมือเหล่านี้

ตั้งค่า Plugin

ทำให้ controller ทำงาน ต้อง tweak นิดหน่อย Right click plugin เลือก Properties dialogue เปิด configuration window

ทำให้ประสบการณ์ฟังเพลงบน Linux seamless ด้วยเครื่องมือเหล่านี้

บอก XFCE sound menu ว่าอยากควบคุมอะไร ไม่ทำ มันจะไม่ทำงาน! เปิด media player ที่เลือก กดปุ่ม refresh ใน Player text box auto search เปิด media players

ทำให้ประสบการณ์ฟังเพลงบน Linux seamless ด้วยเครื่องมือเหล่านี้

จุดชอบ: ย้าย controller ได้ ไม่เหมือน DE อื่น customize plugin ได้เยอะ เช่น ผมวางใน side panel ใหม่ (กว้างขึ้น) ให้โชว์ album art

อีกอย่าง useful: speaker icon ไม่ได้แค่ show: ควบคุม volume ได้โดย scroll up/down บนมัน

Desktops อื่นๆ?

ถ้าใช้ extremely lightweight desktop setup อย่าง Openbox integration จำกัดแค่ media player keys (เหมือน GNOME โดยไม่มี extra plugin) ทางเลือกสำหรับคนไม่อยาก advanced integration features น่าเสียดายไม่ใช่ option สำหรับ DEs ที่ integrate controllers แน่นอนอย่าง Unity และ Cinnamon

ทำให้ประสบการณ์ฟังเพลงบน Linux seamless ด้วยเครื่องมือเหล่านี้

ต้องการ command line tool Playerctl Ubuntu/Mint โหลด DEB file/program จากลิงก์ ติดตั้งง่าย double-click download

Tool นี้พยายาม auto control media player ที่รองรับ MPRIS ด้วย terminal commands ทุกคำสั่งนำหน้าด้วย playerctl ตามด้วย command:

playerctl pause|play|play-pause|next|previous

อยากใช้มากกว่านี้ พิมพ์ playerctl --help ดูได้

ทำให้ประสบการณ์ฟังเพลงบน Linux seamless ด้วยเครื่องมือเหล่านี้

แต่นี่ไม่ใช่ ideal way ควบคุม media player แทนสร้าง keyboard shortcuts execute actions เหล่านี้

ทำให้ประสบการณ์ฟังเพลงบน Linux seamless ด้วยเครื่องมือเหล่านี้

Very lightweight desktops อาจต้อง manually enter shortcuts ที่อยากใช้ สำหรับระบบแบบนี้ keyboard symbols ที่อาจต้องการ:

  • XF86AudioPlay
  • XF86AudioPause
  • XF86AudioNext
  • XF86AudioPrev

Symbols นี้ match กับ commands ของ playerctl DE ส่วนใหญ่ให้กด media keys map ไป command — quick และ simple

Enjoy Seamless Control!

แม้ไม่ใช่ส่วน flashy ของ desktop integration กับ media player ทำให้ experience ดีขึ้น แม้ไม่จำเป็น แต่รวมกับหลายอย่าง แสดงว่า Linux amazing แค่ไหน

คุณชอบฟีเจอร์อะไรของ Linux desktop?

Image Credit: natrot via Shutterstock.com