Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

How to configure MOC under Linux

2025-02-24 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Development >

Share

Shulou(Shulou.com)06/01 Report--

This article is about how to configure MOC under Linux. The editor thinks it is very practical, so share it with you as a reference and follow the editor to have a look.

Music On Console (MOC) is a music player program under the Linux/Unix text interface. MOC is powerful and easy to use, and the overall interface typesetting is similar to Midnight Commandert (a text interface file administrator). It has high customization. Support ALSA,OSS or JACK output; customizable color themes and interfaces; Quick Keys; playlists, etc.

Mocp configuration

Before configuring mocp, you can get more information from moc's man man page or info page (such as what the configuration file is, where it should be placed, and what the format should be.)

$mocp-help$ man mocp$ info mocp

* * Note: * * the aur version of moc allows mocp to load lyrics (but only some utf-8-encoded ascii text (in plain English). This version will conflict with what is already installed in the system.

Although osdlyrics theoretically supports moc, simply installing moc and then opening mocp and then opening osdlyrics will not load the lyrics of the audio file (although this will not cause osdlyrics to exit)

For osdlyrics to really support moc, install moc-tray, the taskbar Mini Program, and start mocp and moc-tray before starting osdlyrics.

Moc-tray can start mocp directly and support actions such as stop / play / pause / exit, next song / previous song, etc., but some actions need to be configured in the mocp playlist to get the correct response.

Moc build and installation on aur:

Download the scripts needed by makepkg, such as PKGBUILD.

$git clone https://aur.archlinux.org/moc-lyrics-git.git$ pushd mocp-lyrics-git$ makepkg-sr

Upon successful compilation, a .pkg.tar.xz package is generated and then installed using pacman-U

$mv moc-lyrics-git-1\: 0.2213.c51e02e-1-x86_64.pkg.tar.xz moc-lyrics-git-x86_64.pkg.tar.xz# pacman-U moc-lyrics-git-x86_64.pkg.tar.xz

Copy the mocp sample configuration file to ~ / .moc (create without it). The parameter configuration can be found in the sample file config.example (you can run locate config.example).

Mocp's sample configuration file, although in English, is explained in detail.

$mkdir ~ / .moc$ cp `locate config.example` ~ / .moc/config

The following is copied from the instance configuration file, and the comments starting with the # sign are all comments (although the comments seem obscure, the author explains them very clearly).

~ / .moc / config# This is a configuration file for the MOC player. It should be named# 'config' and placed in the ~ /. Moc directory. As this file can specify# commands which invoke other applications, MOC will refuse to start if it# is not owned by either root or the current user, or if it is writable by# anyone other than its owner. All options are given with their default# values, and therefore commented.# Comments begin with'#'. # You can use quotes and escape ('\') in parameters.## You can have variable values substituted by enclosing the variable name# as "${...}". (This only applies to the portion of the option following# the'='. Variables are substituted first from the environment then,# if not found, from the configuration options. (Note that the value of# a configuration option substituted is that which it has at the time the# substitution variable is encountered.) If there is a naming conflict# between an environment and configuration variable, you may be able to# resolve it by using lowercase as the environment variable matches are# case-sensitive whereas the configuration variables are not.## You can also use the form "${...: -...}" where the value in the second# position will be substituted if the variable name given in the first# position is unset or null.## So For example:## MusicDir = / music/$ {USER:-public} # Fastdir1 = ${MusicDir} / mp3/rock# Fastdir2 = ${MusicDir} / mp3/electronic# Fastdir3 = ${MusicDir} / mp3/rap# Fastdir4 = ${MusicDir} / mp3/etc# … Mocp keyboard mapping configuration

Mocp keyboard mapping is customized, and sample keyboard mapping can be found in $prefix/share/moc/keymap.example

$vim ~ / .moc/keymapmenu_up = k UPmenu_down = j DOWNmenu_page_up = ^ b PAGE_UPmenu_page_down = ^ d PAGE_DOWNmenu_first_item = Mmurb HOMEmenu_last_item = Mmurd ENDmocp theme

The mocp theme is installed in the $prefix/share/moc/themes directory by default, and you can customize that the theme only works for users (put it in the ~ / .moc / themes directory).

Topics specified at mocp startup or specified in the user-level configuration file ~ / .moc / config can be automatically read from $prefix/share/moc/themes and ~ / .moc / themes. (no, the Theme at ~ / .moc / config is specified using an absolute path)

Create a ~ / .moc / themes directory

$mkdir-pv ~ / .moc/themes$ cp / usr/share/moc/themes/moca_theme ~ / .moc/themes/user_moca_theme~/.moc/themes/ user_moca_themebackground = white default boldframe = white default boldwindow_title = yellow default bolddirectory = white defaultselected_directory = white default boldplaylist = white defaultselected_playlist = cyan default boldfile = green default bold # selected_file = yellow red boldselected_file = white black bold. .mocp User themes

This is what my moc looks like in the end:

MOC, command line music player MOC, command line music player

Fbterm shows the same way, but there are no desktop lyrics.

* * Note: * * setting the TERM variable to fbterm in fbterm will make some command-line interfaces based on ncursers libraries (such as mc and alsamixer,mocp) messy. Only when the value of the TERM variable is set to fbterm can vim support more colors on fbterm.

Thank you for reading! This is the end of this article on "how to configure MOC under Linux". I hope the above content can be of some help to you, so that you can learn more knowledge. if you think the article is good, you can share it for more people to see!

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Development

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report